riot with onion address

This commit is contained in:
Bob Mottram 2017-06-20 15:52:40 +01:00
parent baa523aa21
commit d076d70f88
1 changed files with 18 additions and 6 deletions

View File

@ -217,6 +217,9 @@ function install_riot {
exit 827334
fi
function_check get_completion_param
MATRIX_ONION_DOMAIN_NAME=$(get_completion_param "matrix onion domain")
apt-get -yq install wget
if [ ! -d /var/www/$RIOT_DOMAIN_NAME/htdocs ]; then
@ -232,12 +235,21 @@ function install_riot {
cd /var/www/$RIOT_DOMAIN_NAME/htdocs
cp config.sample.json config.json
if [[ $ONION_ONLY == 'no' ]]; then
sed -i "s|\"default_hs_url\":.*|\"default_hs_url\": \"https://${MATRIX_DOMAIN_NAME}\",|g" config.json
sed -i "s|\"default_is_url\":.*|\"default_is_url\": \"https://${MATRIX_DOMAIN_NAME}\",|g" config.json
sed -i "s|\"integrations_ui_url\":.*|\"integrations_ui_url\": \"https://${MATRIX_DOMAIN_NAME}/\",|g" config.json
sed -i "s|\"integrations_rest_url\":.*|\"integrations_rest_url\": \"https://${MATRIX_DOMAIN_NAME}/api\",|g" config.json
sed -i "s|\"bug_report_endpoint_url\":.*|\"bug_report_endpoint_url\": \"https://${MATRIX_DOMAIN_NAME}/bugs\",|g" config.json
sed -i "/\"servers\":/a \"matrix.freedombone.net\"," config.json
sed -i "/\"servers\":/a \"${MATRIX_DOMAIN_NAME}\"," config.json
else
sed -i "s|\"default_hs_url\":.*|\"default_hs_url\": \"http://${MATRIX_ONION_DOMAIN_NAME}\",|g" config.json
sed -i "s|\"default_is_url\":.*|\"default_is_url\": \"http://${MATRIX_ONION_DOMAIN_NAME}\",|g" config.json
sed -i "s|\"integrations_ui_url\":.*|\"integrations_ui_url\": \"http://${MATRIX_ONION_DOMAIN_NAME}/\",|g" config.json
sed -i "s|\"integrations_rest_url\":.*|\"integrations_rest_url\": \"http://${MATRIX_ONION_DOMAIN_NAME}/api\",|g" config.json
sed -i "s|\"bug_report_endpoint_url\":.*|\"bug_report_endpoint_url\": \"http://${MATRIX_ONION_DOMAIN_NAME}/bugs\",|g" config.json
sed -i "/\"servers\":/a \"${MATRIX_ONION_DOMAIN_NAME}\"," config.json
fi
RIOT_ONION_HOSTNAME=$(add_onion_service riot 80 ${RIOT_ONION_PORT})