From 0598701bb12b7bbacec4e79156925a8a826f16dc Mon Sep 17 00:00:00 2001 From: Robles Rodolphe Date: Fri, 12 Jun 2020 16:32:58 +0200 Subject: [PATCH] [feat] #19: Set Cesium in read-only mode when set public --- scripts/install | 3 +++ scripts/upgrade | 3 +++ 2 files changed, 6 insertions(+) diff --git a/scripts/install b/scripts/install index 1702adf..b78edf0 100755 --- a/scripts/install +++ b/scripts/install @@ -37,6 +37,9 @@ cp $nginx_conf /etc/nginx/conf.d/$domain.d/$app.conf if [[ $is_public -eq 1 ]]; then # unprotected_uris allows SSO credentials to be passed anyway. ynh_app_setting_set "$app" unprotected_uris "/" + + # activate read-only mode + ynh_replace_string --match_string='"readonly": false,' --replace_string='"readonly": true,' --target_file="$src_path/config.js" fi # Reload nginx service diff --git a/scripts/upgrade b/scripts/upgrade index 79820c9..d4bbe95 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -46,6 +46,9 @@ cp $nginx_conf /etc/nginx/conf.d/$domain.d/$app.conf # If app is public, add url to SSOWat conf as skipped_uris if [[ $is_public -eq 1 ]]; then ynh_app_setting_set "$app" unprotected_uris "/" + + # activate read-only mode + ynh_replace_string --match_string='"readonly": false,' --replace_string='"readonly": true,' --target_file="$src_path/config.js" fi # Reload nginx service