diff --git a/README.md b/README.md index 47d62ba..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.0~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 114c69f..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.0~ynh1 +**Version incluse :** 2.4.1~ynh2 **Démo :** https://app.umami.is/share/8rmHaheU/umami.is 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 5499633..f3c9819 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~ynh2" maintainers = ["eric_G"] @@ -29,20 +29,26 @@ ram.runtime = "50M" [install] [install.domain] type = "domain" - full_domain = true [install.init_main_permission] type = "group" default = "visitors" + [install.language] + ask.en = "Choose the application language" + ask.fr = "Choisissez la langue de l'application" + type = "select" + choices = ["de-DE", "it-IT", "fr-FR", "en-US"] + default = "fr-FR" + [resources] [resources.sources] [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] 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..28dce37 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 #================================================= diff --git a/tests.toml b/tests.toml index 2a807c8..50c4bd1 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 @@ -12,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"