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

riot config

parent 64e680c2
No related branches found
No related tags found
No related merge requests found
......@@ -246,26 +246,45 @@ function install_riot {
cd "/var/www/$RIOT_DOMAIN_NAME/htdocs" || exit 4628462876
if [[ "$ONION_ONLY" == 'no' ]]; then
RIOT_ONION_HOSTNAME=$(add_onion_service riot 80 ${RIOT_ONION_PORT})
if [[ $ONION_ONLY == "no" ]]; then
riot_config_file="config.${RIOT_DOMAIN_NAME}.json"
cp config.sample.json $riot_config_file
sed -i "s|\"default_hs_url\":.*|\"default_hs_url\": \"https://${MATRIX_DOMAIN_NAME}\",|g" "$riot_config_file"
sed -i "s|\"default_is_url\":.*|\"default_is_url\": \"https://${MATRIX_DOMAIN_NAME}\",|g" "$riot_config_file"
sed -i "s|\"bug_report_endpoint_url\":.*|\"bug_report_endpoint_url\": \"https://${MATRIX_DOMAIN_NAME}/bugs\",|g" "$riot_config_file"
sed -i "/\"servers\":/a \"${MATRIX_DOMAIN_NAME}\"," "$riot_config_file"
{ echo '{';
echo " \"default_hs_url\": \"https://${MATRIX_DOMAIN_NAME}\",";
echo " \"default_is_url\": \"https://${MATRIX_DOMAIN_NAME}\",";
echo ' "brand": "Riot",';
echo ' "integrations_ui_url": "",';
echo ' "integrations_rest_url": "",';
echo " \"bug_report_endpoint_url\": \"https://${MATRIX_DOMAIN_NAME}/bugs\",";
echo ' "enableLabs": false,';
echo ' "roomDirectory": {';
echo ' "servers": [';
echo " \"${MATRIX_DOMAIN_NAME}\",";
echo ' "matrix.org"';
echo ' ]';
echo ' }';
echo '}'; } > "$riot_config_file"
else
riot_config_file="config.${MATRIX_ONION_DOMAIN_NAME}.json"
cp config.sample.json "$riot_config_file"
sed -i "s|\"default_hs_url\":.*|\"default_hs_url\": \"http://${MATRIX_ONION_DOMAIN_NAME}\",|g" "$riot_config_file"
sed -i "s|\"default_is_url\":.*|\"default_is_url\": \"http://${MATRIX_ONION_DOMAIN_NAME}\",|g" "$riot_config_file"
sed -i "s|\"bug_report_endpoint_url\":.*|\"bug_report_endpoint_url\": \"http://${MATRIX_ONION_DOMAIN_NAME}/bugs\",|g" "$riot_config_file"
sed -i "/\"servers\":/a \"${MATRIX_ONION_DOMAIN_NAME}\"," "$riot_config_file"
{ echo '{';
echo " \"default_hs_url\": \"http://${MATRIX_ONION_DOMAIN_NAME}\",";
echo " \"default_is_url\": \"http://${MATRIX_ONION_DOMAIN_NAME}\",";
echo ' "brand": "Riot",';
echo ' "integrations_ui_url": "",';
echo ' "integrations_rest_url": "",';
echo " \"bug_report_endpoint_url\": \"http://${MATRIX_ONION_DOMAIN_NAME}/bugs\",";
echo ' "enableLabs": false,';
echo ' "roomDirectory": {';
echo ' "servers": [';
echo " \"${MATRIX_ONION_DOMAIN_NAME}\",";
echo ' "matrix.org"';
echo ' ]';
echo ' }';
echo '}'; } > "$riot_config_file"
fi
sed -i "s|\"integrations_ui_url\":.*|\"integrations_ui_url\": \"\",|g" "$riot_config_file"
sed -i "s|\"integrations_rest_url\":.*|\"integrations_rest_url\": \"\",|g" "$riot_config_file"
sed -i 's|https://piwik.riot.im/||g' "$riot_config_file"
RIOT_ONION_HOSTNAME=$(add_onion_service riot 80 ${RIOT_ONION_PORT})
riot_nginx_site=/etc/nginx/sites-available/$RIOT_DOMAIN_NAME
if [[ $ONION_ONLY == "no" ]]; then
......
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