diff --git a/check_process b/check_process index 792b884..1fcd745 100644 --- a/check_process +++ b/check_process @@ -7,7 +7,7 @@ path="/path" (PATH) admin="john" (USER) language="fr_FR" - is_public="Yes" (PUBLIC|public=1|private=0) + is_public=1 (PUBLIC|public=1|private=0) ; Checks pkg_linter=1 setup_sub_dir=1 @@ -45,4 +45,4 @@ Notification=all manifest_arg=domain=DOMAIN&path=PATH&admin=USER&language=fr_FR&is_public=PUBLIC& ; commit=22290f672847342fd187a56d39b68393b1e0fd5a name=Version 1.5.3 - manifest_arg=domain=DOMAIN&path=PATH&admin=USER&language=fr_FR&is_public=PUBLIC& \ No newline at end of file + manifest_arg=domain=DOMAIN&path=PATH&admin=USER&language=fr_FR&is_public=PUBLIC& diff --git a/conf/nginx.conf b/conf/nginx.conf index 069cb83..fabc31b 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -13,12 +13,12 @@ location __PATH__/ { client_max_body_size 30m; # Add headers to serve security related headers - add_header Strict-Transport-Security "max-age=15768000;"; - add_header X-Content-Type-Options nosniff; - add_header X-Frame-Options "SAMEORIGIN"; - add_header X-XSS-Protection "1; mode=block"; - add_header X-Download-Options noopen; - add_header X-Permitted-Cross-Domain-Policies none; + more_set_headers "Strict-Transport-Security: max-age=15768000"; + more_set_headers "X-Content-Type-Options: nosniff"; + more_set_headers "X-Frame-Options: SAMEORIGIN"; + more_set_headers "X-XSS-Protection: 1; mode=block"; + more_set_headers "X-Download-Options: noopen"; + more_set_headers "X-Permitted-Cross-Domain-Policies: none"; location ~* \.(jpg|jpeg|gif|css|png|js|ico|swf|mp3|pdf)$ { # Le contenu statique, est signalé au navigateur comme étant diff --git a/manifest.json b/manifest.json index d52c85a..e29cda1 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "A modern open source flat-file CMS", "fr": "Un CMS moderne basé sur des fichiers plats" }, - "version": "1.5.10~ynh1", + "version": "1.5.10~ynh2", "url": "https://www.getgrav.org/", "license": "MIT-0", "maintainer": [ @@ -27,7 +27,7 @@ "email": "lithrel@randomdomainname.net" }], "requirements": { - "yunohost": ">= 3.1.0" + "yunohost": ">= 3.5.0" }, "multi_instance": true, "services": [ @@ -71,6 +71,10 @@ "en": "Is it a public Grav site ?", "fr": "Est-ce un site public ?" }, + "help": { + "en": "Will anyone be able to access the website?", + "fr": "Est-ce que quiconque pourra accéder au site ?" + }, "default": true }, { diff --git a/scripts/backup b/scripts/backup index 30daf38..e57821b 100644 --- a/scripts/backup +++ b/scripts/backup @@ -19,6 +19,7 @@ ynh_abort_if_errors #================================================= # LOAD SETTINGS #================================================= +ynh_script_progression --message="Loading installation settings..." --time --weight=1 app=$YNH_APP_INSTANCE_NAME @@ -31,17 +32,28 @@ db_name=$(ynh_app_setting_get "$app" db_name) #================================================= # BACKUP THE APP MAIN DIR #================================================= +ynh_script_progression --message="Backing up the main app directory..." --time --weight=1 ynh_backup "$final_path" #================================================= # BACKUP THE NGINX CONFIGURATION #================================================= +ynh_script_progression --message="Backing up nginx web server configuration..." --time --weight=1 ynh_backup "/etc/nginx/conf.d/$domain.d/$app.conf" #================================================= # BACKUP THE PHP-FPM CONFIGURATION #================================================= +ynh_script_progression --message="Backing up php-fpm configuration..." --time --weight=1 ynh_backup "/etc/php/7.0/fpm/pool.d/$app.conf" + + +#================================================= +# END OF SCRIPT +#================================================= + +ynh_script_progression --message="Backup script completed for $app. (YunoHost will then actually copy those files to the archive)." --time --last + diff --git a/scripts/install b/scripts/install index 63528c1..316a190 100644 --- a/scripts/install +++ b/scripts/install @@ -31,6 +31,7 @@ app=$YNH_APP_INSTANCE_NAME #================================================= # CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS #================================================= +ynh_script_progression --message="Validating installation parameters..." --time --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" @@ -48,6 +49,7 @@ ynh_webpath_register "$app" "$domain" "$path_url" #================================================= # STORE SETTINGS FROM MANIFEST #================================================= +ynh_script_progression --message="Storing installation settings..." --time --weight=1 ynh_app_setting_set "$app" domain "$domain" ynh_app_setting_set "$app" path "$path_url" @@ -60,12 +62,14 @@ ynh_app_setting_set "$app" language "$language" #================================================= # INSTALL DEPENDENCIES #================================================= +ynh_script_progression --message="Installing dependencies..." --time --weight=1 ynh_install_app_dependencies php7.0-zip #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= +ynh_script_progression --message="Setting up source files..." --time --weight=1 ynh_app_setting_set "$app" final_path "$final_path" # Download, check integrity, uncompress and patch the source from app.src @@ -74,6 +78,7 @@ ynh_setup_source "$final_path" #================================================= # NGINX CONFIGURATION #================================================= +ynh_script_progression --message="Configuring nginx web server..." --time --weight=1 # Create a dedicated nginx config ynh_add_nginx_config @@ -81,6 +86,7 @@ ynh_add_nginx_config #================================================= # CREATE DEDICATED USER #================================================= +ynh_script_progression --message="Configuring system user..." --time --weight=1 # Create a system user ynh_system_user_create "$app" @@ -88,6 +94,7 @@ ynh_system_user_create "$app" #================================================= # PHP-FPM CONFIGURATION #================================================= +ynh_script_progression --message="Configuring php-fpm..." --time --weight=1 # Create a dedicated php-fpm config ynh_add_fpm_config @@ -97,12 +104,12 @@ ynh_add_fpm_config #================================================= # SECURE FILES AND DIRECTORIES #================================================= - chown -R "$app": "$final_path" #================================================= # SETUP SSOWAT #================================================= +ynh_script_progression --message="Configuring SSOwat..." --time --weight=1 # Make app public if necessary if [ "$is_public" -eq "1" ] @@ -116,5 +123,12 @@ fi #================================================= # RELOAD NGINX #================================================= +ynh_script_progression --message="Reloading nginx web server..." --time --weight=1 -systemctl reload nginx \ No newline at end of file +systemctl reload nginx + +#================================================= +# END OF SCRIPT +#================================================= + +ynh_script_progression --message="Installation of $app completed" --time --last diff --git a/scripts/remove b/scripts/remove index 1600700..7cf1359 100644 --- a/scripts/remove +++ b/scripts/remove @@ -12,6 +12,7 @@ source /usr/share/yunohost/helpers #================================================= # LOAD SETTINGS #================================================= +ynh_script_progression --message="Loading installation settings..." --time --weight=1 # Get multi-instances specific variables app=$YNH_APP_INSTANCE_NAME @@ -25,6 +26,7 @@ final_path=$(ynh_app_setting_get "$app" final_path) #================================================= # REMOVE DEPENDENCIES #================================================= +ynh_script_progression --message="Removing dependencies..." --time --weight=1 # Remove metapackage and its dependencies ynh_remove_app_dependencies @@ -32,6 +34,7 @@ ynh_remove_app_dependencies #================================================= # REMOVE APP MAIN DIR #================================================= +ynh_script_progression --message="Removing app main directory..." --time --weight=1 # Remove the app directory securely ynh_secure_remove "$final_path" @@ -39,6 +42,7 @@ ynh_secure_remove "$final_path" #================================================= # REMOVE NGINX CONFIGURATION #================================================= +ynh_script_progression --message="Removing nginx web server configuration..." --time --weight=1 # Remove the dedicated nginx config ynh_remove_nginx_config @@ -46,6 +50,7 @@ ynh_remove_nginx_config #================================================= # REMOVE PHP-FPM CONFIGURATION #================================================= +ynh_script_progression --message="Removing php-fpm configuration..." --time --weight=1 # Remove the dedicated php-fpm config ynh_remove_fpm_config @@ -55,6 +60,14 @@ ynh_remove_fpm_config #================================================= # REMOVE DEDICATED USER #================================================= +ynh_script_progression --message="Removing the dedicated system user..." --time --weight=1 # Delete a system user -ynh_system_user_delete "$app" \ No newline at end of file +ynh_system_user_delete "$app" + + +#================================================= +# END OF SCRIPT +#================================================= + +ynh_script_progression --message="Removal of $app completed" --time --last diff --git a/scripts/restore b/scripts/restore index 7c3facd..9a62aeb 100644 --- a/scripts/restore +++ b/scripts/restore @@ -24,6 +24,7 @@ ynh_abort_if_errors #================================================= # LOAD SETTINGS #================================================= +ynh_script_progression --message="Loading settings..." --time --weight=1 app=$YNH_APP_INSTANCE_NAME @@ -34,6 +35,7 @@ final_path=$(ynh_app_setting_get "$app" final_path) #================================================= # CHECK IF THE APP CAN BE RESTORED #================================================= +ynh_script_progression --message="Validating restoration parameters..." --time --weight=1 ynh_webpath_available "$domain" "$path_url" \ || ynh_die "Path not available: ${domain}${path_url}" @@ -52,12 +54,14 @@ ynh_restore_file "/etc/nginx/conf.d/$domain.d/$app.conf" #================================================= # RESTORE THE APP MAIN DIR #================================================= +ynh_script_progression --message="Restoring the app main directory..." --time --weight=1 ynh_restore_file "$final_path" #================================================= # RECREATE THE DEDICATED USER #================================================= +ynh_script_progression --message="Recreating the dedicated system user..." --time --weight=1 # Create the dedicated user (if not existing) ynh_system_user_create "$app" @@ -80,6 +84,7 @@ ynh_restore_file "/etc/php/7.0/fpm/pool.d/$app.conf" #================================================= # REINSTALL DEPENDENCIES #================================================= +ynh_script_progression --message="Reinstalling dependencies..." --time --weight=1 ynh_install_app_dependencies php7.0-zip @@ -88,7 +93,15 @@ ynh_install_app_dependencies php7.0-zip #================================================= # RELOAD NGINX AND PHP-FPM #================================================= +ynh_script_progression --message="Reloading nginx web server and php-fpm..." --time --weight=1 # Reload services systemctl reload php7.0-fpm -systemctl reload nginx \ No newline at end of file +systemctl reload nginx + + +#================================================= +# END OF SCRIPT +#================================================= + +ynh_script_progression --message="Restoration completed for $app" --time --last diff --git a/scripts/upgrade b/scripts/upgrade index 2725ef7..5624b67 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -12,6 +12,7 @@ source /usr/share/yunohost/helpers #================================================= # LOAD SETTINGS #================================================= +ynh_script_progression --message="Loading installation settings..." --time --weight=1 app=$YNH_APP_INSTANCE_NAME @@ -25,6 +26,7 @@ language=$(ynh_app_setting_get "$app" language) #================================================= # ENSURE DOWNWARD COMPATIBILITY #================================================= +ynh_script_progression --message="Ensuring downward compatibility..." --time --weight=1 # Fix is_public as a boolean value if [ "$is_public" = "Yes" ]; then @@ -50,6 +52,7 @@ fi #================================================= # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP #================================================= +ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." --time --weight=1 # Backup the current version of the app ynh_backup_before_upgrade @@ -72,6 +75,7 @@ path_url=$(ynh_normalize_url_path "$path_url") #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= +ynh_script_progression --message="Upgrading source files..." --time --weight=1 # Download, check integrity, uncompress and patch the source from app-upgrade.src ynh_setup_source "$final_path" "app-upgrade" @@ -79,6 +83,7 @@ ynh_setup_source "$final_path" "app-upgrade" #================================================= # NGINX CONFIGURATION #================================================= +ynh_script_progression --message="Upgrading nginx web server configuration..." --time --weight=1 # Create a dedicated nginx config ynh_add_nginx_config @@ -86,12 +91,14 @@ ynh_add_nginx_config #================================================= # INSTALL DEPENDENCIES #================================================= +ynh_script_progression --message="Upgrading dependencies..." --time --weight=1 ynh_install_app_dependencies php7.0-zip #================================================= # CREATE DEDICATED USER #================================================= +ynh_script_progression --message="Making sure dedicated system user exists..." --time --weight=1 # Create a dedicated user (if not existing) ynh_system_user_create "$app" @@ -99,6 +106,7 @@ ynh_system_user_create "$app" #================================================= # PHP-FPM CONFIGURATION #================================================= +ynh_script_progression --message="Upgrading php-fpm configuration..." --time --weight=1 # Create a dedicated php-fpm config ynh_add_fpm_config @@ -112,6 +120,7 @@ chown -R "$app": "$final_path" #================================================= # SETUP SSOWAT #================================================= +ynh_script_progression --message="Upgrading SSOwat configuration..." --time --weight=1 # Make app public if necessary if [ "$is_public" -eq "1" ] @@ -125,5 +134,12 @@ fi #================================================= # RELOAD NGINX #================================================= +ynh_script_progression --message="Reloading nginx web server..." --time --weight=1 -systemctl reload nginx \ No newline at end of file +systemctl reload nginx + +#================================================= +# END OF SCRIPT +#================================================= + +ynh_script_progression --message="Upgrade of $app completed" --time --last