diff --git a/check_process b/check_process index 5f4a9a1..17fe16f 100644 --- a/check_process +++ b/check_process @@ -19,8 +19,6 @@ incorrect_path=1 port_already_use=0 change_url=0 -;;; Levels - Level 5=auto ;;; Options Email=alex.aubin@mailoo.org Notification=down diff --git a/conf/app.src b/conf/app.src index 8b6d764..290b95b 100644 --- a/conf/app.src +++ b/conf/app.src @@ -3,4 +3,4 @@ SOURCE_SUM=612acd8cc724ab42c5266f7b9966a0212b561331d8770b5609891edb5cb69a8b SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=zip SOURCE_IN_SUBDIR=false -SOURCE_FILENAME=h5ai-0.29.2.zip \ No newline at end of file +SOURCE_FILENAME=h5ai-0.29.2.zip diff --git a/manifest.json b/manifest.json index 7728111..af7559e 100644 --- a/manifest.json +++ b/manifest.json @@ -1,10 +1,10 @@ { - "name": "H5AI", + "name": "h5ai", "id": "h5ai", "packaging_format": 1, "description": { - "en": "A modern HTTP web server index for NGINX.", - "fr": "Un serveur moderne d'index pour NGINX." + "en": "Modern HTTP web server index for NGINX.", + "fr": "Serveur moderne d'index pour NGINX." }, "version": "0.29.2~ynh2", "url": "https://larsjung.de/h5ai/", @@ -14,7 +14,7 @@ "email": "alex.aubin@mailoo.org" }, "requirements": { - "yunohost": ">= 3.7.0" + "yunohost": ">= 3.8.1" }, "multi_instance": false, "services": [ @@ -53,4 +53,4 @@ } ] } -} \ No newline at end of file +} diff --git a/scripts/install b/scripts/install index d2d49b8..7d30d96 100644 --- a/scripts/install +++ b/scripts/install @@ -60,15 +60,6 @@ ynh_script_progression --message="Setting up source files..." --weight=4 # Download, check integrity, uncompress and patch the source from app.src ynh_setup_source "$final_path" -#================================================= -# GENERIC FINALIZATION -#================================================= -# SECURE FILES AND DIRECTORIES -#================================================= - -# Restore permissions on app files -chown -R www-data:www-data "$final_path" - #================================================= # NGINX CONFIGURATION #================================================= @@ -77,6 +68,23 @@ 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 + +#================================================= +# GENERIC FINALIZATION +#================================================= +# SECURE FILES AND DIRECTORIES +#================================================= + +# Restore permissions on app files +chown -R $app: "$final_path" + #================================================= # SETUP SSOWAT #================================================= diff --git a/scripts/remove b/scripts/remove index de6c4b0..09f0850 100644 --- a/scripts/remove +++ b/scripts/remove @@ -26,6 +26,14 @@ ynh_script_progression --message="Removing $app main directory..." --weight=3 # Remove sources ynh_secure_remove --file="$final_path" +#================================================= +# REMOVE DEDICATED USER +#================================================= +ynh_script_progression --message="Removing the dedicated system user..." --weight=1 + +# Delete a system user +ynh_system_user_delete --username=$app + #================================================= # REMOVE THE NGINX CONFIGURATION #================================================= diff --git a/scripts/restore b/scripts/restore index 6371596..4a4e6cb 100644 --- a/scripts/restore +++ b/scripts/restore @@ -51,12 +51,20 @@ ynh_script_progression --message="Restoring the app main directory..." --weight= ynh_restore_file --origin_path="$final_path" +#================================================= +# RECREATE THE DEDICATED USER +#================================================= +ynh_script_progression --message="Recreating the dedicated system user..." --weight=1 + +# Create the dedicated user (if not existing) +ynh_system_user_create --username=$app + #================================================= # RESTORE USER RIGHTS #================================================= # Restore permissions on app files -chown -R www-data:www-data "$final_path" +chown -R $app: "$final_path" #================================================= # GENERIC FINALIZATION diff --git a/scripts/upgrade b/scripts/upgrade index afb6b80..6390aaf 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -90,9 +90,17 @@ fi #================================================= ynh_script_progression --message="Upgrading NGINX web server configuration..." --weight=1 -# Create a dedicated nginx config +# Create a dedicated NGINX config ynh_add_nginx_config +#================================================= +# CREATE DEDICATED USER +#================================================= +ynh_script_progression --message="Making sure dedicated system user exists..." --weight=1 + +# Create a dedicated user (if not existing) +ynh_system_user_create --username=$app + #================================================= # GENERIC FINALIZATION #================================================= @@ -100,7 +108,7 @@ ynh_add_nginx_config #================================================= # Set permissions on app files -chown -R www-data:www-data "$final_path" +chown -R $app: "$final_path" #================================================= # RELOAD NGINX