From 874ce8c7b86a322ae50eab89a0a62375c87086e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Fri, 10 Nov 2023 22:40:55 +0100 Subject: [PATCH 01/30] fix --- manifest.toml | 1 + scripts/install | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/manifest.toml b/manifest.toml index 27675af..4eacbe6 100644 --- a/manifest.toml +++ b/manifest.toml @@ -51,6 +51,7 @@ ram.runtime = "50M" allow_email = true [resources.install_dir] + dir = "/home/borgwarehouse" [resources.permissions] main.url = "/" diff --git a/scripts/install b/scripts/install index cf8db0d..bbf642d 100755 --- a/scripts/install +++ b/scripts/install @@ -55,7 +55,7 @@ ynh_add_nginx_config env_path="$PATH" ynh_add_systemd_config -ynh_add_config --template="../conf/cron" --destination="/etc/cron.d/$app" +ynh_add_config --template="cron" --destination="/etc/cron.d/$app" chown root: "/etc/cron.d/$app" chmod 644 "/etc/cron.d/$app" From e4e04533a7e82504c7749e535ff2b3cc8f12da87 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Fri, 10 Nov 2023 21:40:59 +0000 Subject: [PATCH 02/30] Auto-update README --- README.md | 1 + README_fr.md | 1 + 2 files changed, 2 insertions(+) diff --git a/README.md b/README.md index 10554cd..44492a0 100644 --- a/README.md +++ b/README.md @@ -30,6 +30,7 @@ BorgWarhouse is a fast and modern WebUI for a BorgBackup's central repository se * Official app website: * Official admin documentation: * Upstream app code repository: +* YunoHost Store: * Report a bug: ## Developer info diff --git a/README_fr.md b/README_fr.md index e66a089..950e6d6 100644 --- a/README_fr.md +++ b/README_fr.md @@ -29,6 +29,7 @@ BorgWarhouse est une interface Web rapide et moderne pour BorgBackup. * Site officiel de l’app : * Documentation officielle de l’admin : * Dépôt de code officiel de l’app : +* YunoHost Store: * Signaler un bug : ## Informations pour les développeurs From f7087b1d997e5fe2ef5d2ebca4f562ddf1c5ddd8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Fri, 10 Nov 2023 22:46:57 +0100 Subject: [PATCH 03/30] Update manifest.toml --- manifest.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.toml b/manifest.toml index 4eacbe6..c47cecc 100644 --- a/manifest.toml +++ b/manifest.toml @@ -51,7 +51,7 @@ ram.runtime = "50M" allow_email = true [resources.install_dir] - dir = "/home/borgwarehouse" + dir = "/home/borgwarehouse/" [resources.permissions] main.url = "/" From fb5abb66aa8275a11d70bac909075004712b184c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Fri, 10 Nov 2023 22:49:10 +0100 Subject: [PATCH 04/30] Update manifest.toml --- manifest.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.toml b/manifest.toml index c47cecc..4eacbe6 100644 --- a/manifest.toml +++ b/manifest.toml @@ -51,7 +51,7 @@ ram.runtime = "50M" allow_email = true [resources.install_dir] - dir = "/home/borgwarehouse/" + dir = "/home/borgwarehouse" [resources.permissions] main.url = "/" From 06b300bb102400257f4218bf60962be7b5745866 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Fri, 10 Nov 2023 23:03:23 +0100 Subject: [PATCH 05/30] Update install --- scripts/install | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/scripts/install b/scripts/install index bbf642d..d0951c6 100755 --- a/scripts/install +++ b/scripts/install @@ -36,14 +36,14 @@ ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version ynh_script_progression --message="Setting up source files..." --weight=1 # Download, check integrity, uncompress and patch the source from manifest.toml -ynh_setup_source --dest_dir="$install_dir/app" +#ynh_setup_source --dest_dir="$install_dir/app" -mkdir $install_dir/.ssh && chmod 700 $install_dir/.ssh -touch $install_dir/.ssh/authorized_keys && chmod 600 $install_dir/.ssh/authorized_keys -mkdir $install_dir/repos && chmod 700 $install_dir/repos +mkdir /home/borgwarehouse/.ssh && chmod 700 /home/borgwarehouse/.ssh +touch /home/borgwarehouse/.ssh/authorized_keys && chmod 600 /home/borgwarehouse/.ssh/authorized_keys +mkdir /home/borgwarehouse/repos && chmod 700 /home/borgwarehouse/repos -chown -R $app:www-data "$install_dir" -chmod 700 $install_dir/app/helpers/shells/* +chown -R $app:www-data "/home/borgwarehouse/" +chmod 700 /home/borgwarehouse/app/helpers/shells/* #================================================= # SYSTEM CONFIGURATION @@ -68,17 +68,21 @@ yunohost service add $app --description="WebUI for BorgBackup" --log="/var/log/$ #================================================= ynh_script_progression --message="Adding a configuration file..." --weight=1 -ynh_add_config --template=".env" --destination="$install_dir/app/.env.local" +ynh_add_config --template=".env" --destination="/home/borgwarehouse/app/.env.local" -chmod 400 "$install_dir/app/.env.local" -chown $app:$app "$install_dir/app/.env.local" +chmod 400 "/home/borgwarehouse/app/.env.local" +chown $app:$app "/home/borgwarehouse/app/.env.local" #================================================= # INSTALL BORGWARHOUSE #================================================= ynh_script_progression --message="Installing $app..." --weight=10 -pushd $install_dir/app +pushd /home/borgwarehouse + git clone https://github.com/Ravinou/borgwarehouse.git app +popd + +pushd /home/borgwarehouse/app ynh_use_nodejs ynh_exec_warn_less sudo -u $app env $ynh_node_load_PATH $ynh_npm ci ynh_exec_warn_less sudo -u $app env $ynh_node_load_PATH NODE_ENV=production $ynh_npm run build From 46eaff89d186bd76a1939588f89605ddf26aefd8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Fri, 10 Nov 2023 23:06:29 +0100 Subject: [PATCH 06/30] Revert "Update install" This reverts commit 06b300bb102400257f4218bf60962be7b5745866. --- scripts/install | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/scripts/install b/scripts/install index d0951c6..bbf642d 100755 --- a/scripts/install +++ b/scripts/install @@ -36,14 +36,14 @@ ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version ynh_script_progression --message="Setting up source files..." --weight=1 # Download, check integrity, uncompress and patch the source from manifest.toml -#ynh_setup_source --dest_dir="$install_dir/app" +ynh_setup_source --dest_dir="$install_dir/app" -mkdir /home/borgwarehouse/.ssh && chmod 700 /home/borgwarehouse/.ssh -touch /home/borgwarehouse/.ssh/authorized_keys && chmod 600 /home/borgwarehouse/.ssh/authorized_keys -mkdir /home/borgwarehouse/repos && chmod 700 /home/borgwarehouse/repos +mkdir $install_dir/.ssh && chmod 700 $install_dir/.ssh +touch $install_dir/.ssh/authorized_keys && chmod 600 $install_dir/.ssh/authorized_keys +mkdir $install_dir/repos && chmod 700 $install_dir/repos -chown -R $app:www-data "/home/borgwarehouse/" -chmod 700 /home/borgwarehouse/app/helpers/shells/* +chown -R $app:www-data "$install_dir" +chmod 700 $install_dir/app/helpers/shells/* #================================================= # SYSTEM CONFIGURATION @@ -68,21 +68,17 @@ yunohost service add $app --description="WebUI for BorgBackup" --log="/var/log/$ #================================================= ynh_script_progression --message="Adding a configuration file..." --weight=1 -ynh_add_config --template=".env" --destination="/home/borgwarehouse/app/.env.local" +ynh_add_config --template=".env" --destination="$install_dir/app/.env.local" -chmod 400 "/home/borgwarehouse/app/.env.local" -chown $app:$app "/home/borgwarehouse/app/.env.local" +chmod 400 "$install_dir/app/.env.local" +chown $app:$app "$install_dir/app/.env.local" #================================================= # INSTALL BORGWARHOUSE #================================================= ynh_script_progression --message="Installing $app..." --weight=10 -pushd /home/borgwarehouse - git clone https://github.com/Ravinou/borgwarehouse.git app -popd - -pushd /home/borgwarehouse/app +pushd $install_dir/app ynh_use_nodejs ynh_exec_warn_less sudo -u $app env $ynh_node_load_PATH $ynh_npm ci ynh_exec_warn_less sudo -u $app env $ynh_node_load_PATH NODE_ENV=production $ynh_npm run build From ca67122d5a462bc33549173a771aba3f85039171 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sat, 11 Nov 2023 18:26:33 +0100 Subject: [PATCH 07/30] fix --- manifest.toml | 1 - scripts/install | 5 +++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/manifest.toml b/manifest.toml index 4eacbe6..27675af 100644 --- a/manifest.toml +++ b/manifest.toml @@ -51,7 +51,6 @@ ram.runtime = "50M" allow_email = true [resources.install_dir] - dir = "/home/borgwarehouse" [resources.permissions] main.url = "/" diff --git a/scripts/install b/scripts/install index bbf642d..789f426 100755 --- a/scripts/install +++ b/scripts/install @@ -38,11 +38,12 @@ ynh_script_progression --message="Setting up source files..." --weight=1 # Download, check integrity, uncompress and patch the source from manifest.toml ynh_setup_source --dest_dir="$install_dir/app" -mkdir $install_dir/.ssh && chmod 700 $install_dir/.ssh -touch $install_dir/.ssh/authorized_keys && chmod 600 $install_dir/.ssh/authorized_keys +mkdir /home/borgwarehouse/.ssh && chmod 700 /home/borgwarehouse/.ssh +touch /home/borgwarehouse/.ssh/authorized_keys && chmod 600 /home/borgwarehouse/.ssh/authorized_keys mkdir $install_dir/repos && chmod 700 $install_dir/repos chown -R $app:www-data "$install_dir" +chown -R $app:www-data "/home/borgwarehouse" chmod 700 $install_dir/app/helpers/shells/* #================================================= From 4b98810d3bab77433a718c9b5253788e5c401f6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sat, 11 Nov 2023 18:29:36 +0100 Subject: [PATCH 08/30] Update install --- scripts/install | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/install b/scripts/install index 789f426..6388201 100755 --- a/scripts/install +++ b/scripts/install @@ -38,6 +38,7 @@ ynh_script_progression --message="Setting up source files..." --weight=1 # Download, check integrity, uncompress and patch the source from manifest.toml ynh_setup_source --dest_dir="$install_dir/app" +mkdir /home/borgwarehouse mkdir /home/borgwarehouse/.ssh && chmod 700 /home/borgwarehouse/.ssh touch /home/borgwarehouse/.ssh/authorized_keys && chmod 600 /home/borgwarehouse/.ssh/authorized_keys mkdir $install_dir/repos && chmod 700 $install_dir/repos From 42c3692e8ba3286e910370571331b62650ef1b63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Fri, 22 Dec 2023 09:17:05 +0100 Subject: [PATCH 09/30] fix --- scripts/install | 8 ++++---- scripts/remove | 2 ++ 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/scripts/install b/scripts/install index 6388201..932601b 100755 --- a/scripts/install +++ b/scripts/install @@ -38,13 +38,13 @@ ynh_script_progression --message="Setting up source files..." --weight=1 # Download, check integrity, uncompress and patch the source from manifest.toml ynh_setup_source --dest_dir="$install_dir/app" -mkdir /home/borgwarehouse -mkdir /home/borgwarehouse/.ssh && chmod 700 /home/borgwarehouse/.ssh -touch /home/borgwarehouse/.ssh/authorized_keys && chmod 600 /home/borgwarehouse/.ssh/authorized_keys +mkdir /home/$app +mkdir /home/$app/.ssh && chmod 700 /home/$app/.ssh +touch /home/$app/.ssh/authorized_keys && chmod 600 /home/$app/.ssh/authorized_keys mkdir $install_dir/repos && chmod 700 $install_dir/repos chown -R $app:www-data "$install_dir" -chown -R $app:www-data "/home/borgwarehouse" +chown -R $app:www-data "/home/$app" chmod 700 $install_dir/app/helpers/shells/* #================================================= diff --git a/scripts/remove b/scripts/remove index 3ec7dc4..3bc3d9b 100755 --- a/scripts/remove +++ b/scripts/remove @@ -31,6 +31,8 @@ ynh_remove_nodejs ynh_secure_remove --file="/etc/cron.d/$app" +ynh_secure_remove --file="/home/$app" + #================================================= # END OF SCRIPT #================================================= From 3e2f80471e41a25a06fb72f768f419f22ca3514f Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Mon, 8 Apr 2024 03:30:46 +0200 Subject: [PATCH 10/30] Upgrade to v2.2.1 --- manifest.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/manifest.toml b/manifest.toml index fbcbbba..b899617 100644 --- a/manifest.toml +++ b/manifest.toml @@ -7,7 +7,7 @@ name = "BorgWarehouse" description.en = "WebUI for a BorgBackup's central repository server" description.fr = "WebUI pour BorgBackup" -version = "2.2.0~ynh1" +version = "2.2.1~ynh1" maintainers = [] @@ -43,8 +43,8 @@ ram.runtime = "50M" [resources.sources] [resources.sources.main] - url = "https://github.com/ravinou/borgwarehouse/archive/refs/tags/v2.2.0.tar.gz" - sha256 = "ef99c432f6783796446754963c0b4705b2da2dcefc67252a6f36005fcb48243a" + url = "https://github.com/ravinou/borgwarehouse/archive/refs/tags/v2.2.1.tar.gz" + sha256 = "e1e9730691f7b0a787bc1097de09df6a94e230670dd4afaffade2cad26ff4bf2" autoupdate.strategy = "latest_github_tag" [resources.system_user] From d4b834cf966478d492675bb1aeb8d2166d6e2410 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Mon, 8 Apr 2024 01:30:49 +0000 Subject: [PATCH 11/30] Auto-update READMEs --- ALL_README.md | 6 ++++++ README.md | 28 ++++++++++++++-------------- README_eu.md | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ README_fr.md | 30 +++++++++++++++--------------- README_gl.md | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 131 insertions(+), 29 deletions(-) create mode 100644 ALL_README.md create mode 100644 README_eu.md create mode 100644 README_gl.md diff --git a/ALL_README.md b/ALL_README.md new file mode 100644 index 0000000..77b7509 --- /dev/null +++ b/ALL_README.md @@ -0,0 +1,6 @@ +# All available README files by language + +- [Read the README in English](README.md) +- [Irakurri README euskaraz](README_eu.md) +- [Lire le README en français](README_fr.md) +- [Le o README en galego](README_gl.md) diff --git a/README.md b/README.md index 5c8f689..ad7a27b 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ @@ -9,17 +9,17 @@ It shall NOT be edited by hand. [![Install BorgWarehouse with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=borgwarehouse) -*[Lire ce readme en français.](./README_fr.md)* +*[Read this README in other languages.](./ALL_README.md)* -> *This package allows you to install BorgWarehouse quickly and simply on a YunoHost server. -If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/install) to learn how to install it.* +> *This package allows you to install BorgWarehouse quickly and simply on a YunoHost server.* +> *If you don't have YunoHost, please consult [the guide](https://yunohost.org/install) to learn how to install it.* ## Overview BorgWarhouse is a fast and modern WebUI for a BorgBackup's central repository server. -**Shipped version:** 2.2.0~ynh1 +**Shipped version:** 2.2.1~ynh1 ## Screenshots @@ -27,22 +27,22 @@ BorgWarhouse is a fast and modern WebUI for a BorgBackup's central repository se ## Documentation and resources -* Official app website: -* Official admin documentation: -* Upstream app code repository: -* YunoHost Store: -* Report a bug: +- Official app website: +- Official admin documentation: +- Upstream app code repository: +- YunoHost Store: +- Report a bug: ## Developer info -Please send your pull request to the [testing branch](https://github.com/YunoHost-Apps/borgwarehouse_ynh/tree/testing). +Please send your pull request to the [`testing` branch](https://github.com/YunoHost-Apps/borgwarehouse_ynh/tree/testing). -To try the testing branch, please proceed like that. +To try the `testing` branch, please proceed like that: -``` bash +```bash sudo yunohost app install https://github.com/YunoHost-Apps/borgwarehouse_ynh/tree/testing --debug or sudo yunohost app upgrade borgwarehouse -u https://github.com/YunoHost-Apps/borgwarehouse_ynh/tree/testing --debug ``` -**More info regarding app packaging:** \ No newline at end of file +**More info regarding app packaging:** diff --git a/README_eu.md b/README_eu.md new file mode 100644 index 0000000..bbbd26b --- /dev/null +++ b/README_eu.md @@ -0,0 +1,48 @@ + + +# BorgWarehouse YunoHost-erako + +[![Integrazio maila](https://dash.yunohost.org/integration/borgwarehouse.svg)](https://dash.yunohost.org/appci/app/borgwarehouse) ![Funtzionamendu egoera](https://ci-apps.yunohost.org/ci/badges/borgwarehouse.status.svg) ![Mantentze egoera](https://ci-apps.yunohost.org/ci/badges/borgwarehouse.maintain.svg) + +[![Instalatu BorgWarehouse YunoHost-ekin](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=borgwarehouse) + +*[Irakurri README hau beste hizkuntzatan.](./ALL_README.md)* + +> *Pakete honek BorgWarehouse YunoHost zerbitzari batean azkar eta zailtasunik gabe instalatzea ahalbidetzen dizu.* +> *YunoHost ez baduzu, kontsultatu [gida](https://yunohost.org/install) nola instalatu ikasteko.* + +## Aurreikuspena + +BorgWarhouse is a fast and modern WebUI for a BorgBackup's central repository server. + + +**Paketatutako bertsioa:** 2.2.1~ynh1 + +## Pantaila-argazkiak + +![BorgWarehouse(r)en pantaila-argazkia](./doc/screenshots/screenshot.png) + +## Dokumentazioa eta baliabideak + +- Aplikazioaren webgune ofiziala: +- Administratzaileen dokumentazio ofiziala: +- Jatorrizko aplikazioaren kode-gordailua: +- YunoHost Denda: +- Eman errore baten berri: + +## Garatzaileentzako informazioa + +Bidali `pull request`a [`testing` abarrera](https://github.com/YunoHost-Apps/borgwarehouse_ynh/tree/testing). + +`testing` abarra probatzeko, ondorengoa egin: + +```bash +sudo yunohost app install https://github.com/YunoHost-Apps/borgwarehouse_ynh/tree/testing --debug +edo +sudo yunohost app upgrade borgwarehouse -u https://github.com/YunoHost-Apps/borgwarehouse_ynh/tree/testing --debug +``` + +**Informazio gehiago aplikazioaren paketatzeari buruz:** diff --git a/README_fr.md b/README_fr.md index f15cfe3..dba7e98 100644 --- a/README_fr.md +++ b/README_fr.md @@ -1,6 +1,6 @@ # BorgWarehouse pour YunoHost @@ -9,16 +9,16 @@ It shall NOT be edited by hand. [![Installer BorgWarehouse avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=borgwarehouse) -*[Read this readme in english.](./README.md)* +*[Lire le README dans d'autres langues.](./ALL_README.md)* -> *Ce package vous permet d’installer BorgWarehouse rapidement et simplement sur un serveur YunoHost. -Si vous n’avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour savoir comment l’installer et en profiter.* +> *Ce package vous permet d’installer BorgWarehouse rapidement et simplement sur un serveur YunoHost.* +> *Si vous n’avez pas YunoHost, consultez [ce guide](https://yunohost.org/install) pour savoir comment l’installer et en profiter.* ## Vue d’ensemble BorgWarhouse est une interface Web rapide et moderne pour BorgBackup. -**Version incluse :** 2.2.0~ynh1 +**Version incluse :** 2.2.1~ynh1 ## Captures d’écran @@ -26,22 +26,22 @@ BorgWarhouse est une interface Web rapide et moderne pour BorgBackup. ## Documentations et ressources -* Site officiel de l’app : -* Documentation officielle de l’admin : -* Dépôt de code officiel de l’app : -* YunoHost Store: -* Signaler un bug : +- Site officiel de l’app : +- Documentation officielle de l’admin : +- Dépôt de code officiel de l’app : +- YunoHost Store : +- Signaler un bug : ## Informations pour les développeurs -Merci de faire vos pull request sur la [branche testing](https://github.com/YunoHost-Apps/borgwarehouse_ynh/tree/testing). +Merci de faire vos pull request sur la [branche `testing`](https://github.com/YunoHost-Apps/borgwarehouse_ynh/tree/testing). -Pour essayer la branche testing, procédez comme suit. +Pour essayer la branche `testing`, procédez comme suit : -``` bash +```bash sudo yunohost app install https://github.com/YunoHost-Apps/borgwarehouse_ynh/tree/testing --debug ou sudo yunohost app upgrade borgwarehouse -u https://github.com/YunoHost-Apps/borgwarehouse_ynh/tree/testing --debug ``` -**Plus d’infos sur le packaging d’applications :** \ No newline at end of file +**Plus d’infos sur le packaging d’applications :** diff --git a/README_gl.md b/README_gl.md new file mode 100644 index 0000000..efd927c --- /dev/null +++ b/README_gl.md @@ -0,0 +1,48 @@ + + +# BorgWarehouse para YunoHost + +[![Nivel de integración](https://dash.yunohost.org/integration/borgwarehouse.svg)](https://dash.yunohost.org/appci/app/borgwarehouse) ![Estado de funcionamento](https://ci-apps.yunohost.org/ci/badges/borgwarehouse.status.svg) ![Estado de mantemento](https://ci-apps.yunohost.org/ci/badges/borgwarehouse.maintain.svg) + +[![Instalar BorgWarehouse con YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=borgwarehouse) + +*[Le este README en outros idiomas.](./ALL_README.md)* + +> *Este paquete permíteche instalar BorgWarehouse de xeito rápido e doado nun servidor YunoHost.* +> *Se non usas YunoHost, le a [documentación](https://yunohost.org/install) para saber como instalalo.* + +## Vista xeral + +BorgWarhouse is a fast and modern WebUI for a BorgBackup's central repository server. + + +**Versión proporcionada:** 2.2.1~ynh1 + +## Capturas de pantalla + +![Captura de pantalla de BorgWarehouse](./doc/screenshots/screenshot.png) + +## Documentación e recursos + +- Web oficial da app: +- Documentación oficial para admin: +- Repositorio de orixe do código: +- Tenda YunoHost: +- Informar dun problema: + +## Info de desenvolvemento + +Envía a túa colaboración á [rama `testing`](https://github.com/YunoHost-Apps/borgwarehouse_ynh/tree/testing). + +Para probar a rama `testing`, procede deste xeito: + +```bash +sudo yunohost app install https://github.com/YunoHost-Apps/borgwarehouse_ynh/tree/testing --debug +ou +sudo yunohost app upgrade borgwarehouse -u https://github.com/YunoHost-Apps/borgwarehouse_ynh/tree/testing --debug +``` + +**Máis info sobre o empaquetado da app:** From 1dbc4b52129c47a6b036cc439949b2f9e4b74058 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Fri, 3 May 2024 06:20:57 +0000 Subject: [PATCH 12/30] Auto-update READMEs --- ALL_README.md | 1 + README.md | 10 +++++----- README_fr.md | 10 +++++----- README_zh_Hans.md | 48 +++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 59 insertions(+), 10 deletions(-) create mode 100644 README_zh_Hans.md diff --git a/ALL_README.md b/ALL_README.md index 77b7509..a01b345 100644 --- a/ALL_README.md +++ b/ALL_README.md @@ -4,3 +4,4 @@ - [Irakurri README euskaraz](README_eu.md) - [Lire le README en français](README_fr.md) - [Le o README en galego](README_gl.md) +- [阅读中文(简体)的 README](README_zh_Hans.md) diff --git a/README.md b/README.md index b778fde..ad7a27b 100644 --- a/README.md +++ b/README.md @@ -27,11 +27,11 @@ BorgWarhouse is a fast and modern WebUI for a BorgBackup's central repository se ## Documentation and resources -* Official app website: -* Official admin documentation: -* Upstream app code repository: -* YunoHost Store: -* Report a bug: +- Official app website: +- Official admin documentation: +- Upstream app code repository: +- YunoHost Store: +- Report a bug: ## Developer info diff --git a/README_fr.md b/README_fr.md index 89380ef..dba7e98 100644 --- a/README_fr.md +++ b/README_fr.md @@ -26,11 +26,11 @@ BorgWarhouse est une interface Web rapide et moderne pour BorgBackup. ## Documentations et ressources -* Site officiel de l’app : -* Documentation officielle de l’admin : -* Dépôt de code officiel de l’app : -* YunoHost Store: -* Signaler un bug : +- Site officiel de l’app : +- Documentation officielle de l’admin : +- Dépôt de code officiel de l’app : +- YunoHost Store : +- Signaler un bug : ## Informations pour les développeurs diff --git a/README_zh_Hans.md b/README_zh_Hans.md new file mode 100644 index 0000000..65a42f9 --- /dev/null +++ b/README_zh_Hans.md @@ -0,0 +1,48 @@ + + +# YunoHost 的 BorgWarehouse + +[![集成程度](https://dash.yunohost.org/integration/borgwarehouse.svg)](https://dash.yunohost.org/appci/app/borgwarehouse) ![工作状态](https://ci-apps.yunohost.org/ci/badges/borgwarehouse.status.svg) ![维护状态](https://ci-apps.yunohost.org/ci/badges/borgwarehouse.maintain.svg) + +[![使用 YunoHost 安装 BorgWarehouse](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=borgwarehouse) + +*[阅读此 README 的其它语言版本。](./ALL_README.md)* + +> *通过此软件包,您可以在 YunoHost 服务器上快速、简单地安装 BorgWarehouse。* +> *如果您还没有 YunoHost,请参阅[指南](https://yunohost.org/install)了解如何安装它。* + +## 概况 + +BorgWarhouse is a fast and modern WebUI for a BorgBackup's central repository server. + + +**分发版本:** 2.2.1~ynh1 + +## 截图 + +![BorgWarehouse 的截图](./doc/screenshots/screenshot.png) + +## 文档与资源 + +- 官方应用网站: +- 官方管理文档: +- 上游应用代码库: +- YunoHost 商店: +- 报告 bug: + +## 开发者信息 + +请向 [`testing` 分支](https://github.com/YunoHost-Apps/borgwarehouse_ynh/tree/testing) 发送拉取请求。 + +如要尝试 `testing` 分支,请这样操作: + +```bash +sudo yunohost app install https://github.com/YunoHost-Apps/borgwarehouse_ynh/tree/testing --debug +或 +sudo yunohost app upgrade borgwarehouse -u https://github.com/YunoHost-Apps/borgwarehouse_ynh/tree/testing --debug +``` + +**有关应用打包的更多信息:** From 034f5f5fe6542ebb730ef90dcff6ddfa3f438ea5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Wed, 8 May 2024 22:24:23 +0200 Subject: [PATCH 13/30] cleaning --- conf/systemd.service | 2 +- scripts/install | 1 - scripts/upgrade | 1 - 3 files changed, 1 insertion(+), 3 deletions(-) diff --git a/conf/systemd.service b/conf/systemd.service index 9360a93..d32ada6 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -7,7 +7,7 @@ After=network.target Type=simple User=__APP__ Group=__APP__ -Environment="PATH=__ENV_PATH__" +Environment="__YNH_NODE_LOAD_PATH__" WorkingDirectory=__INSTALL_DIR__/app Environment=PORT=__PORT__ ExecStart=__YNH_NPM__ run start diff --git a/scripts/install b/scripts/install index 932601b..910c2ad 100755 --- a/scripts/install +++ b/scripts/install @@ -54,7 +54,6 @@ ynh_script_progression --message="Adding system configurations related to $app.. ynh_add_nginx_config -env_path="$PATH" ynh_add_systemd_config ynh_add_config --template="cron" --destination="/etc/cron.d/$app" diff --git a/scripts/upgrade b/scripts/upgrade index 9c56584..e59d464 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -49,7 +49,6 @@ ynh_script_progression --message="Upgrading system configurations related to $ap ynh_add_nginx_config -env_path="$PATH" ynh_add_systemd_config yunohost service add $app --description="WebUI for BorgBackup" --log="/var/log/$app/$app.log" From edfe0a8be52c2ce61c43026084278b1b8a608efe Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Wed, 8 May 2024 20:24:28 +0000 Subject: [PATCH 14/30] Auto-update READMEs --- README_zh_Hans.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README_zh_Hans.md b/README_zh_Hans.md index 65a42f9..0c1b8a6 100644 --- a/README_zh_Hans.md +++ b/README_zh_Hans.md @@ -3,7 +3,7 @@ 请勿手动编辑。 --> -# YunoHost 的 BorgWarehouse +# YunoHost 上的 BorgWarehouse [![集成程度](https://dash.yunohost.org/integration/borgwarehouse.svg)](https://dash.yunohost.org/appci/app/borgwarehouse) ![工作状态](https://ci-apps.yunohost.org/ci/badges/borgwarehouse.status.svg) ![维护状态](https://ci-apps.yunohost.org/ci/badges/borgwarehouse.maintain.svg) From 27ec1770c91d6bbc624027e414b64ce079dae0e9 Mon Sep 17 00:00:00 2001 From: Limezy Date: Wed, 1 May 2024 22:34:31 +0700 Subject: [PATCH 15/30] Tests +upgrade 2.2.1 --- scripts/backup | 9 +++++++++ scripts/install | 8 ++++---- scripts/remove | 2 ++ scripts/restore | 7 +++++++ 4 files changed, 22 insertions(+), 4 deletions(-) diff --git a/scripts/backup b/scripts/backup index a07766f..8cf6b3c 100755 --- a/scripts/backup +++ b/scripts/backup @@ -21,6 +21,15 @@ ynh_print_info --message="Declaring files to be backed up..." ynh_backup --src_path="$install_dir" +unlink "/home/$app/repos" +ynh_backup --src_path="/home/$app" + +#================================================= +# BACKUP THE REPOS DIRECTORY +#================================================= + +ynh_backup --src_path="/home/yunohost.app/$app" --is_big + #================================================= # BACKUP THE NGINX CONFIGURATION #================================================= diff --git a/scripts/install b/scripts/install index 910c2ad..f244b10 100755 --- a/scripts/install +++ b/scripts/install @@ -38,10 +38,10 @@ ynh_script_progression --message="Setting up source files..." --weight=1 # Download, check integrity, uncompress and patch the source from manifest.toml ynh_setup_source --dest_dir="$install_dir/app" -mkdir /home/$app -mkdir /home/$app/.ssh && chmod 700 /home/$app/.ssh -touch /home/$app/.ssh/authorized_keys && chmod 600 /home/$app/.ssh/authorized_keys -mkdir $install_dir/repos && chmod 700 $install_dir/repos +mkdir -p "/home/$app/.ssh" && chmod 700 "/home/$app/.ssh" +touch "/home/$app/.ssh/authorized_keys" && chmod 600 "/home/$app/.ssh/authorized_keys" +mkdir "/home/yunohost.app/$app" && chmod 700 "/home/yunohost.app/$app" +ln -s "/home/yunohost.app/$app" "/home/$app/repos" && chmod 700 "/home/$app/repos" chown -R $app:www-data "$install_dir" chown -R $app:www-data "/home/$app" diff --git a/scripts/remove b/scripts/remove index 3bc3d9b..b2abf47 100755 --- a/scripts/remove +++ b/scripts/remove @@ -33,6 +33,8 @@ ynh_secure_remove --file="/etc/cron.d/$app" ynh_secure_remove --file="/home/$app" +ynh_secure_remove --file="/home/yunohost.app/$app" + #================================================= # END OF SCRIPT #================================================= diff --git a/scripts/restore b/scripts/restore index 5c7b30d..3241426 100755 --- a/scripts/restore +++ b/scripts/restore @@ -19,6 +19,13 @@ ynh_restore_file --origin_path="$install_dir" chown -R $app:www-data "$install_dir" +ynh_restore_file --origin_path="/home/$app" +ynh_restore_file --origin_path="/home/yunohost.app/$app" + +chown -R $app:www-data "/home/$app" +chown -R $app:www-data "/home/yunohost.app/$app" --not_mandatory +ln -s "/home/yunohost.app/$app" "/home/$app/repos" && chmod 700 "/home/$app/repos" + #================================================= # REINSTALL DEPENDENCIES #================================================= From 1795a9e18463111aa68e5c451af73f21d8ef04e2 Mon Sep 17 00:00:00 2001 From: Limezy Date: Wed, 1 May 2024 23:18:22 +0700 Subject: [PATCH 16/30] Fixes --- conf/systemd.service | 2 +- scripts/backup | 2 ++ scripts/install | 8 ++++++-- scripts/restore | 1 + 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/conf/systemd.service b/conf/systemd.service index d32ada6..a62b16f 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -8,7 +8,7 @@ Type=simple User=__APP__ Group=__APP__ Environment="__YNH_NODE_LOAD_PATH__" -WorkingDirectory=__INSTALL_DIR__/app +WorkingDirectory=/home/__APP__/app Environment=PORT=__PORT__ ExecStart=__YNH_NPM__ run start Restart=on-failure diff --git a/scripts/backup b/scripts/backup index 8cf6b3c..4d6fc8c 100755 --- a/scripts/backup +++ b/scripts/backup @@ -21,7 +21,9 @@ ynh_print_info --message="Declaring files to be backed up..." ynh_backup --src_path="$install_dir" +unlink "/home/$app/app" unlink "/home/$app/repos" + ynh_backup --src_path="/home/$app" #================================================= diff --git a/scripts/install b/scripts/install index f244b10..222fef7 100755 --- a/scripts/install +++ b/scripts/install @@ -38,14 +38,18 @@ ynh_script_progression --message="Setting up source files..." --weight=1 # Download, check integrity, uncompress and patch the source from manifest.toml ynh_setup_source --dest_dir="$install_dir/app" -mkdir -p "/home/$app/.ssh" && chmod 700 "/home/$app/.ssh" +mkdir "/home/$app" && chmod 700 "/home/$app" +ln -s "$install_dir/app" "/home/$app/app" +chmod 700 "/home/$app/app/helpers/shells/*" + +mkdir "/home/$app/.ssh" && chmod 700 "/home/$app/.ssh" touch "/home/$app/.ssh/authorized_keys" && chmod 600 "/home/$app/.ssh/authorized_keys" + mkdir "/home/yunohost.app/$app" && chmod 700 "/home/yunohost.app/$app" ln -s "/home/yunohost.app/$app" "/home/$app/repos" && chmod 700 "/home/$app/repos" chown -R $app:www-data "$install_dir" chown -R $app:www-data "/home/$app" -chmod 700 $install_dir/app/helpers/shells/* #================================================= # SYSTEM CONFIGURATION diff --git a/scripts/restore b/scripts/restore index 3241426..48e03df 100755 --- a/scripts/restore +++ b/scripts/restore @@ -25,6 +25,7 @@ ynh_restore_file --origin_path="/home/yunohost.app/$app" chown -R $app:www-data "/home/$app" chown -R $app:www-data "/home/yunohost.app/$app" --not_mandatory ln -s "/home/yunohost.app/$app" "/home/$app/repos" && chmod 700 "/home/$app/repos" +ln -s "$install_dir/app" "/home/$app/app" && chmod 700 "/home/$app/app" #================================================= # REINSTALL DEPENDENCIES From 3208694ead03308d884e77c9f5809a7817631d04 Mon Sep 17 00:00:00 2001 From: Limezy Date: Wed, 1 May 2024 23:22:47 +0700 Subject: [PATCH 17/30] Fix restore --- scripts/restore | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/restore b/scripts/restore index 48e03df..4152f8e 100755 --- a/scripts/restore +++ b/scripts/restore @@ -20,10 +20,10 @@ ynh_restore_file --origin_path="$install_dir" chown -R $app:www-data "$install_dir" ynh_restore_file --origin_path="/home/$app" -ynh_restore_file --origin_path="/home/yunohost.app/$app" +ynh_restore_file --origin_path="/home/yunohost.app/$app" --not_mandatory chown -R $app:www-data "/home/$app" -chown -R $app:www-data "/home/yunohost.app/$app" --not_mandatory +chown -R $app:www-data "/home/yunohost.app/$app" ln -s "/home/yunohost.app/$app" "/home/$app/repos" && chmod 700 "/home/$app/repos" ln -s "$install_dir/app" "/home/$app/app" && chmod 700 "/home/$app/app" From 3dc95cffb6dec8e9a8cc643d0579a6603045a81e Mon Sep 17 00:00:00 2001 From: Limezy Date: Wed, 1 May 2024 23:46:50 +0700 Subject: [PATCH 18/30] Update install --- scripts/install | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index 222fef7..5c7e942 100755 --- a/scripts/install +++ b/scripts/install @@ -40,7 +40,6 @@ ynh_setup_source --dest_dir="$install_dir/app" mkdir "/home/$app" && chmod 700 "/home/$app" ln -s "$install_dir/app" "/home/$app/app" -chmod 700 "/home/$app/app/helpers/shells/*" mkdir "/home/$app/.ssh" && chmod 700 "/home/$app/.ssh" touch "/home/$app/.ssh/authorized_keys" && chmod 600 "/home/$app/.ssh/authorized_keys" @@ -51,6 +50,8 @@ ln -s "/home/yunohost.app/$app" "/home/$app/repos" && chmod 700 "/home/$app/repo chown -R $app:www-data "$install_dir" chown -R $app:www-data "/home/$app" +chmod 700 "/home/$app/app/helpers/shells/"* + #================================================= # SYSTEM CONFIGURATION #================================================= From 854dc3fa267632bb0b2278947167b5ff564d7fbd Mon Sep 17 00:00:00 2001 From: Limezy Date: Mon, 6 May 2024 10:27:07 +0700 Subject: [PATCH 19/30] Update systemd.service --- conf/systemd.service | 34 ---------------------------------- 1 file changed, 34 deletions(-) diff --git a/conf/systemd.service b/conf/systemd.service index a62b16f..acb7549 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -13,39 +13,5 @@ Environment=PORT=__PORT__ ExecStart=__YNH_NPM__ run start Restart=on-failure -# Sandboxing options to harden security -# Depending on specificities of your service/app, you may need to tweak these -# .. but this should be a good baseline -# Details for these options: https://www.freedesktop.org/software/systemd/man/systemd.exec.html -NoNewPrivileges=yes -PrivateTmp=yes -PrivateDevices=yes -RestrictAddressFamilies=AF_UNIX AF_INET AF_INET6 AF_NETLINK -RestrictNamespaces=yes -RestrictRealtime=yes -DevicePolicy=closed -ProtectClock=yes -ProtectHostname=yes -ProtectProc=invisible -ProtectSystem=full -ProtectControlGroups=yes -ProtectKernelModules=yes -ProtectKernelTunables=yes -LockPersonality=yes -SystemCallArchitectures=native -SystemCallFilter=~@clock @debug @module @mount @obsolete @reboot @setuid @swap @cpu-emulation @privileged - -# Denying access to capabilities that should not be relevant for webapps -# Doc: https://man7.org/linux/man-pages/man7/capabilities.7.html -CapabilityBoundingSet=~CAP_RAWIO CAP_MKNOD -CapabilityBoundingSet=~CAP_AUDIT_CONTROL CAP_AUDIT_READ CAP_AUDIT_WRITE -CapabilityBoundingSet=~CAP_SYS_BOOT CAP_SYS_TIME CAP_SYS_MODULE CAP_SYS_PACCT -CapabilityBoundingSet=~CAP_LEASE CAP_LINUX_IMMUTABLE CAP_IPC_LOCK -CapabilityBoundingSet=~CAP_BLOCK_SUSPEND CAP_WAKE_ALARM -CapabilityBoundingSet=~CAP_SYS_TTY_CONFIG -CapabilityBoundingSet=~CAP_MAC_ADMIN CAP_MAC_OVERRIDE -CapabilityBoundingSet=~CAP_NET_ADMIN CAP_NET_BROADCAST CAP_NET_RAW -CapabilityBoundingSet=~CAP_SYS_ADMIN CAP_SYS_PTRACE CAP_SYSLOG - [Install] WantedBy=multi-user.target From eb2d957e030f496e179edb4cc4d901123c782758 Mon Sep 17 00:00:00 2001 From: Limezy Date: Mon, 6 May 2024 14:59:45 +0700 Subject: [PATCH 20/30] Update .env --- conf/.env | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/conf/.env b/conf/.env index 53534b7..979ae75 100644 --- a/conf/.env +++ b/conf/.env @@ -2,6 +2,10 @@ NEXTAUTH_URL=https://__DOMAIN__ NEXTAUTH_SECRET='__SECRET__' CRONJOB_KEY='__CRON_KEY__' + +# Base directory +home=/home/yunohost.app/__APP__ + # Wizard's variables UNIX_USER=__APP__ FQDN=__DOMAIN__ @@ -9,6 +13,7 @@ SSH_SERVER_PORT=__SSH_PORT__ SSH_SERVER_FINGERPRINT_RSA=__RSA_KEY__ SSH_SERVER_FINGERPRINT_ED25519=__ED25519_KEY__ SSH_SERVER_FINGERPRINT_ECDSA=__ECDSA_KEY__ + # SMTP's variables MAIL_SMTP_FROM=borgwarehouse@__MAIN_DOMAIN__ MAIL_SMTP_HOST=__MAIN_DOMAIN__ @@ -16,5 +21,6 @@ MAIL_SMTP_PORT=25 MAIL_SMTP_LOGIN=__APP__ MAIL_SMTP_PWD=__MAIL_PWD__ MAIL_REJECT_SELFSIGNED_TLS=true + # Disable NextJS telemetry NEXT_TELEMETRY_DISABLED=1 \ No newline at end of file From 1ebc03231603c3c5aad3e5dbc89b0496839ec1cb Mon Sep 17 00:00:00 2001 From: Limezy Date: Mon, 6 May 2024 15:11:20 +0700 Subject: [PATCH 21/30] Test with env variable --- scripts/backup | 9 ++------- scripts/change_url | 6 +++--- scripts/install | 31 ++++++++++++++----------------- scripts/remove | 2 -- scripts/restore | 16 ++++++++-------- scripts/upgrade | 10 +++++----- 6 files changed, 32 insertions(+), 42 deletions(-) diff --git a/scripts/backup b/scripts/backup index 4d6fc8c..af6b2dc 100755 --- a/scripts/backup +++ b/scripts/backup @@ -19,18 +19,13 @@ ynh_print_info --message="Declaring files to be backed up..." # BACKUP THE APP MAIN DIR #================================================= -ynh_backup --src_path="$install_dir" - -unlink "/home/$app/app" -unlink "/home/$app/repos" - -ynh_backup --src_path="/home/$app" +ynh_backup --src_path="/home/yunohost.app/$app/app" #================================================= # BACKUP THE REPOS DIRECTORY #================================================= -ynh_backup --src_path="/home/yunohost.app/$app" --is_big +ynh_backup --src_path="/home/yunohost.app/$app/repos" --is_big #================================================= # BACKUP THE NGINX CONFIGURATION diff --git a/scripts/change_url b/scripts/change_url index 43b84fb..8157cf0 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -30,10 +30,10 @@ ynh_change_url_nginx_config #================================================= ynh_script_progression --message="Adding a configuration file..." --weight=1 -ynh_add_config --template=".env" --destination="$install_dir/app/.env.local" +ynh_add_config --template=".env" --destination="/home/yunohost.app/$app/app/.env.local" -chmod 400 "$install_dir/app/.env.local" -chown $app:$app "$install_dir/app/.env.local" +chmod 400 "/home/yunohost.app/$app/app/.env.local" +chown $app:$app "/home/yunohost.app/$app/app/.env.local" #================================================= # GENERIC FINALISATION diff --git a/scripts/install b/scripts/install index 5c7e942..84a96e2 100755 --- a/scripts/install +++ b/scripts/install @@ -35,22 +35,19 @@ ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version #================================================= ynh_script_progression --message="Setting up source files..." --weight=1 -# Download, check integrity, uncompress and patch the source from manifest.toml -ynh_setup_source --dest_dir="$install_dir/app" - -mkdir "/home/$app" && chmod 700 "/home/$app" -ln -s "$install_dir/app" "/home/$app/app" - -mkdir "/home/$app/.ssh" && chmod 700 "/home/$app/.ssh" -touch "/home/$app/.ssh/authorized_keys" && chmod 600 "/home/$app/.ssh/authorized_keys" - mkdir "/home/yunohost.app/$app" && chmod 700 "/home/yunohost.app/$app" -ln -s "/home/yunohost.app/$app" "/home/$app/repos" && chmod 700 "/home/$app/repos" -chown -R $app:www-data "$install_dir" -chown -R $app:www-data "/home/$app" +# Download, check integrity, uncompress and patch the source from manifest.toml +ynh_setup_source --dest_dir="/home/yunohost.app/$app/app" -chmod 700 "/home/$app/app/helpers/shells/"* +chmod 700 "/home/yunohost.app/$app" + +mkdir "/home/yunohost.app/$app/.ssh" && chmod 700 "/home/yunohost.app/$app/.ssh" +touch "/home/yunohost.app/$app/.ssh/authorized_keys" && chmod 600 "/home/yunohost.app/$app/.ssh/authorized_keys" + +chown -R $app:www-data "/home/yunohost.app/$app" + +chmod 700 "/home/yunohost.app/$app/app/helpers/shells/"* #================================================= # SYSTEM CONFIGURATION @@ -74,17 +71,17 @@ yunohost service add $app --description="WebUI for BorgBackup" --log="/var/log/$ #================================================= ynh_script_progression --message="Adding a configuration file..." --weight=1 -ynh_add_config --template=".env" --destination="$install_dir/app/.env.local" +ynh_add_config --template=".env" --destination="home/yunohost.app/$app/app/.env.local" -chmod 400 "$install_dir/app/.env.local" -chown $app:$app "$install_dir/app/.env.local" +chmod 400 "/home/yunohost.app/$app/app/.env.local" +chown $app:$app "/home/yunohost.app/$app/app/.env.local" #================================================= # INSTALL BORGWARHOUSE #================================================= ynh_script_progression --message="Installing $app..." --weight=10 -pushd $install_dir/app +pushd /home/yunohost.app/$app/app ynh_use_nodejs ynh_exec_warn_less sudo -u $app env $ynh_node_load_PATH $ynh_npm ci ynh_exec_warn_less sudo -u $app env $ynh_node_load_PATH NODE_ENV=production $ynh_npm run build diff --git a/scripts/remove b/scripts/remove index b2abf47..ce16d7a 100755 --- a/scripts/remove +++ b/scripts/remove @@ -31,8 +31,6 @@ ynh_remove_nodejs ynh_secure_remove --file="/etc/cron.d/$app" -ynh_secure_remove --file="/home/$app" - ynh_secure_remove --file="/home/yunohost.app/$app" #================================================= diff --git a/scripts/restore b/scripts/restore index 4152f8e..280aebd 100755 --- a/scripts/restore +++ b/scripts/restore @@ -15,17 +15,17 @@ source /usr/share/yunohost/helpers #================================================= ynh_script_progression --message="Restoring the app main directory..." --weight=1 -ynh_restore_file --origin_path="$install_dir" +mkdir -p "/home/yunohost.app/$app" && chmod 700 "/home/yunohost.app/$app" -chown -R $app:www-data "$install_dir" +ynh_restore_file --origin_path="/home/yunohost.app/$app/app" -ynh_restore_file --origin_path="/home/$app" -ynh_restore_file --origin_path="/home/yunohost.app/$app" --not_mandatory +chown -R $app:www-data "/home/yunohost.app/$app/app" -chown -R $app:www-data "/home/$app" -chown -R $app:www-data "/home/yunohost.app/$app" -ln -s "/home/yunohost.app/$app" "/home/$app/repos" && chmod 700 "/home/$app/repos" -ln -s "$install_dir/app" "/home/$app/app" && chmod 700 "/home/$app/app" +ynh_restore_file --origin_path="/home/yunohost.app/$app/repos" --not_mandatory + +chown -R $app:www-data "/home/yunohost.app/$app/repos" + +chmod 700 "/home/yunohost.app/$app" #================================================= # REINSTALL DEPENDENCIES diff --git a/scripts/upgrade b/scripts/upgrade index e59d464..d609955 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -37,10 +37,10 @@ then ynh_script_progression --message="Upgrading source files..." --weight=1 # Download, check integrity, uncompress and patch the source from manifest.toml - ynh_setup_source --dest_dir="$install_dir" --keep="app/.env.local app/config/users.json app/config/repo.json" + ynh_setup_source --dest_dir="/home/yunohost.app/$app/app" --keep="app/.env.local app/config/users.json app/config/repo.json" fi -chown -R $app:www-data "$install_dir" +chown -R $app:www-data "/home/yunohost.app/$app/app" #================================================= # REAPPLY SYSTEM CONFIGURATIONS @@ -60,10 +60,10 @@ yunohost service add $app --description="WebUI for BorgBackup" --log="/var/log/$ #================================================= ynh_script_progression --message="Updating a configuration file..." --weight=1 -ynh_add_config --template=".env" --destination="$install_dir/app/.env.local" +ynh_add_config --template=".env" --destination="/home/yunohost.app/$app/app/.env.local" -chmod 400 "$install_dir/app/.env.local" -chown $app:$app "$install_dir/app/.env.local" +chmod 400 "/home/yunohost.app/$app/app/.env.local" +chown $app:$app "/home/yunohost.app/$app/app/.env.local" #================================================= # START SYSTEMD SERVICE From d3185d55accf26e2a8fed725f07dd366954ace0a Mon Sep 17 00:00:00 2001 From: Limezy Date: Mon, 6 May 2024 15:21:46 +0700 Subject: [PATCH 22/30] Update install --- scripts/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index 84a96e2..066e408 100755 --- a/scripts/install +++ b/scripts/install @@ -71,7 +71,7 @@ yunohost service add $app --description="WebUI for BorgBackup" --log="/var/log/$ #================================================= ynh_script_progression --message="Adding a configuration file..." --weight=1 -ynh_add_config --template=".env" --destination="home/yunohost.app/$app/app/.env.local" +ynh_add_config --template=".env" --destination="/home/yunohost.app/$app/app/.env.local" chmod 400 "/home/yunohost.app/$app/app/.env.local" chown $app:$app "/home/yunohost.app/$app/app/.env.local" From 3749cf3b59ee674995d2e762d02ee0dcd05a80a6 Mon Sep 17 00:00:00 2001 From: Limezy Date: Mon, 6 May 2024 16:02:20 +0700 Subject: [PATCH 23/30] Update systemd.service --- conf/systemd.service | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/systemd.service b/conf/systemd.service index acb7549..cf70664 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -8,7 +8,7 @@ Type=simple User=__APP__ Group=__APP__ Environment="__YNH_NODE_LOAD_PATH__" -WorkingDirectory=/home/__APP__/app +WorkingDirectory=/home/yunohost.app/__APP__/app Environment=PORT=__PORT__ ExecStart=__YNH_NPM__ run start Restart=on-failure From f76d424e95dd16dda9166e101bbe24a0f05fe422 Mon Sep 17 00:00:00 2001 From: Limezy Date: Mon, 6 May 2024 17:14:06 +0700 Subject: [PATCH 24/30] Update install --- scripts/install | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/install b/scripts/install index 066e408..9b86555 100755 --- a/scripts/install +++ b/scripts/install @@ -49,6 +49,8 @@ chown -R $app:www-data "/home/yunohost.app/$app" chmod 700 "/home/yunohost.app/$app/app/helpers/shells/"* +mkdir "/home/yunohost.app/$app/repos" && chmod 700 "/home/yunohost.app/$app/repos" + #================================================= # SYSTEM CONFIGURATION #================================================= From fba827ca8fb4422d623ecd8821b0eaf93e5dfc00 Mon Sep 17 00:00:00 2001 From: Limezy Date: Tue, 7 May 2024 20:37:51 +0700 Subject: [PATCH 25/30] Update manifest.toml --- manifest.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/manifest.toml b/manifest.toml index b899617..814e0aa 100644 --- a/manifest.toml +++ b/manifest.toml @@ -49,6 +49,7 @@ ram.runtime = "50M" [resources.system_user] allow_email = true + allow_ssh = true [resources.install_dir] From 042bdd8e9c5ced82a26f701bbefd62cae5fdf7ae Mon Sep 17 00:00:00 2001 From: Limezy Date: Thu, 9 May 2024 00:23:18 +0700 Subject: [PATCH 26/30] Update manifest.toml --- manifest.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/manifest.toml b/manifest.toml index 814e0aa..b138839 100644 --- a/manifest.toml +++ b/manifest.toml @@ -50,6 +50,7 @@ ram.runtime = "50M" [resources.system_user] allow_email = true allow_ssh = true + home = /home/yunohost.app/__APP__ [resources.install_dir] From 546d35b541c6a08279a5557e5c8fd207b33b7a55 Mon Sep 17 00:00:00 2001 From: Limezy Date: Thu, 9 May 2024 00:30:35 +0700 Subject: [PATCH 27/30] Update manifest.toml --- manifest.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.toml b/manifest.toml index b138839..d01e949 100644 --- a/manifest.toml +++ b/manifest.toml @@ -50,7 +50,7 @@ ram.runtime = "50M" [resources.system_user] allow_email = true allow_ssh = true - home = /home/yunohost.app/__APP__ + home = "/home/yunohost.app/__APP__" [resources.install_dir] From b9bbe8220743c8db4aae04d4a6275cb5875903f4 Mon Sep 17 00:00:00 2001 From: Limezy Date: Thu, 9 May 2024 01:21:13 +0700 Subject: [PATCH 28/30] Update install --- scripts/install | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/install b/scripts/install index 9b86555..0bf997c 100755 --- a/scripts/install +++ b/scripts/install @@ -45,12 +45,12 @@ chmod 700 "/home/yunohost.app/$app" mkdir "/home/yunohost.app/$app/.ssh" && chmod 700 "/home/yunohost.app/$app/.ssh" touch "/home/yunohost.app/$app/.ssh/authorized_keys" && chmod 600 "/home/yunohost.app/$app/.ssh/authorized_keys" -chown -R $app:www-data "/home/yunohost.app/$app" - chmod 700 "/home/yunohost.app/$app/app/helpers/shells/"* mkdir "/home/yunohost.app/$app/repos" && chmod 700 "/home/yunohost.app/$app/repos" +chown -R $app:www-data "/home/yunohost.app/$app" + #================================================= # SYSTEM CONFIGURATION #================================================= From 574c841a784a2f7bffd1a065f9d01bdce12cb566 Mon Sep 17 00:00:00 2001 From: Limezy Date: Thu, 9 May 2024 08:13:57 +0700 Subject: [PATCH 29/30] Update restore --- scripts/restore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/restore b/scripts/restore index 280aebd..9969e31 100755 --- a/scripts/restore +++ b/scripts/restore @@ -25,7 +25,7 @@ ynh_restore_file --origin_path="/home/yunohost.app/$app/repos" --not_mandatory chown -R $app:www-data "/home/yunohost.app/$app/repos" -chmod 700 "/home/yunohost.app/$app" +chmod -R 700 "/home/yunohost.app/$app" #================================================= # REINSTALL DEPENDENCIES From 53d244d9266545443f2e41d649d85bb07d117576 Mon Sep 17 00:00:00 2001 From: Limezy Date: Thu, 9 May 2024 11:37:12 +0700 Subject: [PATCH 30/30] Test --- scripts/backup | 1 + scripts/restore | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/scripts/backup b/scripts/backup index af6b2dc..4d90835 100755 --- a/scripts/backup +++ b/scripts/backup @@ -20,6 +20,7 @@ ynh_print_info --message="Declaring files to be backed up..." #================================================= ynh_backup --src_path="/home/yunohost.app/$app/app" +ynh_backup --src_path="/home/yunohost.app/$app/.ssh" #================================================= # BACKUP THE REPOS DIRECTORY diff --git a/scripts/restore b/scripts/restore index 9969e31..10a0863 100755 --- a/scripts/restore +++ b/scripts/restore @@ -18,14 +18,14 @@ ynh_script_progression --message="Restoring the app main directory..." --weight= mkdir -p "/home/yunohost.app/$app" && chmod 700 "/home/yunohost.app/$app" ynh_restore_file --origin_path="/home/yunohost.app/$app/app" - -chown -R $app:www-data "/home/yunohost.app/$app/app" +ynh_restore_file --origin_path="/home/yunohost.app/$app/.ssh" ynh_restore_file --origin_path="/home/yunohost.app/$app/repos" --not_mandatory -chown -R $app:www-data "/home/yunohost.app/$app/repos" - chmod -R 700 "/home/yunohost.app/$app" +chmod 600 "/home/yunohost.app/$app/.ssh/authorized_keys" + +chown -R $app:www-data "/home/yunohost.app/$app" #================================================= # REINSTALL DEPENDENCIES