From 79b41cec0b433db52082fe0bdc0a89a5b11a949e 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 27745bd00eada7e69f107db29db31ed7b145f270 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.0
---
.../vaultwarden-web/patches/v2022.6.0.patch | 311 ++++++++++++++++++
srcpkgs/vaultwarden-web/template | 36 ++
srcpkgs/vaultwarden-web/update | 2 +
3 files changed, 349 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.
+
+
+-
++
+