From ec4127d6cc518bdfc262e25f6e6d48a75489b920 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sun, 16 Oct 2022 20:24:22 +0200 Subject: [PATCH] Upgrade package (#21) * set client_max_body_size * Auto-update README Co-authored-by: yunohost-bot --- README.md | 2 +- README_fr.md | 2 +- conf/nginx.conf | 2 +- conf/php-fpm.conf | 4 ++-- manifest.json | 6 +++--- scripts/_common.sh | 2 +- scripts/install | 17 +++++++++-------- scripts/restore | 33 ++++++++++++++------------------- scripts/upgrade | 16 ++++++++-------- 9 files changed, 40 insertions(+), 44 deletions(-) diff --git a/README.md b/README.md index 0796c25..e1dcbea 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in Adminer (formerly phpMinAdmin) is a full-featured database management tool written in PHP. Conversely to phpMyAdmin, it consist of a single file ready to deploy to the target server. Adminer is available for MySQL, MariaDB, PostgreSQL, SQLite, MS SQL, Oracle, Elasticsearch, MongoDB and others via plugin. -**Shipped version:** 4.8.1~ynh3 +**Shipped version:** 4.8.1~ynh4 **Demo:** https://demo.adminer.org/adminer.php?username= diff --git a/README_fr.md b/README_fr.md index 7f4180f..1a090ab 100644 --- a/README_fr.md +++ b/README_fr.md @@ -17,7 +17,7 @@ Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour Adminer (anciennement phpMinAdmin) est un outil de gestion de base de données complet écrit en PHP. À l'inverse de phpMyAdmin, il se compose d'un seul fichier prêt à être déployé sur le serveur cible. Adminer est disponible pour MySQL, MariaDB, PostgreSQL, SQLite, MS SQL, Oracle, Elasticsearch, MongoDB et autres via un plugin. -**Version incluse :** 4.8.1~ynh3 +**Version incluse :** 4.8.1~ynh4 **Démo :** https://demo.adminer.org/adminer.php?username= diff --git a/conf/nginx.conf b/conf/nginx.conf index 8b721d2..993e426 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -7,7 +7,7 @@ location __PATH__/ { index 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 50M; try_files $uri $uri/ index.php; location ~ [^/]\.php(/|$) { diff --git a/conf/php-fpm.conf b/conf/php-fpm.conf index ab1a471..b4c2372 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] = 50M +php_admin_value[post_max_size] = 50M ; php_admin_flag[mail.add_x_header] = Off ; Other common parameters diff --git a/manifest.json b/manifest.json index 3521226..afe8cc4 100644 --- a/manifest.json +++ b/manifest.json @@ -7,7 +7,7 @@ "fr": "Gestionnaire de base de données" }, - "version": "4.8.1~ynh3", + "version": "4.8.1~ynh4", "url": "https://www.adminer.org/", "upstream": { "license": "Apache-2.0", @@ -27,12 +27,12 @@ "url": "https://github.com/jesuisfol/adminer_ynh" }, "requirements": { - "yunohost": ">= 4.3.0" + "yunohost": ">= 11.0.9" }, "multi_instance": true, "services": [ "nginx", - "php7.3-fpm" + "php8.0-fpm" ], "arguments": { "install" : [ diff --git a/scripts/_common.sh b/scripts/_common.sh index 9a8943f..742287b 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -4,7 +4,7 @@ # COMMON VARIABLES #================================================= -YNH_PHP_VERSION="7.3" +YNH_PHP_VERSION="8.0" # dependencies used by the app pkg_dependencies="php${YNH_PHP_VERSION}-mysql php${YNH_PHP_VERSION}-sqlite3 php${YNH_PHP_VERSION}-pgsql" diff --git a/scripts/install b/scripts/install index c627b15..3b8be1c 100644 --- a/scripts/install +++ b/scripts/install @@ -76,14 +76,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=3 - -# Create a dedicated nginx config -ynh_add_nginx_config - #================================================= # PHP-FPM CONFIGURATION #================================================= @@ -91,6 +83,15 @@ ynh_script_progression --message="Configuring PHP-FPM..." --weight=1 # Create a dedicated php-fpm config ynh_add_fpm_config --usage=low --footprint=low +phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) + +#================================================= +# NGINX CONFIGURATION +#================================================= +ynh_script_progression --message="Configuring NGINX web server..." --weight=3 + +# Create a dedicated nginx config +ynh_add_nginx_config #================================================= # SETUP SSOWAT diff --git a/scripts/restore b/scripts/restore index da9a51d..6968fc1 100644 --- a/scripts/restore +++ b/scripts/restore @@ -36,16 +36,11 @@ fpm_usage=$(ynh_app_setting_get --app=$app --key=fpm_usage) #================================================= ynh_script_progression --message="Validating restoration parameters..." --weight=1 -test ! -d $final_path || ynh_die --message="There is already a directory: $final_path " +test ! -d $final_path \ + || ynh_die --message="There is already a directory: $final_path " #================================================= # STANDARD RESTORATION STEPS -#================================================= -# RESTORE THE NGINX CONFIGURATION -#================================================= - -ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" - #================================================= # RECREATE THE DEDICATED USER #================================================= @@ -65,6 +60,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 #================================================= @@ -73,23 +76,15 @@ ynh_script_progression --message="Reconfiguring PHP-FPM..." --weight=5 ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" # Recreate a dedicated php-fpm config -ynh_add_fpm_config --usage=$fpm_usage --footprint=$fpm_footprint --phpversion=$phpversion +ynh_add_fpm_config --phpversion=$phpversion --usage=$fpm_usage --footprint=$fpm_footprint #================================================= -# REINSTALL DEPENDENCIES +# RESTORE THE NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Reinstalling dependencies..." --weight=1 +ynh_script_progression --message="Restoring the NGINX web server configuration..." -# Define and install dependencies -ynh_install_app_dependencies $pkg_dependencies -#================================================= -# REINSTALL DEPENDENCIES -#================================================= -ynh_script_progression --message="Reinstalling dependencies..." --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 e4eecb5..8fd49a9 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -101,14 +101,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 #================================================= @@ -124,6 +116,14 @@ ynh_script_progression --message="Upgrading PHP-FPM configuration..." --weight=1 # Create a dedicated PHP-FPM config ynh_add_fpm_config --phpversion=$phpversion --usage=$fpm_usage --footprint=$fpm_footprint +#================================================= +# NGINX CONFIGURATION +#================================================= +ynh_script_progression --message="Upgrading NGINX web server configuration..." --weight=1 + +# Create a dedicated nginx config +ynh_add_nginx_config + #================================================= # RELOAD NGINX #=================================================