|
|
|
|
47
|
|
47
|
|
48
|
MATRIX_DATA_DIR='/var/lib/matrix'
|
48
|
MATRIX_DATA_DIR='/var/lib/matrix'
|
49
|
MATRIX_HTTP_PORT=8448
|
49
|
MATRIX_HTTP_PORT=8448
|
50
|
-MATRIX_PORT=8008
|
|
|
|
|
50
|
+MATRIX_PORT=8009
|
51
|
MATRIX_FEDERATION_ONION_PORT=8111
|
51
|
MATRIX_FEDERATION_ONION_PORT=8111
|
52
|
MATRIX_ONION_PORT=8109
|
52
|
MATRIX_ONION_PORT=8109
|
53
|
MATRIX_REPO="https://github.com/matrix-org/synapse"
|
53
|
MATRIX_REPO="https://github.com/matrix-org/synapse"
|
|
|
|
|
90
|
echo ' location /_matrix {' >> $matrix_nginx_site
|
90
|
echo ' location /_matrix {' >> $matrix_nginx_site
|
91
|
function_check nginx_limits
|
91
|
function_check nginx_limits
|
92
|
nginx_limits ${MATRIX_DOMAIN_NAME} '15m'
|
92
|
nginx_limits ${MATRIX_DOMAIN_NAME} '15m'
|
93
|
- echo ' proxy_pass http://localhost:8008;' >> $matrix_nginx_site
|
|
|
|
|
93
|
+ echo " proxy_pass http://localhost:${MATRIX_PORT};" >> $matrix_nginx_site
|
94
|
echo ' }' >> $matrix_nginx_site
|
94
|
echo ' }' >> $matrix_nginx_site
|
95
|
echo '}' >> $matrix_nginx_site
|
95
|
echo '}' >> $matrix_nginx_site
|
96
|
echo '' >> $matrix_nginx_site
|
96
|
echo '' >> $matrix_nginx_site
|
97
|
echo 'server {' >> $matrix_nginx_site
|
97
|
echo 'server {' >> $matrix_nginx_site
|
98
|
- echo " listen 0.0.0.0:8448;" >> $matrix_nginx_site
|
|
|
|
|
98
|
+ echo " listen 0.0.0.0:${MATRIX_HTTP_PORT};" >> $matrix_nginx_site
|
99
|
echo " server_name ${MATRIX_DOMAIN_NAME};" >> $matrix_nginx_site
|
99
|
echo " server_name ${MATRIX_DOMAIN_NAME};" >> $matrix_nginx_site
|
100
|
echo '' >> $matrix_nginx_site
|
100
|
echo '' >> $matrix_nginx_site
|
101
|
echo ' # Security' >> $matrix_nginx_site
|
101
|
echo ' # Security' >> $matrix_nginx_site
|
|
|
|
|
120
|
echo ' location /_matrix {' >> $matrix_nginx_site
|
120
|
echo ' location /_matrix {' >> $matrix_nginx_site
|
121
|
function_check nginx_limits
|
121
|
function_check nginx_limits
|
122
|
nginx_limits ${MATRIX_DOMAIN_NAME} '15m'
|
122
|
nginx_limits ${MATRIX_DOMAIN_NAME} '15m'
|
123
|
- echo ' proxy_pass http://localhost:8008;' >> $matrix_nginx_site
|
|
|
|
|
123
|
+ echo " proxy_pass http://localhost:${MATRIX_PORT};" >> $matrix_nginx_site
|
124
|
echo ' }' >> $matrix_nginx_site
|
124
|
echo ' }' >> $matrix_nginx_site
|
125
|
echo '}' >> $matrix_nginx_site
|
125
|
echo '}' >> $matrix_nginx_site
|
126
|
echo '' >> $matrix_nginx_site
|
126
|
echo '' >> $matrix_nginx_site
|
|
|
|
|
144
|
echo ' location /_matrix {' >> $matrix_nginx_site
|
144
|
echo ' location /_matrix {' >> $matrix_nginx_site
|
145
|
function_check nginx_limits
|
145
|
function_check nginx_limits
|
146
|
nginx_limits ${MATRIX_DOMAIN_NAME} '15m'
|
146
|
nginx_limits ${MATRIX_DOMAIN_NAME} '15m'
|
147
|
- echo ' proxy_pass http://localhost:8008;' >> $matrix_nginx_site
|
|
|
|
|
147
|
+ echo " proxy_pass http://localhost:${MATRIX_PORT};" >> $matrix_nginx_site
|
148
|
echo ' }' >> $matrix_nginx_site
|
148
|
echo ' }' >> $matrix_nginx_site
|
149
|
echo '}' >> $matrix_nginx_site
|
149
|
echo '}' >> $matrix_nginx_site
|
150
|
echo '' >> $matrix_nginx_site
|
150
|
echo '' >> $matrix_nginx_site
|
|
|
|
|
165
|
echo ' location /_matrix {' >> $matrix_nginx_site
|
165
|
echo ' location /_matrix {' >> $matrix_nginx_site
|
166
|
function_check nginx_limits
|
166
|
function_check nginx_limits
|
167
|
nginx_limits ${MATRIX_DOMAIN_NAME} '15m'
|
167
|
nginx_limits ${MATRIX_DOMAIN_NAME} '15m'
|
168
|
- echo ' proxy_pass http://localhost:8008;' >> $matrix_nginx_site
|
|
|
|
|
168
|
+ echo " proxy_pass http://localhost:${MATRIX_PORT};" >> $matrix_nginx_site
|
169
|
echo ' }' >> $matrix_nginx_site
|
169
|
echo ' }' >> $matrix_nginx_site
|
170
|
echo '}' >> $matrix_nginx_site
|
170
|
echo '}' >> $matrix_nginx_site
|
171
|
|
171
|
|
|
|
|
|
219
|
fi
|
219
|
fi
|
220
|
sed -i "s|tls_dh_params_path:.*|tls_dh_params_path: \"/etc/ssl/certs/${MATRIX_DOMAIN_NAME}.dhparam\"|g" "${filepath}"
|
220
|
sed -i "s|tls_dh_params_path:.*|tls_dh_params_path: \"/etc/ssl/certs/${MATRIX_DOMAIN_NAME}.dhparam\"|g" "${filepath}"
|
221
|
fi
|
221
|
fi
|
222
|
- sed -i 's|8448|8449|g' "${filepath}"
|
|
|
|
|
222
|
+ sed -i "s|${MATRIX_HTTP_PORT}|8449|g" "${filepath}"
|
|
|
223
|
+ sed -i "s|8008|${MATRIX_PORT}|g" "${filepath}"
|
223
|
sed -i 's|tls:.*|tls: False|g' "${filepath}"
|
224
|
sed -i 's|tls:.*|tls: False|g' "${filepath}"
|
224
|
sed -i 's|no_tls: .*|no_tls: True|g' "${filepath}"
|
225
|
sed -i 's|no_tls: .*|no_tls: True|g' "${filepath}"
|
225
|
sed -i ':a;N;$!ba;s/ tls: [^\n]*/ tls: False/2' "${filepath}"
|
226
|
sed -i ':a;N;$!ba;s/ tls: [^\n]*/ tls: False/2' "${filepath}"
|