From fc1b20c1426175c2194927f34fc9a9f0c534657a Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Tue, 27 Aug 2024 03:52:08 +0200 Subject: [PATCH 1/6] Upgrade sources - `main` v7.56: https://github.com/wekan/wekan/releases/tag/v7.56 --- manifest.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/manifest.toml b/manifest.toml index de8083f..ea367f4 100644 --- a/manifest.toml +++ b/manifest.toml @@ -5,7 +5,7 @@ name = "Wekan" description.en = "Trello-like kanban" description.fr = "Kanban similaire à Trello" -version = "7.54~ynh1" +version = "7.56~ynh1" maintainers = ["alexAubin", "ljf", "yalh76"] @@ -46,8 +46,8 @@ ram.runtime = "50M" [resources] [resources.sources.main] - amd64.url = "https://github.com/wekan/wekan/releases/download/v7.54/wekan-7.54-amd64.zip" - amd64.sha256 = "18f10a6b86897605ac355d37fdea51e3651ddbf4bdd161b89a0ebc2260000b8d" + amd64.url = "https://github.com/wekan/wekan/releases/download/v7.56/wekan-7.56-amd64.zip" + amd64.sha256 = "9811a870743d1b4ad28fdb27f5d1592ee8825ec386992d3ef1009e99dc09e225" autoupdate.strategy = "latest_github_release" autoupdate.asset.amd64 = ".*-amd64.zip" From 34ce31b73bb7ca1321f7a04c8844d78e1cf71e2c Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Tue, 27 Aug 2024 01:52:10 +0000 Subject: [PATCH 2/6] Auto-update READMEs --- ALL_README.md | 1 + README.md | 2 +- README_es.md | 2 +- README_eu.md | 2 +- README_fr.md | 2 +- README_gl.md | 2 +- README_id.md | 2 +- README_ru.md | 50 +++++++++++++++++++++++++++++++++++++++++++++++ README_zh_Hans.md | 2 +- 9 files changed, 58 insertions(+), 7 deletions(-) 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.md b/README.md index 1319486..fa4bf68 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ It shall NOT be edited by hand. WeKan is an completely Open Source and Free software collaborative kanban board application. -**Shipped version:** 7.54~ynh1 +**Shipped version:** 7.56~ynh1 **Demo:** diff --git a/README_es.md b/README_es.md index 29781a3..0d8ebc4 100644 --- a/README_es.md +++ b/README_es.md @@ -19,7 +19,7 @@ No se debe editar a mano. WeKan is an completely Open Source and Free software collaborative kanban board application. -**Versión actual:** 7.54~ynh1 +**Versión actual:** 7.56~ynh1 **Demo:** diff --git a/README_eu.md b/README_eu.md index c5f62f0..c168d9c 100644 --- a/README_eu.md +++ b/README_eu.md @@ -19,7 +19,7 @@ EZ editatu eskuz. WeKan is an completely Open Source and Free software collaborative kanban board application. -**Paketatutako bertsioa:** 7.54~ynh1 +**Paketatutako bertsioa:** 7.56~ynh1 **Demoa:** diff --git a/README_fr.md b/README_fr.md index 4d84fc0..eab000c 100644 --- a/README_fr.md +++ b/README_fr.md @@ -19,7 +19,7 @@ Il NE doit PAS être modifié à la main. WeKan est une application de tableau kanban collaborative entièrement libre et open source. -**Version incluse :** 7.54~ynh1 +**Version incluse :** 7.56~ynh1 **Démo :** diff --git a/README_gl.md b/README_gl.md index dca2787..8dd974f 100644 --- a/README_gl.md +++ b/README_gl.md @@ -19,7 +19,7 @@ NON debe editarse manualmente. WeKan is an completely Open Source and Free software collaborative kanban board application. -**Versión proporcionada:** 7.54~ynh1 +**Versión proporcionada:** 7.56~ynh1 **Demo:** diff --git a/README_id.md b/README_id.md index 30293a6..80e6545 100644 --- a/README_id.md +++ b/README_id.md @@ -19,7 +19,7 @@ Ini TIDAK boleh diedit dengan tangan. WeKan is an completely Open Source and Free software collaborative kanban board application. -**Versi terkirim:** 7.54~ynh1 +**Versi terkirim:** 7.56~ynh1 **Demo:** diff --git a/README_ru.md b/README_ru.md new file mode 100644 index 0000000..838c4ce --- /dev/null +++ b/README_ru.md @@ -0,0 +1,50 @@ + + +# Wekan для YunoHost + +[![Уровень интеграции](https://dash.yunohost.org/integration/wekan.svg)](https://ci-apps.yunohost.org/ci/apps/wekan/) ![Состояние работы](https://ci-apps.yunohost.org/ci/badges/wekan.status.svg) ![Состояние сопровождения](https://ci-apps.yunohost.org/ci/badges/wekan.maintain.svg) + +[![Установите Wekan с YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=wekan) + +*[Прочтите этот README на других языках.](./ALL_README.md)* + +> *Этот пакет позволяет Вам установить Wekan быстро и просто на YunoHost-сервер.* +> *Если у Вас нет YunoHost, пожалуйста, посмотрите [инструкцию](https://yunohost.org/install), чтобы узнать, как установить его.* + +## Обзор + +WeKan is an completely Open Source and Free software collaborative kanban board application. + + +**Поставляемая версия:** 7.56~ynh1 + +**Демо-версия:** + +## Снимки экрана + +![Снимок экрана Wekan](./doc/screenshots/screenshot.jpg) + +## Документация и ресурсы + +- Официальный веб-сайт приложения: +- Официальная документация администратора: +- Репозиторий кода главной ветки приложения: +- Магазин YunoHost: +- Сообщите об ошибке: + +## Информация для разработчиков + +Пришлите Ваш запрос на слияние в [ветку `testing`](https://github.com/YunoHost-Apps/wekan_ynh/tree/testing). + +Чтобы попробовать ветку `testing`, пожалуйста, сделайте что-то вроде этого: + +```bash +sudo yunohost app install https://github.com/YunoHost-Apps/wekan_ynh/tree/testing --debug +или +sudo yunohost app upgrade wekan -u https://github.com/YunoHost-Apps/wekan_ynh/tree/testing --debug +``` + +**Больше информации о пакетировании приложений:** diff --git a/README_zh_Hans.md b/README_zh_Hans.md index 31196d6..8a9611d 100644 --- a/README_zh_Hans.md +++ b/README_zh_Hans.md @@ -19,7 +19,7 @@ WeKan is an completely Open Source and Free software collaborative kanban board application. -**分发版本:** 7.54~ynh1 +**分发版本:** 7.56~ynh1 **演示:** From fb91bfa17d62c52636eff8d60e5b67222a2afe14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Thu, 29 Aug 2024 14:09:19 +0200 Subject: [PATCH 3/6] Update _common.sh --- scripts/_common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index 04438b0..fd5c41a 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -5,7 +5,7 @@ #================================================= nodejs_version="14" -mongo_version="7.0" +mongo_version="6.0" #================================================= # PERSONAL HELPERS From 935d344270e9c651014a8f03fe0891675f43d9c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Thu, 29 Aug 2024 14:19:08 +0200 Subject: [PATCH 4/6] cleaning --- .gitignore | 3 +++ conf/.env | 2 +- conf/systemd.service | 2 +- manifest.toml | 3 ++- scripts/_common.sh | 14 +---------- scripts/backup | 23 ++++++------------ scripts/change_url | 34 +++++++++----------------- scripts/install | 46 +++++++++++++++-------------------- scripts/remove | 18 +++++--------- scripts/restore | 42 +++++++++++++------------------- scripts/upgrade | 58 ++++++++++++++++++-------------------------- 11 files changed, 92 insertions(+), 153 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..8f144f3 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +*~ +*.sw[op] +.DS_Store diff --git a/conf/.env b/conf/.env index 7198df0..e922483 100644 --- a/conf/.env +++ b/conf/.env @@ -8,7 +8,7 @@ NODE_ENV=production WRITABLE_PATH=__INSTALL_DIR__ # The path to NODEJS -__YNH_NODE_LOAD_PATH__ +PATH=__PATH_WITH_NODEJS__ #--------------------------------------------- # Debug OIDC OAuth2 etc. #DEBUG=true diff --git a/conf/systemd.service b/conf/systemd.service index 148183a..f9d7608 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -9,7 +9,7 @@ User=__APP__ Group=__APP__ EnvironmentFile=__INSTALL_DIR__/.env WorkingDirectory=__INSTALL_DIR__/ -ExecStart=__YNH_NODE__ __INSTALL_DIR__/main.js +ExecStart=__NODEJS_DIR__/node __INSTALL_DIR__/main.js Restart=on-failure SuccessExitStatus=143 #RestartSec=10 diff --git a/manifest.toml b/manifest.toml index ea367f4..eb221e2 100644 --- a/manifest.toml +++ b/manifest.toml @@ -17,7 +17,8 @@ admindoc = "https://github.com/wekan/wekan/wiki" code = "https://github.com/wekan/wekan" [integration] -yunohost = ">= 11.2.20" +yunohost = ">= 11.2.18" +helpers_version = "2.1" architectures = ["amd64"] multi_instance = true diff --git a/scripts/_common.sh b/scripts/_common.sh index fd5c41a..4b7802d 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -1,20 +1,8 @@ #!/bin/bash #================================================= -# COMMON VARIABLES +# COMMON VARIABLES AND CUSTOM HELPERS #================================================= nodejs_version="14" mongo_version="6.0" - -#================================================= -# PERSONAL HELPERS -#================================================= - -#================================================= -# EXPERIMENTAL HELPERS -#================================================= - -#================================================= -# FUTURE OFFICIAL HELPERS -#================================================= diff --git a/scripts/backup b/scripts/backup index a67eaaf..a0087cd 100644 --- a/scripts/backup +++ b/scripts/backup @@ -1,43 +1,34 @@ #!/bin/bash -#================================================= -# GENERIC START -#================================================= -# IMPORT GENERIC HELPERS -#================================================= - # Keep this path for calling _common.sh inside the execution's context of backup and restore scripts 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" #================================================= # BACKUP THE NGINX 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 MONGODB DATABASE #================================================= -ynh_print_info --message="Backing up the MongoDB database..." +ynh_print_info "Backing up the MongoDB database..." -ynh_mongo_dump_db --database="$db_name" > ./dump.bson +ynh_mongo_dump_db > ./dump.bson #================================================= # 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 7614f0b..96aa3e0 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -1,52 +1,42 @@ #!/bin/bash -#================================================= -# GENERIC STARTING -#================================================= -# IMPORT GENERIC HELPERS -#================================================= - source _common.sh source /usr/share/yunohost/helpers -#================================================= -# STANDARD MODIFICATIONS #================================================= # STOP SYSTEMD SERVICE #================================================= -ynh_script_progression --message="Stopping a systemd service..." +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..." +ynh_script_progression "Updating NGINX web server configuration..." -ynh_change_url_nginx_config +ynh_config_change_url_nginx #================================================= # SPECIFIC MODIFICATIONS #================================================= # MODIFY URL IN .ENV #================================================= -ynh_script_progression --message="Updating .env configuration..." +ynh_script_progression "Updating .env configuration..." -ynh_backup_if_checksum_is_different --file="$install_dir/.env" -ynh_replace_string --match_string="$old_domain$old_path" --replace_string="$new_domain$new_path" --target_file="$install_dir/.env" -ynh_store_file_checksum --file="$install_dir/.env" +ynh_backup_if_checksum_is_different "$install_dir/.env" +ynh_replace --match="$old_domain$old_path" --replace="$new_domain$new_path" --file="$install_dir/.env" +ynh_store_file_checksum "$install_dir/.env" -#================================================= -# GENERIC FINALISATION #================================================= # START SYSTEMD SERVICE #================================================= -ynh_script_progression --message="Starting a systemd service..." +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="Enabling LDAP Background Sync" +ynh_systemctl --service=$app --action="start" --log_path=systemd --wait_until="Enabling LDAP Background Sync" -#if [ ${PACKAGE_CHECK_EXEC:-0} -eq 1 ]; then +#if ynh_in_ci_tests; then # sleep 60 #fi @@ -54,4 +44,4 @@ ynh_systemd_action --service_name=$app --action="start" --log_path=systemd --lin # END OF SCRIPT #================================================= -ynh_script_progression --message="Change of URL completed for $app" +ynh_script_progression "Change of URL completed for $app" diff --git a/scripts/install b/scripts/install index 7898dcf..7e3ed4e 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 @@ -14,44 +8,42 @@ main_domain=$(cat /etc/yunohost/current_host) #================================================= # INSTALL DEPENDENCIES #================================================= -ynh_script_progression --message="Installing dependencies..." +ynh_script_progression "Installing dependencies..." -ynh_install_nodejs --nodejs_version=$nodejs_version -ynh_use_nodejs +ynh_nodejs_install #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= -ynh_script_progression --message="Setting up source files..." +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" -chmod -R o-rwx "$install_dir" -chown -R $app:$app "$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:$app "$install_dir" #================================================= # CREATE A MONGODB DATABASE #================================================= -ynh_script_progression --message="Creating a MongoDB database..." +ynh_script_progression "Creating a MongoDB database..." db_name=$(ynh_sanitize_dbid --db_name=$app) db_user=$db_name -ynh_app_setting_set --app=$app --key=db_name --value=$db_name +ynh_app_setting_set --key=db_name --value=$db_name -ynh_install_mongo --mongo_version=$mongo_version +ynh_install_mongo ynh_mongo_setup_db --db_user=$db_user --db_name=$db_name #================================================= # NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Configuring NGINX web server..." +ynh_script_progression "Configuring NGINX web server..." # Create a dedicated NGINX config -ynh_add_nginx_config +ynh_config_add_nginx # Create a dedicated systemd config -ynh_add_systemd_config +ynh_config_add_systemd yunohost service add $app --description="Wekan daemon" --log="/var/log/$app/$app.log" @@ -60,22 +52,22 @@ yunohost service add $app --description="Wekan daemon" --log="/var/log/$app/$app #================================================= # ADD A CONFIGURATION #================================================= -ynh_script_progression --message="Adding a config file..." +ynh_script_progression "Adding a config file..." -ynh_add_config --template=".env" --destination="$install_dir/.env" +ynh_config_add --template=".env" --destination="$install_dir/.env" -chmod 400 "$install_dir/.env" -chown $app:$app "$install_dir/.env" +#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/.env" +#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/.env" #================================================= # START SYSTEMD SERVICE #================================================= -ynh_script_progression --message="Starting a systemd service..." +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="Enabling LDAP Background Sync" +ynh_systemctl --service=$app --action="start" --log_path=systemd --wait_until="Enabling LDAP Background Sync" -#if [ ${PACKAGE_CHECK_EXEC:-0} -eq 1 ]; then +#if ynh_in_ci_tests; then # sleep 60 #fi @@ -83,4 +75,4 @@ ynh_systemd_action --service_name=$app --action="start" --log_path=systemd --lin # END OF SCRIPT #================================================= -ynh_script_progression --message="Installation of $app completed" +ynh_script_progression "Installation of $app completed" diff --git a/scripts/remove b/scripts/remove index 26100a7..d394f94 100755 --- 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 @@ -16,27 +10,27 @@ source /usr/share/yunohost/helpers #================================================= # 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 integration..." + ynh_script_progression "Removing $app service integration..." yunohost service remove $app fi # Remove the dedicated systemd config -ynh_remove_systemd_config +ynh_config_remove_systemd # Remove a database if it exists, along with the associated user ynh_mongo_remove_db --db_user=$db_user --db_name=$db_name ynh_remove_mongo # Remove the dedicated NGINX config -ynh_remove_nginx_config +ynh_config_remove_nginx # Remove metapackage and its dependencies -ynh_remove_nodejs +ynh_nodejs_remove #================================================= # END OF SCRIPT #================================================= -ynh_script_progression --message="Removal of $app completed" +ynh_script_progression "Removal of $app completed" diff --git a/scripts/restore b/scripts/restore index 389d031..868f327 100644 --- a/scripts/restore +++ b/scripts/restore @@ -1,51 +1,43 @@ #!/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 the app main directory..." +ynh_script_progression "Restoring the app main directory..." -ynh_restore_file --origin_path="$install_dir" - -chmod -R o-rwx "$install_dir" -chown -R $app:$app "$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:$app "$install_dir" #================================================= # SPECIFIC RESTORATION #================================================= # REINSTALL DEPENDENCIES #================================================= -ynh_script_progression --message="Reinstalling dependencies..." +ynh_script_progression "Reinstalling dependencies..." # Define and install dependencies -ynh_install_nodejs --nodejs_version=$nodejs_version -ynh_use_nodejs +ynh_nodejs_install #================================================= # RESTORE THE MONGODB DATABASE #================================================= -ynh_script_progression --message="Restoring the MongoDB database..." +ynh_script_progression "Restoring the MongoDB database..." -ynh_install_mongo --mongo_version=$mongo_version -ynh_mongo_restore_db --database="$db_name" < ./dump.bson +ynh_install_mongo +ynh_mongo_restore_db < ./dump.bson #================================================= # RESTORE THE NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Restoring the NGINX web server configuration..." +ynh_script_progression "Restoring the NGINX web server configuration..." -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="Wekan daemon" --log="/var/log/$app/$app.log" @@ -53,18 +45,18 @@ yunohost service add $app --description="Wekan daemon" --log="/var/log/$app/$app #================================================= # START SYSTEMD SERVICE #================================================= -ynh_script_progression --message="Starting a systemd service..." +ynh_script_progression "Starting $app's systemd service..." -ynh_systemd_action --service_name=$app --action="start" --log_path=systemd --line_match="Enabling LDAP Background Sync" +ynh_systemctl --service=$app --action="start" --log_path=systemd --wait_until="Enabling LDAP Background Sync" -#if [ ${PACKAGE_CHECK_EXEC:-0} -eq 1 ]; then +#if ynh_in_ci_tests; then # sleep 60 #fi -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" +ynh_script_progression "Restoration completed for $app" diff --git a/scripts/upgrade b/scripts/upgrade index b24d7d5..b5352fb 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -1,93 +1,81 @@ #!/bin/bash -#================================================= -# GENERIC START -#================================================= -# IMPORT GENERIC HELPERS -#================================================= - source _common.sh source /usr/share/yunohost/helpers main_domain=$(cat /etc/yunohost/current_host) -#================================================= -# STANDARD UPGRADE STEPS #================================================= # STOP SYSTEMD SERVICE #================================================= -ynh_script_progression --message="Stopping a systemd service..." +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 #================================================= # ENSURE DOWNWARD COMPATIBILITY #================================================= -ynh_script_progression --message="Ensuring downward compatibility..." +ynh_script_progression "Ensuring downward compatibility..." # If mongo_version doesn't exist, create it if [ -z "$mongo_version" ]; then mongo_version="$(mongod --version | grep -oP 'db version v\K.{0,3}')" - ynh_app_setting_set --app=$app --key=mongo_version --value=$mongo_version + ynh_app_setting_set --key=mongo_version --value=$mongo_version fi -ynh_secure_remove --file="/etc/apt/sources.list.d/mongodb-org-3.2.list" -ynh_secure_remove --file="/etc/apt/sources.list.d/mongodb-org-4.4.list" +ynh_safe_rm "/etc/apt/sources.list.d/mongodb-org-3.2.list" +ynh_safe_rm "/etc/apt/sources.list.d/mongodb-org-4.4.list" #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= -ynh_script_progression --message="Upgrading source files..." +ynh_script_progression "Upgrading source files..." # Download, check integrity, uncompress and patch the source from app.src ynh_setup_source --dest_dir="$install_dir" --keep=".env" -chmod -R o-rwx "$install_dir" -chown -R $app:$app "$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:$app "$install_dir" #================================================= # UPGRADE DEPENDENCIES #================================================= -ynh_script_progression --message="Upgrading dependencies..." +ynh_script_progression "Upgrading dependencies..." -ynh_install_nodejs --nodejs_version=$nodejs_version -ynh_use_nodejs +ynh_nodejs_install -ynh_install_mongo --mongo_version=$mongo_version +ynh_install_mongo #================================================= # NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Upgrading NGINX web server configuration..." +ynh_script_progression "Upgrading NGINX web server configuration..." # Create a dedicated NGINX config -ynh_add_nginx_config +ynh_config_add_nginx # Create a dedicated systemd config -ynh_add_systemd_config +ynh_config_add_systemd yunohost service add $app --description="Wekan daemon" --log="/var/log/$app/$app.log" -#================================================= -# SPECIFIC UPGRADE #================================================= # UPDATE A CONFIG FILE #================================================= -ynh_script_progression --message="Updating a configuration file..." +ynh_script_progression "Updating configuration..." -ynh_add_config --template=".env" --destination="$install_dir/.env" +ynh_config_add --template=".env" --destination="$install_dir/.env" -chmod 400 "$install_dir/.env" -chown $app:$app "$install_dir/.env" +#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/.env" +#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/.env" #================================================= # START SYSTEMD SERVICE #================================================= -ynh_script_progression --message="Starting a systemd service..." +ynh_script_progression "Starting $app's systemd service..." -ynh_systemd_action --service_name=$app --action="start" --log_path=systemd --line_match="Enabling LDAP Background Sync" +ynh_systemctl --service=$app --action="start" --log_path=systemd --wait_until="Enabling LDAP Background Sync" -#if [ ${PACKAGE_CHECK_EXEC:-0} -eq 1 ]; then +#if ynh_in_ci_tests; then # sleep 60 #fi @@ -95,4 +83,4 @@ ynh_systemd_action --service_name=$app --action="start" --log_path=systemd --lin # END OF SCRIPT #================================================= -ynh_script_progression --message="Upgrade of $app completed" +ynh_script_progression "Upgrade of $app completed" From 22bbb5ff27eb57bee5ebdb7f18d8d89c763e72ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Thu, 29 Aug 2024 14:21:36 +0200 Subject: [PATCH 5/6] cleaning --- manifest.toml | 2 +- scripts/install | 8 -------- scripts/remove | 4 ---- scripts/restore | 7 ------- scripts/upgrade | 10 +--------- 5 files changed, 2 insertions(+), 29 deletions(-) diff --git a/manifest.toml b/manifest.toml index eb221e2..31a59e4 100644 --- a/manifest.toml +++ b/manifest.toml @@ -17,7 +17,7 @@ admindoc = "https://github.com/wekan/wekan/wiki" code = "https://github.com/wekan/wekan" [integration] -yunohost = ">= 11.2.18" +yunohost = ">= 11.2.29" helpers_version = "2.1" architectures = ["amd64"] multi_instance = true diff --git a/scripts/install b/scripts/install index 7e3ed4e..ae532c3 100644 --- a/scripts/install +++ b/scripts/install @@ -17,11 +17,8 @@ ynh_nodejs_install #================================================= 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" -#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:$app "$install_dir" #================================================= # CREATE A MONGODB DATABASE #================================================= @@ -39,10 +36,8 @@ ynh_mongo_setup_db --db_user=$db_user --db_name=$db_name #================================================= ynh_script_progression "Configuring NGINX web server..." -# Create a dedicated NGINX config ynh_config_add_nginx -# Create a dedicated systemd config ynh_config_add_systemd yunohost service add $app --description="Wekan daemon" --log="/var/log/$app/$app.log" @@ -56,9 +51,6 @@ ynh_script_progression "Adding a config file..." ynh_config_add --template=".env" --destination="$install_dir/.env" -#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/.env" -#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/.env" - #================================================= # START SYSTEMD SERVICE #================================================= diff --git a/scripts/remove b/scripts/remove index d394f94..91aefd1 100755 --- a/scripts/remove +++ b/scripts/remove @@ -9,24 +9,20 @@ source /usr/share/yunohost/helpers # REMOVE SERVICE INTEGRATION IN YUNOHOST #================================================= -# 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 integration..." yunohost service remove $app fi -# Remove the dedicated systemd config ynh_config_remove_systemd # Remove a database if it exists, along with the associated user ynh_mongo_remove_db --db_user=$db_user --db_name=$db_name ynh_remove_mongo -# Remove the dedicated NGINX config ynh_config_remove_nginx -# Remove metapackage and its dependencies ynh_nodejs_remove #================================================= diff --git a/scripts/restore b/scripts/restore index 868f327..dd13a52 100644 --- a/scripts/restore +++ b/scripts/restore @@ -10,8 +10,6 @@ ynh_script_progression "Restoring the 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:$app "$install_dir" #================================================= # SPECIFIC RESTORATION #================================================= @@ -19,7 +17,6 @@ ynh_restore "$install_dir" #================================================= ynh_script_progression "Reinstalling dependencies..." -# Define and install dependencies ynh_nodejs_install #================================================= @@ -49,10 +46,6 @@ ynh_script_progression "Starting $app's systemd service..." ynh_systemctl --service=$app --action="start" --log_path=systemd --wait_until="Enabling LDAP Background Sync" -#if ynh_in_ci_tests; then -# sleep 60 -#fi - ynh_systemctl --service=nginx --action=reload #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index b5352fb..87f582e 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -31,11 +31,8 @@ ynh_safe_rm "/etc/apt/sources.list.d/mongodb-org-4.4.list" #================================================= ynh_script_progression "Upgrading source files..." -# Download, check integrity, uncompress and patch the source from app.src -ynh_setup_source --dest_dir="$install_dir" --keep=".env" +ynh_setup_source --dest_dir="$install_dir" --keep=".env" -#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:$app "$install_dir" #================================================= # UPGRADE DEPENDENCIES #================================================= @@ -50,10 +47,8 @@ ynh_install_mongo #================================================= ynh_script_progression "Upgrading NGINX web server configuration..." -# Create a dedicated NGINX config ynh_config_add_nginx -# Create a dedicated systemd config ynh_config_add_systemd yunohost service add $app --description="Wekan daemon" --log="/var/log/$app/$app.log" @@ -65,9 +60,6 @@ ynh_script_progression "Updating configuration..." ynh_config_add --template=".env" --destination="$install_dir/.env" -#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/.env" -#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/.env" - #================================================= # START SYSTEMD SERVICE #================================================= From 99439a5d76739df7d919923aa77bf5793c32492a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Thu, 29 Aug 2024 14:42:37 +0200 Subject: [PATCH 6/6] Update upgrade --- scripts/upgrade | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index 87f582e..0814af3 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -31,7 +31,7 @@ ynh_safe_rm "/etc/apt/sources.list.d/mongodb-org-4.4.list" #================================================= ynh_script_progression "Upgrading source files..." -ynh_setup_source --dest_dir="$install_dir" --keep=".env" +ynh_setup_source --dest_dir="$install_dir" --full_replace --keep=".env" #================================================= # UPGRADE DEPENDENCIES