From 39e45952c45dd401aaa009b1b96deb358dc0511e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Fri, 27 Oct 2023 09:10:05 +0200 Subject: [PATCH 01/12] mail --- conf/config.yml | 4 ++-- manifest.toml | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/conf/config.yml b/conf/config.yml index 907adf5..a77fc4e 100644 --- a/conf/config.yml +++ b/conf/config.yml @@ -138,9 +138,9 @@ mailer: # SMTP Auth Type. Can be either `plain`, `login` or `cram-md5`. authtype: "plain" # SMTP username - username: "" + username: "__APP__" # SMTP password - password: "" + password: "__MAIL_PWD__" # Wether to skip verification of the tls certificate on the server skiptlsverify: true # The default from address when sending emails diff --git a/manifest.toml b/manifest.toml index def0311..464c2d7 100644 --- a/manifest.toml +++ b/manifest.toml @@ -65,6 +65,7 @@ ram.runtime = "50M" [resources.ports] [resources.system_user] + allow_email = true [resources.install_dir] From 9a8f6c3905a246cccfe5966b397a8396c021f210 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Fri, 27 Oct 2023 09:12:57 +0200 Subject: [PATCH 02/12] cleaning --- scripts/change_url | 2 +- scripts/install | 15 ++------------- scripts/restore | 23 ++--------------------- scripts/upgrade | 11 ----------- 4 files changed, 5 insertions(+), 46 deletions(-) diff --git a/scripts/change_url b/scripts/change_url index db32764..a639a04 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -24,7 +24,7 @@ redis_db=$(ynh_redis_get_free_db) #================================================= ynh_script_progression --message="Stopping a systemd service..." --weight=1 -ynh_systemd_action --service_name=$app --action=stop --log_path="/var/log/$app/$app.log" +ynh_systemd_action --service_name=$app --action=stop --log_path="systemd" #================================================= # MODIFY URL IN NGINX CONF diff --git a/scripts/install b/scripts/install index c95c5d9..cd72d20 100644 --- a/scripts/install +++ b/scripts/install @@ -76,14 +76,6 @@ cp "$back" "$backend_path/vikunja" chmod +x "$backend_path/vikunja" chown -R $app:www-data "$backend_path/files" -#================================================= -# NGINX CONFIGURATION -#================================================= -ynh_script_progression --message="Configuring NGINX web server..." --weight=3 - -# Create a dedicated NGINX config -ynh_add_nginx_config - #================================================= # ADD A CONFIGURATION #================================================= @@ -100,12 +92,9 @@ chown $app:$app "$backend_path/config.yml" #================================================= ynh_script_progression --message="Configuring a systemd service..." --weight=1 -ynh_add_systemd_config +ynh_add_nginx_config -#================================================= -# INTEGRATE SERVICE IN YUNOHOST -#================================================= -ynh_script_progression --message="Integrating service in YunoHost..." --weight=1 +ynh_add_systemd_config yunohost service add $app --description="Self-hosted To-Do list application" --log="/var/log/$app/$app.log" diff --git a/scripts/restore b/scripts/restore index df9e294..e999a4d 100644 --- a/scripts/restore +++ b/scripts/restore @@ -9,15 +9,6 @@ source ../settings/scripts/_common.sh source /usr/share/yunohost/helpers -#================================================= -# STANDARD RESTORATION STEPS -#================================================= -# RESTORE THE NGINX CONFIGURATION -#================================================= -ynh_script_progression --message="Restoring the NGINX configuration..." --weight=1 - -ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" - #================================================= # RESTORE THE APP MAIN DIR #================================================= @@ -46,14 +37,11 @@ ynh_psql_execute_file_as_root --file="./db.sql" --database=$db_name #================================================= ynh_script_progression --message="Restoring the systemd configuration..." --weight=5 +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..." - yunohost service add $app --description="Self-hosted To-Do list application" --log="/var/log/$app/$app.log" #================================================= @@ -63,13 +51,6 @@ ynh_script_progression --message="Starting a systemd service..." --weight=1 ynh_systemd_action --service_name=$app --action=start --log_path=systemd --line_match="server started on" -#================================================= -# GENERIC FINALIZATION -#================================================= -# RELOAD NGINX -#================================================= -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 ec696e5..97abbec 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -100,7 +100,6 @@ if [ "$upgrade_type" == "UPGRADE_APP" ] then ynh_script_progression --message="Upgrading source files..." --weight=5 - # Download, check integrity, uncompress and patch the source from app.src # Frontend ynh_setup_source --dest_dir="$install_dir" --source_id="front" @@ -136,18 +135,8 @@ ynh_script_progression --message="Upgrading NGINX web server configuration..." - # Create a dedicated NGINX config ynh_add_nginx_config -#================================================= -# SETUP SYSTEMD -#================================================= -ynh_script_progression --message="Configuring a systemd service..." --weight=2 - ynh_add_systemd_config -#================================================= -# INTEGRATE SERVICE IN YUNOHOST -#================================================= -ynh_script_progression --message="Integrating service in YunoHost..." - yunohost service add $app --description="Self-hosted To-Do list application" --log="/var/log/$app/$app.log" #================================================= From 79df6a303bc7185319ff81833b47e801f0adf176 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Fri, 27 Oct 2023 07:13:02 +0000 Subject: [PATCH 03/12] Auto-update README --- README.md | 1 + README_fr.md | 1 + 2 files changed, 2 insertions(+) diff --git a/README.md b/README.md index 1574329..aaba6db 100644 --- a/README.md +++ b/README.md @@ -40,6 +40,7 @@ Vikunja is a self-hosted open-source to-do list application for all platforms. * Official app website: * Official admin documentation: * Upstream app code repository: +* YunoHost Store: * Report a bug: ## Developer info diff --git a/README_fr.md b/README_fr.md index 60bae26..8cf5cbe 100644 --- a/README_fr.md +++ b/README_fr.md @@ -40,6 +40,7 @@ Vikunja est une application de liste de tâches Open Source auto-hébergée pour * Site officiel de l’app : * Documentation officielle de l’admin : * Dépôt de code officiel de l’app : +* YunoHost Store: * Signaler un bug : ## Informations pour les développeurs From 684c17dd0ca6845c84919e64ca43982ef1b172f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Fri, 27 Oct 2023 09:20:57 +0200 Subject: [PATCH 04/12] cleaning --- manifest.toml | 4 ++-- scripts/install | 37 +++++++++++++++---------------------- scripts/remove | 25 +++---------------------- scripts/restore | 14 +++++++++----- scripts/upgrade | 5 ++--- 5 files changed, 31 insertions(+), 54 deletions(-) diff --git a/manifest.toml b/manifest.toml index 464c2d7..2b4a8bc 100644 --- a/manifest.toml +++ b/manifest.toml @@ -5,7 +5,7 @@ name = "Vikunja" description.en = "Self-hosted To-Do list application" description.fr = "Application de liste de tâches auto-hébergée" -version = "0.21.0~ynh4" +version = "0.21.0~ynh5" maintainers = ["eric_G"] @@ -41,7 +41,7 @@ ram.runtime = "50M" ask.fr = "Choisissez la langue de l'application" type = "select" choices = ["de", "en", "es", "fa", "fr", "it", "lt", "nl", "pl", "pt"] - default = "en" + default = "fr" [resources] diff --git a/scripts/install b/scripts/install index cd72d20..30293fd 100644 --- a/scripts/install +++ b/scripts/install @@ -15,6 +15,8 @@ source /usr/share/yunohost/helpers timezone="$(cat /etc/timezone)" secret=$(ynh_string_random --length=32) +redis_db=$(ynh_redis_get_free_db) +backend_path=/opt/$app set_motd="" enable_registration="true" @@ -26,16 +28,11 @@ enable_userdeletion="true" maxavatarsize=1024 maxitemsperpage=50 -#================================================= -# CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS -#================================================= - -backend_path=/opt/$app - #================================================= # STORE SETTINGS FROM MANIFEST #================================================= +ynh_app_setting_set --app=$app --key=backend_path --value=$backend_path ynh_app_setting_set --app=$app --key=set_motd --value=$set_motd ynh_app_setting_set --app=$app --key=enable_registration --value=$enable_registration ynh_app_setting_set --app=$app --key=enable_linksharing --value=$enable_linksharing @@ -54,7 +51,6 @@ ynh_script_progression --message="Setting up frontend..." --weight=1 # Download, check integrity, uncompress and patch the source from app.src ynh_setup_source --dest_dir="$install_dir" --source_id="front" -chmod 750 "$install_dir" chmod -R o-rwx "$install_dir" chown -R $app:www-data "$install_dir" @@ -63,8 +59,6 @@ chown -R $app:www-data "$install_dir" #================================================= ynh_script_progression --message="Setting up backend..." --weight=1 -ynh_app_setting_set --app=$app --key=backend_path --value=$backend_path - # Download, check integrity, uncompress and patch the source from app.src mkdir -p "$backend_path" mkdir -p "$backend_path/files" @@ -77,20 +71,9 @@ chmod +x "$backend_path/vikunja" chown -R $app:www-data "$backend_path/files" #================================================= -# ADD A CONFIGURATION +# SYSTEM CONFIGURATION #================================================= -ynh_script_progression --message="Adding a configuration file..." --weight=1 - -redis_db=$(ynh_redis_get_free_db) -ynh_add_config --template="../conf/config.yml" --destination="$backend_path/config.yml" - -chmod 400 "$backend_path/config.yml" -chown $app:$app "$backend_path/config.yml" - -#================================================= -# SETUP SYSTEMD -#================================================= -ynh_script_progression --message="Configuring a systemd service..." --weight=1 +ynh_script_progression --message="Adding system configurations related to $app..." --weight=1 ynh_add_nginx_config @@ -98,6 +81,16 @@ ynh_add_systemd_config yunohost service add $app --description="Self-hosted To-Do list application" --log="/var/log/$app/$app.log" +#================================================= +# ADD A CONFIGURATION +#================================================= +ynh_script_progression --message="Adding a configuration file..." --weight=1 + +ynh_add_config --template="config.yml" --destination="$backend_path/config.yml" + +chmod 400 "$backend_path/config.yml" +chown $app:$app "$backend_path/config.yml" + #================================================= # START SYSTEMD SERVICE #================================================= diff --git a/scripts/remove b/scripts/remove index 31c3e17..0e09476 100644 --- 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,34 +23,14 @@ 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 THE REDIS DATABASE -#================================================= -ynh_script_progression --message="Removing the redis database..." - ynh_redis_remove_db "$redis_db" -#================================================= -# REMOVE APP MAIN DIR -#================================================= -ynh_script_progression --message="Removing $app main directory..." --weight=6 - # Remove backend ynh_secure_remove --file="$backend_path" -#================================================= -# REMOVE NGINX CONFIGURATION -#================================================= -ynh_script_progression --message="Removing NGINX web server configuration..." --weight=5 - # Remove the dedicated NGINX config ynh_remove_nginx_config diff --git a/scripts/restore b/scripts/restore index e999a4d..8e89323 100644 --- a/scripts/restore +++ b/scripts/restore @@ -30,12 +30,14 @@ chown -R $app:www-data "$backend_path/files" #================================================= ynh_script_progression --message="Restoring the PostgreSQL database..." --weight=6 -ynh_psql_execute_file_as_root --file="./db.sql" --database=$db_name +ynh_psql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < ./db.sql #================================================= -# RESTORE SYSTEMD +# RESTORE SYSTEM CONFIGURATIONS #================================================= -ynh_script_progression --message="Restoring the systemd configuration..." --weight=5 +# 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" @@ -45,9 +47,11 @@ systemctl enable $app.service --quiet yunohost service add $app --description="Self-hosted To-Do list application" --log="/var/log/$app/$app.log" #================================================= -# START SYSTEMD SERVICE +# GENERIC FINALIZATION #================================================= -ynh_script_progression --message="Starting a systemd service..." --weight=1 +# RELOAD NGINX AND PHP-FPM OR THE APP SERVICE +#================================================= +ynh_script_progression --message="Reloading NGINX web server and $app's service..." --weight=1 ynh_systemd_action --service_name=$app --action=start --log_path=systemd --line_match="server started on" diff --git a/scripts/upgrade b/scripts/upgrade index 97abbec..69bd6b6 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -15,6 +15,7 @@ source /usr/share/yunohost/helpers timezone="$(cat /etc/timezone)" secret=$(ynh_string_random --length=32) +redis_db=$(ynh_redis_get_free_db) #================================================= # CHECK VERSION @@ -121,8 +122,7 @@ chown -R $app:www-data "$backend_path/files" #================================================= ynh_script_progression --message="Upgrading a configuration file..." --weight=1 -redis_db=$(ynh_redis_get_free_db) -ynh_add_config --template="../conf/config.yml" --destination="$backend_path/config.yml" +ynh_add_config --template="config.yml" --destination="$backend_path/config.yml" chmod 400 "$backend_path/config.yml" chown $app:$app "$backend_path/config.yml" @@ -132,7 +132,6 @@ chown $app:$app "$backend_path/config.yml" #================================================= ynh_script_progression --message="Upgrading NGINX web server configuration..." --weight=2 -# Create a dedicated NGINX config ynh_add_nginx_config ynh_add_systemd_config From d64660e826cccc7d20e12ce67687530d91c1040f Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Fri, 27 Oct 2023 07:21:08 +0000 Subject: [PATCH 05/12] 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 aaba6db..58be5a4 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ Vikunja is a self-hosted open-source to-do list application for all platforms. - CalDAV - Links -**Shipped version:** 0.21.0~ynh4 +**Shipped version:** 0.21.0~ynh5 **Demo:** https://try.vikunja.io/login diff --git a/README_fr.md b/README_fr.md index 8cf5cbe..81a87d1 100644 --- a/README_fr.md +++ b/README_fr.md @@ -27,7 +27,7 @@ Vikunja est une application de liste de tâches Open Source auto-hébergée pour - CalDAV - Links -**Version incluse :** 0.21.0~ynh4 +**Version incluse :** 0.21.0~ynh5 **Démo :** https://try.vikunja.io/login From b54d794bc5e704bbf423885855c9e37eee9c335a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Fri, 27 Oct 2023 09:36:28 +0200 Subject: [PATCH 06/12] Update config.yml --- conf/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/config.yml b/conf/config.yml index a77fc4e..c642ee8 100644 --- a/conf/config.yml +++ b/conf/config.yml @@ -345,4 +345,4 @@ defaultsettings: # The language of the user interface. Must be an ISO 639-1 language code. Will default to the browser language the user uses when signing up. language: __LANGUAGE__ # The time zone of each individual user. This will affect when users get reminders and overdue task emails. - timezone: