4 Commits

Author SHA1 Message Date
  Gattes a83ce8fef3 Adding Healthcheck and upgrading to latest synapse backend 1 month ago
  Gattes bf037fe2f9 Minor fix 1 month ago
  Gattes abab6cd41c Minor bumps and fixes 1 month ago
  Miguel 01fc922ac7 Bumping up version 1 month ago
2 changed files with 24 additions and 35 deletions
  1. 14
    20
      docker-compose.yaml
  2. 10
    15
      install.sh

+ 14
- 20
docker-compose.yaml View File

17
       matrix_db:
17
       matrix_db:
18
     ports:
18
     ports:
19
       - 8008:8008
19
       - 8008:8008
20
+    healthcheck:
21
+      test: ["CMD", "curl", "-fSs", "http://localhost:8008/health"]
22
+      interval: 15s
23
+      timeout: 5s
24
+      retries: 3
25
+      start_period: 5s
20
 
26
 
21
   db:
27
   db:
22
-    image: docker.io/postgres:16.2-alpine
28
+    image: docker.io/postgres:16-alpine
23
     environment:
29
     environment:
24
       - POSTGRES_DB=synapse
30
       - POSTGRES_DB=synapse
25
       - POSTGRES_USER=matrix_synapse
31
       - POSTGRES_USER=matrix_synapse
39
       matrix_server:
45
       matrix_server:
40
         ipv4_address: 10.10.10.3
46
         ipv4_address: 10.10.10.3
41
     depends_on:
47
     depends_on:
42
-      - synapse
48
+      synapse:
49
+        condition: service_healthy
43
 
50
 
44
   sydent:
51
   sydent:
45
     image: docker.io/matrixdotorg/sydent:v2.6.1
52
     image: docker.io/matrixdotorg/sydent:v2.6.1
48
       matrix_server:
55
       matrix_server:
49
         ipv4_address: 10.10.10.5
56
         ipv4_address: 10.10.10.5
50
     depends_on:
57
     depends_on:
51
-      - synapse
58
+      synapse:
59
+        condition: service_healthy
52
 
60
 
53
   synapse-admin:
61
   synapse-admin:
54
     image: awesometechnologies/synapse-admin:0.10.3
62
     image: awesometechnologies/synapse-admin:0.10.3
57
       matrix_server:
65
       matrix_server:
58
         ipv4_address: 10.10.10.6
66
         ipv4_address: 10.10.10.6
59
     depends_on:
67
     depends_on:
60
-      - synapse
61
-
62
-  sliding-sync:
63
-    image: ghcr.io/matrix-org/sliding-sync:v0.99.19
64
-    restart: always
65
-    environment:
66
-      - SYNCV3_BINDADDR=:8008
67
-      - SYNCV3_SERVER=https://DOMAIN
68
-      - SYNCV3_SECRET=SLIDING_SYNC_KEY
69
-      - SYNCV3_DB=user=matrix_synapse dbname=synapse sslmode=disable host=db password=PG_PASS
70
-    networks:
71
-      matrix_server:
72
-        ipv4_address: 10.10.10.7
73
-      matrix_db:
74
-    depends_on:
75
-      - synapse
68
+      synapse:
69
+        condition: service_healthy
76
 
70
 
77
   hydrogen-web:
71
   hydrogen-web:
78
-    image: ghcr.io/element-hq/hydrogen-web:v0.4.1
72
+    image: ghcr.io/element-hq/hydrogen-web:v0.5.1
79
     restart: unless-stopped
73
     restart: unless-stopped
80
     environment:
74
     environment:
81
       - |
75
       - |

+ 10
- 15
install.sh View File

94
 sed -i "s|DOMAIN|${DOMAIN}|g" "${BASE_DIR}/docker-compose.yaml"
94
 sed -i "s|DOMAIN|${DOMAIN}|g" "${BASE_DIR}/docker-compose.yaml"
95
 sed -i "s|PG_PASS|${PG_PASS}|g" "${BASE_DIR}/docker-compose.yaml"
95
 sed -i "s|PG_PASS|${PG_PASS}|g" "${BASE_DIR}/docker-compose.yaml"
96
 
96
 
97
+# Generate synapse file
97
 # Generate synapse file
98
 # Generate synapse file
98
 echo -e "Generating synapse file..\n"
99
 echo -e "Generating synapse file..\n"
99
-docker compose run --rm synapse_homeserver --generate-config -H ${DOMAIN} -c /data/homeserver.yaml --report-stats=yes
100
+docker compose run --rm -e SYNAPSE_SERVER_NAME=${DOMAIN} -e SYNAPSE_REPORT_STATS=yes synapse generate
100
 
101
 
101
 # Replace DB config in Synapse's homeserver.yaml
102
 # Replace DB config in Synapse's homeserver.yaml
102
 echo -e "Configuring homeserver.yaml\n"
103
 echo -e "Configuring homeserver.yaml\n"
111
 
112
 
112
 # Configure User Directory and TURN
113
 # Configure User Directory and TURN
113
 cat <<EOF >> "${BASE_DIR}/config/synapse/homeserver.yaml"
114
 cat <<EOF >> "${BASE_DIR}/config/synapse/homeserver.yaml"
115
+public_baseurl: "https://${DOMAIN}"
114
 user_directory:
116
 user_directory:
115
     enabled: true
117
     enabled: true
116
     search_all_users: true
118
     search_all_users: true
121
 turn_shared_secret: "${TURN_STATIC_SECRET}"
123
 turn_shared_secret: "${TURN_STATIC_SECRET}"
122
 turn_uris: [ "turn:${DOMAIN}?transport=udp" ]
124
 turn_uris: [ "turn:${DOMAIN}?transport=udp" ]
123
 suppress_key_server_warning: true
125
 suppress_key_server_warning: true
126
+enable_authenticated_media: False
124
 retention:
127
 retention:
125
   enabled: true
128
   enabled: true
126
   default_policy:
129
   default_policy:
162
     add_header X-Content-Type-Options nosniff;
165
     add_header X-Content-Type-Options nosniff;
163
     add_header X-Frame-Options "SAMEORIGIN";
166
     add_header X-Frame-Options "SAMEORIGIN";
164
 
167
 
165
-    location /.well-known/matrix/client {
166
-        default_type application/json;
167
-        add_header Access-Control-Allow-Origin *;
168
-        return 200 '{"m.homeserver": {"base_url": "https://${DOMAIN}"}, "org.matrix.msc3575.proxy": {"url": "https://${DOMAIN}"}}';
169
-    }
170
-
171
     # Admin panel
168
     # Admin panel
172
     location /admin/ {
169
     location /admin/ {
173
         proxy_pass http://10.10.10.6/;
170
         proxy_pass http://10.10.10.6/;
186
         proxy_http_version 1.1;
183
         proxy_http_version 1.1;
187
     }
184
     }
188
 
185
 
189
-    # Sliding Sync
190
-    location ~ ^/(client/|_matrix/client/unstable/org.matrix.msc3575/sync) {
191
-        proxy_pass http://10.10.10.7:8008;
192
-        proxy_set_header X-Forwarded-For \$remote_addr;
193
-        proxy_set_header X-Forwarded-Proto \$scheme;
194
-        proxy_set_header Host \$host;
195
-    }
196
-
197
     # Synapse Backend
186
     # Synapse Backend
198
     location ~ ^(\/_matrix|\/_synapse\/(client|admin)) {
187
     location ~ ^(\/_matrix|\/_synapse\/(client|admin)) {
199
         # Synapse Container Network IP
188
         # Synapse Container Network IP
216
         proxy_http_version 1.1;
205
         proxy_http_version 1.1;
217
     }
206
     }
218
 
207
 
208
+    location /.well-known/matrix/client {
209
+        default_type application/json;
210
+        add_header Access-Control-Allow-Origin *;
211
+        return 200 '{"m.homeserver": {"base_url": "https://${DOMAIN}"}, "m.identity_server": {"base_url": "https://${DOMAIN}"}}';
212
+    }
213
+
219
     # Element Frontend
214
     # Element Frontend
220
     location / {
215
     location / {
221
         # Element chat Container Network IP
216
         # Element chat Container Network IP

Loading…
Cancel
Save