From 6f728c3decaa870b1895d1c1350d41c5414dffec Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Fri, 25 Sep 2020 19:26:57 +0200 Subject: [PATCH] fix --- conf/add_sso_conf.py | 11 ----------- scripts/install | 20 -------------------- scripts/restore | 26 +++----------------------- 3 files changed, 3 insertions(+), 54 deletions(-) delete mode 100644 conf/add_sso_conf.py diff --git a/conf/add_sso_conf.py b/conf/add_sso_conf.py deleted file mode 100644 index 9bc3bf7..0000000 --- a/conf/add_sso_conf.py +++ /dev/null @@ -1,11 +0,0 @@ -import json - -with open("/etc/ssowat/conf.json.persistent", "r", encoding='utf-8') as jsonFile: - data = json.load(jsonFile) - if "protected_urls" in data: - data["protected_urls"].append("__DOMAIN____PATH__/admin") - else: - data["protected_urls"] = ["__DOMAIN____PATH__/admin"] - -with open("/etc/ssowat/conf.json.persistent", "w", encoding='utf-8') as jsonFile: - jsonFile.write(json.dumps(data, indent=4, sort_keys=True)) diff --git a/scripts/install b/scripts/install index 4d645ea..b4dd2a6 100644 --- a/scripts/install +++ b/scripts/install @@ -114,22 +114,6 @@ ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --targ ynh_replace_string --match_string="__PATH__" --replace_string="${path_url%/}" --target_file="$final_path/user/config.php" ynh_replace_string --match_string="__RANDOM__" --replace_string="$(ynh_string_random 24)" --target_file="$final_path/user/config.php" -# The script "add_sso_conf.py" will just add en entry for the path "/admin" in the sso conf.json.persistent file in the cathegory "protected_urls". -cp ../conf/add_sso_conf.py $final_path/add_sso_conf.py -cp ../conf/remove_sso_conf.py $final_path/remove_sso_conf.py -ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="$final_path/add_sso_conf.py" -if [ "$path_url" != "/" ]; then - ynh_replace_string --match_string="__PATH__" --replace_string="$path_url" --target_file="$final_path/add_sso_conf.py" - ynh_replace_string --match_string="__PATH__" --replace_string="$path_url" --target_file="$final_path/remove_sso_conf.py" -else - ynh_replace_string --match_string="__PATH__" --replace_string="" --target_file="$final_path/add_sso_conf.py" - ynh_replace_string --match_string="__PATH__" --replace_string="" --target_file="$final_path/remove_sso_conf.py" -fi -ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="$final_path/remove_sso_conf.py" - - -python3 $final_path/add_sso_conf.py || ynh_die "Your file /etc/ssowat/conf.json.persistent don't respect the json synaxe. Please fix the synaxe to install this app. For more information see here : https://github.com/YunoHost-Apps/yourls_ynh" - # Set permissions chown -R $app: $final_path @@ -138,10 +122,6 @@ chown -R $app: $final_path # unprotected_uris allows SSO credentials to be passed anyway. ynh_app_setting_set --app=$app --key=unprotected_uris --value="/" -# Restrict access to admin only -yunohost app addaccess --users=$admin $app -yunohost app ssowatconf - #================================================= # RELOAD NGINX #================================================= diff --git a/scripts/restore b/scripts/restore index dd5c943..74e8ca8 100644 --- a/scripts/restore +++ b/scripts/restore @@ -59,10 +59,6 @@ ynh_script_progression --message="Restoring the app main directory..." --time -- ynh_restore_file --origin_path="$final_path" -# The script "add_sso_conf.py" will just add en entry for the path "/admin" in the sso conf.json.persistent file in the cathegory "protected_urls". -python3 $final_path/add_sso_conf.py || ynh_die "Your file /etc/ssowat/conf.json.persistent don't respect the json synaxe. Please fix the synaxe to install this app. For more information see here : https://github.com/YunoHost-Apps/synapse_ynh/issues/32" - - #================================================= # RESTORE THE MYSQL DATABASE #================================================= @@ -99,32 +95,16 @@ chown -R $app: $final_path # RESTORE THE PHP-FPM CONFIGURATION #================================================= -ynh_restore_file --origin_path="/etc/php/7.0/fpm/pool.d/$app.conf" - +ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" #================================================= # GENERIC FINALIZATION #================================================= # RELOAD NGINX AND PHP-FPM #================================================= -sudo yunohost app setting $app unprotected_uris -v "/" +ynh_script_progression --message="Reloading nginx web server and php-fpm..." --weight=1 -#================================================= -# SETUP SSOWAT -#================================================= - -# Restrict access to admin only -yunohost app addaccess --users=$admin $app -yunohost app ssowatconf - -#================================================= -# GENERIC FINALIZATION -#================================================= -# RELOAD NGINX AND PHP-FPM -#================================================= -ynh_script_progression --message="Reloading nginx web server and php-fpm..." --time --weight=1 - -ynh_systemd_action --service_name=php7.0-fpm --action=reload +ynh_systemd_action --service_name=php$phpversion-fpm --action=reload ynh_systemd_action --service_name=nginx --action=reload #=================================================