Browse Source

riot config filename

Bob Mottram 7 years ago
parent
commit
22198a7f5f
1 changed files with 16 additions and 16 deletions
  1. 16
    16
      src/freedombone-app-riot

+ 16
- 16
src/freedombone-app-riot View File

@@ -66,8 +66,6 @@ function add_user_riot {
66 66
 }
67 67
 
68 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 69
     sed -i '/riot.im/d' /var/www/$RIOT_DOMAIN_NAME/htdocs/home.html
72 70
 }
73 71
 
@@ -253,23 +251,25 @@ function install_riot {
253 251
     riot_download
254 252
 
255 253
     cd /var/www/$RIOT_DOMAIN_NAME/htdocs
256
-    cp config.sample.json config.json
257 254
 
258 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 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 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 274
     RIOT_ONION_HOSTNAME=$(add_onion_service riot 80 ${RIOT_ONION_PORT})
275 275
 
@@ -347,9 +347,9 @@ function install_riot {
347 347
     function_check add_ddns_domain
348 348
     add_ddns_domain $RIOT_DOMAIN_NAME
349 349
 
350
+    riot_remove_bad_links
350 351
     chown -R www-data:www-data /var/www/$RIOT_DOMAIN_NAME/htdocs
351 352
 
352
-    riot_remove_bad_links
353 353
     systemctl restart nginx
354 354
 
355 355
     set_completion_param "riot domain" "$RIOT_DOMAIN_NAME"