
diff --git a/conf/.env b/conf/.env
deleted file mode 100644
index 548f0c6..0000000
--- a/conf/.env
+++ /dev/null
@@ -1,4 +0,0 @@
-ICAD_LOGIN=
-ICAD_PASSWORD=
-GEOCODER_EMAIL=contact@__DOMAIN__
-APP_ENV=production
\ No newline at end of file
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 90dbc4f..7da685b 100644
--- a/conf/nginx.conf
+++ b/conf/nginx.conf
@@ -1,18 +1,26 @@
-#sub_path_only rewrite ^__PATH__$ __PATH__/ permanent;
-location __PATH__/ {
-
- # Path to source
- root __INSTALL_DIR__/public;
-
- index index.php;
-
- # Common parameter to increase upload size limit in conjunction with dedicated PHP-FPM file
- client_max_body_size 250M;
-
- try_files $uri $uri/ /index.php?$query_string;
-
- location ~ [^/]\.php(/|$) {
+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/php__PHP_VERSION__-fpm-__APP__.sock;
+}
+
+location ^~ __PATH__/media/ {
+ alias __DATA_DIR__/media/;
+}
+
+location __PATH__/ {
+ alias __INSTALL_DIR__/public/;
+ index index.php;
+ client_max_body_size 260M;
+ try_files $uri $uri/ @__APP__;
+ location ~ /\. { deny all; }
+ location ~ \.php$ { return 404; }
+}
+
+location @__APP__ {
+ include fastcgi_params;
+ fastcgi_param SCRIPT_FILENAME __INSTALL_DIR__/public/index.php;
+ fastcgi_param HTTP_PROXY "";
fastcgi_pass unix:/var/run/php/php__PHP_VERSION__-fpm-__APP__.sock;
- include fastcgi_params_no_auth;
- }
}
diff --git a/doc/.gitkeep b/doc/.gitkeep
deleted file mode 100644
index e69de29..0000000
diff --git a/doc/ADMIN.md b/doc/ADMIN.md
new file mode 100644
index 0000000..edcc857
--- /dev/null
+++ b/doc/ADMIN.md
@@ -0,0 +1,3 @@
+Globinours stores its persistent data in `__DATA_DIR__` and its application files in `__INSTALL_DIR__`.
+
+The application uses its own user accounts. Open the application settings to manage users, backups and maintenance operations.
diff --git a/doc/ADMIN_fr.md b/doc/ADMIN_fr.md
new file mode 100644
index 0000000..ca300ca
--- /dev/null
+++ b/doc/ADMIN_fr.md
@@ -0,0 +1,3 @@
+Globinours conserve ses données persistantes dans `__DATA_DIR__` et ses fichiers applicatifs dans `__INSTALL_DIR__`.
+
+Lâapplication utilise ses propres comptes. Ouvrez ses paramĂštres pour gĂ©rer les utilisateurs, les sauvegardes et les opĂ©rations de maintenance.
diff --git a/doc/DESCRIPTION.md b/doc/DESCRIPTION.md
index 8f9533d..fd29c36 100644
--- a/doc/DESCRIPTION.md
+++ b/doc/DESCRIPTION.md
@@ -1,3 +1 @@
-Globinours is a web-based animal shelter management application, developed in response to specific needs identified in the field.
-
-It centralises information on the animals, their health, their documents, their family relationships, foster families, contacts and day-to-day activities. Its aim is simple: to enable volunteers and managers to find or enter information in a matter of seconds, without having to navigate through a series of complex screens.
+Globinours is a lightweight shelter management application for animals, medical care, placements, contacts, documents, statistics and adoption publishing.
diff --git a/doc/DESCRIPTION_fr.md b/doc/DESCRIPTION_fr.md
index 13f4b64..49af4c9 100644
--- a/doc/DESCRIPTION_fr.md
+++ b/doc/DESCRIPTION_fr.md
@@ -1 +1 @@
-Ceci est une fausse description des fonctionalités de l'app
+Globinours est une application lĂ©gĂšre de gestion de refuge : animaux, mĂ©dical, placements, annuaire, documents, statistiques et mini-site dâadoption.
diff --git a/doc/POST_INSTALL.md b/doc/POST_INSTALL.md
new file mode 100644
index 0000000..4ba6976
--- /dev/null
+++ b/doc/POST_INSTALL.md
@@ -0,0 +1 @@
+Open the application URL and complete the Globinours setup wizard to create the first administrator account. Keep the application-level login enabled: this package does not use YunoHost SSO.
diff --git a/doc/POST_INSTALL_fr.md b/doc/POST_INSTALL_fr.md
new file mode 100644
index 0000000..dd6fbd4
--- /dev/null
+++ b/doc/POST_INSTALL_fr.md
@@ -0,0 +1 @@
+Ouvrez lâadresse de lâapplication et terminez lâassistant Globinours afin de crĂ©er le premier compte administrateur. Conservez lâauthentification propre Ă lâapplication : ce paquet nâutilise pas le SSO YunoHost.
diff --git a/doc/screenshots/.gitkeep b/doc/screenshots/.gitkeep
deleted file mode 100644
index e69de29..0000000
diff --git a/doc/screenshots/example.jpg b/doc/screenshots/example.jpg
index a1efa1a..104a3e5 100644
Binary files a/doc/screenshots/example.jpg and b/doc/screenshots/example.jpg differ
diff --git a/logo.png b/logo.png
new file mode 100644
index 0000000..62079fb
Binary files /dev/null and b/logo.png differ
diff --git a/manifest.toml b/manifest.toml
index 739539c..a17b28d 100644
--- a/manifest.toml
+++ b/manifest.toml
@@ -5,7 +5,7 @@ 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-rc.17~ynh2"
+version = "1.0.0-rc.18~ynh1"
maintainers = ["OverSu"]
[upstream]
@@ -34,8 +34,8 @@ ram.runtime = "100M"
[resources]
[resources.sources.main]
- url = "https://nnsprod.com/git/oversu/Globinours/archive/e786756f2214ab89c0dc2667fdd484cfa5f2a176.tar.gz"
- sha256 = "d685aa88adef339fddc56a29649bd6aec475baceca23f1f81e8c0ae2c6489c4a"
+ url = "https://nnsprod.com/git/oversu/Globinours/archive/81f259ea6ef722de7e3b6da071c092fdd81630a6.tar.gz"
+ sha256 = "7ea9618f27c6aeb68b30fe117e0fec4b31af48e082eb52a46e0134ab401c7784"
in_subdir = true
autoupdate.strategy = "latest_forgejo_commit"
autoupdate.upstream = "https://nnsprod.com/git/oversu/Globinours"
diff --git a/scripts/_common.sh b/scripts/_common.sh
old mode 100644
new mode 100755
diff --git a/scripts/backup b/scripts/backup
index 030a031..8f41a4b 100755
--- a/scripts/backup
+++ b/scripts/backup
@@ -4,28 +4,18 @@
# IMPORT GENERIC HELPERS
#=================================================
+source ../settings/scripts/_common.sh
source /usr/share/yunohost/helpers
+#=================================================
+# DECLARE DATA TO BACK UP
+#=================================================
+
ynh_print_info "Declaring files to be backed up..."
-#=================================================
-# BACKUP THE APP MAIN DIR
-#=================================================
-
ynh_backup "$install_dir"
-
-#=================================================
-# BACKUP SYSTEM CONFIGURATION
-#=================================================
-
-# Backup the PHP-FPM configuration
+ynh_backup "$data_dir"
+ynh_backup "/etc/nginx/conf.d/$domain.d/$app.conf"
ynh_backup "/etc/php/$php_version/fpm/pool.d/$app.conf"
-# Backup the NGINX configuration
-ynh_backup "/etc/nginx/conf.d/$domain.d/$app.conf"
-
-#=================================================
-# END OF SCRIPT
-#=================================================
-
-ynh_print_info "Backup script completed for $app. (YunoHost will then actually copy those files to the archive)."
+ynh_print_info "Backup script completed for $app"
diff --git a/scripts/change_url b/scripts/change_url
old mode 100644
new mode 100755
index 1e7d63b..484ac86
--- a/scripts/change_url
+++ b/scripts/change_url
@@ -10,10 +10,11 @@ source /usr/share/yunohost/helpers
#=================================================
# MODIFY URL IN NGINX CONF
#=================================================
+
ynh_script_progression "Updating NGINX web server configuration..."
-# this will most likely adjust NGINX config correctly
ynh_config_change_url_nginx
+ynh_systemctl --service=nginx --action=reload
#=================================================
# END OF SCRIPT
diff --git a/scripts/install b/scripts/install
index e3d57e1..dc09c0b 100755
--- a/scripts/install
+++ b/scripts/install
@@ -4,45 +4,43 @@
# IMPORT GENERIC HELPERS
#=================================================
+source _common.sh
source /usr/share/yunohost/helpers
-#=================================================
-# INITIALIZE AND STORE SETTINGS
-#=================================================
-
-ynh_app_setting_set --key=php_upload_max_filesize --value=250M
-ynh_app_setting_set --key=php_post_max_size --value=260M
-
#=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE
#=================================================
+
ynh_script_progression "Setting up source files..."
-# Download, check integrity, uncompress and patch the source from manifest.toml
ynh_setup_source --dest_dir="$install_dir"
-mkdir $install_dir/data $install_dir/public/media $install_dir/storage
-chown -R $app:$app $install_dir/data $install_dir/public/media $install_dir/storage
-chmod -R u+rwX $install_dir/data $install_dir/public/media $install_dir/storage
-
#=================================================
# APP INITIAL CONFIGURATION
#=================================================
-ynh_script_progression "Adding $app's configuration files..."
-ynh_config_add --template=".env" --destination="$install_dir/.env"
+prepare_persistent_paths
+install_yunohost_logo
#=================================================
# SYSTEM CONFIGURATION
#=================================================
+
ynh_script_progression "Adding system configurations related to $app..."
-# Create a PHP-FPM config (with conf/extra_php-fpm.conf being appended to it)
ynh_config_add_phpfpm
-
-# Create a dedicated NGINX config using the conf/nginx.conf template
ynh_config_add_nginx
+#=================================================
+# INITIALIZE THE APPLICATION
+#=================================================
+
+ynh_script_progression "Initializing the database..."
+
+ynh_exec_as_app php "$install_dir/scripts/migrate.php"
+
+ynh_systemctl --service="php$php_version-fpm" --action=reload
+
#=================================================
# END OF SCRIPT
#=================================================
diff --git a/scripts/remove b/scripts/remove
index 1e717e1..3d73865 100755
--- a/scripts/remove
+++ b/scripts/remove
@@ -4,15 +4,20 @@
# IMPORT GENERIC HELPERS
#=================================================
+source _common.sh
source /usr/share/yunohost/helpers
#=================================================
# REMOVE SYSTEM CONFIGURATION
#=================================================
+
ynh_script_progression "Removing system configurations related to $app..."
-ynh_config_remove_nginx
+if [[ -e "/usr/share/yunohost/applogos/$app.png" ]]; then
+ ynh_safe_rm "/usr/share/yunohost/applogos/$app.png"
+fi
+ynh_config_remove_nginx
ynh_config_remove_phpfpm
#=================================================
diff --git a/tests.toml b/tests.toml
index 6dbcbf5..e3d18f7 100644
--- a/tests.toml
+++ b/tests.toml
@@ -1,22 +1,10 @@
-#:schema https://raw.githubusercontent.com/YunoHost/apps/main/schemas/tests.v1.schema.json
-
test_format = 1.0
[default]
+ args.init_main_permission = "visitors"
- # ------------
- # Tests to run
- # ------------
+ test_upgrade_from.1a45355.name = "Upgrade from 1.0.0-rc.3~ynh10"
- # -------------------------------------------------------------------------------
- # EVERYTHING PAST THIS POINT IS OPTIONAL AND MOST LIKELY UNNECESSARY FOR NEW APPS
- #--------------------------------------------------------------------------------
-
- # -------------------------------
- # Default args to use for install
- # -------------------------------
-
- # -------------------------------
- # Commits to test upgrade from
- # -------------------------------
-
\ No newline at end of file
+ [default.curl_tests]
+ home.path = "/"
+ home.expect_title = "Globinours"