From 9a63b64e32d0514bdef56d7ea8e7d9474b24333a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Wed, 31 Jul 2024 22:25:15 +0200 Subject: [PATCH 1/4] cleaning --- manifest.toml | 2 -- scripts/upgrade | 1 - 2 files changed, 3 deletions(-) diff --git a/manifest.toml b/manifest.toml index bce8eef..8f9c17f 100644 --- a/manifest.toml +++ b/manifest.toml @@ -60,8 +60,6 @@ ram.runtime = "50M" in_subdir = false format = "zip" - # autoupdate.strategy = "latest_gitea_release" - [resources.system_user] allow_email = true diff --git a/scripts/upgrade b/scripts/upgrade index 7c5da08..d168490 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -97,7 +97,6 @@ executable="$(find $install_dir -name "vikunja-*" \! -name "*.sha256")" mv "$executable" "$install_dir/vikunja" chmod +x "$install_dir/vikunja" - chmod -R o-rwx "$install_dir" chown -R $app:www-data "$install_dir" From 8a93dc6a48901de3dd5328b87a7b4f654585f510 Mon Sep 17 00:00:00 2001 From: Yunohost-Bot <> Date: Sat, 31 Aug 2024 03:09:10 +0200 Subject: [PATCH 2/4] [autopatch] Automatic patch attempt for helpers 2.1 --- manifest.toml | 3 +- scripts/_common.sh | 14 +------- scripts/backup | 23 ++++---------- scripts/change_url | 30 ++++++------------ scripts/install | 51 +++++++++++++----------------- scripts/remove | 18 ++++------- scripts/restore | 35 ++++++++------------ scripts/upgrade | 79 +++++++++++++++++++++++----------------------- 8 files changed, 101 insertions(+), 152 deletions(-) diff --git a/manifest.toml b/manifest.toml index bce8eef..c5a3b38 100644 --- a/manifest.toml +++ b/manifest.toml @@ -19,7 +19,8 @@ admindoc = "https://vikunja.io/docs/" code = "https://kolaente.dev/vikunja/vikunja" [integration] -yunohost = ">= 11.2.21" +yunohost = ">= 11.2.18" +helpers_version = "2.1" architectures = "all" multi_instance = true ldap = false diff --git a/scripts/_common.sh b/scripts/_common.sh index 944a65e..3d7f008 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -1,17 +1,5 @@ #!/bin/bash #================================================= -# COMMON VARIABLES -#================================================= - -#================================================= -# PERSONAL HELPERS -#================================================= - -#================================================= -# EXPERIMENTAL HELPERS -#================================================= - -#================================================= -# FUTURE OFFICIAL HELPERS +# COMMON VARIABLES AND CUSTOM HELPERS #================================================= diff --git a/scripts/backup b/scripts/backup index c711f03..587b47d 100644 --- a/scripts/backup +++ b/scripts/backup @@ -1,42 +1,33 @@ #!/bin/bash -#================================================= -# GENERIC START -#================================================= -# IMPORT GENERIC HELPERS -#================================================= - source ../settings/scripts/_common.sh source /usr/share/yunohost/helpers -#================================================= -# DECLARE DATA AND CONF FILES TO BACKUP -#================================================= -ynh_print_info --message="Declaring files to be backed up..." +ynh_print_info "Declaring files to be backed up..." #================================================= # BACKUP THE APP MAIN DIR #================================================= -ynh_backup --src_path="$install_dir" +ynh_backup "$install_dir" #================================================= # SYSTEM CONFIGURATION #================================================= -ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf" +ynh_backup "/etc/nginx/conf.d/$domain.d/$app.conf" -ynh_backup --src_path="/etc/systemd/system/$app.service" +ynh_backup "/etc/systemd/system/$app.service" #================================================= # BACKUP THE POSTGRESQL DATABASE #================================================= -ynh_print_info --message="Backing up the PostgreSQL database..." +ynh_print_info "Backing up the PostgreSQL database..." -ynh_psql_dump_db --database="$db_name" > db.sql +ynh_psql_dump_db > db.sql #================================================= # END OF SCRIPT #================================================= -ynh_print_info --message="Backup script completed for $app. (YunoHost will then actually copy those files to the archive)." +ynh_print_info "Backup script completed for $app. (YunoHost will then actually copy those files to the archive)." diff --git a/scripts/change_url b/scripts/change_url index e8cbf6f..7c11dd8 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -1,11 +1,5 @@ #!/bin/bash -#================================================= -# GENERIC STARTING -#================================================= -# IMPORT GENERIC HELPERS -#================================================= - source _common.sh source /usr/share/yunohost/helpers @@ -17,45 +11,41 @@ secret=$(ynh_string_random --length=32) timezone="$(cat /etc/timezone)" redis_db=$(ynh_redis_get_free_db) -#================================================= -# STANDARD MODIFICATIONS #================================================= # STOP SYSTEMD SERVICE #================================================= -ynh_script_progression --message="Stopping a systemd service..." --weight=1 +ynh_script_progression "Stopping $app's systemd service..." -ynh_systemd_action --service_name=$app --action=stop --log_path="systemd" +ynh_systemctl --service=$app --action=stop --log_path="systemd" #================================================= # MODIFY URL IN NGINX CONF #================================================= -ynh_script_progression --message="Updating NGINX web server configuration..." --weight=1 +ynh_script_progression "Updating NGINX web server configuration..." -ynh_change_url_nginx_config +ynh_config_change_url_nginx #================================================= # ADD A CONFIGURATION #================================================= -ynh_script_progression --message="Adding a configuration file..." --weight=1 +ynh_script_progression "Adding $app's configuration..." domain="$new_domain" path="$new_path" -ynh_add_config --template="config.yml" --destination="$install_dir/config.yml" +ynh_config_add --template="config.yml" --destination="$install_dir/config.yml" -chmod 600 "$install_dir/config.yml" +#REMOVEME? Assuming the file is setup using ynh_config_add, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chmod 600 "$install_dir/config.yml" -#================================================= -# GENERIC FINALISATION #================================================= # START SYSTEMD SERVICE #================================================= -ynh_script_progression --message="Starting a systemd service..." --weight=1 +ynh_script_progression "Starting $app's systemd service..." # Start a systemd service -ynh_systemd_action --service_name=$app --action=start --log_path=systemd +ynh_systemctl --service=$app --action=start --log_path=systemd #================================================= # END OF SCRIPT #================================================= -ynh_script_progression --message="Change of URL completed for $app" --last +ynh_script_progression "Change of URL completed for $app" diff --git a/scripts/install b/scripts/install index a3fae88..fd5b202 100644 --- a/scripts/install +++ b/scripts/install @@ -1,11 +1,5 @@ #!/bin/bash -#================================================= -# GENERIC START -#================================================= -# IMPORT GENERIC HELPERS -#================================================= - source _common.sh source /usr/share/yunohost/helpers @@ -31,20 +25,20 @@ maxitemsperpage=50 # STORE SETTINGS FROM MANIFEST #================================================= -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 -ynh_app_setting_set --app=$app --key=enable_taskattachments --value=$enable_taskattachments -ynh_app_setting_set --app=$app --key=enable_taskcomments --value=$enable_taskcomments -ynh_app_setting_set --app=$app --key=enable_emailreminders --value=$enable_emailreminders -ynh_app_setting_set --app=$app --key=enable_userdeletion --value=$enable_userdeletion -ynh_app_setting_set --app=$app --key=maxavatarsize --value=$maxavatarsize -ynh_app_setting_set --app=$app --key=maxitemsperpage --value=$maxitemsperpage +ynh_app_setting_set --key=set_motd --value=$set_motd +ynh_app_setting_set --key=enable_registration --value=$enable_registration +ynh_app_setting_set --key=enable_linksharing --value=$enable_linksharing +ynh_app_setting_set --key=enable_taskattachments --value=$enable_taskattachments +ynh_app_setting_set --key=enable_taskcomments --value=$enable_taskcomments +ynh_app_setting_set --key=enable_emailreminders --value=$enable_emailreminders +ynh_app_setting_set --key=enable_userdeletion --value=$enable_userdeletion +ynh_app_setting_set --key=maxavatarsize --value=$maxavatarsize +ynh_app_setting_set --key=maxitemsperpage --value=$maxitemsperpage #================================================= # INSTALL Vikunja #================================================= -ynh_script_progression --message="Setting up source files..." --weight=1 +ynh_script_progression "Setting up source files..." # Download, check integrity, uncompress and patch the source from app.src ynh_setup_source --dest_dir="$install_dir" @@ -52,40 +46,39 @@ executable="$(find $install_dir -name "vikunja-*" \! -name "*.sha256")" mv "$executable" "$install_dir/vikunja" chmod +x "$install_dir/vikunja" -chmod -R o-rwx "$install_dir" -chown -R $app:www-data "$install_dir" - +#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chmod -R o-rwx "$install_dir" +#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chown -R $app:www-data "$install_dir" #================================================= # ADD A CONFIGURATION #================================================= -ynh_script_progression --message="Adding a configuration file..." --weight=1 +ynh_script_progression "Adding $app's configuration..." -ynh_add_config --template="config.yml" --destination="$install_dir/config.yml" +ynh_config_add --template="config.yml" --destination="$install_dir/config.yml" -chmod 400 "$install_dir/config.yml" -chown "$app:$app" "$install_dir/config.yml" +#REMOVEME? Assuming the file is setup using ynh_config_add, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chmod 400 "$install_dir/config.yml" +#REMOVEME? Assuming the file is setup using ynh_config_add, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chown "$app:$app" "$install_dir/config.yml" #================================================= # SYSTEM CONFIGURATION #================================================= -ynh_script_progression --message="Adding system configurations related to $app..." --weight=1 +ynh_script_progression "Adding system configurations related to $app..." -ynh_add_nginx_config +ynh_config_add_nginx -ynh_add_systemd_config +ynh_config_add_systemd yunohost service add $app --description="Self-hosted To-Do list application" --log="/var/log/$app/$app.log" #================================================= # START SYSTEMD SERVICE #================================================= -ynh_script_progression --message="Starting $app's systemd service..." --weight=2 +ynh_script_progression "Starting $app's systemd service..." # Start a systemd service -ynh_systemd_action --service_name="$app" --action=start --log_path=systemd #--line_match="server started on" +ynh_systemctl --service="$app" --action=start --log_path=systemd #--wait_until="server started on" #================================================= # END OF SCRIPT #================================================= -ynh_script_progression --message="Installation of $app completed" --last +ynh_script_progression "Installation of $app completed" diff --git a/scripts/remove b/scripts/remove index e63c3ec..e518524 100644 --- a/scripts/remove +++ b/scripts/remove @@ -1,11 +1,5 @@ #!/bin/bash -#================================================= -# GENERIC START -#================================================= -# IMPORT GENERIC HELPERS -#================================================= - source _common.sh source /usr/share/yunohost/helpers @@ -14,25 +8,25 @@ source /usr/share/yunohost/helpers #================================================= # REMOVE SYSTEMD SERVICE #================================================= -ynh_script_progression --message="Removing system configurations related to $app..." --weight=1 +ynh_script_progression "Removing system configurations related to $app..." # 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 +if ynh_hide_warnings yunohost service status $app >/dev/null then - ynh_script_progression --message="Removing $app service..." --weight=1 + ynh_script_progression "Removing $app service..." yunohost service remove $app fi # Remove the dedicated systemd config -ynh_remove_systemd_config +ynh_config_remove_systemd ynh_redis_remove_db "$redis_db" # Remove the dedicated NGINX config -ynh_remove_nginx_config +ynh_config_remove_nginx #================================================= # END OF SCRIPT #================================================= -ynh_script_progression --message="Removal of $app completed" --last +ynh_script_progression "Removal of $app completed" diff --git a/scripts/restore b/scripts/restore index 72d6098..b25afff 100644 --- a/scripts/restore +++ b/scripts/restore @@ -1,58 +1,49 @@ #!/bin/bash -#================================================= -# GENERIC START -#================================================= -# IMPORT GENERIC HELPERS -#================================================= - source ../settings/scripts/_common.sh source /usr/share/yunohost/helpers #================================================= # RESTORE THE APP MAIN DIR #================================================= -ynh_script_progression --message="Restoring $app main directory..." --weight=4 +ynh_script_progression "Restoring $app main directory..." -ynh_restore_file --origin_path="$install_dir" - -chmod -R o-rwx "$install_dir" -chown -R "$app:www-data" "$install_dir" +ynh_restore "$install_dir" +#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chmod -R o-rwx "$install_dir" +#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chown -R "$app:www-data" "$install_dir" #================================================= # RESTORE THE POSTGRESQL DATABASE #================================================= -ynh_script_progression --message="Restoring the PostgreSQL database..." --weight=6 +ynh_script_progression "Restoring the PostgreSQL database..." -ynh_psql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < ./db.sql +ynh_psql_db_shell < ./db.sql #================================================= # RESTORE SYSTEM CONFIGURATIONS #================================================= # RESTORE THE PHP-FPM CONFIGURATION #================================================= -ynh_script_progression --message="Restoring system configurations related to $app..." --weight=1 +ynh_script_progression "Restoring system configurations related to $app..." -ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" +ynh_restore "/etc/nginx/conf.d/$domain.d/$app.conf" -ynh_restore_file --origin_path="/etc/systemd/system/$app.service" +ynh_restore "/etc/systemd/system/$app.service" systemctl enable $app.service --quiet yunohost service add $app --description="Self-hosted To-Do list application" --log="/var/log/$app/$app.log" -#================================================= -# GENERIC FINALIZATION #================================================= # RELOAD NGINX AND PHP-FPM OR THE APP SERVICE #================================================= -ynh_script_progression --message="Reloading NGINX web server and $app's service..." --weight=1 +ynh_script_progression "Reloading NGINX web server and $app's service..." -ynh_systemd_action --service_name=$app --action=start --log_path=systemd --line_match="server started on" +ynh_systemctl --service=$app --action=start --log_path=systemd --wait_until="server started on" -ynh_systemd_action --service_name=nginx --action=reload +ynh_systemctl --service=nginx --action=reload #================================================= # END OF SCRIPT #================================================= -ynh_script_progression --message="Restoration completed for $app" --last +ynh_script_progression "Restoration completed for $app" diff --git a/scripts/upgrade b/scripts/upgrade index 7c5da08..122d28b 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -1,11 +1,5 @@ #!/bin/bash -#================================================= -# GENERIC START -#================================================= -# IMPORT GENERIC HELPERS -#================================================= - source _common.sh source /usr/share/yunohost/helpers @@ -20,117 +14,124 @@ redis_db=$(ynh_redis_get_free_db) #================================================= # ENSURE DOWNWARD COMPATIBILITY #================================================= -ynh_script_progression --message="Ensuring downward compatibility..." --weight=1 +ynh_script_progression "Ensuring downward compatibility..." +# FIXMEhelpers2.1: maybe replace with: ynh_app_setting_set_default --key=set_motd --value="" if [ -z "${set_motd:-}" ]; then set_motd="" - ynh_app_setting_set --app="$app" --key="set_motd" --value="$set_motd" + ynh_app_setting_set --key="set_motd" --value="$set_motd" fi +# FIXMEhelpers2.1: maybe replace with: ynh_app_setting_set_default --key=enable_registration --value="true" if [ -z "${enable_registration:-}" ]; then enable_registration="true" - ynh_app_setting_set --app="$app" --key="enable_registration" --value="$enable_registration" + ynh_app_setting_set --key="enable_registration" --value="$enable_registration" fi +# FIXMEhelpers2.1: maybe replace with: ynh_app_setting_set_default --key=enable_linksharing --value="true" if [ -z "${enable_linksharing:-}" ]; then enable_linksharing="true" - ynh_app_setting_set --app="$app" --key="enable_linksharing" --value="$enable_linksharing" + ynh_app_setting_set --key="enable_linksharing" --value="$enable_linksharing" fi +# FIXMEhelpers2.1: maybe replace with: ynh_app_setting_set_default --key=enable_taskattachments --value="true" if [ -z "${enable_taskattachments:-}" ]; then enable_taskattachments="true" - ynh_app_setting_set --app="$app" --key="enable_taskattachments" --value="$enable_taskattachments" + ynh_app_setting_set --key="enable_taskattachments" --value="$enable_taskattachments" fi +# FIXMEhelpers2.1: maybe replace with: ynh_app_setting_set_default --key=enable_taskcomments --value="true" if [ -z "${enable_taskcomments:-}" ]; then enable_taskcomments="true" - ynh_app_setting_set --app="$app" --key="enable_taskcomments" --value="$enable_taskcomments" + ynh_app_setting_set --key="enable_taskcomments" --value="$enable_taskcomments" fi +# FIXMEhelpers2.1: maybe replace with: ynh_app_setting_set_default --key=enable_emailreminders --value="true" if [ -z "${enable_emailreminders:-}" ]; then enable_emailreminders="true" - ynh_app_setting_set --app="$app" --key="enable_emailreminders" --value="$enable_emailreminders" + ynh_app_setting_set --key="enable_emailreminders" --value="$enable_emailreminders" fi +# FIXMEhelpers2.1: maybe replace with: ynh_app_setting_set_default --key=enable_userdeletion --value="true" if [ -z "${enable_userdeletion:-}" ]; then enable_userdeletion="true" - ynh_app_setting_set --app="$app" --key="enable_userdeletion" --value="$enable_userdeletion" + ynh_app_setting_set --key="enable_userdeletion" --value="$enable_userdeletion" fi +# FIXMEhelpers2.1: maybe replace with: ynh_app_setting_set_default --key=maxavatarsize --value=1024 if [ -z "${maxavatarsize:-}" ]; then maxavatarsize=1024 - ynh_app_setting_set --app="$app" --key="maxavatarsize" --value="$maxavatarsize" + ynh_app_setting_set --key="maxavatarsize" --value="$maxavatarsize" fi +# FIXMEhelpers2.1: maybe replace with: ynh_app_setting_set_default --key=maxitemsperpage --value=50 if [ -z "${maxitemsperpage:-}" ]; then maxitemsperpage=50 - ynh_app_setting_set --app="$app" --key="maxitemsperpage" --value="$maxitemsperpage" + ynh_app_setting_set --key="maxitemsperpage" --value="$maxitemsperpage" fi +# FIXMEhelpers2.1: maybe replace with: ynh_app_setting_set_default --key=language --value="en" if [ -z "${language:-}" ]; then language="en" - ynh_app_setting_set --app="$app" --key="language" --value="$language" + ynh_app_setting_set --key="language" --value="$language" fi -if ynh_compare_current_package_version --comparison lt --version "0.23.0~ynh1"; then +if ynh_app_upgrading_from_version_before 0.23.0~ynh1; then mv "$backend_path/config.yml" "$install_dir/config.yml" - ynh_secure_remove "$backend_path" - ynh_app_setting_delete --app="$app" --key="backend_path" + ynh_safe_rm "$backend_path" + ynh_app_setting_delete --key="backend_path" fi -#================================================= -# STANDARD UPGRADE STEPS #================================================= # STOP SYSTEMD SERVICE #================================================= -ynh_script_progression --message="Stopping a systemd service..." --weight=1 +ynh_script_progression "Stopping $app's systemd service..." -ynh_systemd_action --service_name=$app --action=stop --log_path=systemd +ynh_systemctl --service=$app --action=stop --log_path=systemd #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= -ynh_script_progression --message="Upgrading source files..." --weight=5 +ynh_script_progression "Upgrading source files..." -ynh_setup_source --dest_dir="$install_dir" --full_replace=1 +ynh_setup_source --dest_dir="$install_dir" --full_replace executable="$(find $install_dir -name "vikunja-*" \! -name "*.sha256")" mv "$executable" "$install_dir/vikunja" chmod +x "$install_dir/vikunja" -chmod -R o-rwx "$install_dir" -chown -R $app:www-data "$install_dir" - +#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chmod -R o-rwx "$install_dir" +#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chown -R $app:www-data "$install_dir" #================================================= # UPDATE A CONFIG FILE #================================================= -ynh_script_progression --message="Updating $app's configuration files..." --weight=1 +ynh_script_progression "Updating $app's configuration files..." -ynh_add_config --template="config.yml" --destination="$install_dir/config.yml" +ynh_config_add --template="config.yml" --destination="$install_dir/config.yml" -chmod 400 "$install_dir/config.yml" -chown $app:$app "$install_dir/config.yml" +#REMOVEME? Assuming the file is setup using ynh_config_add, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chmod 400 "$install_dir/config.yml" +#REMOVEME? Assuming the file is setup using ynh_config_add, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chown $app:$app "$install_dir/config.yml" #================================================= # REAPPLY SYSTEM CONFIGURATIONS #================================================= -ynh_script_progression --message="Upgrading system configurations related to $app..." --weight=1 +ynh_script_progression "Upgrading system configurations related to $app..." -ynh_add_nginx_config +ynh_config_add_nginx -ynh_add_systemd_config +ynh_config_add_systemd yunohost service add $app --description="Self-hosted To-Do list application" --log="/var/log/$app/$app.log" #================================================= # START SYSTEMD SERVICE #================================================= -ynh_script_progression --message="Starting a systemd service..." --weight=1 +ynh_script_progression "Starting $app's systemd service..." -ynh_systemd_action --service_name=$app --action=start --log_path=systemd --line_match="server started on" +ynh_systemctl --service=$app --action=start --log_path=systemd --wait_until="server started on" #================================================= # END OF SCRIPT #================================================= -ynh_script_progression --message="Upgrade of $app completed" --last +ynh_script_progression "Upgrade of $app completed" From b978b23c87e495b99801dcc8b211c8dcbb97d2b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sat, 31 Aug 2024 09:04:32 +0200 Subject: [PATCH 3/4] cleaning --- manifest.toml | 5 +++- scripts/change_url | 3 --- scripts/install | 8 +----- scripts/remove | 3 --- scripts/restore | 4 --- scripts/upgrade | 65 +++++++--------------------------------------- 6 files changed, 15 insertions(+), 73 deletions(-) diff --git a/manifest.toml b/manifest.toml index c5a3b38..e693ed0 100644 --- a/manifest.toml +++ b/manifest.toml @@ -19,12 +19,15 @@ admindoc = "https://vikunja.io/docs/" code = "https://kolaente.dev/vikunja/vikunja" [integration] -yunohost = ">= 11.2.18" +yunohost = ">= 11.2.29" helpers_version = "2.1" architectures = "all" multi_instance = true + ldap = false + sso = false + disk = "50M" ram.build = "1500M" ram.runtime = "50M" diff --git a/scripts/change_url b/scripts/change_url index 7c11dd8..9b2a49c 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -34,14 +34,11 @@ domain="$new_domain" path="$new_path" ynh_config_add --template="config.yml" --destination="$install_dir/config.yml" -#REMOVEME? Assuming the file is setup using ynh_config_add, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chmod 600 "$install_dir/config.yml" - #================================================= # START SYSTEMD SERVICE #================================================= ynh_script_progression "Starting $app's systemd service..." -# Start a systemd service ynh_systemctl --service=$app --action=start --log_path=systemd #================================================= diff --git a/scripts/install b/scripts/install index fd5b202..f7b3736 100644 --- a/scripts/install +++ b/scripts/install @@ -40,14 +40,12 @@ ynh_app_setting_set --key=maxitemsperpage --value=$maxitemsperpage #================================================= ynh_script_progression "Setting up source files..." -# Download, check integrity, uncompress and patch the source from app.src ynh_setup_source --dest_dir="$install_dir" executable="$(find $install_dir -name "vikunja-*" \! -name "*.sha256")" mv "$executable" "$install_dir/vikunja" chmod +x "$install_dir/vikunja" -#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chmod -R o-rwx "$install_dir" -#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chown -R $app:www-data "$install_dir" + #================================================= # ADD A CONFIGURATION #================================================= @@ -55,9 +53,6 @@ ynh_script_progression "Adding $app's configuration..." ynh_config_add --template="config.yml" --destination="$install_dir/config.yml" -#REMOVEME? Assuming the file is setup using ynh_config_add, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chmod 400 "$install_dir/config.yml" -#REMOVEME? Assuming the file is setup using ynh_config_add, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chown "$app:$app" "$install_dir/config.yml" - #================================================= # SYSTEM CONFIGURATION #================================================= @@ -74,7 +69,6 @@ yunohost service add $app --description="Self-hosted To-Do list application" --l #================================================= ynh_script_progression "Starting $app's systemd service..." -# Start a systemd service ynh_systemctl --service="$app" --action=start --log_path=systemd #--wait_until="server started on" #================================================= diff --git a/scripts/remove b/scripts/remove index e518524..43a52f5 100644 --- a/scripts/remove +++ b/scripts/remove @@ -10,19 +10,16 @@ source /usr/share/yunohost/helpers #================================================= ynh_script_progression "Removing system configurations related to $app..." -# Remove the service from the list of services known by YunoHost (added from `yunohost service add`) if ynh_hide_warnings yunohost service status $app >/dev/null then ynh_script_progression "Removing $app service..." yunohost service remove $app fi -# Remove the dedicated systemd config ynh_config_remove_systemd ynh_redis_remove_db "$redis_db" -# Remove the dedicated NGINX config ynh_config_remove_nginx #================================================= diff --git a/scripts/restore b/scripts/restore index b25afff..96d547c 100644 --- a/scripts/restore +++ b/scripts/restore @@ -10,8 +10,6 @@ ynh_script_progression "Restoring $app main directory..." ynh_restore "$install_dir" -#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chmod -R o-rwx "$install_dir" -#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chown -R "$app:www-data" "$install_dir" #================================================= # RESTORE THE POSTGRESQL DATABASE #================================================= @@ -22,8 +20,6 @@ ynh_psql_db_shell < ./db.sql #================================================= # RESTORE SYSTEM CONFIGURATIONS #================================================= -# RESTORE THE PHP-FPM CONFIGURATION -#================================================= ynh_script_progression "Restoring system configurations related to $app..." ynh_restore "/etc/nginx/conf.d/$domain.d/$app.conf" diff --git a/scripts/upgrade b/scripts/upgrade index 122d28b..eee2642 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -16,65 +16,25 @@ redis_db=$(ynh_redis_get_free_db) #================================================= ynh_script_progression "Ensuring downward compatibility..." -# FIXMEhelpers2.1: maybe replace with: ynh_app_setting_set_default --key=set_motd --value="" -if [ -z "${set_motd:-}" ]; then - set_motd="" - ynh_app_setting_set --key="set_motd" --value="$set_motd" -fi +ynh_app_setting_set_default --key=set_motd --value="" -# FIXMEhelpers2.1: maybe replace with: ynh_app_setting_set_default --key=enable_registration --value="true" -if [ -z "${enable_registration:-}" ]; then - enable_registration="true" - ynh_app_setting_set --key="enable_registration" --value="$enable_registration" -fi +ynh_app_setting_set_default --key=enable_registration --value="true" -# FIXMEhelpers2.1: maybe replace with: ynh_app_setting_set_default --key=enable_linksharing --value="true" -if [ -z "${enable_linksharing:-}" ]; then - enable_linksharing="true" - ynh_app_setting_set --key="enable_linksharing" --value="$enable_linksharing" -fi +ynh_app_setting_set_default --key=enable_linksharing --value="true" -# FIXMEhelpers2.1: maybe replace with: ynh_app_setting_set_default --key=enable_taskattachments --value="true" -if [ -z "${enable_taskattachments:-}" ]; then - enable_taskattachments="true" - ynh_app_setting_set --key="enable_taskattachments" --value="$enable_taskattachments" -fi +ynh_app_setting_set_default --key=enable_taskattachments --value="true" -# FIXMEhelpers2.1: maybe replace with: ynh_app_setting_set_default --key=enable_taskcomments --value="true" -if [ -z "${enable_taskcomments:-}" ]; then - enable_taskcomments="true" - ynh_app_setting_set --key="enable_taskcomments" --value="$enable_taskcomments" -fi +ynh_app_setting_set_default --key=enable_taskcomments --value="true" -# FIXMEhelpers2.1: maybe replace with: ynh_app_setting_set_default --key=enable_emailreminders --value="true" -if [ -z "${enable_emailreminders:-}" ]; then - enable_emailreminders="true" - ynh_app_setting_set --key="enable_emailreminders" --value="$enable_emailreminders" -fi +ynh_app_setting_set_default --key=enable_emailreminders --value="true" -# FIXMEhelpers2.1: maybe replace with: ynh_app_setting_set_default --key=enable_userdeletion --value="true" -if [ -z "${enable_userdeletion:-}" ]; then - enable_userdeletion="true" - ynh_app_setting_set --key="enable_userdeletion" --value="$enable_userdeletion" -fi +ynh_app_setting_set_default --key=enable_userdeletion --value="true" -# FIXMEhelpers2.1: maybe replace with: ynh_app_setting_set_default --key=maxavatarsize --value=1024 -if [ -z "${maxavatarsize:-}" ]; then - maxavatarsize=1024 - ynh_app_setting_set --key="maxavatarsize" --value="$maxavatarsize" -fi +ynh_app_setting_set_default --key=maxavatarsize --value=1024 -# FIXMEhelpers2.1: maybe replace with: ynh_app_setting_set_default --key=maxitemsperpage --value=50 -if [ -z "${maxitemsperpage:-}" ]; then - maxitemsperpage=50 - ynh_app_setting_set --key="maxitemsperpage" --value="$maxitemsperpage" -fi +ynh_app_setting_set_default --key=maxitemsperpage --value=50 -# FIXMEhelpers2.1: maybe replace with: ynh_app_setting_set_default --key=language --value="en" -if [ -z "${language:-}" ]; then - language="en" - ynh_app_setting_set --key="language" --value="$language" -fi +ynh_app_setting_set_default --key=language --value="en" if ynh_app_upgrading_from_version_before 0.23.0~ynh1; then mv "$backend_path/config.yml" "$install_dir/config.yml" @@ -100,8 +60,6 @@ mv "$executable" "$install_dir/vikunja" chmod +x "$install_dir/vikunja" -#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chmod -R o-rwx "$install_dir" -#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chown -R $app:www-data "$install_dir" #================================================= # UPDATE A CONFIG FILE #================================================= @@ -109,9 +67,6 @@ ynh_script_progression "Updating $app's configuration files..." ynh_config_add --template="config.yml" --destination="$install_dir/config.yml" -#REMOVEME? Assuming the file is setup using ynh_config_add, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chmod 400 "$install_dir/config.yml" -#REMOVEME? Assuming the file is setup using ynh_config_add, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chown $app:$app "$install_dir/config.yml" - #================================================= # REAPPLY SYSTEM CONFIGURATIONS #================================================= From 5177e3b9f3072693a798e0e9957814f8ce472b61 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Sat, 31 Aug 2024 07:05:18 +0000 Subject: [PATCH 4/4] Auto-update READMEs --- ALL_README.md | 1 + README_ru.md | 58 +++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 59 insertions(+) create mode 100644 README_ru.md diff --git a/ALL_README.md b/ALL_README.md index 4ed64dd..e3c80d2 100644 --- a/ALL_README.md +++ b/ALL_README.md @@ -6,4 +6,5 @@ - [Lire le README en français](README_fr.md) - [Le o README en galego](README_gl.md) - [Baca README dalam bahasa bahasa Indonesia](README_id.md) +- [Прочитать README на русский](README_ru.md) - [阅读中文(简体)的 README](README_zh_Hans.md) diff --git a/README_ru.md b/README_ru.md new file mode 100644 index 0000000..0198908 --- /dev/null +++ b/README_ru.md @@ -0,0 +1,58 @@ + + +# Vikunja для YunoHost + +[![Уровень интеграции](https://dash.yunohost.org/integration/vikunja.svg)](https://ci-apps.yunohost.org/ci/apps/vikunja/) ![Состояние работы](https://ci-apps.yunohost.org/ci/badges/vikunja.status.svg) ![Состояние сопровождения](https://ci-apps.yunohost.org/ci/badges/vikunja.maintain.svg) + +[![Установите Vikunja с YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=vikunja) + +*[Прочтите этот README на других языках.](./ALL_README.md)* + +> *Этот пакет позволяет Вам установить Vikunja быстро и просто на YunoHost-сервер.* +> *Если у Вас нет YunoHost, пожалуйста, посмотрите [инструкцию](https://yunohost.org/install), чтобы узнать, как установить его.* + +## Обзор + +Vikunja is a self-hosted open-source to-do list application for all platforms. + +### Features + +- Stay organized +- Collaborate with peers +- Tasks +- Kanban board +- CalDAV +- Links + +**Поставляемая версия:** 0.24.1~ynh3 + +**Демо-версия:** + +## Снимки экрана + +![Снимок экрана Vikunja](./doc/screenshots/kanban.png) + +## Документация и ресурсы + +- Официальный веб-сайт приложения: +- Официальная документация администратора: +- Репозиторий кода главной ветки приложения: +- Магазин YunoHost: +- Сообщите об ошибке: + +## Информация для разработчиков + +Пришлите Ваш запрос на слияние в [ветку `testing`](https://github.com/YunoHost-Apps/vikunja_ynh/tree/testing). + +Чтобы попробовать ветку `testing`, пожалуйста, сделайте что-то вроде этого: + +```bash +sudo yunohost app install https://github.com/YunoHost-Apps/vikunja_ynh/tree/testing --debug +или +sudo yunohost app upgrade vikunja -u https://github.com/YunoHost-Apps/vikunja_ynh/tree/testing --debug +``` + +**Больше информации о пакетировании приложений:**