|
|
|
|
66
|
}
|
66
|
}
|
67
|
|
67
|
|
68
|
function riot_remove_bad_links {
|
68
|
function riot_remove_bad_links {
|
69
|
- # We should not need to be depending on sites that we don't control
|
|
|
70
|
- sed -i 's|https://piwik.riot.im/||g' /var/www/$RIOT_DOMAIN_NAME/htdocs/config.json
|
|
|
71
|
sed -i '/riot.im/d' /var/www/$RIOT_DOMAIN_NAME/htdocs/home.html
|
69
|
sed -i '/riot.im/d' /var/www/$RIOT_DOMAIN_NAME/htdocs/home.html
|
72
|
}
|
70
|
}
|
73
|
|
71
|
|
|
|
|
|
253
|
riot_download
|
251
|
riot_download
|
254
|
|
252
|
|
255
|
cd /var/www/$RIOT_DOMAIN_NAME/htdocs
|
253
|
cd /var/www/$RIOT_DOMAIN_NAME/htdocs
|
256
|
- cp config.sample.json config.json
|
|
|
257
|
|
254
|
|
258
|
if [[ $ONION_ONLY == 'no' ]]; then
|
255
|
if [[ $ONION_ONLY == 'no' ]]; then
|
259
|
- sed -i "s|\"default_hs_url\":.*|\"default_hs_url\": \"https://${MATRIX_DOMAIN_NAME}\",|g" config.json
|
|
|
260
|
- sed -i "s|\"default_is_url\":.*|\"default_is_url\": \"https://${MATRIX_DOMAIN_NAME}\",|g" config.json
|
|
|
261
|
- sed -i "s|\"integrations_ui_url\":.*|\"integrations_ui_url\": \"\",|g" config.json
|
|
|
262
|
- sed -i "s|\"integrations_rest_url\":.*|\"integrations_rest_url\": \"\",|g" config.json
|
|
|
263
|
- sed -i "s|\"bug_report_endpoint_url\":.*|\"bug_report_endpoint_url\": \"https://${MATRIX_DOMAIN_NAME}/bugs\",|g" config.json
|
|
|
264
|
- sed -i "/\"servers\":/a \"${MATRIX_DOMAIN_NAME}\"," config.json
|
|
|
|
|
256
|
+ riot_config_file="config.${RIOT_DOMAIN_NAME}.json"
|
|
|
257
|
+ cp config.sample.json $riot_config_file
|
|
|
258
|
+ sed -i "s|\"default_hs_url\":.*|\"default_hs_url\": \"https://${MATRIX_DOMAIN_NAME}\",|g" $riot_config_file
|
|
|
259
|
+ sed -i "s|\"default_is_url\":.*|\"default_is_url\": \"https://${MATRIX_DOMAIN_NAME}\",|g" $riot_config_file
|
|
|
260
|
+ sed -i "s|\"bug_report_endpoint_url\":.*|\"bug_report_endpoint_url\": \"https://${MATRIX_DOMAIN_NAME}/bugs\",|g" $riot_config_file
|
|
|
261
|
+ sed -i "/\"servers\":/a \"${MATRIX_DOMAIN_NAME}\"," $riot_config_file
|
265
|
else
|
262
|
else
|
266
|
- sed -i "s|\"default_hs_url\":.*|\"default_hs_url\": \"http://${MATRIX_ONION_DOMAIN_NAME}\",|g" config.json
|
|
|
267
|
- sed -i "s|\"default_is_url\":.*|\"default_is_url\": \"http://${MATRIX_ONION_DOMAIN_NAME}\",|g" config.json
|
|
|
268
|
- sed -i "s|\"integrations_ui_url\":.*|\"integrations_ui_url\": \"\",|g" config.json
|
|
|
269
|
- sed -i "s|\"integrations_rest_url\":.*|\"integrations_rest_url\": \"\",|g" config.json
|
|
|
270
|
- sed -i "s|\"bug_report_endpoint_url\":.*|\"bug_report_endpoint_url\": \"http://${MATRIX_ONION_DOMAIN_NAME}/bugs\",|g" config.json
|
|
|
271
|
- sed -i "/\"servers\":/a \"${MATRIX_ONION_DOMAIN_NAME}\"," config.json
|
|
|
|
|
263
|
+ riot_config_file="config.${MATRIX_ONION_DOMAIN_NAME}.json"
|
|
|
264
|
+ cp config.sample.json $riot_config_file
|
|
|
265
|
+ sed -i "s|\"default_hs_url\":.*|\"default_hs_url\": \"http://${MATRIX_ONION_DOMAIN_NAME}\",|g" $riot_config_file
|
|
|
266
|
+ sed -i "s|\"default_is_url\":.*|\"default_is_url\": \"http://${MATRIX_ONION_DOMAIN_NAME}\",|g" $riot_config_file
|
|
|
267
|
+ sed -i "s|\"bug_report_endpoint_url\":.*|\"bug_report_endpoint_url\": \"http://${MATRIX_ONION_DOMAIN_NAME}/bugs\",|g" $riot_config_file
|
|
|
268
|
+ sed -i "/\"servers\":/a \"${MATRIX_ONION_DOMAIN_NAME}\"," $riot_config_file
|
272
|
fi
|
269
|
fi
|
|
|
270
|
+ sed -i "s|\"integrations_ui_url\":.*|\"integrations_ui_url\": \"\",|g" $riot_config_file
|
|
|
271
|
+ sed -i "s|\"integrations_rest_url\":.*|\"integrations_rest_url\": \"\",|g" $riot_config_file
|
|
|
272
|
+ sed -i 's|https://piwik.riot.im/||g' $riot_config_file
|
273
|
|
273
|
|
274
|
RIOT_ONION_HOSTNAME=$(add_onion_service riot 80 ${RIOT_ONION_PORT})
|
274
|
RIOT_ONION_HOSTNAME=$(add_onion_service riot 80 ${RIOT_ONION_PORT})
|
275
|
|
275
|
|
|
|
|
|
347
|
function_check add_ddns_domain
|
347
|
function_check add_ddns_domain
|
348
|
add_ddns_domain $RIOT_DOMAIN_NAME
|
348
|
add_ddns_domain $RIOT_DOMAIN_NAME
|
349
|
|
349
|
|
|
|
350
|
+ riot_remove_bad_links
|
350
|
chown -R www-data:www-data /var/www/$RIOT_DOMAIN_NAME/htdocs
|
351
|
chown -R www-data:www-data /var/www/$RIOT_DOMAIN_NAME/htdocs
|
351
|
|
352
|
|
352
|
- riot_remove_bad_links
|
|
|
353
|
systemctl restart nginx
|
353
|
systemctl restart nginx
|
354
|
|
354
|
|
355
|
set_completion_param "riot domain" "$RIOT_DOMAIN_NAME"
|
355
|
set_completion_param "riot domain" "$RIOT_DOMAIN_NAME"
|