From 85283b25fc7dee6f1080db220948a9ba9addeb7b Mon Sep 17 00:00:00 2001 From: magikcypress Date: Mon, 8 May 2017 19:25:22 +0200 Subject: [PATCH] [fix] clean code & fix is_public to restore --- scripts/install | 13 ++++++++----- scripts/restore | 5 +++++ 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/scripts/install b/scripts/install index 73f73f8..4c17cc2 100644 --- a/scripts/install +++ b/scripts/install @@ -22,18 +22,21 @@ CHECK_DOMAINPATH CHECK_FINALPATH +# Save app settings +ynh_app_setting_set $app domain $domain +ynh_app_setting_set $app path $path +ynh_app_setting_set $app is_public $is_public + # Create system user dedicace for this app ynh_system_user_create $app # Copy files to the right place final_path=/var/www/$app sudo mkdir -p $final_path -extract_source $final_path +ynh_app_setting_set $app final_path $final_path -# Copy files to the right place with the right permissions -final_path=/var/www/$app -sudo mkdir -p $final_path -sudo chown -R $app: $final_path +# Get source application +extract_source $final_path # Modify Nginx configuration file and copy it to Nginx conf directory ynh_nginx_config diff --git a/scripts/restore b/scripts/restore index d1e4884..1940fb7 100644 --- a/scripts/restore +++ b/scripts/restore @@ -71,6 +71,11 @@ if [[ $is_public -eq 0 ]]; then ynh_app_setting_delete $app skipped_uris fi +if [ $is_public -eq 1 ] +then + ynh_app_setting_set $app skipped_uris "/" # Make app public if necessary +fi + # Reload service sudo systemctl reload nginx sudo yunohost app ssowatconf \ No newline at end of file