From c6edb5c9667eac50baaedcc3cc39edbf99dea0e5 Mon Sep 17 00:00:00 2001 From: Limezy Date: Mon, 23 Jan 2023 08:43:38 +0700 Subject: [PATCH 1/5] Trying to use ynh_secure_remove --- scripts/upgrade | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index 187d204..5187e2f 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -58,10 +58,9 @@ ynh_system_user_create --username=$app --home_dir="$final_path" # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= -# Remove www file -pushd "$final_path" - ynh_exec_warn_less sudo -u $app rm -rf * -popd +# Void and recreate final_path +ynh_secure_remove --file="$final_path" +ynh_exec_warn_less sudo -u $app mkdir "$final_path" if [ "$upgrade_type" == "UPGRADE_APP" ] then From eb4cf490845359ac26b555b7843e4afa72cf8741 Mon Sep 17 00:00:00 2001 From: Limezy Date: Mon, 23 Jan 2023 08:48:12 +0700 Subject: [PATCH 2/5] Update upgrade --- scripts/upgrade | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index 5187e2f..4989326 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -60,7 +60,7 @@ ynh_system_user_create --username=$app --home_dir="$final_path" # Void and recreate final_path ynh_secure_remove --file="$final_path" -ynh_exec_warn_less sudo -u $app mkdir "$final_path" +ynh_exec_warn_less sudo mkdir "$final_path" if [ "$upgrade_type" == "UPGRADE_APP" ] then From 1c9a1c5ba7b158e9de402ff5b23a7e9c32bcd16f Mon Sep 17 00:00:00 2001 From: Limezy Date: Mon, 23 Jan 2023 18:23:11 +0700 Subject: [PATCH 3/5] Fix sudo linter error --- scripts/install | 4 ++-- scripts/upgrade | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/install b/scripts/install index 52389cd..d5b7d4a 100755 --- a/scripts/install +++ b/scripts/install @@ -92,8 +92,8 @@ chmod -R o-rwx "$final_path" chown -R $app:www-data "$final_path" pushd "$final_path" - ynh_exec_warn_less sudo -u $app mv ./www_data/* . - ynh_exec_warn_less sudo -u $app ./module/install.sh + ynh_exec_warn_less mv ./www_data/* . + ynh_exec_warn_less ./module/install.sh ynh_mysql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < db/table.sql ynh_mysql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < db/demo.sql popd diff --git a/scripts/upgrade b/scripts/upgrade index 4989326..89203f9 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -60,7 +60,7 @@ ynh_system_user_create --username=$app --home_dir="$final_path" # Void and recreate final_path ynh_secure_remove --file="$final_path" -ynh_exec_warn_less sudo mkdir "$final_path" +ynh_exec_warn_less mkdir "$final_path" if [ "$upgrade_type" == "UPGRADE_APP" ] then @@ -75,8 +75,8 @@ chmod -R o-rwx "$final_path" chown -R $app:www-data "$final_path" pushd "$final_path" - ynh_exec_warn_less sudo -u $app mv ./www_data/* . - ynh_exec_warn_less sudo -u $app ./module/install.sh + ynh_exec_warn_less mv ./www_data/* . + ynh_exec_warn_less ./module/install.sh popd #================================================= From 69df1926a6c90291794459596ffe05956b63201b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Mon, 23 Jan 2023 12:59:09 +0100 Subject: [PATCH 4/5] Fix linter --- conf/config.php | 4 ++-- manifest.json | 12 ++++++------ scripts/restore | 4 ++-- scripts/upgrade | 2 +- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/conf/config.php b/conf/config.php index 85121dc..3bfef15 100644 --- a/conf/config.php +++ b/conf/config.php @@ -8,8 +8,8 @@ */ define("DB_HOST", "localhost"); -define("DB_ID", "__APP__"); -define("DB_NAME", "__APP__"); +define("DB_ID", "__DB_USER__"); +define("DB_NAME", "__DB_NAME__"); define("DB_PORT", 3306); define("DB_PASSWORD", "__DB_PWD__"); diff --git a/manifest.json b/manifest.json index 8885571..80bb599 100644 --- a/manifest.json +++ b/manifest.json @@ -1,10 +1,10 @@ { - "name": "Moncycle.app", - "id": "moncycle_app", + "name": "Moncycle", + "id": "moncycle", "packaging_format": 1, "description": { - "en": "Menstrual cycle follow-up application for natural family planning", - "fr": "Application de suivi de cycle pour les méthodes naturelles de régulation de naissance." + "en": "Menstrual cycle follow-up for natural family planning", + "fr": "Suivi de cycle pour les méthodes naturelles de régulation de naissance" }, "version": "7.0~ynh1", "url": "https://moncycle.app", @@ -38,8 +38,8 @@ { "name": "path", "type": "path", - "example": "/example", - "default": "/example" + "example": "/moncycle", + "default": "/moncycle" }, { "name": "is_public", diff --git a/scripts/restore b/scripts/restore index da920e5..fa8e115 100755 --- a/scripts/restore +++ b/scripts/restore @@ -86,14 +86,14 @@ ynh_install_app_dependencies $pkg_dependencies #================================================= # RESTORE THE PHP-FPM CONFIGURATION #================================================= -ynh_script_progression --message="Restoring the PHP-FPM configuration..." --time --weight=1 +ynh_script_progression --message="Restoring the PHP-FPM configuration..." --weight=1 ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" #================================================= # RESTORE THE NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Restoring the NGINX web server configuration..." --time --weight=1 +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" diff --git a/scripts/upgrade b/scripts/upgrade index 89203f9..35c2315 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -97,7 +97,7 @@ ynh_add_fpm_config #================================================= # NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Upgrading NGINX web server configuration..." --time --weight=1 +ynh_script_progression --message="Upgrading NGINX web server configuration..." --weight=1 # Create a dedicated NGINX config ynh_add_nginx_config From a531db28a1e55f64ef5043b36ee382d8b6562d2b Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Mon, 23 Jan 2023 11:59:14 +0000 Subject: [PATCH 5/5] Auto-update README --- README.md | 20 ++++++++++---------- README_fr.md | 20 ++++++++++---------- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index 7f5bcab..b467ff5 100644 --- a/README.md +++ b/README.md @@ -3,14 +3,14 @@ N.B.: This README was automatically generated by https://github.com/YunoHost/app It shall NOT be edited by hand. --> -# Moncycle.app for YunoHost +# Moncycle for YunoHost -[![Integration level](https://dash.yunohost.org/integration/moncycle_app.svg)](https://dash.yunohost.org/appci/app/moncycle_app) ![Working status](https://ci-apps.yunohost.org/ci/badges/moncycle_app.status.svg) ![Maintenance status](https://ci-apps.yunohost.org/ci/badges/moncycle_app.maintain.svg) -[![Install Moncycle.app with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=moncycle_app) +[![Integration level](https://dash.yunohost.org/integration/moncycle.svg)](https://dash.yunohost.org/appci/app/moncycle) ![Working status](https://ci-apps.yunohost.org/ci/badges/moncycle.status.svg) ![Maintenance status](https://ci-apps.yunohost.org/ci/badges/moncycle.maintain.svg) +[![Install Moncycle with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=moncycle) *[Lire ce readme en français.](./README_fr.md)* -> *This package allows you to install Moncycle.app quickly and simply on a YunoHost server. +> *This package allows you to install Moncycle quickly and simply on a YunoHost server. If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/install) to learn how to install it.* ## Overview @@ -62,7 +62,7 @@ Il existe plusieurs méthodes proposées par différentes associations. Voici un ## Screenshots -![Screenshot of Moncycle.app](./doc/screenshots/moncycle_app.png) +![Screenshot of Moncycle](./doc/screenshots/moncycle_app.png) ## Disclaimers / important information @@ -77,19 +77,19 @@ Il existe plusieurs méthodes proposées par différentes associations. Voici un * Official user documentation: * Official admin documentation: * Upstream app code repository: -* YunoHost documentation for this app: -* Report a bug: +* YunoHost documentation for this app: +* Report a bug: ## Developer info -Please send your pull request to the [testing branch](https://github.com/YunoHost-Apps/moncycle_app_ynh/tree/testing). +Please send your pull request to the [testing branch](https://github.com/YunoHost-Apps/moncycle_ynh/tree/testing). To try the testing branch, please proceed like that. ``` bash -sudo yunohost app install https://github.com/YunoHost-Apps/moncycle_app_ynh/tree/testing --debug +sudo yunohost app install https://github.com/YunoHost-Apps/moncycle_ynh/tree/testing --debug or -sudo yunohost app upgrade moncycle_app -u https://github.com/YunoHost-Apps/moncycle_app_ynh/tree/testing --debug +sudo yunohost app upgrade moncycle -u https://github.com/YunoHost-Apps/moncycle_ynh/tree/testing --debug ``` **More info regarding app packaging:** diff --git a/README_fr.md b/README_fr.md index ce23fa3..2714697 100644 --- a/README_fr.md +++ b/README_fr.md @@ -3,14 +3,14 @@ N.B.: This README was automatically generated by https://github.com/YunoHost/app It shall NOT be edited by hand. --> -# Moncycle.app pour YunoHost +# Moncycle pour YunoHost -[![Niveau d’intégration](https://dash.yunohost.org/integration/moncycle_app.svg)](https://dash.yunohost.org/appci/app/moncycle_app) ![Statut du fonctionnement](https://ci-apps.yunohost.org/ci/badges/moncycle_app.status.svg) ![Statut de maintenance](https://ci-apps.yunohost.org/ci/badges/moncycle_app.maintain.svg) -[![Installer Moncycle.app avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=moncycle_app) +[![Niveau d’intégration](https://dash.yunohost.org/integration/moncycle.svg)](https://dash.yunohost.org/appci/app/moncycle) ![Statut du fonctionnement](https://ci-apps.yunohost.org/ci/badges/moncycle.status.svg) ![Statut de maintenance](https://ci-apps.yunohost.org/ci/badges/moncycle.maintain.svg) +[![Installer Moncycle avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=moncycle) *[Read this readme in english.](./README.md)* -> *Ce package vous permet d’installer Moncycle.app rapidement et simplement sur un serveur YunoHost. +> *Ce package vous permet d’installer Moncycle rapidement et simplement sur un serveur YunoHost. Si vous n’avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour savoir comment l’installer et en profiter.* ## Vue d’ensemble @@ -62,7 +62,7 @@ Il existe plusieurs méthodes proposées par différentes associations. Voici un ## Captures d’écran -![Capture d’écran de Moncycle.app](./doc/screenshots/moncycle_app.png) +![Capture d’écran de Moncycle](./doc/screenshots/moncycle_app.png) ## Avertissements / informations importantes @@ -77,19 +77,19 @@ Il existe plusieurs méthodes proposées par différentes associations. Voici un * Documentation officielle utilisateur : * Documentation officielle de l’admin : * Dépôt de code officiel de l’app : -* Documentation YunoHost pour cette app : -* Signaler un bug : +* Documentation YunoHost pour cette app : +* Signaler un bug : ## Informations pour les développeurs -Merci de faire vos pull request sur la [branche testing](https://github.com/YunoHost-Apps/moncycle_app_ynh/tree/testing). +Merci de faire vos pull request sur la [branche testing](https://github.com/YunoHost-Apps/moncycle_ynh/tree/testing). Pour essayer la branche testing, procédez comme suit. ``` bash -sudo yunohost app install https://github.com/YunoHost-Apps/moncycle_app_ynh/tree/testing --debug +sudo yunohost app install https://github.com/YunoHost-Apps/moncycle_ynh/tree/testing --debug ou -sudo yunohost app upgrade moncycle_app -u https://github.com/YunoHost-Apps/moncycle_app_ynh/tree/testing --debug +sudo yunohost app upgrade moncycle -u https://github.com/YunoHost-Apps/moncycle_ynh/tree/testing --debug ``` **Plus d’infos sur le packaging d’applications :** \ No newline at end of file