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 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/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", diff --git a/scripts/install b/scripts/install index 1f16515..67096dc 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 @@ -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..4651851 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 @@ -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:.*$"