From 062bae3ae2d1003188ae1457f46a8ad48a3686c9 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.0 --- 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..c71af0eb1b12 --- /dev/null +++ b/srcpkgs/vaultwarden/patches/config.patch @@ -0,0 +1,41 @@ +diff --git a/.env.template b/.env.template +index 6af6b53..18b7f98 100644 +--- a/.env.template ++++ b/.env.template +@@ -5,7 +5,7 @@ + ## in the admin interface. Those overrides are stored within DATA_FOLDER/config.json . + + ## 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 +@@ -46,8 +46,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 +@@ -103,7 +103,7 @@ + + ## Logging to file + ## It's recommended to also set 'ROCKET_CLI_COLORS=off' +-# LOG_FILE=/path/to/log ++# LOG_FILE=/var/log/vaultwarden.log + + ## Logging to Syslog + ## This requires extended logging +@@ -291,6 +291,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..7d769e2052b7 --- /dev/null +++ b/srcpkgs/vaultwarden/template @@ -0,0 +1,25 @@ +# Template file for 'vaultwarden' +pkgname=vaultwarden +version=1.25.0 +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=5391f60b3afa9b66cad03cc19903ccc5ad229cbfde142041c7f910d60fd2d2cf + +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 ca7d8b7cc5a8029950a15f96c88fd627651f903c 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.05.0 --- .../vaultwarden-web/patches/v2022.05.0.patch | 312 ++++++++++++++++++ srcpkgs/vaultwarden-web/template | 36 ++ srcpkgs/vaultwarden-web/update | 2 + 3 files changed, 350 insertions(+) create mode 100644 srcpkgs/vaultwarden-web/patches/v2022.05.0.patch create mode 100644 srcpkgs/vaultwarden-web/template create mode 100644 srcpkgs/vaultwarden-web/update diff --git a/srcpkgs/vaultwarden-web/patches/v2022.05.0.patch b/srcpkgs/vaultwarden-web/patches/v2022.05.0.patch new file mode 100644 index 000000000000..8ed7c0f6a433 --- /dev/null +++ b/srcpkgs/vaultwarden-web/patches/v2022.05.0.patch @@ -0,0 +1,312 @@ +Submodule jslib contains modified content +diff --git a/jslib/angular/src/components/register.component.ts b/jslib/angular/src/components/register.component.ts +index d4b99e17..c1626200 100644 +--- a/jslib/angular/src/components/register.component.ts ++++ b/jslib/angular/src/components/register.component.ts +@@ -28,7 +28,7 @@ export class RegisterComponent extends CaptchaProtectedComponent implements OnIn + formPromise: Promise; + masterPasswordScore: number; + referenceData: ReferenceEventRequest; +- showTerms = true; ++ showTerms = false; + acceptPolicies = false; + + protected successRoute = "login"; +@@ -47,7 +47,7 @@ export class RegisterComponent extends CaptchaProtectedComponent implements OnIn + protected logService: LogService + ) { + super(environmentService, i18nService, platformUtilsService); +- this.showTerms = !platformUtilsService.isSelfHost(); ++ this.showTerms = false; + } + + async ngOnInit() { +@@ -85,6 +85,15 @@ export class RegisterComponent extends CaptchaProtectedComponent implements OnIn + } + + async submit() { ++ if (typeof crypto.subtle === 'undefined') { ++ this.platformUtilsService.showToast( ++ "error", ++ "This browser requires HTTPS to use the web vault", ++ "Check the Vaultwarden wiki for details on how to enable it" ++ ); ++ return; ++ } ++ + if (!this.acceptPolicies && this.showTerms) { + this.platformUtilsService.showToast( + "error", +diff --git a/src/404.html b/src/404.html +index 6cf5e363..54d11495 100644 +--- a/src/404.html ++++ b/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/src/app/app.component.ts b/src/app/app.component.ts +index 9e26f680..dd759fd7 100644 +--- a/src/app/app.component.ts ++++ b/src/app/app.component.ts +@@ -165,6 +165,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/src/app/layouts/footer.component.html b/src/app/layouts/footer.component.html +index 8601e123..22a0248b 100644 +--- a/src/app/layouts/footer.component.html ++++ b/src/app/layouts/footer.component.html +@@ -1,6 +1,6 @@ +