Skip to content
Snippets Groups Projects
Commit ccb1f9c5 authored by Bob Mottram's avatar Bob Mottram
Browse files

Set default homeserver and identity server for riot

parent 5e523a67
No related branches found
No related tags found
No related merge requests found
......@@ -53,6 +53,26 @@ riot_variables=(MY_USERNAME
ONION_ONLY
DDNS_PROVIDER)
function riot_set_default_homeserver {
if [ ! "$RIOT_DOMAIN_NAME" ]; then
read_config_param RIOT_DOMAIN_NAME
fi
if [[ "$ONION_ONLY" == 'no' ]]; then
if [ ! "$MATRIX_DOMAIN_NAME" ]; then
read_config_param MATRIX_DOMAIN_NAME
fi
sed -i "s|https://matrix.org|https://$MATRIX_DOMAIN_NAME|g" /var/www/$RIOT_DOMAIN_NAME/htdocs/bundles/*/*.js
sed -i "s|https://vector.im|https://$MATRIX_DOMAIN_NAME|g" /var/www/$RIOT_DOMAIN_NAME/htdocs/bundles/*/*.js
else
if [ -f /var/lib/tor/hidden_service_matrix/hostname ]; then
MATRIX_ONION_HOSTNAME=$(cat /var/lib/tor/hidden_service_matrix/hostname)
sed -i "s|https://matrix.org|https://$MATRIX_ONION_HOSTNAME|g" /var/www/$RIOT_DOMAIN_NAME/htdocs/bundles/*/*.js
sed -i "s|https://vector.im|https://$MATRIX_ONION_HOSTNAME|g" /var/www/$RIOT_DOMAIN_NAME/htdocs/bundles/*/*.js
fi
fi
}
function logging_on_riot {
echo -n ''
}
......@@ -187,6 +207,9 @@ function upgrade_riot {
sed -i "s|riot version.*|riot version:$RIOT_VERSION|g" "${COMPLETION_FILE}"
riot_remove_bad_links
read_config_param ONION_ONLY
riot_set_default_homeserver
systemctl restart nginx
}
......@@ -403,6 +426,9 @@ function install_riot {
else
sed -i "s|riot version.*|riot version:${RIOT_VERSION}|g" "${COMPLETION_FILE}"
fi
riot_set_default_homeserver
APP_INSTALLED=1
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment