From 98ea277a9c6e2468d84bcfc3a5d7a470845bc1fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Wed, 2 Aug 2023 13:57:52 +0200 Subject: [PATCH 01/11] Update manifest.toml --- manifest.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/manifest.toml b/manifest.toml index 5499633..745ab34 100644 --- a/manifest.toml +++ b/manifest.toml @@ -5,7 +5,7 @@ name = "Umami" description.en = "Simple, fast, privacy-focused alternative to Google Analytics" description.fr = "Analyse de trafic web simple et respectueux" -version = "2.4.0~ynh1" +version = "2.4.1~ynh1" maintainers = ["eric_G"] @@ -41,8 +41,8 @@ ram.runtime = "50M" [resources.sources.main] - url = "https://github.com/mikecao/umami/archive/refs/tags/v2.4.0.tar.gz" - sha256 = "3ddad068538f77fc23b2f3a78caeb93cf9613cb54a03f5c811c4c140ff0ca4db" + url = "https://github.com/mikecao/umami/archive/refs/tags/v2.4.1.tar.gz" + sha256 = "01682a6c1b87773653e5f5bddc3157843e252c38ac94daf8c936f31308157680" autoupdate.strategy = "latest_github_tag" [resources.system_user] From 6c219bf69aad1b44857e5e743f5b8cbfd05b231a Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Wed, 2 Aug 2023 11:57:57 +0000 Subject: [PATCH 02/11] Auto-update README --- README.md | 2 +- README_fr.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 47d62ba..380af45 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ Umami is a simple, easy to use, self-hosted web analytics solution. The goal is - Privacy-focused -**Shipped version:** 2.4.0~ynh1 +**Shipped version:** 2.4.1~ynh1 **Demo:** https://app.umami.is/share/8rmHaheU/umami.is diff --git a/README_fr.md b/README_fr.md index 114c69f..07c0aec 100644 --- a/README_fr.md +++ b/README_fr.md @@ -31,7 +31,7 @@ Umami is a simple, easy to use, self-hosted web analytics solution. The goal is - Privacy-focused -**Version incluse :** 2.4.0~ynh1 +**Version incluse :** 2.4.1~ynh1 **Démo :** https://app.umami.is/share/8rmHaheU/umami.is From 53be6e163546e5fdf4cbe0237ffef5aa60d9d462 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sat, 12 Aug 2023 14:35:07 +0200 Subject: [PATCH 03/11] add language --- conf/.env | 6 ++---- manifest.toml | 7 +++++++ scripts/install | 24 +++++++----------------- scripts/remove | 25 +++---------------------- scripts/restore | 27 ++++++--------------------- scripts/upgrade | 37 ++++++++++++++++++++----------------- 6 files changed, 45 insertions(+), 81 deletions(-) diff --git a/conf/.env b/conf/.env index c24e7c1..e2d7381 100644 --- a/conf/.env +++ b/conf/.env @@ -1,7 +1,5 @@ -DATABASE_TYPE=postgresql - +DATABASE_TYPE=postgresql DATABASE_URL=postgresql://__DB_USER__:__DB_PWD__@127.0.0.1:5432/__DB_NAME__ - DISABLE_TELEMETRY=0 - PORT=__PORT__ +DEFAULT_LOCALE="__LANGUAGE__" diff --git a/manifest.toml b/manifest.toml index 745ab34..52b8c13 100644 --- a/manifest.toml +++ b/manifest.toml @@ -35,6 +35,13 @@ ram.runtime = "50M" type = "group" default = "visitors" + [install.language] + ask.en = "Choose the application language" + ask.fr = "Choisissez la langue de l'application" + type = "string" + choices = ["de-DE", "it-IT", "fr-FR", "en-US"] + default = "fr-FR" + [resources] [resources.sources] diff --git a/scripts/install b/scripts/install index d4cbfde..6d4e23c 100755 --- a/scripts/install +++ b/scripts/install @@ -29,13 +29,18 @@ chmod -R o-rwx "$install_dir" chown -R $app:www-data "$install_dir" #================================================= -# NGINX CONFIGURATION +# SYSTEM CONFIGURATION #================================================= -ynh_script_progression --message="Configuring NGINX web server..." --weight=1 +ynh_script_progression --message="Adding system configurations related to $app..." --weight=1 # Create a dedicated NGINX config ynh_add_nginx_config +# Create a dedicated systemd config +ynh_add_systemd_config + +yunohost service add $app --description="Web Analytics" --log="/var/log/$app/$app.log" + #================================================= # ADD A CONFIGURATION #================================================= @@ -57,21 +62,6 @@ pushd $install_dir ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH yarn build popd -#================================================= -# SETUP SYSTEMD -#================================================= -ynh_script_progression --message="Configuring a systemd service..." --weight=1 - -# Create a dedicated systemd config -ynh_add_systemd_config - -#================================================= -# INTEGRATE SERVICE IN YUNOHOST -#================================================= -ynh_script_progression --message="Integrating service in YunoHost..." --weight=1 - -yunohost service add $app --description="Web Analytics" --log="/var/log/$app/$app.log" - #================================================= # START SYSTEMD SERVICE #================================================= diff --git a/scripts/remove b/scripts/remove index bb95289..eb74b39 100755 --- a/scripts/remove +++ b/scripts/remove @@ -10,10 +10,11 @@ source _common.sh source /usr/share/yunohost/helpers #================================================= -# STANDARD REMOVE +# REMOVE SYSTEM CONFIGURATIONS #================================================= -# REMOVE SERVICE INTEGRATION IN YUNOHOST +# REMOVE SYSTEMD SERVICE #================================================= +ynh_script_progression --message="Removing system configurations related to $app..." --weight=1 # 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 @@ -22,35 +23,15 @@ then yunohost service remove $app fi -#================================================= -# STOP AND REMOVE SERVICE -#================================================= -ynh_script_progression --message="Stopping and removing the systemd service..." --weight=1 - # Remove the dedicated systemd config ynh_remove_systemd_config -#================================================= -# REMOVE LOGROTATE CONFIGURATION -#================================================= -ynh_script_progression --message="Removing logrotate configuration..." --weight=1 - # Remove the app-specific logrotate config ynh_remove_logrotate -#================================================= -# REMOVE NGINX CONFIGURATION -#================================================= -ynh_script_progression --message="Removing NGINX web server configuration..." --weight=1 - # Remove the dedicated NGINX config ynh_remove_nginx_config -#================================================= -# REMOVE DEPENDENCIES -#================================================= -ynh_script_progression --message="Removing dependencies..." --weight=1 - ynh_remove_nodejs #================================================= diff --git a/scripts/restore b/scripts/restore index 193583b..e214e48 100755 --- a/scripts/restore +++ b/scripts/restore @@ -30,13 +30,6 @@ ynh_script_progression --message="Reinstalling dependencies..." --weight=10 # Install Nodejs ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version -#================================================= -# 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 DATABASE #================================================= @@ -45,18 +38,17 @@ ynh_script_progression --message="Restoring the database..." --weight=6 ynh_psql_execute_file_as_root --file="./db.sql" --database=$db_name #================================================= -# RESTORE SYSTEMD +# RESTORE SYSTEM CONFIGURATIONS #================================================= -ynh_script_progression --message="Restoring the systemd configuration..." --weight=1 +# RESTORE THE PHP-FPM CONFIGURATION +#================================================= +ynh_script_progression --message="Restoring system configurations related to $app..." --weight=1 + +ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" ynh_restore_file --origin_path="/etc/systemd/system/$app.service" systemctl enable $app.service --quiet -#================================================= -# INTEGRATE SERVICE IN YUNOHOST -#================================================= -ynh_script_progression --message="Integrating service in YunoHost..." --weight=1 - yunohost service add $app --description="Web Analytics" --log="/var/log/$app/$app.log" #================================================= @@ -66,13 +58,6 @@ ynh_script_progression --message="Starting a systemd service..." --weight=1 ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log" -#================================================= -# GENERIC FINALIZATION -#================================================= -# RELOAD NGINX AND PHP-FPM -#================================================= -ynh_script_progression --message="Reloading NGINX web server..." --weight=1 - ynh_systemd_action --service_name=nginx --action=reload #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index eec3214..bbf006c 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -15,6 +15,19 @@ source /usr/share/yunohost/helpers upgrade_type=$(ynh_check_app_version_changed) +#================================================= +# STANDARD UPGRADE STEPS +#================================================= +# ENSURE DOWNWARD COMPATIBILITY +#================================================= +ynh_script_progression --message="Ensuring downward compatibility..." --weight=1 + +# If language doesn't exist, create it +if [ -z "$language" ]; then + language="en-US" + ynh_app_setting_set --app=$app --key=language --value=$language +fi + #================================================= # STANDARD UPGRADE STEPS #================================================= @@ -48,13 +61,18 @@ ynh_script_progression --message="Upgrading dependencies..." --weight=10 ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version #================================================= -# NGINX CONFIGURATION +# REAPPLY SYSTEM CONFIGURATIONS #================================================= -ynh_script_progression --message="Upgrading NGINX web server configuration..." --weight=1 +ynh_script_progression --message="Upgrading system configurations related to $app..." --weight=1 # Create a dedicated NGINX config ynh_add_nginx_config +# Create a dedicated systemd config +ynh_add_systemd_config + +yunohost service add $app --description="Web Analytics" --log="/var/log/$app/$app.log" + #================================================= # ADD A CONFIGURATION #================================================= @@ -77,21 +95,6 @@ pushd $install_dir #ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH npx @umami/migrate-v1-v2@latest popd -#================================================= -# SETUP SYSTEMD -#================================================= -ynh_script_progression --message="Upgrading systemd configuration..." --weight=1 - -# Create a dedicated systemd config -ynh_add_systemd_config - -#================================================= -# INTEGRATE SERVICE IN YUNOHOST -#================================================= -ynh_script_progression --message="Integrating service in YunoHost..." --weight=1 - -yunohost service add $app --description="Web Analytics" --log="/var/log/$app/$app.log" - #================================================= # START SYSTEMD SERVICE #================================================= From d0175eef5ac1d6af0d03b15e28f694422b591c7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sat, 12 Aug 2023 14:35:43 +0200 Subject: [PATCH 04/11] Update tests.toml --- tests.toml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests.toml b/tests.toml index 2a807c8..17b2039 100644 --- a/tests.toml +++ b/tests.toml @@ -1,6 +1,11 @@ test_format = 1.0 [default] + # ------------------------------- + # Default args to use for install + # ------------------------------- + + args.language = "fr_FR" # ------------ # Tests to run From 90b2a3a415893dccc3338e3695c3ed772129ce16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sat, 12 Aug 2023 14:36:17 +0200 Subject: [PATCH 05/11] Update manifest.toml --- manifest.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.toml b/manifest.toml index 52b8c13..35f8c25 100644 --- a/manifest.toml +++ b/manifest.toml @@ -5,7 +5,7 @@ name = "Umami" description.en = "Simple, fast, privacy-focused alternative to Google Analytics" description.fr = "Analyse de trafic web simple et respectueux" -version = "2.4.1~ynh1" +version = "2.4.1~ynh2" maintainers = ["eric_G"] From 197e3ae908018ed4cabc9d1c2e0a39db1a9fc811 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Sat, 12 Aug 2023 12:36:21 +0000 Subject: [PATCH 06/11] Auto-update README --- README.md | 2 +- README_fr.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 380af45..6cf70cc 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ Umami is a simple, easy to use, self-hosted web analytics solution. The goal is - Privacy-focused -**Shipped version:** 2.4.1~ynh1 +**Shipped version:** 2.4.1~ynh2 **Demo:** https://app.umami.is/share/8rmHaheU/umami.is diff --git a/README_fr.md b/README_fr.md index 07c0aec..35347c8 100644 --- a/README_fr.md +++ b/README_fr.md @@ -31,7 +31,7 @@ Umami is a simple, easy to use, self-hosted web analytics solution. The goal is - Privacy-focused -**Version incluse :** 2.4.1~ynh1 +**Version incluse :** 2.4.1~ynh2 **Démo :** https://app.umami.is/share/8rmHaheU/umami.is From 2cc2e3efefbb257edeccd8bb5f703b0fff4357fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sat, 12 Aug 2023 14:49:55 +0200 Subject: [PATCH 07/11] Update manifest.toml --- manifest.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.toml b/manifest.toml index 35f8c25..710d669 100644 --- a/manifest.toml +++ b/manifest.toml @@ -38,7 +38,7 @@ ram.runtime = "50M" [install.language] ask.en = "Choose the application language" ask.fr = "Choisissez la langue de l'application" - type = "string" + type = "select" choices = ["de-DE", "it-IT", "fr-FR", "en-US"] default = "fr-FR" From 58c8698d5eb219c4e175a1ffad274b6aece4bd79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sat, 12 Aug 2023 19:24:21 +0200 Subject: [PATCH 08/11] Update manifest.toml --- manifest.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/manifest.toml b/manifest.toml index 710d669..f3c9819 100644 --- a/manifest.toml +++ b/manifest.toml @@ -29,7 +29,6 @@ ram.runtime = "50M" [install] [install.domain] type = "domain" - full_domain = true [install.init_main_permission] type = "group" From f9542fe325316833a225ae9524fb0be5b5f5359d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sat, 12 Aug 2023 19:25:05 +0200 Subject: [PATCH 09/11] Update tests.toml --- tests.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests.toml b/tests.toml index 17b2039..243682c 100644 --- a/tests.toml +++ b/tests.toml @@ -5,7 +5,7 @@ test_format = 1.0 # Default args to use for install # ------------------------------- - args.language = "fr_FR" + args.language = "fr-FR" # ------------ # Tests to run From dd07b31260a32d582cc55893b657c4dffc5c3fe4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Tue, 15 Aug 2023 11:45:06 +0200 Subject: [PATCH 10/11] Update tests.toml --- tests.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests.toml b/tests.toml index 243682c..50c4bd1 100644 --- a/tests.toml +++ b/tests.toml @@ -17,4 +17,4 @@ test_format = 1.0 # Commits to test upgrade from # ------------------------------- - test_upgrade_from.eb20586e7add0ee1f6da31bbe6fd8d7fe245c036.name = "Upgrade from 1.40" + test_upgrade_from.895948665a07b21752d5ba11d297f3a6531d832c.name = "Upgrade from 2.4.0" From e148d0e550b01537574048bf50f9078da5df3030 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Tue, 15 Aug 2023 13:44:03 +0200 Subject: [PATCH 11/11] Update upgrade --- scripts/upgrade | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index bbf006c..28dce37 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -23,7 +23,7 @@ upgrade_type=$(ynh_check_app_version_changed) ynh_script_progression --message="Ensuring downward compatibility..." --weight=1 # If language doesn't exist, create it -if [ -z "$language" ]; then +if [ -z "${language:-}" ]; then language="en-US" ynh_app_setting_set --app=$app --key=language --value=$language fi