Switch matrix port

This commit is contained in:
Bob Mottram 2017-05-22 19:08:01 +01:00
parent 56b2b766fd
commit 48853d108f
1 changed files with 8 additions and 7 deletions

View File

@ -47,7 +47,7 @@ MATRIX_CODE=
MATRIX_DATA_DIR='/var/lib/matrix'
MATRIX_HTTP_PORT=8448
MATRIX_PORT=8008
MATRIX_PORT=8009
MATRIX_FEDERATION_ONION_PORT=8111
MATRIX_ONION_PORT=8109
MATRIX_REPO="https://github.com/matrix-org/synapse"
@ -90,12 +90,12 @@ function matrix_nginx {
echo ' location /_matrix {' >> $matrix_nginx_site
function_check nginx_limits
nginx_limits ${MATRIX_DOMAIN_NAME} '15m'
echo ' proxy_pass http://localhost:8008;' >> $matrix_nginx_site
echo " proxy_pass http://localhost:${MATRIX_PORT};" >> $matrix_nginx_site
echo ' }' >> $matrix_nginx_site
echo '}' >> $matrix_nginx_site
echo '' >> $matrix_nginx_site
echo 'server {' >> $matrix_nginx_site
echo " listen 0.0.0.0:8448;" >> $matrix_nginx_site
echo " listen 0.0.0.0:${MATRIX_HTTP_PORT};" >> $matrix_nginx_site
echo " server_name ${MATRIX_DOMAIN_NAME};" >> $matrix_nginx_site
echo '' >> $matrix_nginx_site
echo ' # Security' >> $matrix_nginx_site
@ -120,7 +120,7 @@ function matrix_nginx {
echo ' location /_matrix {' >> $matrix_nginx_site
function_check nginx_limits
nginx_limits ${MATRIX_DOMAIN_NAME} '15m'
echo ' proxy_pass http://localhost:8008;' >> $matrix_nginx_site
echo " proxy_pass http://localhost:${MATRIX_PORT};" >> $matrix_nginx_site
echo ' }' >> $matrix_nginx_site
echo '}' >> $matrix_nginx_site
echo '' >> $matrix_nginx_site
@ -144,7 +144,7 @@ function matrix_nginx {
echo ' location /_matrix {' >> $matrix_nginx_site
function_check nginx_limits
nginx_limits ${MATRIX_DOMAIN_NAME} '15m'
echo ' proxy_pass http://localhost:8008;' >> $matrix_nginx_site
echo " proxy_pass http://localhost:${MATRIX_PORT};" >> $matrix_nginx_site
echo ' }' >> $matrix_nginx_site
echo '}' >> $matrix_nginx_site
echo '' >> $matrix_nginx_site
@ -165,7 +165,7 @@ function matrix_nginx {
echo ' location /_matrix {' >> $matrix_nginx_site
function_check nginx_limits
nginx_limits ${MATRIX_DOMAIN_NAME} '15m'
echo ' proxy_pass http://localhost:8008;' >> $matrix_nginx_site
echo " proxy_pass http://localhost:${MATRIX_PORT};" >> $matrix_nginx_site
echo ' }' >> $matrix_nginx_site
echo '}' >> $matrix_nginx_site
@ -219,7 +219,8 @@ function matrix_configure_homeserver_yaml {
fi
sed -i "s|tls_dh_params_path:.*|tls_dh_params_path: \"/etc/ssl/certs/${MATRIX_DOMAIN_NAME}.dhparam\"|g" "${filepath}"
fi
sed -i 's|8448|8449|g' "${filepath}"
sed -i "s|${MATRIX_HTTP_PORT}|8449|g" "${filepath}"
sed -i "s|8008|${MATRIX_PORT}|g" "${filepath}"
sed -i 's|tls:.*|tls: False|g' "${filepath}"
sed -i 's|no_tls: .*|no_tls: True|g' "${filepath}"
sed -i ':a;N;$!ba;s/ tls: [^\n]*/ tls: False/2' "${filepath}"