Skip to content

Commit d68d7fa

Browse files
committed
chore(compose): chat front-end was 503
1 parent c364f1e commit d68d7fa

9 files changed

+62
-57
lines changed

.compose/chat/config.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
"platform": "localDebug",
1313
"default_max_upload_avatar_size_in_bytes": 1000000,
1414
"dev_mode": true,
15+
"qr_code_download_url": "https://sign-up.twake.app/download/chat",
1516
"enable_logs": true,
1617
"support_url": "https://twake.app/support"
1718
}

.compose/chat/default.conf.template

Lines changed: 0 additions & 14 deletions
This file was deleted.

.compose/examples/tom+fed+chat+admin.pgsql+ldap.yml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,10 @@ services:
143143
- MATRIX_DATABASE_USER=synapse
144144
- MATRIX_DATABASE_PASSWORD=synapse!1
145145

146+
- SMS_API_KEY=SOME_SECRET_KEY
147+
148+
- SMS_API_URL=https://api.octopush.com/v1/public
149+
146150
- LOG_LEVEL=silly
147151
- LOG_TRANSPORTS=Console
148152

@@ -200,12 +204,9 @@ services:
200204
image: linagora/twake-web
201205
volumes:
202206
- ../chat/config.json:/usr/share/nginx/html/web/config.json
203-
- ../chat/default.conf.template:/etc/nginx/templates/default.conf.template
204207
- ../ssl:/etc/nginx/ssl
205208
# ports:
206-
# - 6868:6868
207-
environment:
208-
- TWAKECHAT_LISTEN_PORT=6868
209+
# - 80:80
209210
networks:
210211
- frontend
211212

@@ -221,8 +222,13 @@ services:
221222
ports:
222223
- 443:443
223224
volumes:
224-
- ../haproxy:/usr/local/etc/haproxy
225+
# Reverse proxy routing configuration
225226
- ../haproxy/haproxy.tom+fed+chat+admin.cfg:/usr/local/etc/haproxy/haproxy.cfg
227+
- ../haproxy/cors.lua:/usr/local/etc/haproxy/cors.lua
228+
- ../haproxy/lua_endpoint_to_function.map_rewrite.cfg:/usr/local/etc/haproxy/lua_endpoint_to_function.map_rewrite.cfg
229+
- ../haproxy/lua_endpoint_to_worker.map_rewrite.lua:/usr/local/etc/haproxy/lua_endpoint_to_worker.map_rewrite.lua
230+
- ../haproxy/synapse_worker_endpoint_indexer.lua:/usr/local/etc/haproxy/synapse_worker_endpoint_indexer.lua
231+
# HTTPS SSL Certs
226232
- ../ssl/both.pem:/etc/ssl/certs/both.pem
227233
sysctls:
228234
- net.ipv4.ip_unprivileged_port_start=0

.compose/examples/tom+fed+chat+admin.sqlite.yml

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -135,23 +135,16 @@ services:
135135
# - USERDB_ENGINE=sqlite ## Uncomment to enable local userDB
136136
# - USERDB_HOST=/opt/lemon/db/lemon.db ## Uncomment to enable local userDB
137137

138-
- SMS_API_KEY=SOME_SECRET_KEY
139-
140-
- SMS_API_URL=https://api.octopush.com/v1/public
141-
142138
- LOG_LEVEL=silly
143139
- LOG_TRANSPORTS=Console
144140

145141
chat:
146142
image: linagora/twake-web
147143
volumes:
148144
- ../chat/config.json:/usr/share/nginx/html/web/config.json
149-
- ../chat/default.conf.template:/etc/nginx/templates/default.conf.template
150145
- ../ssl:/etc/nginx/ssl
151146
# ports:
152-
# - 6868:6868
153-
environment:
154-
- TWAKECHAT_LISTEN_PORT=6868
147+
# - 80:80
155148
networks:
156149
- frontend
157150

@@ -167,8 +160,13 @@ services:
167160
ports:
168161
- 443:443
169162
volumes:
170-
- ../haproxy:/usr/local/etc/haproxy
163+
# Reverse proxy routing configuration
171164
- ../haproxy/haproxy.tom+fed+chat+admin.cfg:/usr/local/etc/haproxy/haproxy.cfg
165+
- ../haproxy/cors.lua:/usr/local/etc/haproxy/cors.lua
166+
- ../haproxy/lua_endpoint_to_function.map_rewrite.cfg:/usr/local/etc/haproxy/lua_endpoint_to_function.map_rewrite.cfg
167+
- ../haproxy/lua_endpoint_to_worker.map_rewrite.lua:/usr/local/etc/haproxy/lua_endpoint_to_worker.map_rewrite.lua
168+
- ../haproxy/synapse_worker_endpoint_indexer.lua:/usr/local/etc/haproxy/synapse_worker_endpoint_indexer.lua
169+
# HTTPS SSL Certs
172170
- ../ssl/both.pem:/etc/ssl/certs/both.pem
173171
sysctls:
174172
- net.ipv4.ip_unprivileged_port_start=0

.compose/examples/tom+fed+chat.pgsql+ldap.yml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,10 @@ services:
143143
- MATRIX_DATABASE_USER=synapse
144144
- MATRIX_DATABASE_PASSWORD=synapse!1
145145

146+
- SMS_API_KEY=SOME_SECRET_KEY
147+
148+
- SMS_API_URL=https://api.octopush.com/v1/public
149+
146150
- LOG_LEVEL=silly
147151
- LOG_TRANSPORTS=Console
148152

@@ -200,12 +204,9 @@ services:
200204
image: linagora/twake-web
201205
volumes:
202206
- ../chat/config.json:/usr/share/nginx/html/web/config.json
203-
- ../chat/default.conf.template:/etc/nginx/templates/default.conf.template
204207
- ../ssl:/etc/nginx/ssl
205208
# ports:
206-
# - 6868:6868
207-
environment:
208-
- TWAKECHAT_LISTEN_PORT=6868
209+
# - 80:80
209210
networks:
210211
- frontend
211212

@@ -214,8 +215,13 @@ services:
214215
ports:
215216
- 443:443
216217
volumes:
217-
- ../haproxy:/usr/local/etc/haproxy
218+
# Reverse proxy routing configuration
218219
- ../haproxy/haproxy.tom+fed+chat.cfg:/usr/local/etc/haproxy/haproxy.cfg
220+
- ../haproxy/cors.lua:/usr/local/etc/haproxy/cors.lua
221+
- ../haproxy/lua_endpoint_to_function.map_rewrite.cfg:/usr/local/etc/haproxy/lua_endpoint_to_function.map_rewrite.cfg
222+
- ../haproxy/lua_endpoint_to_worker.map_rewrite.lua:/usr/local/etc/haproxy/lua_endpoint_to_worker.map_rewrite.lua
223+
- ../haproxy/synapse_worker_endpoint_indexer.lua:/usr/local/etc/haproxy/synapse_worker_endpoint_indexer.lua
224+
# HTTPS SSL Certs
219225
- ../ssl/both.pem:/etc/ssl/certs/both.pem
220226
sysctls:
221227
- net.ipv4.ip_unprivileged_port_start=0

.compose/examples/tom+fed+chat.sqlite.yml

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -135,23 +135,16 @@ services:
135135
# - USERDB_ENGINE=sqlite ## Uncomment to enable local userDB
136136
# - USERDB_HOST=/opt/lemon/db/lemon.db ## Uncomment to enable local userDB
137137

138-
- SMS_API_KEY=SOME_SECRET_KEY
139-
140-
- SMS_API_URL=https://api.octopush.com/v1/public
141-
142138
- LOG_LEVEL=silly
143139
- LOG_TRANSPORTS=Console
144140

145141
chat:
146142
image: linagora/twake-web
147143
volumes:
148144
- ../chat/config.json:/usr/share/nginx/html/web/config.json
149-
- ../chat/default.conf.template:/etc/nginx/templates/default.conf.template
150145
- ../ssl:/etc/nginx/ssl
151146
# ports:
152-
# - 6868:6868
153-
environment:
154-
- TWAKECHAT_LISTEN_PORT=6868
147+
# - 80:80
155148
networks:
156149
- frontend
157150

@@ -160,8 +153,13 @@ services:
160153
ports:
161154
- 443:443
162155
volumes:
163-
- ../haproxy:/usr/local/etc/haproxy
156+
# Reverse proxy routing configuration
164157
- ../haproxy/haproxy.tom+fed+chat.cfg:/usr/local/etc/haproxy/haproxy.cfg
158+
- ../haproxy/cors.lua:/usr/local/etc/haproxy/cors.lua
159+
- ../haproxy/lua_endpoint_to_function.map_rewrite.cfg:/usr/local/etc/haproxy/lua_endpoint_to_function.map_rewrite.cfg
160+
- ../haproxy/lua_endpoint_to_worker.map_rewrite.lua:/usr/local/etc/haproxy/lua_endpoint_to_worker.map_rewrite.lua
161+
- ../haproxy/synapse_worker_endpoint_indexer.lua:/usr/local/etc/haproxy/synapse_worker_endpoint_indexer.lua
162+
# HTTPS SSL Certs
165163
- ../ssl/both.pem:/etc/ssl/certs/both.pem
166164
sysctls:
167165
- net.ipv4.ip_unprivileged_port_start=0

.compose/haproxy/haproxy.tom+fed+chat+admin.cfg

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,14 @@ frontend http-in
4040
acl is_fed hdr_end(host) -i fed.docker.localhost
4141
use_backend fed if is_fed
4242

43-
acl is_chat hdr_end(host) -i chat.docker.localhost
44-
use_backend chat if is_chat
43+
acl is_chat hdr(host) -i chat.docker.localhost
44+
45+
# If the host is chat.docker.localhost AND the path is exactly '/'
46+
# Then redirect to https://chat.docker.localhost/web/ with a 301 Permanent Redirect
47+
http-request redirect location https://chat.docker.localhost/web/ code 301 if is_chat { path eq / }
48+
49+
# Rule to send traffic for chat.docker.localhost to the chat backend
50+
use_backend chat if is_chat
4551

4652
acl is_admin hdr_end(host) -i admin.docker.localhost
4753
use_backend admin if is_admin
@@ -80,7 +86,7 @@ backend chat
8086
balance roundrobin
8187
option forwardfor
8288
http-request set-header X-Forwarded-Proto https
83-
server node1 chat:6868 check
89+
server node1 chat:80 check
8490

8591
backend admin
8692
balance roundrobin

.compose/haproxy/haproxy.tom+fed+chat.cfg

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,14 @@ frontend http-in
4040
acl is_fed hdr_end(host) -i fed.docker.localhost
4141
use_backend fed if is_fed
4242

43-
acl is_chat hdr_end(host) -i chat.docker.localhost
44-
use_backend chat if is_chat
43+
acl is_chat hdr(host) -i chat.docker.localhost
44+
45+
# If the host is chat.docker.localhost AND the path is exactly '/'
46+
# Then redirect to https://chat.docker.localhost/web/ with a 301 Permanent Redirect
47+
http-request redirect location https://chat.docker.localhost/web/ code 301 if is_chat { path eq / }
48+
49+
# Rule to send traffic for chat.docker.localhost to the chat backend
50+
use_backend chat if is_chat
4551

4652
acl is_portal hdr_end(host) -i auth.docker.localhost
4753
acl is_portal hdr_end(host) -i docker.localhost
@@ -77,4 +83,4 @@ backend chat
7783
balance roundrobin
7884
option forwardfor
7985
http-request set-header X-Forwarded-Proto https
80-
server node1 chat:6868 check
86+
server node1 chat:80 check

docker-compose.yml

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -134,23 +134,16 @@ services:
134134
# - USERDB_ENGINE=sqlite ## Uncomment to enable local userDB
135135
# - USERDB_HOST=/opt/lemon/db/lemon.db ## Uncomment to enable local userDB
136136

137-
- SMS_API_KEY=SOME_SECRET_KEY
138-
139-
- SMS_API_URL=https://api.octopush.com/v1/public
140-
141137
- LOG_LEVEL=silly
142138
- LOG_TRANSPORTS=Console
143139

144140
chat:
145141
image: linagora/twake-web
146142
volumes:
147143
- ./.compose/chat/config.json:/usr/share/nginx/html/web/config.json
148-
- ./.compose/chat/default.conf.template:/etc/nginx/templates/default.conf.template
149144
- ./.compose/ssl:/etc/nginx/ssl
150145
# ports:
151-
# - 6868:6868
152-
environment:
153-
- TWAKECHAT_LISTEN_PORT=6868
146+
# - 80:80
154147
networks:
155148
- frontend
156149

@@ -159,8 +152,13 @@ services:
159152
ports:
160153
- 443:443
161154
volumes:
162-
- ./.compose/haproxy:/usr/local/etc/haproxy
155+
# Reverse proxy routing configuration
163156
- ./.compose/haproxy/haproxy.tom+fed+chat.cfg:/usr/local/etc/haproxy/haproxy.cfg
157+
- ./.compose/haproxy/cors.lua:/usr/local/etc/haproxy/cors.lua
158+
- ./.compose/haproxy/lua_endpoint_to_function.map_rewrite.cfg:/usr/local/etc/haproxy/lua_endpoint_to_function.map_rewrite.cfg
159+
- ./.compose/haproxy/lua_endpoint_to_worker.map_rewrite.lua:/usr/local/etc/haproxy/lua_endpoint_to_worker.map_rewrite.lua
160+
- ./.compose/haproxy/synapse_worker_endpoint_indexer.lua:/usr/local/etc/haproxy/synapse_worker_endpoint_indexer.lua
161+
# HTTPS SSL Certs
164162
- ./.compose/ssl/both.pem:/etc/ssl/certs/both.pem
165163
sysctls:
166164
- net.ipv4.ip_unprivileged_port_start=0

0 commit comments

Comments
 (0)