From febfa5f2025931ab3a1d8b3f26f14aeb44267a0a Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Sat, 10 Sep 2022 18:48:36 +0000 Subject: [PATCH 1/7] Auto-update README --- README.md | 18 +++++++++--------- README_fr.md | 26 +++++++++++++++----------- 2 files changed, 24 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index e79ca07..7ba1d1a 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ It shall NOT be edited by hand. # PetitesAnnonces for YunoHost -[![Integration level](https://dash.yunohost.org/integration/petitesannonces.svg)](https://dash.yunohost.org/appci/app/petitesannonces) ![](https://ci-apps.yunohost.org/ci/badges/petitesannonces.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/petitesannonces.maintain.svg) +[![Integration level](https://dash.yunohost.org/integration/petitesannonces.svg)](https://dash.yunohost.org/appci/app/petitesannonces) ![Working status](https://ci-apps.yunohost.org/ci/badges/petitesannonces.status.svg) ![Maintenance status](https://ci-apps.yunohost.org/ci/badges/petitesannonces.maintain.svg) [![Install PetitesAnnonces with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=petitesannonces) *[Lire ce readme en français.](./README_fr.md)* @@ -20,27 +20,27 @@ Make your own classified advertising website easily **Shipped version:** 0.1.0~ynh2 - ## Screenshots -![](./doc/screenshots/demo.png) +![Screenshot of PetitesAnnonces](./doc/screenshots/demo.png) ## Documentation and resources -* Official app website: https://framagit.org/toitoinebzh/petitesannonces -* Upstream app code repository: https://framagit.org/toitoinebzh/petitesannonces -* YunoHost documentation for this app: https://yunohost.org/app_petitesannonces -* Report a bug: https://github.com/YunoHost-Apps/petitesannonces_ynh/issues +* Official app website: +* Upstream app code repository: +* YunoHost documentation for this app: +* Report a bug: ## Developer info Please send your pull request to the [testing branch](https://github.com/YunoHost-Apps/petitesannonces_ynh/tree/testing). To try the testing branch, please proceed like that. -``` + +``` bash sudo yunohost app install https://github.com/YunoHost-Apps/petitesannonces_ynh/tree/testing --debug or sudo yunohost app upgrade petitesannonces -u https://github.com/YunoHost-Apps/petitesannonces_ynh/tree/testing --debug ``` -**More info regarding app packaging:** https://yunohost.org/packaging_apps \ No newline at end of file +**More info regarding app packaging:** diff --git a/README_fr.md b/README_fr.md index f5193d4..01a5ae3 100644 --- a/README_fr.md +++ b/README_fr.md @@ -1,10 +1,14 @@ + + # PetitesAnnonces pour YunoHost -[![Niveau d'intégration](https://dash.yunohost.org/integration/petitesannonces.svg)](https://dash.yunohost.org/appci/app/petitesannonces) ![](https://ci-apps.yunohost.org/ci/badges/petitesannonces.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/petitesannonces.maintain.svg) +[![Niveau d'intégration](https://dash.yunohost.org/integration/petitesannonces.svg)](https://dash.yunohost.org/appci/app/petitesannonces) ![Statut du fonctionnement](https://ci-apps.yunohost.org/ci/badges/petitesannonces.status.svg) ![Statut de maintenance](https://ci-apps.yunohost.org/ci/badges/petitesannonces.maintain.svg) [![Installer PetitesAnnonces avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=petitesannonces) *[Read this readme in english.](./README.md)* -*[Lire ce readme en français.](./README_fr.md)* > *Ce package vous permet d'installer PetitesAnnonces 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.* @@ -13,30 +17,30 @@ Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour Créer simplement et rapidement votre site de Petites Annonces -**Version incluse :** 0.1.0~ynh2 - +**Version incluse :** 0.1.0~ynh2 ## Captures d'écran -![](./doc/screenshots/demo.png) +![Capture d'écran de PetitesAnnonces](./doc/screenshots/demo.png) ## Documentations et ressources -* Site officiel de l'app : https://framagit.org/toitoinebzh/petitesannonces -* Dépôt de code officiel de l'app : https://framagit.org/toitoinebzh/petitesannonces -* Documentation YunoHost pour cette app : https://yunohost.org/app_petitesannonces -* Signaler un bug : https://github.com/YunoHost-Apps/petitesannonces_ynh/issues +* Site officiel de l'app : +* Dépôt de code officiel de l'app : +* 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/petitesannonces_ynh/tree/testing). Pour essayer la branche testing, procédez comme suit. -``` + +``` bash sudo yunohost app install https://github.com/YunoHost-Apps/petitesannonces_ynh/tree/testing --debug ou sudo yunohost app upgrade petitesannonces -u https://github.com/YunoHost-Apps/petitesannonces_ynh/tree/testing --debug ``` -**Plus d'infos sur le packaging d'applications :** https://yunohost.org/packaging_apps \ No newline at end of file +**Plus d'infos sur le packaging d'applications :** From e5788a2fd3b963e19c5c5bc16a95db52a5f92acd Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sat, 10 Sep 2022 21:05:59 +0200 Subject: [PATCH 2/7] Add max_body_size --- conf/config.php | 21 +++++++++++++++++++++ conf/nginx.conf | 9 +-------- conf/php-fpm.conf | 4 ++-- manifest.json | 5 ++--- scripts/_common.sh | 2 +- scripts/install | 28 ++++++++++++++++++---------- scripts/remove | 19 ------------------- scripts/restore | 14 ++++++++------ scripts/upgrade | 9 +-------- 9 files changed, 54 insertions(+), 57 deletions(-) create mode 100644 conf/config.php diff --git a/conf/config.php b/conf/config.php new file mode 100644 index 0000000..6343277 --- /dev/null +++ b/conf/config.php @@ -0,0 +1,21 @@ + diff --git a/conf/nginx.conf b/conf/nginx.conf index 37de41d..b26a6dc 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -4,16 +4,10 @@ location __PATH__/ { # Path to source alias __FINALPATH__/ ; - # Force usage of https - if ($scheme = http) { - rewrite ^ https://$server_name$request_uri? permanent; - } - -### Example PHP configuration (remove it if not used) 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(/|$) { @@ -26,7 +20,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..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 40bbf75..854d6dd 100644 --- a/manifest.json +++ b/manifest.json @@ -19,7 +19,7 @@ "email": "antoine@miaou.org" }, "requirements": { - "yunohost": ">= 4.2.4" + "yunohost": ">= 4.3.0" }, "multi_instance": true, "services": [ @@ -31,8 +31,7 @@ "install" : [ { "name": "domain", - "type": "domain", - "example": "example.com" + "type": "domain" }, { "name": "path", diff --git a/scripts/_common.sh b/scripts/_common.sh index d7614e9..4f582df 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -4,7 +4,7 @@ # COMMON VARIABLES #================================================= -YNH_PHP_VERSION="7.3" +YNH_PHP_VERSION="7.4" #================================================= # PERSONAL HELPERS diff --git a/scripts/install b/scripts/install index d93c61a..69b9a07 100755 --- a/scripts/install +++ b/scripts/install @@ -79,6 +79,14 @@ chmod 750 "$final_path" chmod -R o-rwx "$final_path" chown -R $app:www-data "$final_path" +#================================================= +# PHP-FPM CONFIGURATION +#================================================= +ynh_script_progression --message="Configuring PHP-FPM..." --weight=1 + +# Create a dedicated php-fpm config +ynh_add_fpm_config + #================================================= # NGINX CONFIGURATION #================================================= @@ -88,12 +96,14 @@ ynh_script_progression --message="Configuring NGINX web server..." --weight=1 ynh_add_nginx_config #================================================= -# PHP-FPM CONFIGURATION +# ADD A CONFIGURATION #================================================= -ynh_script_progression --message="Configuring PHP-FPM..." --weight=1 +ynh_script_progression --message="Adding a configuration file..." --weight=1 -# Create a dedicated php-fpm config -ynh_add_fpm_config +ynh_add_config --template="../conf/config.php" --destination="$final_path/conf/config.php" + +chmod 400 "$final_path/conf/config.php" +chown $app:$app "$final_path/conf/config.php" #================================================= # SETUP APPLICATION WITH CURL @@ -107,10 +117,6 @@ ynh_systemd_action --service_name=nginx --action=reload # Installation with curl ynh_script_progression --message="Finalizing installation..." --weight=1 -ynh_replace_string --match_string="votre_nom_de_bdd" --replace_string=$db_name --target_file="$final_path/conf/config.php" -ynh_replace_string --match_string="votre_utilisateur_de_bdd" --replace_string=$db_user --target_file="$final_path/conf/config.php" -ynh_replace_string --match_string="votre_mdp_de_bdd" --replace_string=$db_pwd --target_file="$final_path/conf/config.php" - ynh_local_curl "/install.php" # Supprimer install.php @@ -122,9 +128,11 @@ ynh_secure_remove --file=$final_path/install.php ynh_script_progression --message="Configuring permissions..." --weight=1 # Make app public if necessary -if [ $is_public -eq 0 ] +if [ $is_public -eq 1 ] then - ynh_permission_update --permission="main" --remove="visitors" + # Everyone can access the app. + # The "main" permission is automatically created before the install script. + ynh_permission_update --permission="main" --add="visitors" fi #================================================= diff --git a/scripts/remove b/scripts/remove index 7618fe2..46932d9 100755 --- a/scripts/remove +++ b/scripts/remove @@ -23,17 +23,6 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path) #================================================= # STANDARD REMOVE -#================================================= -# REMOVE SERVICE INTEGRATION IN YUNOHOST -#================================================= - -# Remove the service from the list of services known by Yunohost (added from `yunohost service add`) -if ynh_exec_warn_less yunohost service status $app >/dev/null -then - ynh_script_progression --message="Removing $app service..." --weight=1 - #yunohost service remove $app -fi - #================================================= # REMOVE THE MYSQL DATABASE #================================================= @@ -66,14 +55,6 @@ ynh_script_progression --message="Removing PHP-FPM configuration..." --weight=1 # Remove the dedicated php-fpm config ynh_remove_fpm_config -#================================================= -# REMOVE LOGROTATE CONFIGURATION -#================================================= -ynh_script_progression --message="Removing logrotate configuration..." --weight=1 - -# Remove the app-specific logrotate config -ynh_remove_logrotate - #================================================= # GENERIC FINALIZATION #================================================= diff --git a/scripts/restore b/scripts/restore index d6b56cb..5569de7 100755 --- a/scripts/restore +++ b/scripts/restore @@ -47,12 +47,6 @@ test ! -d $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 #================================================= @@ -75,9 +69,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" +#================================================= +# 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" + #================================================= # RESTORE THE MYSQL DATABASE #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 1f7fff9..50f5591 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -77,7 +77,7 @@ then ynh_script_progression --message="Upgrading source files..." --weight=1 # Download, check integrity, uncompress and patch the source from app.src - ynh_setup_source --dest_dir="$final_path" + ynh_setup_source --dest_dir="$final_path" --keep="conf/config.php" fi chmod 750 "$final_path" @@ -106,13 +106,6 @@ ynh_add_fpm_config # Supprimer install.php ynh_secure_remove --file="$final_path/install.php" -# Restaurer config.php -# ynh_restore_file $final_path/conf/config.php # pas autorisé dans upgrade - -# autre piste -ynh_replace_string --match_string="votre_nom_de_bdd" --replace_string=$db_name --target_file="$final_path/conf/config.php" -ynh_replace_string --match_string="votre_utilisateur_de_bdd" --replace_string=$db_user --target_file="$final_path/conf/config.php" -ynh_replace_string --match_string="votre_mdp_de_bdd" --replace_string=$db_pwd --target_file="$final_path/conf/config.php" #================================================= # RELOAD NGINX From 68a0b48b0f3fc76dfb3eaf91dcada7add7740b1c Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Sat, 10 Sep 2022 19:06:03 +0000 Subject: [PATCH 3/7] Auto-update README --- README.md | 18 +++++++++--------- README_fr.md | 26 +++++++++++++++----------- 2 files changed, 24 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index e79ca07..7ba1d1a 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ It shall NOT be edited by hand. # PetitesAnnonces for YunoHost -[![Integration level](https://dash.yunohost.org/integration/petitesannonces.svg)](https://dash.yunohost.org/appci/app/petitesannonces) ![](https://ci-apps.yunohost.org/ci/badges/petitesannonces.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/petitesannonces.maintain.svg) +[![Integration level](https://dash.yunohost.org/integration/petitesannonces.svg)](https://dash.yunohost.org/appci/app/petitesannonces) ![Working status](https://ci-apps.yunohost.org/ci/badges/petitesannonces.status.svg) ![Maintenance status](https://ci-apps.yunohost.org/ci/badges/petitesannonces.maintain.svg) [![Install PetitesAnnonces with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=petitesannonces) *[Lire ce readme en français.](./README_fr.md)* @@ -20,27 +20,27 @@ Make your own classified advertising website easily **Shipped version:** 0.1.0~ynh2 - ## Screenshots -![](./doc/screenshots/demo.png) +![Screenshot of PetitesAnnonces](./doc/screenshots/demo.png) ## Documentation and resources -* Official app website: https://framagit.org/toitoinebzh/petitesannonces -* Upstream app code repository: https://framagit.org/toitoinebzh/petitesannonces -* YunoHost documentation for this app: https://yunohost.org/app_petitesannonces -* Report a bug: https://github.com/YunoHost-Apps/petitesannonces_ynh/issues +* Official app website: +* Upstream app code repository: +* YunoHost documentation for this app: +* Report a bug: ## Developer info Please send your pull request to the [testing branch](https://github.com/YunoHost-Apps/petitesannonces_ynh/tree/testing). To try the testing branch, please proceed like that. -``` + +``` bash sudo yunohost app install https://github.com/YunoHost-Apps/petitesannonces_ynh/tree/testing --debug or sudo yunohost app upgrade petitesannonces -u https://github.com/YunoHost-Apps/petitesannonces_ynh/tree/testing --debug ``` -**More info regarding app packaging:** https://yunohost.org/packaging_apps \ No newline at end of file +**More info regarding app packaging:** diff --git a/README_fr.md b/README_fr.md index f5193d4..01a5ae3 100644 --- a/README_fr.md +++ b/README_fr.md @@ -1,10 +1,14 @@ + + # PetitesAnnonces pour YunoHost -[![Niveau d'intégration](https://dash.yunohost.org/integration/petitesannonces.svg)](https://dash.yunohost.org/appci/app/petitesannonces) ![](https://ci-apps.yunohost.org/ci/badges/petitesannonces.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/petitesannonces.maintain.svg) +[![Niveau d'intégration](https://dash.yunohost.org/integration/petitesannonces.svg)](https://dash.yunohost.org/appci/app/petitesannonces) ![Statut du fonctionnement](https://ci-apps.yunohost.org/ci/badges/petitesannonces.status.svg) ![Statut de maintenance](https://ci-apps.yunohost.org/ci/badges/petitesannonces.maintain.svg) [![Installer PetitesAnnonces avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=petitesannonces) *[Read this readme in english.](./README.md)* -*[Lire ce readme en français.](./README_fr.md)* > *Ce package vous permet d'installer PetitesAnnonces 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.* @@ -13,30 +17,30 @@ Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour Créer simplement et rapidement votre site de Petites Annonces -**Version incluse :** 0.1.0~ynh2 - +**Version incluse :** 0.1.0~ynh2 ## Captures d'écran -![](./doc/screenshots/demo.png) +![Capture d'écran de PetitesAnnonces](./doc/screenshots/demo.png) ## Documentations et ressources -* Site officiel de l'app : https://framagit.org/toitoinebzh/petitesannonces -* Dépôt de code officiel de l'app : https://framagit.org/toitoinebzh/petitesannonces -* Documentation YunoHost pour cette app : https://yunohost.org/app_petitesannonces -* Signaler un bug : https://github.com/YunoHost-Apps/petitesannonces_ynh/issues +* Site officiel de l'app : +* Dépôt de code officiel de l'app : +* 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/petitesannonces_ynh/tree/testing). Pour essayer la branche testing, procédez comme suit. -``` + +``` bash sudo yunohost app install https://github.com/YunoHost-Apps/petitesannonces_ynh/tree/testing --debug ou sudo yunohost app upgrade petitesannonces -u https://github.com/YunoHost-Apps/petitesannonces_ynh/tree/testing --debug ``` -**Plus d'infos sur le packaging d'applications :** https://yunohost.org/packaging_apps \ No newline at end of file +**Plus d'infos sur le packaging d'applications :** From bbee2cf83e494b2e5e7d72a92d43d9bc02c2ff8d Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sat, 10 Sep 2022 21:06:15 +0200 Subject: [PATCH 4/7] Update manifest.json --- manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.json b/manifest.json index 854d6dd..193b308 100644 --- a/manifest.json +++ b/manifest.json @@ -24,7 +24,7 @@ "multi_instance": true, "services": [ "nginx", - "php7.3-fpm", + "php7.4-fpm", "mysql" ], "arguments": { From d4ac9c784861561a67d05f0c8d977836446bbe47 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Tue, 4 Oct 2022 09:22:51 +0200 Subject: [PATCH 5/7] Update restore --- scripts/restore | 2 -- 1 file changed, 2 deletions(-) diff --git a/scripts/restore b/scripts/restore index 5569de7..690d517 100755 --- a/scripts/restore +++ b/scripts/restore @@ -40,8 +40,6 @@ phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= ynh_script_progression --message="Validating restoration parameters..." --weight=1 -ynh_webpath_available --domain=$domain --path_url=$path_url \ - || ynh_die --message="Path not available: ${domain}${path_url}" test ! -d $final_path \ || ynh_die --message="There is already a directory: $final_path " From 87d9e18e93a5f37e8f8a47d1ab5d28802de63457 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Tue, 4 Oct 2022 09:23:48 +0200 Subject: [PATCH 6/7] Update upgrade --- scripts/upgrade | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index 50f5591..e9c6fbe 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -84,14 +84,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 - #================================================= # PHP-FPM CONFIGURATION #================================================= @@ -100,6 +92,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 + #================================================= # SPECIFIC UPGRADE #================================================= From 58f410124a9fb59b93ce05b165f7270baf9c2b75 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Wed, 12 Oct 2022 19:46:07 +0000 Subject: [PATCH 7/7] Auto-update README --- README.md | 1 - README_fr.md | 3 +-- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/README.md b/README.md index 7ba1d1a..6a80c6b 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,6 @@ Make your own classified advertising website easily **Shipped version:** 0.1.0~ynh2 - ## Screenshots ![Screenshot of PetitesAnnonces](./doc/screenshots/demo.png) diff --git a/README_fr.md b/README_fr.md index 01a5ae3..1993bd6 100644 --- a/README_fr.md +++ b/README_fr.md @@ -17,8 +17,7 @@ Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour Créer simplement et rapidement votre site de Petites Annonces -**Version incluse :** 0.1.0~ynh2 - +**Version incluse :** 0.1.0~ynh2 ## Captures d'écran