|
@@ -94,9 +94,10 @@ PG_PASS=$(pwgen -s 28 -1)
|
94
|
94
|
sed -i "s|DOMAIN|${DOMAIN}|g" "${BASE_DIR}/docker-compose.yaml"
|
95
|
95
|
sed -i "s|PG_PASS|${PG_PASS}|g" "${BASE_DIR}/docker-compose.yaml"
|
96
|
96
|
|
|
97
|
+# Generate synapse file
|
97
|
98
|
# Generate synapse file
|
98
|
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
|
102
|
# Replace DB config in Synapse's homeserver.yaml
|
102
|
103
|
echo -e "Configuring homeserver.yaml\n"
|
|
@@ -111,6 +112,7 @@ cp /tmp/homeserver.yaml "${BASE_DIR}/config/synapse/homeserver.yaml"
|
111
|
112
|
|
112
|
113
|
# Configure User Directory and TURN
|
113
|
114
|
cat <<EOF >> "${BASE_DIR}/config/synapse/homeserver.yaml"
|
|
115
|
+public_baseurl: "https://${DOMAIN}"
|
114
|
116
|
user_directory:
|
115
|
117
|
enabled: true
|
116
|
118
|
search_all_users: true
|
|
@@ -121,6 +123,7 @@ turn_user_lifetime: 86400000
|
121
|
123
|
turn_shared_secret: "${TURN_STATIC_SECRET}"
|
122
|
124
|
turn_uris: [ "turn:${DOMAIN}?transport=udp" ]
|
123
|
125
|
suppress_key_server_warning: true
|
|
126
|
+enable_authenticated_media: False
|
124
|
127
|
retention:
|
125
|
128
|
enabled: true
|
126
|
129
|
default_policy:
|
|
@@ -162,12 +165,6 @@ server {
|
162
|
165
|
add_header X-Content-Type-Options nosniff;
|
163
|
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
|
168
|
# Admin panel
|
172
|
169
|
location /admin/ {
|
173
|
170
|
proxy_pass http://10.10.10.6/;
|
|
@@ -186,14 +183,6 @@ server {
|
186
|
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
|
186
|
# Synapse Backend
|
198
|
187
|
location ~ ^(\/_matrix|\/_synapse\/(client|admin)) {
|
199
|
188
|
# Synapse Container Network IP
|
|
@@ -216,6 +205,12 @@ server {
|
216
|
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
|
214
|
# Element Frontend
|
220
|
215
|
location / {
|
221
|
216
|
# Element chat Container Network IP
|