From 96c629edd745ca5ba8a6868f242b136ce0e650ac 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.2
---
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..5d46f1b4f867
--- /dev/null
+++ b/srcpkgs/vaultwarden/template
@@ -0,0 +1,25 @@
+# Template file for 'vaultwarden'
+pkgname=vaultwarden
+version=1.25.2
+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=f4afc2d8aa7aa59dd1ae16497b6a7f9b412ff426a24868e3081054e611d4824d
+
+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 309ab5ee3118db1fa7909c0a7186323382cf5e35 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.8.1
---
.../vaultwarden-web/patches/v2022.8.0.patch | 314 ++++++++++++++++++
srcpkgs/vaultwarden-web/template | 30 ++
srcpkgs/vaultwarden-web/update | 2 +
3 files changed, 346 insertions(+)
create mode 100644 srcpkgs/vaultwarden-web/patches/v2022.8.0.patch
create mode 100644 srcpkgs/vaultwarden-web/template
create mode 100644 srcpkgs/vaultwarden-web/update
diff --git a/srcpkgs/vaultwarden-web/patches/v2022.8.0.patch b/srcpkgs/vaultwarden-web/patches/v2022.8.0.patch
new file mode 100644
index 000000000000..c6a4869f6134
--- /dev/null
+++ b/srcpkgs/vaultwarden-web/patches/v2022.8.0.patch
@@ -0,0 +1,314 @@
+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.
+
+
+-
++
+