From d69266d57431a77622cfc3e7ce23907c34dd67c4 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sun, 16 Oct 2022 20:38:07 +0200 Subject: [PATCH 1/4] Fix script order --- conf/nginx.conf | 4 +--- conf/php-fpm.conf | 4 ++-- manifest.json | 2 +- scripts/_common.sh | 4 +++- scripts/install | 17 +++++++++-------- scripts/restore | 24 +++++++++++------------- scripts/upgrade | 16 ++++++++-------- 7 files changed, 35 insertions(+), 36 deletions(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index c169ca5..c9fb7eb 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -4,11 +4,10 @@ location __PATH__/ { # Path to source alias __FINALPATH__/; -### Example PHP configuration (remove it if not used) index index.php __PATH__/_h5ai/public/index.php; # Common parameter to increase upload size limit in conjunction with dedicated php-fpm file - #client_max_body_size 50M; + client_max_body_size 500M; try_files $uri.html $uri $uri/ =404; @@ -24,7 +23,6 @@ location __PATH__/ { fastcgi_param PATH_INFO $fastcgi_path_info; fastcgi_param SCRIPT_FILENAME $request_filename; } -### End of PHP configuration part # Include SSOWAT user panel. include conf.d/yunohost_panel.conf.inc; diff --git a/conf/php-fpm.conf b/conf/php-fpm.conf index ab1a471..573704e 100644 --- a/conf/php-fpm.conf +++ b/conf/php-fpm.conf @@ -419,8 +419,8 @@ chdir = __FINALPATH__ ;php_admin_value[memory_limit] = 32M ; Common values to change to increase file upload limit -; php_admin_value[upload_max_filesize] = 50M -; php_admin_value[post_max_size] = 50M +php_admin_value[upload_max_filesize] = 500M +php_admin_value[post_max_size] = 500M ; php_admin_flag[mail.add_x_header] = Off ; Other common parameters diff --git a/manifest.json b/manifest.json index 61f1449..fbe90f7 100644 --- a/manifest.json +++ b/manifest.json @@ -21,7 +21,7 @@ "email": "alex.aubin@mailoo.org" }, "requirements": { - "yunohost": ">= 4.3.0" + "yunohost": ">= 11.0.9" }, "multi_instance": true, "services": [ diff --git a/scripts/_common.sh b/scripts/_common.sh index 6fb7135..caa3c0c 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -7,7 +7,9 @@ YNH_PHP_VERSION=7.4 # dependencies used by the app -pkg_dependencies="php$YNH_PHP_VERSION-fpm ffmpeg imagemagick" +php_dependencies="php$YNH_PHP_VERSION-fpm" + +pkg_dependencies="ffmpeg imagemagick $php_dependencies" #================================================= # PERSONAL HELPERS diff --git a/scripts/install b/scripts/install index 5c2c8b7..fd9d729 100644 --- a/scripts/install +++ b/scripts/install @@ -82,14 +82,6 @@ chmod 750 "$final_path" chmod -R o-rwx "$final_path" chown -R $app:www-data "$final_path" -#================================================= -# NGINX CONFIGURATION -#================================================= -ynh_script_progression --message="Configuring NGINX web server..." --weight=1 - -# Create a dedicated NGINX config -ynh_add_nginx_config - #================================================= # PHP-FPM CONFIGURATION #================================================= @@ -97,6 +89,15 @@ ynh_script_progression --message="Configuring PHP-FPM..." --weight=1 # Create a dedicated PHP-FPM config ynh_add_fpm_config +phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) + +#================================================= +# NGINX CONFIGURATION +#================================================= +ynh_script_progression --message="Configuring NGINX web server..." --weight=1 + +# Create a dedicated NGINX config +ynh_add_nginx_config #================================================= # SETUP SSOWAT diff --git a/scripts/restore b/scripts/restore index 813cb0f..cfb077f 100644 --- a/scripts/restore +++ b/scripts/restore @@ -42,13 +42,6 @@ test ! -d $final_path \ #================================================= # STANDARD RESTORATION STEPS -#================================================= -# RESTORE THE NGINX CONFIGURATION -#================================================= -ynh_script_progression --message="Restoring the NGINX web server configuration..." --weight=1 - -ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" - #================================================= # RECREATE THE DEDICATED USER #================================================= @@ -68,6 +61,14 @@ chmod 750 "$final_path" chmod -R o-rwx "$final_path" chown -R $app:www-data "$final_path" +#================================================= +# REINSTALL DEPENDENCIES +#================================================= +ynh_script_progression --message="Reinstalling dependencies..." --weight=1 + +# Define and install dependencies +ynh_install_app_dependencies $pkg_dependencies + #================================================= # RESTORE THE PHP-FPM CONFIGURATION #================================================= @@ -76,14 +77,11 @@ ynh_script_progression --message="Restoring the PHP-FPM configuration..." --weig ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" #================================================= -# SPECIFIC RESTORATION +# RESTORE THE NGINX CONFIGURATION #================================================= -# REINSTALL DEPENDENCIES -#================================================= -ynh_script_progression --message="Reinstalling dependencies..." --weight=1 +ynh_script_progression --message="Restoring the NGINX web server configuration..." --weight=1 -# Define and install dependencies -ynh_install_app_dependencies $pkg_dependencies +ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" #================================================= # GENERIC FINALIZATION diff --git a/scripts/upgrade b/scripts/upgrade index af7a987..b05af36 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -71,14 +71,6 @@ chmod 750 "$final_path" chmod -R o-rwx "$final_path" chown -R $app:www-data "$final_path" -#================================================= -# NGINX CONFIGURATION -#================================================= -ynh_script_progression --message="Upgrading NGINX web server configuration..." --weight=1 - -# Create a dedicated NGINX config -ynh_add_nginx_config - #================================================= # UPGRADE DEPENDENCIES #================================================= @@ -94,6 +86,14 @@ ynh_script_progression --message="Upgrading PHP-FPM configuration..." --weight=1 # Create a dedicated PHP-FPM config ynh_add_fpm_config +#================================================= +# NGINX CONFIGURATION +#================================================= +ynh_script_progression --message="Upgrading NGINX web server configuration..." --weight=1 + +# Create a dedicated NGINX config +ynh_add_nginx_config + #================================================= # RELOAD NGINX #================================================= From 798ca62f9dac1da026872d4fe639451fb3888492 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sun, 16 Oct 2022 22:55:29 +0200 Subject: [PATCH 2/4] Fix --- scripts/backup | 1 + scripts/restore | 1 + 2 files changed, 2 insertions(+) diff --git a/scripts/backup b/scripts/backup index 8a882cb..aa7c492 100644 --- a/scripts/backup +++ b/scripts/backup @@ -30,6 +30,7 @@ app=$YNH_APP_INSTANCE_NAME final_path=$(ynh_app_setting_get --app=$app --key=final_path) domain=$(ynh_app_setting_get --app=$app --key=domain) +phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= # DECLARE DATA AND CONF FILES TO BACKUP diff --git a/scripts/restore b/scripts/restore index cfb077f..24e81b0 100644 --- a/scripts/restore +++ b/scripts/restore @@ -31,6 +31,7 @@ app=$YNH_APP_INSTANCE_NAME domain=$(ynh_app_setting_get --app=$app --key=domain) path_url=$(ynh_app_setting_get --app=$app --key=path) final_path=$(ynh_app_setting_get --app=$app --key=final_path) +phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= # CHECK IF THE APP CAN BE RESTORED From 4f1cffb2339e4f5fcd1a450b7fa487c3c20e53b9 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sun, 16 Oct 2022 22:56:37 +0200 Subject: [PATCH 3/4] Update check_process --- check_process | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/check_process b/check_process index c587673..bdd94ae 100644 --- a/check_process +++ b/check_process @@ -13,7 +13,7 @@ upgrade=1 upgrade=1 from_commit=73f74039fb63adc555222d73ded6b43a64d41456 backup_restore=1 - multi_instance=0 + multi_instance=1 change_url=1 ;;; Upgrade options ; commit=73f74039fb63adc555222d73ded6b43a64d41456 From bb1cbb75eb29ea6865494fedf5a7450e4a45a93e Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sun, 16 Oct 2022 22:58:05 +0200 Subject: [PATCH 4/4] Update check_process --- check_process | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/check_process b/check_process index bdd94ae..55648a7 100644 --- a/check_process +++ b/check_process @@ -11,11 +11,11 @@ setup_private=1 setup_public=1 upgrade=1 - upgrade=1 from_commit=73f74039fb63adc555222d73ded6b43a64d41456 + upgrade=1 from_commit=af190a49ec43b470a38b21d81887a1b457b333fa backup_restore=1 multi_instance=1 change_url=1 ;;; Upgrade options - ; commit=73f74039fb63adc555222d73ded6b43a64d41456 - name=Update check_process, 24 Jun 2019 + ; commit=af190a49ec43b470a38b21d81887a1b457b333fa + name=Merge pull request #11 manifest_arg=domain=DOMAIN&path=PATH&admin=USER&language=fr&is_public=1&password=pass&port=666&