From 22f9c65f017abbcfd0edc19a021ed4f2fe4e77f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sun, 28 Aug 2022 13:26:45 +0200 Subject: [PATCH 1/7] Add php-mysql if the database is installed --- check_process | 6 +++--- manifest.json | 6 +++--- scripts/install | 2 ++ 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/check_process b/check_process index c2fc7c2..ca46183 100644 --- a/check_process +++ b/check_process @@ -5,7 +5,7 @@ with_sftp=1 password="myreallystrengthpassword" is_public=1 - phpversion="7.3" + phpversion="7.4" with_mysql=1 ; Checks pkg_linter=1 @@ -27,7 +27,7 @@ with_sftp=0 password="" is_public=1 - phpversion="7.3" + phpversion="7.4" with_mysql=1 ; Checks setup_sub_dir=1 @@ -40,7 +40,7 @@ with_sftp=1 password="myreallystrengthpassword" is_public=1 - phpversion="7.3" + phpversion="7.4" with_mysql=0 ; Checks setup_sub_dir=1 diff --git a/manifest.json b/manifest.json index 87e12fe..a0fe800 100644 --- a/manifest.json +++ b/manifest.json @@ -18,12 +18,12 @@ "email": "maniackc_dev@crudelis.fr" }], "requirements": { - "yunohost": ">= 4.3.3" + "yunohost": ">= 11.0.9" }, "multi_instance": true, "services": [ "nginx", - "php7.3-fpm", + "php7.4-fpm", "mysql" ], "arguments": { @@ -65,7 +65,7 @@ "fr": "Choisissez une version PHP que vous souhaitez utiliser pour votre application" }, "choices" : ["none", "7.3", "7.4", "8.0"], - "default" : "7.3" + "default" : "7.4" }, { "name": "with_mysql", diff --git a/scripts/install b/scripts/install index b42ee16..1779a18 100644 --- a/scripts/install +++ b/scripts/install @@ -78,6 +78,8 @@ if [ $with_mysql -eq 1 ] then ynh_script_progression --message="Creating a MySQL database..." --weight=2 + ynh_install_app_dependencies "php${phpversion}-mysql" + db_name=$(ynh_sanitize_dbid --db_name=$app) ynh_app_setting_set --app=$app --key=db_name --value=$db_name ynh_mysql_setup_db --db_user=$db_name --db_name=$db_name From 1a14e0bcdb272d030ddacb27817ceb8909bbe8e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sun, 28 Aug 2022 13:32:07 +0200 Subject: [PATCH 2/7] Update restore --- scripts/restore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/restore b/scripts/restore index e554ba8..9c33a55 100644 --- a/scripts/restore +++ b/scripts/restore @@ -65,6 +65,8 @@ ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" if [ $with_mysql -eq 1 ]; then ynh_script_progression --message="Restoring the MySQL database..." + + ynh_install_app_dependencies "php${phpversion}-mysql" db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd) ynh_mysql_setup_db --db_user=$db_name --db_name=$db_name --db_pwd=$db_pwd From 5de029a40f19159d5963cb5770c573307e70065f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sun, 28 Aug 2022 13:32:45 +0200 Subject: [PATCH 3/7] Update restore --- scripts/restore | 2 -- 1 file changed, 2 deletions(-) diff --git a/scripts/restore b/scripts/restore index 9c33a55..e554ba8 100644 --- a/scripts/restore +++ b/scripts/restore @@ -65,8 +65,6 @@ ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" if [ $with_mysql -eq 1 ]; then ynh_script_progression --message="Restoring the MySQL database..." - - ynh_install_app_dependencies "php${phpversion}-mysql" db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd) ynh_mysql_setup_db --db_user=$db_name --db_name=$db_name --db_pwd=$db_pwd From 4f25715b8c3a56a48b60bc05a9db86f1baaec0f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sun, 28 Aug 2022 14:14:24 +0200 Subject: [PATCH 4/7] Update upgrade --- scripts/upgrade | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scripts/upgrade b/scripts/upgrade index 7793eca..57408d1 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -132,6 +132,11 @@ then ynh_install_app_dependencies "php${phpversion}-fpm" fi +if [ $with_mysql -eq 1 ] +then + ynh_install_app_dependencies "php${phpversion}-mysql" +fi + #================================================= # NGINX CONFIGURATION #================================================= From 9dcf5d6758c8e20c4353429f907a86e872d45d82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sun, 28 Aug 2022 14:18:40 +0200 Subject: [PATCH 5/7] Update restore --- scripts/restore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/restore b/scripts/restore index e554ba8..dec9279 100644 --- a/scripts/restore +++ b/scripts/restore @@ -66,6 +66,8 @@ ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" if [ $with_mysql -eq 1 ]; then ynh_script_progression --message="Restoring the MySQL database..." + ynh_install_app_dependencies "php${phpversion}-mysql" + db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd) ynh_mysql_setup_db --db_user=$db_name --db_name=$db_name --db_pwd=$db_pwd ynh_mysql_connect_as --user=$db_name --password=$db_pwd --database=$db_name < ./db.sql From 4fe44887fdc6354a83e31e70247557fdd1e61929 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sun, 28 Aug 2022 17:17:09 +0200 Subject: [PATCH 6/7] Update manifest.json --- manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.json b/manifest.json index a0fe800..1ff3362 100644 --- a/manifest.json +++ b/manifest.json @@ -18,7 +18,7 @@ "email": "maniackc_dev@crudelis.fr" }], "requirements": { - "yunohost": ">= 11.0.9" + "yunohost": ">= 11.0.10" }, "multi_instance": true, "services": [ From 06810433824939f166800390da17cffdb27cb324 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sun, 28 Aug 2022 17:18:03 +0200 Subject: [PATCH 7/7] Update manifest.json --- manifest.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manifest.json b/manifest.json index 1ff3362..c03ee09 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Custom Web app with SFTP access to serve static (HTML, CSS, JS) and PHP files", "fr": "Application Web personnalisée avec accès SFTP pour servir des fichiers statiques (HTML, CSS, JS) et PHP" }, - "version": "1.0~ynh9", + "version": "1.0~ynh10", "url": "https://github.com/YunoHost-Apps/my_webapp_ynh", "license": "GPL-3.0-only", "maintainer": { @@ -18,7 +18,7 @@ "email": "maniackc_dev@crudelis.fr" }], "requirements": { - "yunohost": ">= 11.0.10" + "yunohost": ">= 11.0.9" }, "multi_instance": true, "services": [