From ab5f1cd79691f65fd348fa67e940869623be7884 Mon Sep 17 00:00:00 2001 From: Joel Beckmeyer Date: Thu, 17 Feb 2022 13:25:21 -0500 Subject: [PATCH 1/2] New package: vaultwarden-1.25.1 --- srcpkgs/vaultwarden/files/vaultwarden/log/run | 1 + srcpkgs/vaultwarden/files/vaultwarden/run | 6 +++ srcpkgs/vaultwarden/patches/config.patch | 41 +++++++++++++++++++ srcpkgs/vaultwarden/template | 25 +++++++++++ 4 files changed, 73 insertions(+) create mode 120000 srcpkgs/vaultwarden/files/vaultwarden/log/run create mode 100644 srcpkgs/vaultwarden/files/vaultwarden/run create mode 100644 srcpkgs/vaultwarden/patches/config.patch create mode 100644 srcpkgs/vaultwarden/template diff --git a/srcpkgs/vaultwarden/files/vaultwarden/log/run b/srcpkgs/vaultwarden/files/vaultwarden/log/run new file mode 120000 index 000000000000..3a5b4a586051 --- /dev/null +++ b/srcpkgs/vaultwarden/files/vaultwarden/log/run @@ -0,0 +1 @@ +/usr/bin/vlogger \ No newline at end of file diff --git a/srcpkgs/vaultwarden/files/vaultwarden/run b/srcpkgs/vaultwarden/files/vaultwarden/run new file mode 100644 index 000000000000..ff5d0c6af46d --- /dev/null +++ b/srcpkgs/vaultwarden/files/vaultwarden/run @@ -0,0 +1,6 @@ +#!/bin/sh +[ -r ./conf ] && . ./conf +ENV_FILE=${ENV_FILE:-/etc/vaultwarden.conf} +export ENV_FILE + +exec chpst -u _vaultwarden:_vaultwarden vaultwarden diff --git a/srcpkgs/vaultwarden/patches/config.patch b/srcpkgs/vaultwarden/patches/config.patch new file mode 100644 index 000000000000..54aa626ad1cf --- /dev/null +++ b/srcpkgs/vaultwarden/patches/config.patch @@ -0,0 +1,41 @@ +diff --git a/.env.template b/.env.template +index 66a0434..cebac33 100644 +--- a/.env.template ++++ b/.env.template +@@ -10,7 +10,7 @@ + ## vaultwarden. + + ## Main data folder +-# DATA_FOLDER=data ++DATA_FOLDER=/var/lib/vaultwarden + + ## Database URL + ## When using SQLite, this is the path to the DB file, default to %DATA_FOLDER%/db.sqlite3 +@@ -61,8 +61,8 @@ + # ICON_CACHE_NEGTTL=259200 + + ## Web vault settings +-# WEB_VAULT_FOLDER=web-vault/ +-# WEB_VAULT_ENABLED=true ++# WEB_VAULT_FOLDER=/usr/share/webapps/vaultwarden-web ++WEB_VAULT_ENABLED=false + + ## Enables websocket notifications + # WEBSOCKET_ENABLED=false +@@ -117,7 +117,7 @@ + # LOG_TIMESTAMP_FORMAT="%Y-%m-%d %H:%M:%S.%3f" + + ## Logging to file +-# LOG_FILE=/path/to/log ++# LOG_FILE=/var/log/vaultwarden.log + + ## Logging to Syslog + ## This requires extended logging +@@ -340,6 +340,7 @@ + # ROCKET_PORT=80 # Defaults to 80 in the Docker images, or 8000 otherwise. + # ROCKET_WORKERS=10 + # ROCKET_TLS={certs="/path/to/certs.pem",key="/path/to/key.pem"} ++ROCKET_LIMITS={json=10485760} + + ## Mail specific settings, set SMTP_HOST and SMTP_FROM to enable the mail service. + ## To make sure the email links are pointing to the correct host, set the DOMAIN variable. diff --git a/srcpkgs/vaultwarden/template b/srcpkgs/vaultwarden/template new file mode 100644 index 000000000000..fb129efaa5ae --- /dev/null +++ b/srcpkgs/vaultwarden/template @@ -0,0 +1,25 @@ +# Template file for 'vaultwarden' +pkgname=vaultwarden +version=1.25.1 +revision=1 +build_style=cargo +configure_args="--features sqlite,mysql,postgresql" +hostmakedepends="pkg-config" +makedepends="openssl-devel libmysqlclient-devel postgresql-libs-devel + sqlite-devel" +short_desc="Unofficial Bitwarden compatible server written in Rust" +maintainer="Joel Beckmeyer " +license="GPL-3.0-or-later" +homepage="https://github.com/dani-garcia/vaultwarden" +distfiles="https://github.com/dani-garcia/vaultwarden/archive/${version}.tar.gz" +checksum=6bb938ac3738d0bddb778892ed8832673c8b428232616dba542e9bbd7bc246c1 + +system_accounts="_vaultwarden" +_vaultwarden_homedir="/var/lib/vaultwarden" + +make_dirs="/var/lib/vaultwarden 0750 _vaultwarden _vaultwarden" + +post_install() { + vsconf .env.template vaultwarden.conf + vsv vaultwarden +} From 51ef5e523e0b8a01d8823cc8e71f187e226d4696 Mon Sep 17 00:00:00 2001 From: Joel Beckmeyer Date: Sat, 26 Mar 2022 20:55:52 -0400 Subject: [PATCH 2/2] New package: vaultwarden-web-2022.6.2 --- .../vaultwarden-web/patches/v2022.6.0.patch | 311 ++++++++++++++++++ srcpkgs/vaultwarden-web/template | 30 ++ srcpkgs/vaultwarden-web/update | 2 + 3 files changed, 343 insertions(+) create mode 100644 srcpkgs/vaultwarden-web/patches/v2022.6.0.patch create mode 100644 srcpkgs/vaultwarden-web/template create mode 100644 srcpkgs/vaultwarden-web/update diff --git a/srcpkgs/vaultwarden-web/patches/v2022.6.0.patch b/srcpkgs/vaultwarden-web/patches/v2022.6.0.patch new file mode 100644 index 000000000000..1466ec8e82ac --- /dev/null +++ b/srcpkgs/vaultwarden-web/patches/v2022.6.0.patch @@ -0,0 +1,311 @@ +diff --git a/apps/web/src/404.html b/apps/web/src/404.html +index 6cf5e363d..54d11495c 100644 +--- a/apps/web/src/404.html ++++ b/apps/web/src/404.html +@@ -42,11 +42,10 @@ + +

+

+- You can return to the web vault, check our +- status page or +- contact us. ++ You can return to the web vault, or ++ contact us. +

+ +- ++ + + +diff --git a/apps/web/src/app/app.component.ts b/apps/web/src/app/app.component.ts +index 6c462a73e..4a9aeb936 100644 +--- a/apps/web/src/app/app.component.ts ++++ b/apps/web/src/app/app.component.ts +@@ -169,6 +169,10 @@ export class AppComponent implements OnDestroy, OnInit { + break; + } + case "showToast": ++ if (typeof message.text === "string" && typeof crypto.subtle === 'undefined') { ++ message.title="This browser requires HTTPS to use the web vault"; ++ message.text="Check the Vaultwarden wiki for details on how to enable it"; ++ } + this.showToast(message); + break; + case "setFullWidth": +diff --git a/apps/web/src/app/layouts/footer.component.html b/apps/web/src/app/layouts/footer.component.html +index 98836bfd5..a5356be72 100644 +--- a/apps/web/src/app/layouts/footer.component.html ++++ b/apps/web/src/app/layouts/footer.component.html +@@ -1,6 +1,6 @@ +