From 0cf7c23681eece1b9e4549b4ae3c8b8b4ec25605 Mon Sep 17 00:00:00 2001 From: oversu <95a7002b-481b-4ef3-b578-f9c421550aa4@localhost> Date: Thu, 3 Sep 2026 22:21:13 +0200 Subject: [PATCH] =?UTF-8?q?Pr=C3=A9parer=20le=20paquet=20Globinours=201.0.?= =?UTF-8?q?0-rc.3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 2 ++ LICENSE | 16 ++++++++++++++++ README.md | 25 +++++++++++-------------- conf/extra_php-fpm.conf | 2 ++ conf/nginx.conf | 3 ++- conf/php-fpm.conf | 13 ------------- manifest.toml | 16 +++++++++------- scripts/_common.sh | 8 +++++++- scripts/backup | 0 scripts/change_url | 2 +- scripts/install | 2 +- scripts/remove | 0 scripts/restore | 4 ++-- scripts/upgrade | 2 +- 14 files changed, 54 insertions(+), 41 deletions(-) create mode 100644 .gitignore create mode 100644 LICENSE create mode 100644 conf/extra_php-fpm.conf delete mode 100644 conf/php-fpm.conf mode change 100644 => 100755 scripts/_common.sh mode change 100644 => 100755 scripts/backup mode change 100644 => 100755 scripts/change_url mode change 100644 => 100755 scripts/install mode change 100644 => 100755 scripts/remove mode change 100644 => 100755 scripts/restore mode change 100644 => 100755 scripts/upgrade diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1330247 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +*.log +.DS_Store diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..06e82cf --- /dev/null +++ b/LICENSE @@ -0,0 +1,16 @@ +Globinours YunoHost package + +Copyright (C) 2026 OverSu + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU Affero General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU Affero General Public License for more details. + +You should have received a copy of the GNU Affero General Public License +along with this program. If not, see . diff --git a/README.md b/README.md index b9544a1..ad4cf22 100644 --- a/README.md +++ b/README.md @@ -1,19 +1,10 @@ -# Globinours pour YunoHost — paquet de test 1.0.0-rc.1 +# Globinours pour YunoHost — 1.0.0-rc.3 -Ce paquet installe Globinours sur un domaine ou sous-domaine dédié. La version de test télécharge l’archive depuis un petit serveur HTTP local lancé sur la machine YunoHost ; aucun dépôt Git ni publication externe n’est nécessaire. +Ce paquet installe Globinours sur un domaine ou sous-domaine dédié. Il télécharge une archive immuable de l’application depuis le dépôt Forgejo officiel, puis vérifie son empreinte SHA-256 avant installation. -## Test local +## Installation de test -Copier sur le serveur YunoHost le dossier du paquet sous `/root/globinours_ynh` et `globinours-1.0.0-rc.1.tar.gz` sous `/root/globinours-source/`. - -Dans une première session SSH : - -```bash -cd /root/globinours-source -python3 -m http.server 8123 --bind 127.0.0.1 -``` - -Dans une seconde session SSH : +Depuis un clone du paquet présent sur le serveur YunoHost : ```bash sudo yunohost app install /root/globinours_ynh --debug --force --no-remove-on-failure @@ -21,4 +12,10 @@ sudo yunohost app install /root/globinours_ynh --debug --force --no-remove-on-fa Choisir un domaine ou sous-domaine libre. Après l’installation, ouvrir son URL et terminer la création du premier administrateur dans l’assistant Globinours. -Avant publication, remplacer l’URL locale par celle de l’archive officielle, recalculer son SHA-256 et remplacer `1.0.0~rc1~ynh1` par `1.0.0~ynh1`. +Pour tester une mise à niveau du paquet : + +```bash +sudo yunohost app upgrade globinours -u /root/globinours_ynh --debug +``` + +Globinours utilise ses propres comptes applicatifs : l’intégration LDAP et l’authentification SSO YunoHost ne sont donc pas utilisées. diff --git a/conf/extra_php-fpm.conf b/conf/extra_php-fpm.conf new file mode 100644 index 0000000..218fda4 --- /dev/null +++ b/conf/extra_php-fpm.conf @@ -0,0 +1,2 @@ +php_admin_value[max_execution_time] = 600 +php_admin_value[open_basedir] = __INSTALL_DIR__:__DATA_DIR__:/tmp:/usr/share/php diff --git a/conf/nginx.conf b/conf/nginx.conf index c8fda70..2a8c85a 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -1,12 +1,13 @@ location __PATH__/ { alias __INSTALL_DIR__/public/; index index.php; + client_max_body_size 260M; try_files $uri $uri/ __PATH__/index.php?$query_string; location ~ /\. { deny all; } location = __PATH__/index.php { include fastcgi_params; fastcgi_param SCRIPT_FILENAME __INSTALL_DIR__/public/index.php; fastcgi_param HTTP_PROXY ""; - fastcgi_pass unix:/var/run/php/php8.2-fpm-__APP__.sock; + fastcgi_pass unix:/var/run/php/php__PHP_VERSION__-fpm-__APP__.sock; } } diff --git a/conf/php-fpm.conf b/conf/php-fpm.conf deleted file mode 100644 index 9d6d066..0000000 --- a/conf/php-fpm.conf +++ /dev/null @@ -1,13 +0,0 @@ -[__APP__] -user = __APP__ -group = __APP__ -listen = /var/run/php/php8.2-fpm-__APP__.sock -listen.owner = www-data -listen.group = www-data -pm = ondemand -pm.max_children = 8 -pm.process_idle_timeout = 10s -php_admin_value[upload_max_filesize] = 250M -php_admin_value[post_max_size] = 260M -php_admin_value[max_execution_time] = 600 -php_admin_value[open_basedir] = __INSTALL_DIR__:__DATA_DIR__:/tmp diff --git a/manifest.toml b/manifest.toml index 59dd04c..9a5cd6a 100644 --- a/manifest.toml +++ b/manifest.toml @@ -1,9 +1,11 @@ +#:schema https://raw.githubusercontent.com/YunoHost/apps/main/schemas/manifest.v2.schema.json + packaging_format = 2 id = "globinours" name = "Globinours" description.en = "Lightweight animal shelter management" description.fr = "Gestion légère et complète pour refuges animaliers" -version = "1.0.0~rc1~ynh1" +version = "1.0.0-rc.3~ynh1" maintainers = ["OverSu"] [upstream] @@ -24,21 +26,21 @@ ram.runtime = "100M" [install] [install.domain] type = "domain" - full_domain = true [install.init_main_permission] type = "group" default = "visitors" [resources] [resources.sources.main] - # URL locale utilisée par le bundle de test pré-1.0. - url = "http://127.0.0.1:8123/globinours-1.0.0-rc.1.tar.gz" - sha256 = "d467adc4646bd541cdc695991cb80de5f7a0170d422ff1ef86e9d072af17ebe0" - in_subdir = false + url = "https://nnsprod.com/git/oversu/Globinours/archive/9a2b4068da3c707aa32f365b2d7943398703c44b.tar.gz" + sha256 = "164f56084cf6c75fd1a6f2ae9c7639c65b09e54266b7d3fd07bb1902515a36b5" + in_subdir = true + autoupdate.strategy = "latest_forgejo_commit" + autoupdate.upstream = "https://nnsprod.com/git/oversu/Globinours" [resources.system_user] [resources.install_dir] [resources.data_dir] [resources.permissions] main.url = "/" [resources.apt] - packages = "php8.2-fpm, php8.2-cli, php8.2-sqlite3, php8.2-mbstring, php8.2-xml, php8.2-zip, php8.2-gd, php8.2-curl, php8.2-intl, sqlite3, rsync" + packages = "php8.2-fpm, php8.2-cli, php8.2-sqlite3, php8.2-mbstring, php8.2-xml, php8.2-zip, php8.2-gd, php8.2-curl, php8.2-intl, sqlite3" diff --git a/scripts/_common.sh b/scripts/_common.sh old mode 100644 new mode 100755 index aecf5f9..42be628 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -1,14 +1,20 @@ #!/bin/bash source /usr/share/yunohost/helpers +php_upload_max_filesize="250M" + prepare_persistent_paths() { mkdir -p "$data_dir/association" "$data_dir/grants" "$data_dir/medical-documents" \ "$data_dir/private-media" "$data_dir/media" "$data_dir/storage/logs" \ "$data_dir/storage/backups" "$data_dir/storage/releases" - rm -rf "$install_dir/data" "$install_dir/storage" "$install_dir/public/media" + ynh_safe_rm "$install_dir/data" + ynh_safe_rm "$install_dir/storage" + ynh_safe_rm "$install_dir/public/media" ln -s "$data_dir" "$install_dir/data" ln -s "$data_dir/storage" "$install_dir/storage" ln -s "$data_dir/media" "$install_dir/public/media" chown -R "$app:www-data" "$install_dir" chown -R "$app:$app" "$data_dir" + chmod -R u=rwX,g=rX,o= "$install_dir" + chmod -R u=rwX,g=,o= "$data_dir" } diff --git a/scripts/backup b/scripts/backup old mode 100644 new mode 100755 diff --git a/scripts/change_url b/scripts/change_url old mode 100644 new mode 100755 index 9c3b198..1dc41ab --- a/scripts/change_url +++ b/scripts/change_url @@ -1,4 +1,4 @@ #!/bin/bash source _common.sh -ynh_change_url_nginx_config +ynh_config_change_url_nginx ynh_systemctl --service=nginx --action=reload diff --git a/scripts/install b/scripts/install old mode 100644 new mode 100755 index ace0eaa..02b8b6d --- a/scripts/install +++ b/scripts/install @@ -6,4 +6,4 @@ prepare_persistent_paths ynh_config_add_phpfpm ynh_config_add_nginx ynh_exec_as_app php "$install_dir/scripts/migrate.php" -ynh_systemctl --service=php8.2-fpm --action=reload +ynh_systemctl --service="php$php_version-fpm" --action=reload diff --git a/scripts/remove b/scripts/remove old mode 100644 new mode 100755 diff --git a/scripts/restore b/scripts/restore old mode 100644 new mode 100755 index c6cbb8a..6c1e58a --- a/scripts/restore +++ b/scripts/restore @@ -4,7 +4,7 @@ ynh_restore "$install_dir" ynh_restore "$data_dir" ynh_restore "/etc/nginx/conf.d/$domain.d/$app.conf" ynh_restore "/etc/php/$php_version/fpm/pool.d/$app.conf" -chown -R "$app:$app" "$install_dir" "$data_dir" +prepare_persistent_paths ynh_exec_as_app php "$install_dir/scripts/migrate.php" -ynh_systemctl --service=php8.2-fpm --action=reload +ynh_systemctl --service="php$php_version-fpm" --action=reload ynh_systemctl --service=nginx --action=reload diff --git a/scripts/upgrade b/scripts/upgrade old mode 100644 new mode 100755 index 2098a04..87b9480 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -12,4 +12,4 @@ ynh_config_add_nginx ynh_exec_as_app php "$install_dir/scripts/migrate.php" rm -f "$data_dir/storage/maintenance.flag" trap - EXIT -ynh_systemctl --service=php8.2-fpm --action=reload +ynh_systemctl --service="php$php_version-fpm" --action=reload