1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/wekan_ynh.git synced 2024-09-03 20:36:09 +02:00
This commit is contained in:
eric_G 2024-08-29 12:42:40 +00:00 committed by GitHub
commit 6c4e2bede8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
20 changed files with 144 additions and 181 deletions

3
.gitignore vendored Normal file
View file

@ -0,0 +1,3 @@
*~
*.sw[op]
.DS_Store

View file

@ -6,4 +6,5 @@
- [Lire le README en français](README_fr.md) - [Lire le README en français](README_fr.md)
- [Le o README en galego](README_gl.md) - [Le o README en galego](README_gl.md)
- [Baca README dalam bahasa bahasa Indonesia](README_id.md) - [Baca README dalam bahasa bahasa Indonesia](README_id.md)
- [Прочитать README на русский](README_ru.md)
- [阅读中文(简体)的 README](README_zh_Hans.md) - [阅读中文(简体)的 README](README_zh_Hans.md)

View file

@ -19,7 +19,7 @@ It shall NOT be edited by hand.
WeKan is an completely Open Source and Free software collaborative kanban board application. WeKan is an completely Open Source and Free software collaborative kanban board application.
**Shipped version:** 7.54~ynh1 **Shipped version:** 7.56~ynh1
**Demo:** <https://demo.sandstorm.io/appdemo/m86q05rdvj14yvn78ghaxynqz7u2svw6rnttptxx49g1785cdv1h> **Demo:** <https://demo.sandstorm.io/appdemo/m86q05rdvj14yvn78ghaxynqz7u2svw6rnttptxx49g1785cdv1h>

View file

@ -19,7 +19,7 @@ No se debe editar a mano.
WeKan is an completely Open Source and Free software collaborative kanban board application. 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:** <https://demo.sandstorm.io/appdemo/m86q05rdvj14yvn78ghaxynqz7u2svw6rnttptxx49g1785cdv1h> **Demo:** <https://demo.sandstorm.io/appdemo/m86q05rdvj14yvn78ghaxynqz7u2svw6rnttptxx49g1785cdv1h>

View file

@ -19,7 +19,7 @@ EZ editatu eskuz.
WeKan is an completely Open Source and Free software collaborative kanban board application. WeKan is an completely Open Source and Free software collaborative kanban board application.
**Paketatutako bertsioa:** 7.54~ynh1 **Paketatutako bertsioa:** 7.56~ynh1
**Demoa:** <https://demo.sandstorm.io/appdemo/m86q05rdvj14yvn78ghaxynqz7u2svw6rnttptxx49g1785cdv1h> **Demoa:** <https://demo.sandstorm.io/appdemo/m86q05rdvj14yvn78ghaxynqz7u2svw6rnttptxx49g1785cdv1h>

View file

@ -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. 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:** <https://demo.sandstorm.io/appdemo/m86q05rdvj14yvn78ghaxynqz7u2svw6rnttptxx49g1785cdv1h> **Démo:** <https://demo.sandstorm.io/appdemo/m86q05rdvj14yvn78ghaxynqz7u2svw6rnttptxx49g1785cdv1h>

View file

@ -19,7 +19,7 @@ NON debe editarse manualmente.
WeKan is an completely Open Source and Free software collaborative kanban board application. 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:** <https://demo.sandstorm.io/appdemo/m86q05rdvj14yvn78ghaxynqz7u2svw6rnttptxx49g1785cdv1h> **Demo:** <https://demo.sandstorm.io/appdemo/m86q05rdvj14yvn78ghaxynqz7u2svw6rnttptxx49g1785cdv1h>

View file

@ -19,7 +19,7 @@ Ini TIDAK boleh diedit dengan tangan.
WeKan is an completely Open Source and Free software collaborative kanban board application. WeKan is an completely Open Source and Free software collaborative kanban board application.
**Versi terkirim:** 7.54~ynh1 **Versi terkirim:** 7.56~ynh1
**Demo:** <https://demo.sandstorm.io/appdemo/m86q05rdvj14yvn78ghaxynqz7u2svw6rnttptxx49g1785cdv1h> **Demo:** <https://demo.sandstorm.io/appdemo/m86q05rdvj14yvn78ghaxynqz7u2svw6rnttptxx49g1785cdv1h>

50
README_ru.md Normal file
View file

@ -0,0 +1,50 @@
<!--
Важно: этот README был автоматически сгенерирован <https://github.com/YunoHost/apps/tree/master/tools/readme_generator>
Он НЕ ДОЛЖЕН редактироваться вручную.
-->
# 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
**Демо-версия:** <https://demo.sandstorm.io/appdemo/m86q05rdvj14yvn78ghaxynqz7u2svw6rnttptxx49g1785cdv1h>
## Снимки экрана
![Снимок экрана Wekan](./doc/screenshots/screenshot.jpg)
## Документация и ресурсы
- Официальный веб-сайт приложения: <https://wekan.github.io>
- Официальная документация администратора: <https://github.com/wekan/wekan/wiki>
- Репозиторий кода главной ветки приложения: <https://github.com/wekan/wekan>
- Магазин YunoHost: <https://apps.yunohost.org/app/wekan>
- Сообщите об ошибке: <https://github.com/YunoHost-Apps/wekan_ynh/issues>
## Информация для разработчиков
Пришлите Ваш запрос на слияние в [ветку `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
```
**Больше информации о пакетировании приложений:** <https://yunohost.org/packaging_apps>

View file

@ -19,7 +19,7 @@
WeKan is an completely Open Source and Free software collaborative kanban board application. WeKan is an completely Open Source and Free software collaborative kanban board application.
**分发版本:** 7.54~ynh1 **分发版本:** 7.56~ynh1
**演示:** <https://demo.sandstorm.io/appdemo/m86q05rdvj14yvn78ghaxynqz7u2svw6rnttptxx49g1785cdv1h> **演示:** <https://demo.sandstorm.io/appdemo/m86q05rdvj14yvn78ghaxynqz7u2svw6rnttptxx49g1785cdv1h>

View file

@ -8,7 +8,7 @@ NODE_ENV=production
WRITABLE_PATH=__INSTALL_DIR__ WRITABLE_PATH=__INSTALL_DIR__
# The path to NODEJS # The path to NODEJS
__YNH_NODE_LOAD_PATH__ PATH=__PATH_WITH_NODEJS__
#--------------------------------------------- #---------------------------------------------
# Debug OIDC OAuth2 etc. # Debug OIDC OAuth2 etc.
#DEBUG=true #DEBUG=true

View file

@ -9,7 +9,7 @@ User=__APP__
Group=__APP__ Group=__APP__
EnvironmentFile=__INSTALL_DIR__/.env EnvironmentFile=__INSTALL_DIR__/.env
WorkingDirectory=__INSTALL_DIR__/ WorkingDirectory=__INSTALL_DIR__/
ExecStart=__YNH_NODE__ __INSTALL_DIR__/main.js ExecStart=__NODEJS_DIR__/node __INSTALL_DIR__/main.js
Restart=on-failure Restart=on-failure
SuccessExitStatus=143 SuccessExitStatus=143
#RestartSec=10 #RestartSec=10

View file

@ -5,7 +5,7 @@ name = "Wekan"
description.en = "Trello-like kanban" description.en = "Trello-like kanban"
description.fr = "Kanban similaire à Trello" description.fr = "Kanban similaire à Trello"
version = "7.54~ynh1" version = "7.56~ynh1"
maintainers = ["alexAubin", "ljf", "yalh76"] maintainers = ["alexAubin", "ljf", "yalh76"]
@ -17,7 +17,8 @@ admindoc = "https://github.com/wekan/wekan/wiki"
code = "https://github.com/wekan/wekan" code = "https://github.com/wekan/wekan"
[integration] [integration]
yunohost = ">= 11.2.20" yunohost = ">= 11.2.29"
helpers_version = "2.1"
architectures = ["amd64"] architectures = ["amd64"]
multi_instance = true multi_instance = true
@ -46,8 +47,8 @@ ram.runtime = "50M"
[resources] [resources]
[resources.sources.main] [resources.sources.main]
amd64.url = "https://github.com/wekan/wekan/releases/download/v7.54/wekan-7.54-amd64.zip" amd64.url = "https://github.com/wekan/wekan/releases/download/v7.56/wekan-7.56-amd64.zip"
amd64.sha256 = "18f10a6b86897605ac355d37fdea51e3651ddbf4bdd161b89a0ebc2260000b8d" amd64.sha256 = "9811a870743d1b4ad28fdb27f5d1592ee8825ec386992d3ef1009e99dc09e225"
autoupdate.strategy = "latest_github_release" autoupdate.strategy = "latest_github_release"
autoupdate.asset.amd64 = ".*-amd64.zip" autoupdate.asset.amd64 = ".*-amd64.zip"

View file

@ -1,20 +1,8 @@
#!/bin/bash #!/bin/bash
#================================================= #=================================================
# COMMON VARIABLES # COMMON VARIABLES AND CUSTOM HELPERS
#================================================= #=================================================
nodejs_version="14" nodejs_version="14"
mongo_version="7.0" mongo_version="6.0"
#=================================================
# PERSONAL HELPERS
#=================================================
#=================================================
# EXPERIMENTAL HELPERS
#=================================================
#=================================================
# FUTURE OFFICIAL HELPERS
#=================================================

View file

@ -1,43 +1,34 @@
#!/bin/bash #!/bin/bash
#=================================================
# GENERIC START
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
# Keep this path for calling _common.sh inside the execution's context of backup and restore scripts # Keep this path for calling _common.sh inside the execution's context of backup and restore scripts
source ../settings/scripts/_common.sh source ../settings/scripts/_common.sh
source /usr/share/yunohost/helpers source /usr/share/yunohost/helpers
#================================================= ynh_print_info "Declaring files to be backed up..."
# DECLARE DATA AND CONF FILES TO BACKUP
#=================================================
ynh_print_info --message="Declaring files to be backed up..."
#================================================= #=================================================
# BACKUP THE APP MAIN DIR # BACKUP THE APP MAIN DIR
#================================================= #=================================================
ynh_backup --src_path="$install_dir" ynh_backup "$install_dir"
#================================================= #=================================================
# BACKUP THE NGINX CONFIGURATION # 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 # 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 # 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)."

View file

@ -1,52 +1,42 @@
#!/bin/bash #!/bin/bash
#=================================================
# GENERIC STARTING
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
source _common.sh source _common.sh
source /usr/share/yunohost/helpers source /usr/share/yunohost/helpers
#=================================================
# STANDARD MODIFICATIONS
#================================================= #=================================================
# STOP SYSTEMD SERVICE # 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 # 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 # SPECIFIC MODIFICATIONS
#================================================= #=================================================
# MODIFY URL IN .ENV # 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_backup_if_checksum_is_different "$install_dir/.env"
ynh_replace_string --match_string="$old_domain$old_path" --replace_string="$new_domain$new_path" --target_file="$install_dir/.env" ynh_replace --match="$old_domain$old_path" --replace="$new_domain$new_path" --file="$install_dir/.env"
ynh_store_file_checksum --file="$install_dir/.env" ynh_store_file_checksum "$install_dir/.env"
#=================================================
# GENERIC FINALISATION
#================================================= #=================================================
# START SYSTEMD SERVICE # START SYSTEMD SERVICE
#================================================= #=================================================
ynh_script_progression --message="Starting a systemd service..." ynh_script_progression "Starting $app's systemd service..."
# Start a 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 # sleep 60
#fi #fi
@ -54,4 +44,4 @@ ynh_systemd_action --service_name=$app --action="start" --log_path=systemd --lin
# END OF SCRIPT # END OF SCRIPT
#================================================= #=================================================
ynh_script_progression --message="Change of URL completed for $app" ynh_script_progression "Change of URL completed for $app"

View file

@ -1,11 +1,5 @@
#!/bin/bash #!/bin/bash
#=================================================
# GENERIC START
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
source _common.sh source _common.sh
source /usr/share/yunohost/helpers source /usr/share/yunohost/helpers
@ -14,44 +8,37 @@ main_domain=$(cat /etc/yunohost/current_host)
#================================================= #=================================================
# INSTALL DEPENDENCIES # INSTALL DEPENDENCIES
#================================================= #=================================================
ynh_script_progression --message="Installing dependencies..." ynh_script_progression "Installing dependencies..."
ynh_install_nodejs --nodejs_version=$nodejs_version ynh_nodejs_install
ynh_use_nodejs
#================================================= #=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE # 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" ynh_setup_source --dest_dir="$install_dir"
chmod -R o-rwx "$install_dir"
chown -R $app:$app "$install_dir"
#================================================= #=================================================
# CREATE A MONGODB DATABASE # 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_name=$(ynh_sanitize_dbid --db_name=$app)
db_user=$db_name 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 ynh_mongo_setup_db --db_user=$db_user --db_name=$db_name
#================================================= #=================================================
# NGINX CONFIGURATION # NGINX CONFIGURATION
#================================================= #=================================================
ynh_script_progression --message="Configuring NGINX web server..." ynh_script_progression "Configuring NGINX web server..."
# Create a dedicated NGINX config ynh_config_add_nginx
ynh_add_nginx_config
# Create a dedicated systemd config ynh_config_add_systemd
ynh_add_systemd_config
yunohost service add $app --description="Wekan daemon" --log="/var/log/$app/$app.log" yunohost service add $app --description="Wekan daemon" --log="/var/log/$app/$app.log"
@ -60,22 +47,19 @@ yunohost service add $app --description="Wekan daemon" --log="/var/log/$app/$app
#================================================= #=================================================
# ADD A CONFIGURATION # 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"
#================================================= #=================================================
# START SYSTEMD SERVICE # START SYSTEMD SERVICE
#================================================= #=================================================
ynh_script_progression --message="Starting a systemd service..." ynh_script_progression "Starting $app's systemd service..."
# Start a 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 # sleep 60
#fi #fi
@ -83,4 +67,4 @@ ynh_systemd_action --service_name=$app --action="start" --log_path=systemd --lin
# END OF SCRIPT # END OF SCRIPT
#================================================= #=================================================
ynh_script_progression --message="Installation of $app completed" ynh_script_progression "Installation of $app completed"

View file

@ -1,11 +1,5 @@
#!/bin/bash #!/bin/bash
#=================================================
# GENERIC START
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
source _common.sh source _common.sh
source /usr/share/yunohost/helpers source /usr/share/yunohost/helpers
@ -15,28 +9,24 @@ source /usr/share/yunohost/helpers
# REMOVE SERVICE INTEGRATION IN YUNOHOST # 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
if ynh_exec_warn_less yunohost service status $app >/dev/null
then then
ynh_script_progression --message="Removing $app service integration..." ynh_script_progression "Removing $app service integration..."
yunohost service remove $app yunohost service remove $app
fi fi
# Remove the dedicated systemd config ynh_config_remove_systemd
ynh_remove_systemd_config
# Remove a database if it exists, along with the associated user # Remove a database if it exists, along with the associated user
ynh_mongo_remove_db --db_user=$db_user --db_name=$db_name ynh_mongo_remove_db --db_user=$db_user --db_name=$db_name
ynh_remove_mongo ynh_remove_mongo
# Remove the dedicated NGINX config ynh_config_remove_nginx
ynh_remove_nginx_config
# Remove metapackage and its dependencies ynh_nodejs_remove
ynh_remove_nodejs
#================================================= #=================================================
# END OF SCRIPT # END OF SCRIPT
#================================================= #=================================================
ynh_script_progression --message="Removal of $app completed" ynh_script_progression "Removal of $app completed"

View file

@ -1,51 +1,40 @@
#!/bin/bash #!/bin/bash
#=================================================
# GENERIC START
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
source ../settings/scripts/_common.sh source ../settings/scripts/_common.sh
source /usr/share/yunohost/helpers source /usr/share/yunohost/helpers
#================================================= #=================================================
# RESTORE THE APP MAIN DIR # 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" ynh_restore "$install_dir"
chmod -R o-rwx "$install_dir"
chown -R $app:$app "$install_dir"
#================================================= #=================================================
# SPECIFIC RESTORATION # SPECIFIC RESTORATION
#================================================= #=================================================
# REINSTALL DEPENDENCIES # REINSTALL DEPENDENCIES
#================================================= #=================================================
ynh_script_progression --message="Reinstalling dependencies..." ynh_script_progression "Reinstalling dependencies..."
# Define and install dependencies ynh_nodejs_install
ynh_install_nodejs --nodejs_version=$nodejs_version
ynh_use_nodejs
#================================================= #=================================================
# RESTORE THE MONGODB DATABASE # 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_install_mongo
ynh_mongo_restore_db --database="$db_name" < ./dump.bson ynh_mongo_restore_db < ./dump.bson
#================================================= #=================================================
# RESTORE THE NGINX CONFIGURATION # 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 systemctl enable $app.service --quiet
yunohost service add $app --description="Wekan daemon" --log="/var/log/$app/$app.log" yunohost service add $app --description="Wekan daemon" --log="/var/log/$app/$app.log"
@ -53,18 +42,14 @@ yunohost service add $app --description="Wekan daemon" --log="/var/log/$app/$app
#================================================= #=================================================
# START SYSTEMD SERVICE # 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 ynh_systemctl --service=nginx --action=reload
# sleep 60
#fi
ynh_systemd_action --service_name=nginx --action=reload
#================================================= #=================================================
# END OF SCRIPT # END OF SCRIPT
#================================================= #=================================================
ynh_script_progression --message="Restoration completed for $app" ynh_script_progression "Restoration completed for $app"

View file

@ -1,93 +1,73 @@
#!/bin/bash #!/bin/bash
#=================================================
# GENERIC START
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
source _common.sh source _common.sh
source /usr/share/yunohost/helpers source /usr/share/yunohost/helpers
main_domain=$(cat /etc/yunohost/current_host) main_domain=$(cat /etc/yunohost/current_host)
#=================================================
# STANDARD UPGRADE STEPS
#================================================= #=================================================
# STOP SYSTEMD SERVICE # 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 # 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 mongo_version doesn't exist, create it
if [ -z "$mongo_version" ]; then if [ -z "$mongo_version" ]; then
mongo_version="$(mongod --version | grep -oP 'db version v\K.{0,3}')" 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 fi
ynh_secure_remove --file="/etc/apt/sources.list.d/mongodb-org-3.2.list" ynh_safe_rm "/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-4.4.list"
#================================================= #=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE # 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" --full_replace --keep=".env"
ynh_setup_source --dest_dir="$install_dir" --keep=".env"
chmod -R o-rwx "$install_dir"
chown -R $app:$app "$install_dir"
#================================================= #=================================================
# UPGRADE DEPENDENCIES # UPGRADE DEPENDENCIES
#================================================= #=================================================
ynh_script_progression --message="Upgrading dependencies..." ynh_script_progression "Upgrading dependencies..."
ynh_install_nodejs --nodejs_version=$nodejs_version ynh_nodejs_install
ynh_use_nodejs
ynh_install_mongo --mongo_version=$mongo_version ynh_install_mongo
#================================================= #=================================================
# NGINX CONFIGURATION # 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_config_add_nginx
ynh_add_nginx_config
# Create a dedicated systemd config ynh_config_add_systemd
ynh_add_systemd_config
yunohost service add $app --description="Wekan daemon" --log="/var/log/$app/$app.log" yunohost service add $app --description="Wekan daemon" --log="/var/log/$app/$app.log"
#=================================================
# SPECIFIC UPGRADE
#================================================= #=================================================
# UPDATE A CONFIG FILE # 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"
#================================================= #=================================================
# START SYSTEMD SERVICE # 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 # sleep 60
#fi #fi
@ -95,4 +75,4 @@ ynh_systemd_action --service_name=$app --action="start" --log_path=systemd --lin
# END OF SCRIPT # END OF SCRIPT
#================================================= #=================================================
ynh_script_progression --message="Upgrade of $app completed" ynh_script_progression "Upgrade of $app completed"