From 1fe3900265af6200995731222c823f35305c20ad Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Thu, 9 Sep 2021 22:54:05 +0200 Subject: [PATCH] patch --- check_process | 8 ++++---- manifest.json | 2 +- scripts/install | 18 ++++++++---------- scripts/restore | 16 +++++++--------- 4 files changed, 20 insertions(+), 24 deletions(-) diff --git a/check_process b/check_process index a7db825..6d60f7f 100644 --- a/check_process +++ b/check_process @@ -4,11 +4,11 @@ #echo -n "Here your commands to execute in the container" #echo ", before each installation of the app." ; Manifest - domain="domain.tld" (DOMAIN) - path="/path" (PATH) - admin="john" (USER) + domain="domain.tld" + path="/path" + admin="john" language="fr_FR" - is_public=1 (PUBLIC|public=1|private=0) + is_public=1 ; Actions action_argument=arg1|arg2 is_public=1|0 diff --git a/manifest.json b/manifest.json index 8b5311b..bbd3351 100644 --- a/manifest.json +++ b/manifest.json @@ -34,7 +34,7 @@ "email": "jean-baptiste@holcroft.fr" }], "requirements": { - "yunohost": ">= 4.1.0" + "yunohost": ">= 4.2.4" }, "multi_instance": true, "services": [ diff --git a/scripts/install b/scripts/install index 97ab339..63bce94 100644 --- a/scripts/install +++ b/scripts/install @@ -33,8 +33,6 @@ app=$YNH_APP_INSTANCE_NAME #================================================= ynh_script_progression --message="Validating installation parameters..." --weight=1 -### If the app uses nginx as web server (written in HTML/PHP in most cases), the final path should be "/var/www/$app". -### If the app provides an internal web server (or uses another application server such as uwsgi), the final path should be "/opt/yunohost/$app" final_path=/var/www/$app test ! -e "$final_path" || ynh_die "This path already contains a folder" @@ -53,6 +51,14 @@ ynh_app_setting_set --app=$app --key=path --value=$path_url ynh_app_setting_set --app=$app --key=admin --value=$admin ynh_app_setting_set --app=$app --key=language --value=$language +#================================================= +# CREATE DEDICATED USER +#================================================= +ynh_script_progression --message="Configuring system user..." --weight=1 + +# Create a system user +ynh_system_user_create --username=$app --home_dir=$final_path + #================================================= # STANDARD MODIFICATIONS #================================================= @@ -72,14 +78,6 @@ ynh_script_progression --message="Configuring NGINX web server..." --weight=1 # Create a dedicated nginx config ynh_add_nginx_config -#================================================= -# CREATE DEDICATED USER -#================================================= -ynh_script_progression --message="Configuring system user..." --weight=1 - -# Create a system user -ynh_system_user_create --username=$app --home_dir=$final_path - #================================================= # PHP-FPM CONFIGURATION #================================================= diff --git a/scripts/restore b/scripts/restore index ebea97b..bcdb3a1 100644 --- a/scripts/restore +++ b/scripts/restore @@ -40,8 +40,6 @@ fpm_usage=$(ynh_app_setting_get --app=$app --key=fpm_usage) #================================================= ynh_script_progression --message="Validating restoration parameters..." --weight=1 -ynh_webpath_available --domain=$domain --path_url=$path_url \ - || ynh_die --message="Path not available: ${domain}${path_url}" test ! -d $final_path \ || ynh_die --message="There is already a directory: $final_path " @@ -53,13 +51,6 @@ test ! -d $final_path \ ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" -#================================================= -# RESTORE THE APP MAIN DIR -#================================================= -ynh_script_progression --message="Restoring the app main directory..." --weight=2 - -ynh_restore_file --origin_path="$final_path" - #================================================= # RECREATE THE DEDICATED USER #================================================= @@ -68,6 +59,13 @@ ynh_script_progression --message="Recreating the dedicated system user..." --wei # Create the dedicated user (if not existing) ynh_system_user_create --username=$app --home_dir=$final_path +#================================================= +# RESTORE THE APP MAIN DIR +#================================================= +ynh_script_progression --message="Restoring the app main directory..." --weight=2 + +ynh_restore_file --origin_path="$final_path" + #================================================= # RESTORE USER RIGHTS #=================================================