From 69ead32623d68af685a1367520474eaaebb428de Mon Sep 17 00:00:00 2001 From: tituspijean Date: Sun, 3 Jul 2022 15:50:54 +0200 Subject: [PATCH 1/4] Call cargo with its full path and home dir --- scripts/install | 4 ++-- scripts/upgrade | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/install b/scripts/install index 1f16515..fcd19fa 100644 --- a/scripts/install +++ b/scripts/install @@ -125,11 +125,11 @@ pushd "$final_path" ynh_exec_as "$app" RUSTUP_HOME="$final_path/.rustup" CARGO_HOME="$final_path/.cargo" bash -c 'curl -sSf -L https://static.rust-lang.org/rustup.sh | sh -s -- -y --default-toolchain nightly' popd -export PATH="$PATH:$final_path/.cargo/bin:$final_path/.local/bin:/usr/local/sbin" +export PATH="$PATH:$final_path/.cargo/bin:$final_path/.local/bin:/usr/local/sbin" # Compile vaultwarden pushd "$final_path"/build - ynh_exec_warn_less ynh_exec_as "$app" env PATH="$PATH" cargo build --features sqlite --release + ynh_exec_warn_less ynh_exec_as "$app" env PATH="$PATH" CARGO_HOME="$final_path/.cargo" $final_path/.cargo/bin/cargo build --features sqlite --release popd # Install vaultwarden diff --git a/scripts/upgrade b/scripts/upgrade index 2a71492..d4ecd0b 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -192,11 +192,11 @@ then ynh_exec_as "$app" RUSTUP_HOME="$final_path/.rustup" CARGO_HOME="$final_path/.cargo" bash -c 'curl -sSf -L https://static.rust-lang.org/rustup.sh | sh -s -- -y --default-toolchain nightly' popd - export PATH="$PATH:$final_path/.cargo/bin:$final_path/.local/bin:/usr/local/sbin" + export PATH="$PATH:$final_path/.cargo/bin:$final_path/.local/bin:/usr/local/sbin" # Compile vaultwarden pushd "$final_path"/build - ynh_exec_warn_less ynh_exec_as "$app" env PATH="$PATH" cargo build --features sqlite --release + ynh_exec_warn_less ynh_exec_as "$app" env PATH="$PATH" CARGO_HOME="$final_path/.cargo" $final_path/.cargo/bin/cargo build --features sqlite --release popd # Remove old generated files before copying the new ones From 3fa6fa3fe0342f91111d4215dc62bd426610b2ff Mon Sep 17 00:00:00 2001 From: yalh76 Date: Mon, 4 Jul 2022 20:10:51 +0200 Subject: [PATCH 2/4] Fix #192 --- conf/systemd.service | 2 +- scripts/install | 3 ++- scripts/restore | 3 ++- scripts/upgrade | 3 ++- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/conf/systemd.service b/conf/systemd.service index 16f4776..41cc7d7 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -8,7 +8,7 @@ After=network.target User=__APP__ Group=__APP__ WorkingDirectory=__FINALPATH__/live/ -ReadWriteDirectories=__FINALPATH__/live/ __DATADIR__ +ReadWriteDirectories=__FINALPATH__/live/ __DATADIR__ /var/log/__APP__/ EnvironmentFile=__FINALPATH__/live/.env ExecStart=__FINALPATH__/live/vaultwarden diff --git a/scripts/install b/scripts/install index 1f16515..f35e828 100644 --- a/scripts/install +++ b/scripts/install @@ -196,7 +196,8 @@ ynh_script_progression --message="Configuring Fail2Ban..." # Create a dedicated Fail2Ban config mkdir -p "/var/log/$app" -touch /var/log/"$app"/"$app".log +touch "/var/log/$app/$app.log" +chown -R $app:$app "/var/log/$app" ynh_add_fail2ban_config --logpath="/var/log/$app/$app.log" --failregex="^.*Username or password is incorrect\. Try again\. IP: \. Username:.*$" #================================================= diff --git a/scripts/restore b/scripts/restore index 6bcd0f6..dfeb2ba 100644 --- a/scripts/restore +++ b/scripts/restore @@ -88,7 +88,8 @@ ynh_script_progression --message="Restoring the Fail2Ban configuration..." # Create a dedicated Fail2Ban config mkdir -p "/var/log/$app" -touch /var/log/"$app"/"$app".log +touch "/var/log/$app/$app.log" +chown -R $app:$app "/var/log/$app" ynh_restore_file --origin_path="/etc/fail2ban/jail.d/$app.conf" ynh_restore_file --origin_path="/etc/fail2ban/filter.d/$app.conf" diff --git a/scripts/upgrade b/scripts/upgrade index 2a71492..f0b76eb 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -257,7 +257,8 @@ ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --l ynh_script_progression --message="Reconfiguring Fail2Ban..." mkdir -p "/var/log/$app" -touch /var/log/"$app"/"$app".log +touch "/var/log/$app/$app.log" +chown -R $app:$app "/var/log/$app" # Create a dedicated Fail2Ban config ynh_add_fail2ban_config --logpath="/var/log/$app/$app.log" --failregex="^.*Username or password is incorrect\. Try again\. IP: \. Username:.*$" From 580b0813071ec51fa75924c4bf2e767b8d68a74d Mon Sep 17 00:00:00 2001 From: yalh76 Date: Wed, 6 Jul 2022 02:24:24 +0200 Subject: [PATCH 3/4] Update manifest.json --- manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.json b/manifest.json index f23af75..1cb369f 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Manage passwords and other sensitive informations", "fr": "Gérez les mots de passe et autres informations sensibles" }, - "version": "1.25.0~ynh1", + "version": "1.25.0~ynh2", "url": "https://github.com/dani-garcia/vaultwarden", "upstream": { "license": "GPL-3.0-or-later", From 1fe7e8d9641ec1f1e3199e2e8ed08153f7a394f5 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Wed, 6 Jul 2022 00:24:29 +0000 Subject: [PATCH 4/4] Auto-update README --- README.md | 2 +- README_fr.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index f4c1602..442b2ed 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in Alternative implementation of the Bitwarden server API written in Rust and compatible with upstream Bitwarden clients*, perfect for self-hosted deployment where running the official resource-heavy service might not be ideal. -**Shipped version:** 1.25.0~ynh1 +**Shipped version:** 1.25.0~ynh2 **Demo:** https://vault.bitwarden.com/#/register diff --git a/README_fr.md b/README_fr.md index 8ac537a..6fa60bb 100644 --- a/README_fr.md +++ b/README_fr.md @@ -17,7 +17,7 @@ Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour Alternative implementation of the Bitwarden server API written in Rust and compatible with upstream Bitwarden clients*, perfect for self-hosted deployment where running the official resource-heavy service might not be ideal. -**Version incluse :** 1.25.0~ynh1 +**Version incluse :** 1.25.0~ynh2 **Démo :** https://vault.bitwarden.com/#/register