Browse Source

Server name

Bob Mottram 8 years ago
parent
commit
3700fde49e
1 changed files with 7 additions and 10 deletions
  1. 7
    10
      src/freedombone-app-matrix

+ 7
- 10
src/freedombone-app-matrix View File

62
         proxy_set_header X-Forwarded-For $remote_addr; \
62
         proxy_set_header X-Forwarded-For $remote_addr; \
63
     }'
63
     }'
64
     turn_proxy_str=' \
64
     turn_proxy_str=' \
65
-    location /turn { \
65
+    location /_turn { \
66
         proxy_pass https://localhost:3478; \
66
         proxy_pass https://localhost:3478; \
67
         proxy_set_header X-Forwarded-For $remote_addr; \
67
         proxy_set_header X-Forwarded-For $remote_addr; \
68
     }'
68
     }'
74
         proxy_set_header X-Forwarded-For $remote_addr; \
74
         proxy_set_header X-Forwarded-For $remote_addr; \
75
     }'
75
     }'
76
         turn_proxy_str=' \
76
         turn_proxy_str=' \
77
-    location /turn { \
77
+    location /_turn { \
78
         proxy_pass http://localhost:3478; \
78
         proxy_pass http://localhost:3478; \
79
         proxy_set_header X-Forwarded-For $remote_addr; \
79
         proxy_set_header X-Forwarded-For $remote_addr; \
80
     }'
80
     }'
207
 
207
 
208
     local ymltemp="$(mktemp)"
208
     local ymltemp="$(mktemp)"
209
 
209
 
210
-    awk -v TURNURIES="turn_uris: [\"turn:${DEFAULT_DOMAIN_NAME}/turn?transport=udp\", \"turn:${DEFAULT_DOMAIN_NAME}/turn?transport=tcp\"]" \
210
+    awk -v TURNURIES="turn_uris: [\"turn:${DEFAULT_DOMAIN_NAME}/_turn?transport=udp\", \"turn:${DEFAULT_DOMAIN_NAME}/_turn?transport=tcp\"]" \
211
         -v TURNSHAREDSECRET="turn_shared_secret: \"${turnkey}\"" \
211
         -v TURNSHAREDSECRET="turn_shared_secret: \"${turnkey}\"" \
212
         -v PIDFILE="pid_file: ${MATRIX_DATA_DIR}/homeserver.pid" \
212
         -v PIDFILE="pid_file: ${MATRIX_DATA_DIR}/homeserver.pid" \
213
         -v DATABASE="database: \"${MATRIX_DATA_DIR}/homeserver.db\"" \
213
         -v DATABASE="database: \"${MATRIX_DATA_DIR}/homeserver.db\"" \
235
     sed -i "s|log_file:.*|log_file: \"/dev/null\"|g" "${filepath}"
235
     sed -i "s|log_file:.*|log_file: \"/dev/null\"|g" "${filepath}"
236
     sed -i '0,/bind_address:.*/s//bind_address: 127.0.0.1/' "${filepath}"
236
     sed -i '0,/bind_address:.*/s//bind_address: 127.0.0.1/' "${filepath}"
237
     sed -i '0,/x_forwarded:.*/s//x_forwarded: true/' "${filepath}"
237
     sed -i '0,/x_forwarded:.*/s//x_forwarded: true/' "${filepath}"
238
-    sed -i "s|server_name:.*|server_name: \"${DEFAULT_DOMAIN_NAME}/_matrix\"|g" "${filepath}"
239
-    sed -i "/trusted_third_party_id_servers:/a     - ${DEFAULT_DOMAIN_NAME}/_matrixid" "${filepath}"
240
-    sed -i "s|- ${DEFAULT_DOMAIN_NAME}/_matrixid|    - ${DEFAULT_DOMAIN_NAME}/_matrixid|g" "${filepath}"
238
+    sed -i "s|server_name:.*|server_name: \"${DEFAULT_DOMAIN_NAME}\"|g" "${filepath}"
239
+    sed -i "/trusted_third_party_id_servers:/a     - ${DEFAULT_DOMAIN_NAME}" "${filepath}"
240
+    sed -i "s|- ${DEFAULT_DOMAIN_NAME}|    - ${DEFAULT_DOMAIN_NAME}|g" "${filepath}"
241
 }
241
 }
242
 
242
 
243
 function matrix_configure_identityserver {
243
 function matrix_configure_identityserver {
248
     sed -i "s|Sydent Validation|Freedombone Matrix Account Validation|g" ${filepath}
248
     sed -i "s|Sydent Validation|Freedombone Matrix Account Validation|g" ${filepath}
249
     sed -i "s|pidfile.path.*|pidfile.path = /etc/sydent/sydent.pid|g" ${filepath}
249
     sed -i "s|pidfile.path.*|pidfile.path = /etc/sydent/sydent.pid|g" ${filepath}
250
     sed -i "s|log.path.*|log.path = /dev/null|g" ${filepath}
250
     sed -i "s|log.path.*|log.path = /dev/null|g" ${filepath}
251
-    sed -i "s|server.name.*|server.name = ${DEFAULT_DOMAIN_NAME}/_matrixid|g" ${filepath}
251
+    sed -i "s|server.name.*|server.name = ${DEFAULT_DOMAIN_NAME}|g" ${filepath}
252
 }
252
 }
253
 
253
 
254
 function matrix_diff {
254
 function matrix_diff {
472
 }
472
 }
473
 
473
 
474
 function remove_matrix {
474
 function remove_matrix {
475
-    firewall_remove ${MATRIX_PORT}
476
     systemctl stop matrix
475
     systemctl stop matrix
477
     systemctl stop sydent
476
     systemctl stop sydent
478
 
477
 
644
     fi
643
     fi
645
     chmod -R 700 $MATRIX_DATA_DIR/homeserver.db
644
     chmod -R 700 $MATRIX_DATA_DIR/homeserver.db
646
 
645
 
647
-    firewall_add matrix ${MATRIX_PORT}
648
-
649
     MATRIX_ONION_HOSTNAME=$(add_onion_service matrix ${MATRIX_PORT} ${MATRIX_PORT})
646
     MATRIX_ONION_HOSTNAME=$(add_onion_service matrix ${MATRIX_PORT} ${MATRIX_PORT})
650
     if [ ! ${MATRIX_PASSWORD} ]; then
647
     if [ ! ${MATRIX_PASSWORD} ]; then
651
         if [ -f ${IMAGE_PASSWORD_FILE} ]; then
648
         if [ -f ${IMAGE_PASSWORD_FILE} ]; then