From f1d472ec8b0a05ffbd07eee9acb4220207da922d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Wed, 17 Nov 2021 21:36:22 +0100 Subject: [PATCH] Testing (#18) * 4.3 (#17) --- README.md | 2 +- README_fr.md | 2 +- conf/nginx.conf | 5 ----- manifest.json | 4 ++-- scripts/_common.sh | 2 +- scripts/install | 12 ++++++++++-- scripts/remove | 8 ++++++++ scripts/restore | 9 ++++++++- scripts/upgrade | 10 +++++++++- 9 files changed, 40 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index c8e80f6..b5b9d35 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ Vous pourrez tenir vos joueurs au courant des actualités, leur faire acheter de * Official app website: https://mineweb.org/ * Official admin documentation: https://docs.mineweb.org/ -* Upstream app code repository: ttps://github.com/MineWeb/MineWebCMS/ +* Upstream app code repository: https://github.com/MineWeb/MineWebCMS/ * YunoHost documentation for this app: https://yunohost.org/app_mineweb * Report a bug: https://github.com/YunoHost-Apps/mineweb_ynh/issues diff --git a/README_fr.md b/README_fr.md index 6c91f12..055baac 100644 --- a/README_fr.md +++ b/README_fr.md @@ -28,7 +28,7 @@ Vous pourrez tenir vos joueurs au courant des actualités, leur faire acheter de * Site officiel de l'app : https://mineweb.org/ * Documentation officielle de l'admin : https://docs.mineweb.org/ -* Dépôt de code officiel de l'app : ttps://github.com/MineWeb/MineWebCMS/ +* Dépôt de code officiel de l'app : https://github.com/MineWeb/MineWebCMS/ * Documentation YunoHost pour cette app : https://yunohost.org/app_mineweb * Signaler un bug : https://github.com/YunoHost-Apps/mineweb_ynh/issues diff --git a/conf/nginx.conf b/conf/nginx.conf index c207bfc..45d830a 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -4,11 +4,6 @@ location __PATH__/ { # Path to source alias __FINALPATH__/app/webroot/ ; - # Force usage of https - if ($scheme = http) { - rewrite ^ https://$server_name$request_uri? permanent; - } - index index.php; try_files $uri $uri/ __PATH__/__PATH__/index.php?$query_string; diff --git a/manifest.json b/manifest.json index a3bbf8d..62abea2 100644 --- a/manifest.json +++ b/manifest.json @@ -12,7 +12,7 @@ "license": "AGPL-3.0-only", "website": "https://mineweb.org/", "admindoc": "https://docs.mineweb.org/", - "code": "ttps://github.com/MineWeb/MineWebCMS/" + "code": "https://github.com/MineWeb/MineWebCMS/" }, "license": "AGPL-3.0-only", "maintainer": { @@ -20,7 +20,7 @@ "email": "liberodark@gmail.com" }, "requirements": { - "yunohost": ">= 4.2.4" + "yunohost": ">= 4.3.0" }, "multi_instance": true, "services": [ diff --git a/scripts/_common.sh b/scripts/_common.sh index df46335..b88b4f5 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -8,7 +8,7 @@ YNH_PHP_VERSION="7.3" # dependencies used by the app -extra_php_dependencies="php${YNH_PHP_VERSION}-zip php${YNH_PHP_VERSION}-gd php${YNH_PHP_VERSION}-curl" +pkg_dependencies="php${YNH_PHP_VERSION}-zip php${YNH_PHP_VERSION}-gd php${YNH_PHP_VERSION}-curl" #================================================= # PERSONAL HELPERS diff --git a/scripts/install b/scripts/install index 6889207..73c6de3 100644 --- a/scripts/install +++ b/scripts/install @@ -26,6 +26,7 @@ ynh_abort_if_errors domain=$YNH_APP_ARG_DOMAIN path_url=$YNH_APP_ARG_PATH is_public=$YNH_APP_ARG_IS_PUBLIC +phpversion=$YNH_PHP_VERSION app=$YNH_APP_INSTANCE_NAME @@ -47,6 +48,14 @@ ynh_script_progression --message="Storing installation settings..." --weight=1 ynh_app_setting_set --app=$app --key=domain --value=$domain ynh_app_setting_set --app=$app --key=path --value=$path_url +ynh_app_setting_set --app=$app --key=phpversion --value=$phpversion + +#================================================= +# INSTALL DEPENDENCIES +#================================================= +ynh_script_progression --message="Installing dependencies..." --weight=1 + +ynh_install_app_dependencies $pkg_dependencies #================================================= # STANDARD MODIFICATIONS @@ -94,8 +103,7 @@ ynh_add_nginx_config ynh_script_progression --message="Configuring PHP-FPM..." --weight=2 # Create a dedicated PHP-FPM config -ynh_add_fpm_config --package="$extra_php_dependencies" -phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) +ynh_add_fpm_config #================================================= # MODIFY A CONFIG FILE diff --git a/scripts/remove b/scripts/remove index 63f8bea..0351066 100644 --- a/scripts/remove +++ b/scripts/remove @@ -36,6 +36,14 @@ ynh_script_progression --message="Removing the MySQL database..." --weight=4 # Remove a database if it exists, along with the associated user ynh_mysql_remove_db --db_user=$db_name --db_name=$db_name +#================================================= +# REMOVE DEPENDENCIES +#================================================= +ynh_script_progression --message="Removing dependencies..." --weight=1 + +# Remove metapackage and its dependencies +ynh_remove_app_dependencies + #================================================= # REMOVE APP MAIN DIR #================================================= diff --git a/scripts/restore b/scripts/restore index ec30096..1c7e69c 100644 --- a/scripts/restore +++ b/scripts/restore @@ -67,10 +67,17 @@ chown -R $app:www-data "$final_path" #================================================= # RESTORE THE PHP-FPM CONFIGURATION #================================================= +ynh_script_progression --message="Restoring the PHP-FPM configuration..." --weight=1 ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" -ynh_add_fpm_config --package="$extra_php_dependencies" +#================================================= +# REINSTALL DEPENDENCIES +#================================================= +ynh_script_progression --message="Reinstalling dependencies..." --weight=1 + +# Define and install dependencies +ynh_install_app_dependencies $pkg_dependencies #================================================= # RESTORE THE MYSQL DATABASE diff --git a/scripts/upgrade b/scripts/upgrade index d408e6d..1989288 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -101,17 +101,25 @@ ynh_script_progression --message="Upgrading NGINX web server configuration..." - # Create a dedicated NGINX config ynh_add_nginx_config +#================================================= +# UPGRADE DEPENDENCIES +#================================================= +ynh_script_progression --message="Upgrading dependencies..." --weight=1 + +ynh_install_app_dependencies $pkg_dependencies + #================================================= # PHP-FPM CONFIGURATION #================================================= ynh_script_progression --message="Upgrading PHP-FPM configuration..." --weight=2 # Create a dedicated PHP-FPM config -ynh_add_fpm_config --package="$extra_php_dependencies" +ynh_add_fpm_config #================================================= # MODIFY A CONFIG FILE #================================================= +ynh_script_progression --message="Updating a configuration file..."--weight=1 ynh_add_config --template="../conf/database.php" --destination="$final_path/app/Config/database.php"