Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] New packages: vaultwarden-web-2.28.1, vaultwarden-1.25.0
@ 2022-05-23 17:23 TinfoilSubmarine
  2022-05-23 17:28 ` [PR PATCH] [Updated] " TinfoilSubmarine
                   ` (23 more replies)
  0 siblings, 24 replies; 25+ messages in thread
From: TinfoilSubmarine @ 2022-05-23 17:23 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1272 bytes --]

There is a new pull request by TinfoilSubmarine against master on the void-packages repository

https://github.com/TinfoilSubmarine/void-packages maint/vaultwarden
https://github.com/void-linux/void-packages/pull/37258

New packages: vaultwarden-web-2.28.1, vaultwarden-1.25.0
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **YES**

#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/37258.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-maint/vaultwarden-37258.patch --]
[-- Type: text/x-diff, Size: 13173 bytes --]

From 4265199e52330150a5d2efbba68df97c7c3ffffb Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Sat, 26 Mar 2022 20:55:52 -0400
Subject: [PATCH 1/2] New package: vaultwarden-web-2.28.1

---
 srcpkgs/vaultwarden-web/template | 38 ++++++++++++++++++++++++++++++++
 1 file changed, 38 insertions(+)
 create mode 100644 srcpkgs/vaultwarden-web/template

diff --git a/srcpkgs/vaultwarden-web/template b/srcpkgs/vaultwarden-web/template
new file mode 100644
index 000000000000..3f82acbd9df5
--- /dev/null
+++ b/srcpkgs/vaultwarden-web/template
@@ -0,0 +1,38 @@
+# Template file for 'vaultwarden-web'
+pkgname=vaultwarden-web
+version=2.28.1
+revision=1
+_patch_version=2.28.0
+create_wrksrc=yes
+hostmakedepends="git nodejs"
+short_desc="Web vault builds for vaultwarden"
+maintainer="Joel Beckmeyer <joel@beckmeyer.us>"
+license="GPL-3.0-or-later"
+homepage="https://github.com/dani-garcia/bw_web_builds"
+distfiles="https://raw.githubusercontent.com/dani-garcia/bw_web_builds/v${version}/patches/v${_patch_version}.patch"
+checksum=5abd6c839f2a2ed340b46bd1a0ecde8c71adba12bc72e97e69832077b639e874
+
+post_fetch() {
+	# need to directly clone and checkout version so we can pull in submodules
+	git clone https://github.com/bitwarden/web ${wrksrc}
+	cd ${wrksrc}
+	git checkout "v${version}"
+	git submodule update --init
+}
+
+post_patch() {
+	patch --forward --strip=1 --input="v${version}.patch"
+}
+
+do_configure() {
+	npm ci
+}
+
+do_build() {
+	npm run dist:oss:selfhost
+}
+
+do_install() {
+	vmkdir usr/share/webapps/vaultwarden-web
+	vcopy build/* usr/share/webapps/vaultwarden-web
+}

From c96664e52f4c3b53eb6e5408ec6dfe62b2efdabe Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Thu, 17 Feb 2022 13:25:21 -0500
Subject: [PATCH 2/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 +++++++++
 .../dashmap_available_parallelism.patch       | 14 +++
 .../vaultwarden/patches/format_strings.patch  | 89 +++++++++++++++++++
 srcpkgs/vaultwarden/patches/rust_1.60.patch   | 19 ++++
 srcpkgs/vaultwarden/template                  | 25 ++++++
 7 files changed, 195 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/patches/dashmap_available_parallelism.patch
 create mode 100644 srcpkgs/vaultwarden/patches/format_strings.patch
 create mode 100644 srcpkgs/vaultwarden/patches/rust_1.60.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/patches/dashmap_available_parallelism.patch b/srcpkgs/vaultwarden/patches/dashmap_available_parallelism.patch
new file mode 100644
index 000000000000..64959f872cb2
--- /dev/null
+++ b/srcpkgs/vaultwarden/patches/dashmap_available_parallelism.patch
@@ -0,0 +1,14 @@
+diff --git a/Cargo.toml b/Cargo.toml
+index 1ccd16c..5d0dab6 100644
+--- a/Cargo.toml
++++ b/Cargo.toml
+@@ -155,6 +155,9 @@ mimalloc = { version = "0.1.29", features = ["secure"], default-features = false
+ # 2022-05-04: Forked/Updated the job_scheduler again use the latest dependencies and some fixes.
+ job_scheduler = { git = 'https://github.com/BlackDex/job_scheduler', rev = '9100fc596a083fd9c0b560f8f11f108e0a19d07e' }
+ 
++# revert a commit that breaks Rust 1.57 support
++dashmap = { git = 'https://github.com/TinfoilSubmarine/dashmap', rev = '1008b24de43aabaaa87d35171d588d09aba0865d' }
++
+ # Strip debuginfo from the release builds
+ # Also enable thin LTO for some optimizations
+ [profile.release]
diff --git a/srcpkgs/vaultwarden/patches/format_strings.patch b/srcpkgs/vaultwarden/patches/format_strings.patch
new file mode 100644
index 000000000000..a20ab1ca812b
--- /dev/null
+++ b/srcpkgs/vaultwarden/patches/format_strings.patch
@@ -0,0 +1,89 @@
+diff --git a/src/api/icons.rs b/src/api/icons.rs
+index 71c4899..75e45ee 100644
+--- a/src/api/icons.rs
++++ b/src/api/icons.rs
+@@ -60,7 +60,7 @@ static CLIENT: Lazy<Client> = Lazy::new(|| {
+     match client.build() {
+         Ok(client) => client,
+         Err(e) => {
+-            error!("Possible trust-dns error, trying with trust-dns disabled: '{e}'");
++            error!("Possible trust-dns error, trying with trust-dns disabled: '{}'", e);
+             get_reqwest_client_builder()
+                 .cookie_provider(cookie_store)
+                 .timeout(Duration::from_secs(CONFIG.icon_download_timeout()))
+@@ -454,7 +454,7 @@ async fn get_favicons_node(
+                     }
+                 } else if tag.name == TAG_BASE && tag.attributes.contains_key(ATTR_HREF) {
+                     let href = std::str::from_utf8(tag.attributes.get(ATTR_HREF).unwrap()).unwrap_or_default();
+-                    debug!("Found base href: {href}");
++                    debug!("Found base href: {}", href);
+                     base_url = match base_url.join(href) {
+                         Ok(inner_url) => inner_url,
+                         _ => url.clone(),
+@@ -503,8 +503,8 @@ struct IconUrlResult {
+ /// ```
+ async fn get_icon_url(domain: &str) -> Result<IconUrlResult, Error> {
+     // Default URL with secure and insecure schemes
+-    let ssldomain = format!("https://{domain}");
+-    let httpdomain = format!("http://{domain}");
++    let ssldomain = format!("https://{}", domain);
++    let httpdomain = format!("http://{}", domain);
+ 
+     // First check the domain as given during the request for both HTTPS and HTTP.
+     let resp = match get_page(&ssldomain).or_else(|_| get_page(&httpdomain)).await {
+@@ -522,20 +522,20 @@ async fn get_icon_url(domain: &str) -> Result<IconUrlResult, Error> {
+                     base = domain_parts.next_back().unwrap()
+                 );
+                 if is_valid_domain(&base_domain).await {
+-                    let sslbase = format!("https://{base_domain}");
+-                    let httpbase = format!("http://{base_domain}");
+-                    debug!("[get_icon_url]: Trying without subdomains '{base_domain}'");
++                    let sslbase = format!("https://{}", base_domain);
++                    let httpbase = format!("http://{}", base_domain);
++                    debug!("[get_icon_url]: Trying without subdomains '{}'", base_domain);
+ 
+                     sub_resp = get_page(&sslbase).or_else(|_| get_page(&httpbase)).await;
+                 }
+ 
+             // When the domain is not an IP, and has less then 2 dots, try to add www. infront of it.
+             } else if is_ip.is_err() && domain.matches('.').count() < 2 {
+-                let www_domain = format!("www.{domain}");
++                let www_domain = format!("www.{}", domain);
+                 if is_valid_domain(&www_domain).await {
+-                    let sslwww = format!("https://{www_domain}");
+-                    let httpwww = format!("http://{www_domain}");
+-                    debug!("[get_icon_url]: Trying with www. prefix '{www_domain}'");
++                    let sslwww = format!("https://{}", www_domain);
++                    let httpwww = format!("http://{}", www_domain);
++                    debug!("[get_icon_url]: Trying with www. prefix '{}'", www_domain);
+ 
+                     sub_resp = get_page(&sslwww).or_else(|_| get_page(&httpwww)).await;
+                 }
+@@ -567,10 +567,10 @@ async fn get_icon_url(domain: &str) -> Result<IconUrlResult, Error> {
+         get_favicons_node(dom, &mut iconlist, &url).await;
+     } else {
+         // Add the default favicon.ico to the list with just the given domain
+-        iconlist.push(Icon::new(35, format!("{ssldomain}/favicon.ico")));
+-        iconlist.push(Icon::new(40, format!("{ssldomain}/apple-touch-icon.png")));
+-        iconlist.push(Icon::new(35, format!("{httpdomain}/favicon.ico")));
+-        iconlist.push(Icon::new(40, format!("{httpdomain}/apple-touch-icon.png")));
++        iconlist.push(Icon::new(35, format!("{}/favicon.ico", ssldomain)));
++        iconlist.push(Icon::new(40, format!("{}/apple-touch-icon.png", ssldomain)));
++        iconlist.push(Icon::new(35, format!("{}/favicon.ico", httpdomain)));
++        iconlist.push(Icon::new(40, format!("{}/apple-touch-icon.png", httpdomain)));
+     }
+ 
+     // Sort the iconlist by priority
+diff --git a/src/util.rs b/src/util.rs
+index de61a35..d8cc111 100644
+--- a/src/util.rs
++++ b/src/util.rs
+@@ -619,7 +619,7 @@ pub fn get_reqwest_client() -> Client {
+     match get_reqwest_client_builder().build() {
+         Ok(client) => client,
+         Err(e) => {
+-            error!("Possible trust-dns error, trying with trust-dns disabled: '{e}'");
++            error!("Possible trust-dns error, trying with trust-dns disabled: '{}'", e);
+             get_reqwest_client_builder().trust_dns(false).build().expect("Failed to build client")
+         }
+     }
diff --git a/srcpkgs/vaultwarden/patches/rust_1.60.patch b/srcpkgs/vaultwarden/patches/rust_1.60.patch
new file mode 100644
index 000000000000..afb4ea14e2c8
--- /dev/null
+++ b/srcpkgs/vaultwarden/patches/rust_1.60.patch
@@ -0,0 +1,19 @@
+diff --git a/Cargo.toml b/Cargo.toml
+index 3278c70..1ccd16c 100644
+--- a/Cargo.toml
++++ b/Cargo.toml
+@@ -3,7 +3,7 @@ name = "vaultwarden"
+ version = "1.0.0"
+ authors = ["Daniel García <dani-garcia@users.noreply.github.com>"]
+ edition = "2021"
+-rust-version = "1.60"
++rust-version = "1.57"
+ resolver = "2"
+ 
+ repository = "https://github.com/dani-garcia/vaultwarden"
+@@ -158,5 +158,4 @@ job_scheduler = { git = 'https://github.com/BlackDex/job_scheduler', rev = '9100
+ # Strip debuginfo from the release builds
+ # Also enable thin LTO for some optimizations
+ [profile.release]
+-strip = "debuginfo"
+ lto = "thin"
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 <joel@beckmeyer.us>"
+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
+}

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PR PATCH] [Updated] New packages: vaultwarden-web-2.28.1, vaultwarden-1.25.0
  2022-05-23 17:23 [PR PATCH] New packages: vaultwarden-web-2.28.1, vaultwarden-1.25.0 TinfoilSubmarine
@ 2022-05-23 17:28 ` TinfoilSubmarine
  2022-05-23 18:07 ` [PR REVIEW] " classabbyamp
                   ` (22 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: TinfoilSubmarine @ 2022-05-23 17:28 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1277 bytes --]

There is an updated pull request by TinfoilSubmarine against master on the void-packages repository

https://github.com/TinfoilSubmarine/void-packages maint/vaultwarden
https://github.com/void-linux/void-packages/pull/37258

New packages: vaultwarden-web-2.28.1, vaultwarden-1.25.0
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **YES**

#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/37258.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-maint/vaultwarden-37258.patch --]
[-- Type: text/x-diff, Size: 13180 bytes --]

From d0ba526665e652547a860bd5ac035bcb65f1f086 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Sat, 26 Mar 2022 20:55:52 -0400
Subject: [PATCH 1/2] New package: vaultwarden-web-2.28.1

---
 srcpkgs/vaultwarden-web/template | 38 ++++++++++++++++++++++++++++++++
 1 file changed, 38 insertions(+)
 create mode 100644 srcpkgs/vaultwarden-web/template

diff --git a/srcpkgs/vaultwarden-web/template b/srcpkgs/vaultwarden-web/template
new file mode 100644
index 000000000000..1419945733fb
--- /dev/null
+++ b/srcpkgs/vaultwarden-web/template
@@ -0,0 +1,38 @@
+# Template file for 'vaultwarden-web'
+pkgname=vaultwarden-web
+version=2.28.1
+revision=1
+_patch_version=2.28.0
+create_wrksrc=yes
+hostmakedepends="git nodejs"
+short_desc="Web vault builds for vaultwarden"
+maintainer="Joel Beckmeyer <joel@beckmeyer.us>"
+license="GPL-3.0-or-later"
+homepage="https://github.com/dani-garcia/bw_web_builds"
+distfiles="https://raw.githubusercontent.com/dani-garcia/bw_web_builds/v${version}/patches/v${_patch_version}.patch"
+checksum=5abd6c839f2a2ed340b46bd1a0ecde8c71adba12bc72e97e69832077b639e874
+
+post_fetch() {
+	# need to directly clone and checkout version so we can pull in submodules
+	git clone https://github.com/bitwarden/web ${wrksrc}
+	cd ${wrksrc}
+	git checkout "v${version}"
+	git submodule update --init
+}
+
+post_patch() {
+	patch --forward --strip=1 --input="v${_patch_version}.patch"
+}
+
+do_configure() {
+	npm ci
+}
+
+do_build() {
+	npm run dist:oss:selfhost
+}
+
+do_install() {
+	vmkdir usr/share/webapps/vaultwarden-web
+	vcopy build/* usr/share/webapps/vaultwarden-web
+}

From b0c3631cebe6f08e1d0c924c65eccbe8177872f0 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Thu, 17 Feb 2022 13:25:21 -0500
Subject: [PATCH 2/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 +++++++++
 .../dashmap_available_parallelism.patch       | 14 +++
 .../vaultwarden/patches/format_strings.patch  | 89 +++++++++++++++++++
 srcpkgs/vaultwarden/patches/rust_1.60.patch   | 19 ++++
 srcpkgs/vaultwarden/template                  | 25 ++++++
 7 files changed, 195 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/patches/dashmap_available_parallelism.patch
 create mode 100644 srcpkgs/vaultwarden/patches/format_strings.patch
 create mode 100644 srcpkgs/vaultwarden/patches/rust_1.60.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/patches/dashmap_available_parallelism.patch b/srcpkgs/vaultwarden/patches/dashmap_available_parallelism.patch
new file mode 100644
index 000000000000..64959f872cb2
--- /dev/null
+++ b/srcpkgs/vaultwarden/patches/dashmap_available_parallelism.patch
@@ -0,0 +1,14 @@
+diff --git a/Cargo.toml b/Cargo.toml
+index 1ccd16c..5d0dab6 100644
+--- a/Cargo.toml
++++ b/Cargo.toml
+@@ -155,6 +155,9 @@ mimalloc = { version = "0.1.29", features = ["secure"], default-features = false
+ # 2022-05-04: Forked/Updated the job_scheduler again use the latest dependencies and some fixes.
+ job_scheduler = { git = 'https://github.com/BlackDex/job_scheduler', rev = '9100fc596a083fd9c0b560f8f11f108e0a19d07e' }
+ 
++# revert a commit that breaks Rust 1.57 support
++dashmap = { git = 'https://github.com/TinfoilSubmarine/dashmap', rev = '1008b24de43aabaaa87d35171d588d09aba0865d' }
++
+ # Strip debuginfo from the release builds
+ # Also enable thin LTO for some optimizations
+ [profile.release]
diff --git a/srcpkgs/vaultwarden/patches/format_strings.patch b/srcpkgs/vaultwarden/patches/format_strings.patch
new file mode 100644
index 000000000000..a20ab1ca812b
--- /dev/null
+++ b/srcpkgs/vaultwarden/patches/format_strings.patch
@@ -0,0 +1,89 @@
+diff --git a/src/api/icons.rs b/src/api/icons.rs
+index 71c4899..75e45ee 100644
+--- a/src/api/icons.rs
++++ b/src/api/icons.rs
+@@ -60,7 +60,7 @@ static CLIENT: Lazy<Client> = Lazy::new(|| {
+     match client.build() {
+         Ok(client) => client,
+         Err(e) => {
+-            error!("Possible trust-dns error, trying with trust-dns disabled: '{e}'");
++            error!("Possible trust-dns error, trying with trust-dns disabled: '{}'", e);
+             get_reqwest_client_builder()
+                 .cookie_provider(cookie_store)
+                 .timeout(Duration::from_secs(CONFIG.icon_download_timeout()))
+@@ -454,7 +454,7 @@ async fn get_favicons_node(
+                     }
+                 } else if tag.name == TAG_BASE && tag.attributes.contains_key(ATTR_HREF) {
+                     let href = std::str::from_utf8(tag.attributes.get(ATTR_HREF).unwrap()).unwrap_or_default();
+-                    debug!("Found base href: {href}");
++                    debug!("Found base href: {}", href);
+                     base_url = match base_url.join(href) {
+                         Ok(inner_url) => inner_url,
+                         _ => url.clone(),
+@@ -503,8 +503,8 @@ struct IconUrlResult {
+ /// ```
+ async fn get_icon_url(domain: &str) -> Result<IconUrlResult, Error> {
+     // Default URL with secure and insecure schemes
+-    let ssldomain = format!("https://{domain}");
+-    let httpdomain = format!("http://{domain}");
++    let ssldomain = format!("https://{}", domain);
++    let httpdomain = format!("http://{}", domain);
+ 
+     // First check the domain as given during the request for both HTTPS and HTTP.
+     let resp = match get_page(&ssldomain).or_else(|_| get_page(&httpdomain)).await {
+@@ -522,20 +522,20 @@ async fn get_icon_url(domain: &str) -> Result<IconUrlResult, Error> {
+                     base = domain_parts.next_back().unwrap()
+                 );
+                 if is_valid_domain(&base_domain).await {
+-                    let sslbase = format!("https://{base_domain}");
+-                    let httpbase = format!("http://{base_domain}");
+-                    debug!("[get_icon_url]: Trying without subdomains '{base_domain}'");
++                    let sslbase = format!("https://{}", base_domain);
++                    let httpbase = format!("http://{}", base_domain);
++                    debug!("[get_icon_url]: Trying without subdomains '{}'", base_domain);
+ 
+                     sub_resp = get_page(&sslbase).or_else(|_| get_page(&httpbase)).await;
+                 }
+ 
+             // When the domain is not an IP, and has less then 2 dots, try to add www. infront of it.
+             } else if is_ip.is_err() && domain.matches('.').count() < 2 {
+-                let www_domain = format!("www.{domain}");
++                let www_domain = format!("www.{}", domain);
+                 if is_valid_domain(&www_domain).await {
+-                    let sslwww = format!("https://{www_domain}");
+-                    let httpwww = format!("http://{www_domain}");
+-                    debug!("[get_icon_url]: Trying with www. prefix '{www_domain}'");
++                    let sslwww = format!("https://{}", www_domain);
++                    let httpwww = format!("http://{}", www_domain);
++                    debug!("[get_icon_url]: Trying with www. prefix '{}'", www_domain);
+ 
+                     sub_resp = get_page(&sslwww).or_else(|_| get_page(&httpwww)).await;
+                 }
+@@ -567,10 +567,10 @@ async fn get_icon_url(domain: &str) -> Result<IconUrlResult, Error> {
+         get_favicons_node(dom, &mut iconlist, &url).await;
+     } else {
+         // Add the default favicon.ico to the list with just the given domain
+-        iconlist.push(Icon::new(35, format!("{ssldomain}/favicon.ico")));
+-        iconlist.push(Icon::new(40, format!("{ssldomain}/apple-touch-icon.png")));
+-        iconlist.push(Icon::new(35, format!("{httpdomain}/favicon.ico")));
+-        iconlist.push(Icon::new(40, format!("{httpdomain}/apple-touch-icon.png")));
++        iconlist.push(Icon::new(35, format!("{}/favicon.ico", ssldomain)));
++        iconlist.push(Icon::new(40, format!("{}/apple-touch-icon.png", ssldomain)));
++        iconlist.push(Icon::new(35, format!("{}/favicon.ico", httpdomain)));
++        iconlist.push(Icon::new(40, format!("{}/apple-touch-icon.png", httpdomain)));
+     }
+ 
+     // Sort the iconlist by priority
+diff --git a/src/util.rs b/src/util.rs
+index de61a35..d8cc111 100644
+--- a/src/util.rs
++++ b/src/util.rs
+@@ -619,7 +619,7 @@ pub fn get_reqwest_client() -> Client {
+     match get_reqwest_client_builder().build() {
+         Ok(client) => client,
+         Err(e) => {
+-            error!("Possible trust-dns error, trying with trust-dns disabled: '{e}'");
++            error!("Possible trust-dns error, trying with trust-dns disabled: '{}'", e);
+             get_reqwest_client_builder().trust_dns(false).build().expect("Failed to build client")
+         }
+     }
diff --git a/srcpkgs/vaultwarden/patches/rust_1.60.patch b/srcpkgs/vaultwarden/patches/rust_1.60.patch
new file mode 100644
index 000000000000..afb4ea14e2c8
--- /dev/null
+++ b/srcpkgs/vaultwarden/patches/rust_1.60.patch
@@ -0,0 +1,19 @@
+diff --git a/Cargo.toml b/Cargo.toml
+index 3278c70..1ccd16c 100644
+--- a/Cargo.toml
++++ b/Cargo.toml
+@@ -3,7 +3,7 @@ name = "vaultwarden"
+ version = "1.0.0"
+ authors = ["Daniel García <dani-garcia@users.noreply.github.com>"]
+ edition = "2021"
+-rust-version = "1.60"
++rust-version = "1.57"
+ resolver = "2"
+ 
+ repository = "https://github.com/dani-garcia/vaultwarden"
+@@ -158,5 +158,4 @@ job_scheduler = { git = 'https://github.com/BlackDex/job_scheduler', rev = '9100
+ # Strip debuginfo from the release builds
+ # Also enable thin LTO for some optimizations
+ [profile.release]
+-strip = "debuginfo"
+ lto = "thin"
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 <joel@beckmeyer.us>"
+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
+}

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PR REVIEW] New packages: vaultwarden-web-2.28.1, vaultwarden-1.25.0
  2022-05-23 17:23 [PR PATCH] New packages: vaultwarden-web-2.28.1, vaultwarden-1.25.0 TinfoilSubmarine
  2022-05-23 17:28 ` [PR PATCH] [Updated] " TinfoilSubmarine
@ 2022-05-23 18:07 ` classabbyamp
  2022-05-23 18:07 ` classabbyamp
                   ` (21 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: classabbyamp @ 2022-05-23 18:07 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 391 bytes --]

New review comment by classabbyamp on void-packages repository

https://github.com/void-linux/void-packages/pull/37258#discussion_r879740086

Comment:
instead of using a fork of the dependency, maybe it could be done like other rust packages with dependency patches:
https://github.com/void-linux/void-packages/blob/a46c737fdd1ea39c6ea9f8fd520d0715f2d03b5c/srcpkgs/maturin/template#L25-L29

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PR REVIEW] New packages: vaultwarden-web-2.28.1, vaultwarden-1.25.0
  2022-05-23 17:23 [PR PATCH] New packages: vaultwarden-web-2.28.1, vaultwarden-1.25.0 TinfoilSubmarine
  2022-05-23 17:28 ` [PR PATCH] [Updated] " TinfoilSubmarine
  2022-05-23 18:07 ` [PR REVIEW] " classabbyamp
@ 2022-05-23 18:07 ` classabbyamp
  2022-05-23 18:07 ` classabbyamp
                   ` (20 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: classabbyamp @ 2022-05-23 18:07 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 197 bytes --]

New review comment by classabbyamp on void-packages repository

https://github.com/void-linux/void-packages/pull/37258#discussion_r879734465

Comment:
can this patch be done like standard patches?

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PR REVIEW] New packages: vaultwarden-web-2.28.1, vaultwarden-1.25.0
  2022-05-23 17:23 [PR PATCH] New packages: vaultwarden-web-2.28.1, vaultwarden-1.25.0 TinfoilSubmarine
                   ` (2 preceding siblings ...)
  2022-05-23 18:07 ` classabbyamp
@ 2022-05-23 18:07 ` classabbyamp
  2022-05-23 19:02 ` TinfoilSubmarine
                   ` (19 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: classabbyamp @ 2022-05-23 18:07 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 246 bytes --]

New review comment by classabbyamp on void-packages repository

https://github.com/void-linux/void-packages/pull/37258#discussion_r879733637

Comment:
there's only one submodule. just add it as a distfile and move it into place in `post_extract`

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PR REVIEW] New packages: vaultwarden-web-2.28.1, vaultwarden-1.25.0
  2022-05-23 17:23 [PR PATCH] New packages: vaultwarden-web-2.28.1, vaultwarden-1.25.0 TinfoilSubmarine
                   ` (3 preceding siblings ...)
  2022-05-23 18:07 ` classabbyamp
@ 2022-05-23 19:02 ` TinfoilSubmarine
  2022-05-23 19:22 ` classabbyamp
                   ` (18 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: TinfoilSubmarine @ 2022-05-23 19:02 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 391 bytes --]

New review comment by TinfoilSubmarine on void-packages repository

https://github.com/void-linux/void-packages/pull/37258#discussion_r879784185

Comment:
You mean like the patches included in `srcpkgs/$package/patches`? Yes, it can be applied with the same args to patch (`patch -s -Np1 < v2.28.0.patch`), but we can't just do `mv v2.28.0.patch $PATCHESDIR`. What do you have in mind here?

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PR REVIEW] New packages: vaultwarden-web-2.28.1, vaultwarden-1.25.0
  2022-05-23 17:23 [PR PATCH] New packages: vaultwarden-web-2.28.1, vaultwarden-1.25.0 TinfoilSubmarine
                   ` (4 preceding siblings ...)
  2022-05-23 19:02 ` TinfoilSubmarine
@ 2022-05-23 19:22 ` classabbyamp
  2022-05-23 19:23 ` classabbyamp
                   ` (17 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: classabbyamp @ 2022-05-23 19:22 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 181 bytes --]

New review comment by classabbyamp on void-packages repository

https://github.com/void-linux/void-packages/pull/37258#discussion_r879797222

Comment:
I was thinking just vendor it

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PR REVIEW] New packages: vaultwarden-web-2.28.1, vaultwarden-1.25.0
  2022-05-23 17:23 [PR PATCH] New packages: vaultwarden-web-2.28.1, vaultwarden-1.25.0 TinfoilSubmarine
                   ` (5 preceding siblings ...)
  2022-05-23 19:22 ` classabbyamp
@ 2022-05-23 19:23 ` classabbyamp
  2022-05-23 20:30 ` [PR PATCH] [Updated] " TinfoilSubmarine
                   ` (16 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: classabbyamp @ 2022-05-23 19:23 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 236 bytes --]

New review comment by classabbyamp on void-packages repository

https://github.com/void-linux/void-packages/pull/37258#discussion_r879797222

Comment:
I was thinking just vendor it, put it in the patches dir directly, not as a distfile

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PR PATCH] [Updated] New packages: vaultwarden-web-2.28.1, vaultwarden-1.25.0
  2022-05-23 17:23 [PR PATCH] New packages: vaultwarden-web-2.28.1, vaultwarden-1.25.0 TinfoilSubmarine
                   ` (6 preceding siblings ...)
  2022-05-23 19:23 ` classabbyamp
@ 2022-05-23 20:30 ` TinfoilSubmarine
  2022-05-23 20:32 ` TinfoilSubmarine
                   ` (15 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: TinfoilSubmarine @ 2022-05-23 20:30 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1277 bytes --]

There is an updated pull request by TinfoilSubmarine against master on the void-packages repository

https://github.com/TinfoilSubmarine/void-packages maint/vaultwarden
https://github.com/void-linux/void-packages/pull/37258

New packages: vaultwarden-web-2.28.1, vaultwarden-1.25.0
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **YES**

#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/37258.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-maint/vaultwarden-37258.patch --]
[-- Type: text/x-diff, Size: 38631 bytes --]

From d79d625f22b05eb44535961f634c5d1bc485931a Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Mon, 23 May 2022 10:27:21 -0400
Subject: [PATCH 01/11] New package: python3-darkdetect-0.6.0

---
 srcpkgs/python3-darkdetect/template | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
 create mode 100644 srcpkgs/python3-darkdetect/template

diff --git a/srcpkgs/python3-darkdetect/template b/srcpkgs/python3-darkdetect/template
new file mode 100644
index 000000000000..b9e0f32190c9
--- /dev/null
+++ b/srcpkgs/python3-darkdetect/template
@@ -0,0 +1,18 @@
+# Template file for 'python3-darkdetect'
+pkgname=python3-darkdetect
+version=0.6.0
+revision=1
+wrksrc="darkdetect-${version}"
+build_style=python3-module
+hostmakedepends="python3-setuptools"
+short_desc="Detect OS Dark Mode from Python"
+maintainer="Joel Beckmeyer <joel@beckmeyer.us>"
+license="BSD-3-Clause"
+homepage="http://github.com/albertosottile/darkdetect"
+distfiles="${PYPI_SITE}/d/darkdetect/darkdetect-${version}.tar.gz"
+checksum=7993275b537b4579ba2eee7673b0b95783f99c7ddb82a9f90dc077a379b427f1
+make_check=no # no tests included
+
+post_install() {
+	vlicense LICENSE
+}

From 67e324a1bfec49262a7ab8c77b479361cd9f8054 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Mon, 23 May 2022 10:22:37 -0400
Subject: [PATCH 02/11] New package: python3-gaphas-3.6.0

---
 srcpkgs/python3-gaphas/template | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
 create mode 100644 srcpkgs/python3-gaphas/template

diff --git a/srcpkgs/python3-gaphas/template b/srcpkgs/python3-gaphas/template
new file mode 100644
index 000000000000..b4fb4dca7968
--- /dev/null
+++ b/srcpkgs/python3-gaphas/template
@@ -0,0 +1,16 @@
+# Template file for 'python3-gaphas'
+pkgname=python3-gaphas
+version=3.6.0
+revision=1
+wrksrc="gaphas-${version}"
+build_style=python3-pep517
+hostmakedepends="python3-poetry-core"
+depends="python3-gobject python3-cairo"
+checkdepends="python3-pytest xvfb-run gtk4 $depends"
+short_desc="GTK+ diagramming widget library for Python"
+maintainer="Joel Beckmeyer <joel@beckmeyer.us>"
+license="Apache-2.0"
+homepage="https://gaphas.readthedocs.io"
+distfiles="https://github.com/gaphor/gaphas/archive/${version}.tar.gz"
+checksum=96f1be036cf5155dc15508257acf3663cd3ec12154f6ce5011aead10e80c40d1
+make_check_pre="xvfb-run"

From cc9364bcc2c0bccc6324b2e81dde5de8dcba357e Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Mon, 23 May 2022 11:17:26 -0400
Subject: [PATCH 03/11] New package: python3-flit_scm-1.5.0

---
 .../patches/relax_version_constraints.patch   | 39 +++++++++++++++++++
 srcpkgs/python3-flit_scm/template             | 19 +++++++++
 2 files changed, 58 insertions(+)
 create mode 100644 srcpkgs/python3-flit_scm/patches/relax_version_constraints.patch
 create mode 100644 srcpkgs/python3-flit_scm/template

diff --git a/srcpkgs/python3-flit_scm/patches/relax_version_constraints.patch b/srcpkgs/python3-flit_scm/patches/relax_version_constraints.patch
new file mode 100644
index 000000000000..658d1e950276
--- /dev/null
+++ b/srcpkgs/python3-flit_scm/patches/relax_version_constraints.patch
@@ -0,0 +1,39 @@
+From ccbb547dea83e13799946b6bf639ea1c678e3ed0 Mon Sep 17 00:00:00 2001
+From: Padraic Fanning <fanninpm@miamioh.edu>
+Date: Sat, 21 May 2022 22:18:50 -0400
+Subject: [PATCH] Relax version constraints
+
+This resolves #5.
+---
+ pyproject.toml | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/pyproject.toml b/pyproject.toml
+index e331fb4..08dcf6e 100644
+--- a/pyproject.toml
++++ b/pyproject.toml
+@@ -18,8 +18,8 @@ classifiers = [
+     "Topic :: Software Development :: Build Tools",
+ ]
+ dependencies = [
+-    "flit-core==3.5.0",
+-    "setuptools_scm==6.4.2",
++    "flit-core~=3.5",
++    "setuptools_scm~=6.4",
+     "tomli>=2,<3",
+ ]
+ dynamic = ["version"]
+@@ -33,8 +33,8 @@ repository = "https://gitlab.com/WillDaSilva/flit_scm"
+ 
+ [build-system]
+ requires = [
+-    "flit-core==3.5.0",
+-    "setuptools_scm==6.4.2",
++    "flit-core~=3.5",
++    "setuptools_scm~=6.4",
+     "tomli>=2,<3",
+ ]
+ build-backend = "flit_scm:buildapi"
+-- 
+GitLab
+
diff --git a/srcpkgs/python3-flit_scm/template b/srcpkgs/python3-flit_scm/template
new file mode 100644
index 000000000000..64049c3d278e
--- /dev/null
+++ b/srcpkgs/python3-flit_scm/template
@@ -0,0 +1,19 @@
+# Template file for 'python3-flit_scm'
+pkgname=python3-flit_scm
+version=1.5.0
+revision=1
+wrksrc="flit_scm-${version}"
+build_style=python3-pep517
+hostmakedepends="python3-flit_core python3-setuptools_scm python3-tomli"
+depends="$hostmakedepends"
+short_desc="Setuptools_scm to version, flit to build - PEP 518 build backend"
+maintainer="Joel Beckmeyer <joel@beckmeyer.us>"
+license="MIT"
+homepage="https://gitlab.com/WillDaSilva/flit_scm"
+distfiles="${PYPI_SITE}/f/flit_scm/flit_scm-${version}.tar.gz"
+checksum=fd0c704375b4424152caced0584cebe4131ccdc236a239dd1a055a80ee935f70
+make_check=no # no tests specified
+
+post_install() {
+	vlicense LICENSE
+}

From 7719290c014015ae9e1f9fbff72d30c0e141ba0f Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Mon, 23 May 2022 11:23:14 -0400
Subject: [PATCH 04/11] New package: python3-exceptiongroup-1.0.0rc7

---
 srcpkgs/python3-exceptiongroup/template | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
 create mode 100644 srcpkgs/python3-exceptiongroup/template

diff --git a/srcpkgs/python3-exceptiongroup/template b/srcpkgs/python3-exceptiongroup/template
new file mode 100644
index 000000000000..c45d77549236
--- /dev/null
+++ b/srcpkgs/python3-exceptiongroup/template
@@ -0,0 +1,19 @@
+# Template file for 'python3-exceptiongroup'
+pkgname=python3-exceptiongroup
+version=1.0.0rc7
+revision=1
+wrksrc="exceptiongroup-${version}"
+build_style=python3-pep517
+hostmakedepends="python3-flit_scm"
+short_desc="Backport of PEP 654 (exception groups)"
+maintainer="Joel Beckmeyer <joel@beckmeyer.us>"
+license="MIT,PSF-2.0"
+homepage="https://github.com/agronholm/exceptiongroup"
+changelog="https://raw.githubusercontent.com/agronholm/exceptiongroup/main/CHANGES.rst"
+distfiles="${PYPI_SITE}/e/exceptiongroup/exceptiongroup-${version}.tar.gz"
+checksum=2019e6e9d6ef84ff65c5c7c451b75802c662d53bcb124abf47ad118d39f9a1ca
+make_check=no # no tests included
+
+post_install() {
+	vlicense LICENSE
+}

From 87f214fd315edf19f456622b2d639e74c01eabe9 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Mon, 23 May 2022 09:55:02 -0400
Subject: [PATCH 05/11] New package: python3-generic-1.1.0

---
 srcpkgs/python3-generic/template | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
 create mode 100644 srcpkgs/python3-generic/template

diff --git a/srcpkgs/python3-generic/template b/srcpkgs/python3-generic/template
new file mode 100644
index 000000000000..a5bc6b73d197
--- /dev/null
+++ b/srcpkgs/python3-generic/template
@@ -0,0 +1,19 @@
+# Template file for 'python3-generic'
+pkgname=python3-generic
+version=1.1.0
+revision=1
+wrksrc="generic-${version}"
+build_style=python3-pep517
+hostmakedepends="python3-poetry-core"
+depends="python3-exceptiongroup"
+checkdepends="python3-pytest $depends"
+short_desc="Generic programming library for Python"
+maintainer="Joel Beckmeyer <joel@beckmeyer.us>"
+license="BSD-3-Clause-Modification"
+homepage="https://generic.readthedocs.io"
+distfiles="https://github.com/gaphor/generic/archive/${version}.tar.gz"
+checksum=8628d1bce4044e7664c149f785d7ad17a388e96c648ee09aef39d73578d52943
+
+post_install() {
+	vlicense LICENSE.txt
+}

From aef9d8f77b73d608868da6c645b97d5f67041cdf Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Mon, 23 May 2022 11:42:45 -0400
Subject: [PATCH 06/11] New package: python3-tinycss2-1.1.1

---
 srcpkgs/python3-tinycss2/template | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)
 create mode 100644 srcpkgs/python3-tinycss2/template

diff --git a/srcpkgs/python3-tinycss2/template b/srcpkgs/python3-tinycss2/template
new file mode 100644
index 000000000000..b9e72e405974
--- /dev/null
+++ b/srcpkgs/python3-tinycss2/template
@@ -0,0 +1,23 @@
+# Template file for 'python3-tinycss2'
+pkgname=python3-tinycss2
+version=1.1.1
+revision=1
+wrksrc=tinycss2-${version}
+build_style=python3-pep517
+hostmakedepends="python3-flit_core python3-webencodings"
+depends="python3-webencodings"
+checkdepends="python3-pytest"
+short_desc="Tiny CSS parser"
+maintainer="Joel Beckmeyer <joel@beckmeyer.us>"
+license="BSD-3-Clause"
+homepage="https://www.courtbouillon.org/tinycss2"
+distfiles="${PYPI_SITE}/t/tinycss2/tinycss2-${version}.tar.gz"
+checksum=b2e44dd8883c360c35dd0d1b5aad0b610e5156c2cb3b33434634e539ead9d8bf
+
+pre_check() {
+	vsed -e '/addopts/d' -i pyproject.toml
+}
+
+post_install() {
+	vlicense LICENSE
+}

From be26f887f8e338056df271d0fd130b9a05208235 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Mon, 23 May 2022 12:52:48 -0400
Subject: [PATCH 07/11] New package: python3-xdoctest-1.0.0

---
 srcpkgs/python3-xdoctest/template | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
 create mode 100644 srcpkgs/python3-xdoctest/template

diff --git a/srcpkgs/python3-xdoctest/template b/srcpkgs/python3-xdoctest/template
new file mode 100644
index 000000000000..ac7d1445b08d
--- /dev/null
+++ b/srcpkgs/python3-xdoctest/template
@@ -0,0 +1,16 @@
+# Template file for 'python3-xdoctest'
+pkgname=python3-xdoctest
+version=1.0.0
+revision=1
+wrksrc="xdoctest-${version}"
+build_style=python3-module
+hostmakedepends="python3-setuptools"
+depends="python3-six"
+checkdepends="python3-pytest $depends"
+short_desc="Doctest with AST instead of REGEX (with pytest plugin integration)"
+maintainer="Joel Beckmeyer <joel@beckmeyer.us>"
+license="Apache-2.0"
+homepage="https://github.com/Erotemic/xdoctest"
+distfiles="https://github.com/gaphor/xdoctest/archive/${version}.tar.gz"
+distfiles="${PYPI_SITE}/x/xdoctest/xdoctest-${version}.tar.gz"
+checksum=7ebba7e71457e6e7cf86c463699575e52b1c9cc32ee2ee5e72256d6cd3aaeb2d

From a76987dc8b472905677fa1d98d2630071deb0980 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Mon, 23 May 2022 10:39:17 -0400
Subject: [PATCH 08/11] New package: gaphor-2.10.0

---
 srcpkgs/gaphor/template | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)
 create mode 100644 srcpkgs/gaphor/template

diff --git a/srcpkgs/gaphor/template b/srcpkgs/gaphor/template
new file mode 100644
index 000000000000..6f14aa39aa6e
--- /dev/null
+++ b/srcpkgs/gaphor/template
@@ -0,0 +1,22 @@
+# Template file for 'gaphor'
+pkgname=gaphor
+version=2.10.0
+revision=1
+wrksrc="gaphor-${version}"
+build_style=python3-pep517
+hostmakedepends="python3-poetry-core"
+depends="python3-cairo python3-gobject python3-gaphas python3-generic
+ python3-tinycss2 python3-jedi python3-darkdetect"
+checkdepends="python3-pytest python3-pytest-timeout python3-hypothesis xvfb-run
+ gtksourceview4 python3-Sphinx $depends"
+short_desc="Simple modeling tool written in Python"
+maintainer="Joel Beckmeyer <joel@beckmeyer.us>"
+license="Apache-2.0"
+homepage="https://gaphor.org"
+distfiles="https://github.com/gaphor/gaphor/archive/${version}.tar.gz"
+checksum=cb2255f9fb31e367999a9e07d6ac814551f34c6d2fb3ffcce5aa5764bc2ffe7f
+make_check_pre="xvfb-run"
+
+pre_check() {
+	vsed -e '/addopts/d' -i pyproject.toml
+}

From 7db1146cac880214c346041fec430ab171d0ecaf Mon Sep 17 00:00:00 2001
From: Andrew Benson <abenson+void@gmail.com>
Date: Mon, 23 May 2022 09:42:51 -0500
Subject: [PATCH 09/11] python3-httpcore: update to 0.15.0.

---
 srcpkgs/python3-httpcore/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/python3-httpcore/template b/srcpkgs/python3-httpcore/template
index 99d7b420fe7c..5491bf7c0cd0 100644
--- a/srcpkgs/python3-httpcore/template
+++ b/srcpkgs/python3-httpcore/template
@@ -1,6 +1,6 @@
 # Template file for 'python3-httpcore'
 pkgname=python3-httpcore
-version=0.14.7
+version=0.15.0
 revision=1
 wrksrc="httpcore-$version"
 build_style=python3-module
@@ -12,7 +12,7 @@ license="BSD-3-Clause"
 homepage="https://www.encode.io/httpcore/"
 changelog="https://raw.githubusercontent.com/encode/httpcore/master/CHANGELOG.md"
 distfiles="https://github.com/encode/httpcore/archive/refs/tags/$version.tar.gz"
-checksum=7f5736b3d1a2382d3b137c8f77d19229f3742789447ef1c1a55bb95918c02277
+checksum=e5458b6342fb6a0cdd58b86c1336516b90ad8879dedc24a9667f9fdf7b4081ea
 make_check=no # at least trustme python module is not packaged
 
 post_install() {

From 8ad68450189b94a720835f694bb422113e67717b Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Sat, 26 Mar 2022 20:55:52 -0400
Subject: [PATCH 10/11] New package: vaultwarden-web-2.28.1

---
 srcpkgs/vaultwarden-web/patches/v2.28.0.patch | 271 ++++++++++++++++++
 srcpkgs/vaultwarden-web/template              |  34 +++
 2 files changed, 305 insertions(+)
 create mode 100644 srcpkgs/vaultwarden-web/patches/v2.28.0.patch
 create mode 100644 srcpkgs/vaultwarden-web/template

diff --git a/srcpkgs/vaultwarden-web/patches/v2.28.0.patch b/srcpkgs/vaultwarden-web/patches/v2.28.0.patch
new file mode 100644
index 000000000000..77ae1affb2b4
--- /dev/null
+++ b/srcpkgs/vaultwarden-web/patches/v2.28.0.patch
@@ -0,0 +1,271 @@
+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<any>;
+   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 @@
+         </a>
+       </p>
+       <p>
+-        You can <a href="/">return to the web vault</a>, check our
+-        <a href="https://status.bitwarden.com/">status page</a> or
+-        <a href="https://bitwarden.com/contact/">contact us</a>.
++        You can <a href="/">return to the web vault</a>, or
++        <a href="https://github.com/dani-garcia/vaultwarden">contact us</a>.
+       </p>
+     </div>
+-    <div class="container footer text-muted content">© Copyright 2022 Bitwarden, Inc.</div>
++    <div class="container footer text-muted content">© Copyright 2022 Bitwarden, Inc. (Powered by Vaultwarden)</div>
+   </body>
+ </html>
+diff --git a/src/app/app.component.ts b/src/app/app.component.ts
+index cd94408f..56bc4bdb 100644
+--- a/src/app/app.component.ts
++++ b/src/app/app.component.ts
+@@ -159,6 +159,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 @@
+ <div class="container footer text-muted">
+   <div class="row">
+-    <div class="col">&copy; {{ year }}, Bitwarden Inc.</div>
++    <div class="col">&copy; {{ year }}, Bitwarden Inc. (Powered by Vaultwarden)</div>
+     <div class="col text-center"></div>
+     <div class="col text-right">
+       {{ "versionNumber" | i18n: version }}
+diff --git a/src/app/layouts/frontend-layout.component.html b/src/app/layouts/frontend-layout.component.html
+index 479302d3..84930683 100644
+--- a/src/app/layouts/frontend-layout.component.html
++++ b/src/app/layouts/frontend-layout.component.html
+@@ -1,5 +1,5 @@
+ <router-outlet></router-outlet>
+ <div class="container my-5 text-muted text-center">
+-  &copy; {{ year }}, Bitwarden Inc. <br />
++  &copy; {{ year }}, Bitwarden Inc. (Powered by Vaultwarden)<br />
+   {{ "versionNumber" | i18n: version }}
+ </div>
+diff --git a/src/app/layouts/navbar.component.html b/src/app/layouts/navbar.component.html
+index c03c2bdf..a074e0c2 100644
+--- a/src/app/layouts/navbar.component.html
++++ b/src/app/layouts/navbar.component.html
+@@ -65,7 +65,7 @@
+           </a>
+           <a
+             class="dropdown-item"
+-            href="https://bitwarden.com/help/"
++            href="https://github.com/dani-garcia/vaultwarden"
+             target="_blank"
+             rel="noopener"
+           >
+diff --git a/src/app/organizations/vault/vault.component.ts b/src/app/organizations/vault/vault.component.ts
+index ea7d683e..2b534e05 100644
+--- a/src/app/organizations/vault/vault.component.ts
++++ b/src/app/organizations/vault/vault.component.ts
+@@ -68,11 +68,7 @@ export class VaultComponent implements OnInit, OnDestroy {
+   ) {}
+ 
+   ngOnInit() {
+-    this.trashCleanupWarning = this.i18nService.t(
+-      this.platformUtilsService.isSelfHost()
+-        ? "trashCleanupWarningSelfHosted"
+-        : "trashCleanupWarning"
+-    );
++    this.trashCleanupWarning = this.i18nService.t("trashCleanupWarningSelfHosted");
+     this.route.parent.params.pipe(first()).subscribe(async (params) => {
+       this.organization = await this.organizationService.get(params.organizationId);
+       this.groupingsComponent.organization = this.organization;
+diff --git a/src/app/send/access.component.html b/src/app/send/access.component.html
+index 19bc107b..7e1dbcc7 100644
+--- a/src/app/send/access.component.html
++++ b/src/app/send/access.component.html
+@@ -137,15 +137,6 @@
+     <div class="col-12 text-center mt-5 text-muted">
+       <p class="mb-0">
+         {{ "sendAccessTaglineProductDesc" | i18n }}<br />
+-        {{ "sendAccessTaglineLearnMore" | i18n }}
+-        <a href="https://www.bitwarden.com/products/send?source=web-vault" target="_blank"
+-          >Bitwarden Send</a
+-        >
+-        {{ "sendAccessTaglineOr" | i18n }}
+-        <a href="https://vault.bitwarden.com/#/register" target="_blank">{{
+-          "sendAccessTaglineSignUp" | i18n
+-        }}</a>
+-        {{ "sendAccessTaglineTryToday" | i18n }}
+       </p>
+     </div>
+   </div>
+diff --git a/src/app/services/services.module.ts b/src/app/services/services.module.ts
+index c8e95320..88f5240c 100644
+--- a/src/app/services/services.module.ts
++++ b/src/app/services/services.module.ts
+@@ -65,11 +65,23 @@ export function initFactory(
+   platformUtilsService: PlatformUtilsServiceAbstraction,
+   cryptoService: CryptoServiceAbstraction
+ ): () => void {
++  function getBaseUrl() {
++      // If the base URL is `https://vaultwarden.example.com/base/path/`,
++      // `window.location.href` should have one of the following forms:
++      //
++      // - `https://vaultwarden.example.com/base/path/`
++      // - `https://vaultwarden.example.com/base/path/#/some/route[?queryParam=...]`
++      //
++      // We want to get to just `https://vaultwarden.example.com/base/path`.
++      let baseUrl = window.location.href;
++      baseUrl = baseUrl.replace(/#.*/, '');  // Strip off `#` and everything after.
++      baseUrl = baseUrl.replace(/\/+$/, ''); // Trim any trailing `/` chars.
++      return baseUrl;
++  }
+   return async () => {
+     await stateService.init();
+ 
+-    const urls = process.env.URLS as Urls;
+-    urls.base ??= window.location.origin;
++    const urls = {base: getBaseUrl()};
+     environmentService.setUrls(urls);
+ 
+     setTimeout(() => notificationsService.init(), 3000);
+diff --git a/src/app/vault/vault.component.ts b/src/app/vault/vault.component.ts
+index c3730bfa..3fab9245 100644
+--- a/src/app/vault/vault.component.ts
++++ b/src/app/vault/vault.component.ts
+@@ -91,11 +91,7 @@ export class VaultComponent implements OnInit, OnDestroy {
+   async ngOnInit() {
+     this.showVerifyEmail = !(await this.tokenService.getEmailVerified());
+     this.showBrowserOutdated = window.navigator.userAgent.indexOf("MSIE") !== -1;
+-    this.trashCleanupWarning = this.i18nService.t(
+-      this.platformUtilsService.isSelfHost()
+-        ? "trashCleanupWarningSelfHosted"
+-        : "trashCleanupWarning"
+-    );
++    this.trashCleanupWarning = this.i18nService.t('trashCleanupWarningSelfHosted');
+ 
+     this.route.queryParams.pipe(first()).subscribe(async (params) => {
+       await this.syncService.fullSync(false);
+diff --git a/src/scss/styles.scss b/src/scss/styles.scss
+index d2678ac8..fb467a7e 100644
+--- a/src/scss/styles.scss
++++ b/src/scss/styles.scss
+@@ -56,3 +56,55 @@
+ @import "./plugins";
+ @import "./tables";
+ @import "./toasts";
++
++
++/**** START Vaultwarden CHANGES ****/
++/* This combines all selectors extending it into one */
++%vw-hide { display: none !important; }
++
++/* This allows searching for the combined style in the browsers dev-tools (look into the head tag) */
++#vw-hide, head { @extend %vw-hide; }
++
++/* Hide any link pointing to billing */
++a[href$="/settings/billing"] { @extend %vw-hide; }
++
++/* Hide any link pointing to subscriptions */
++a[href$="/settings/subscription"] { @extend %vw-hide; }
++
++/* Hide any link pointing to Sponsored Families */
++a[href$="/settings/sponsored-families"] { @extend %vw-hide; }
++
++/* Hide the `Enterprise Single Sign-On` button on the login page */
++a[href$="/sso"] { @extend %vw-hide; }
++
++/* Hide the info box that advertises Bitwarden Send */
++app-send-info.d-block { @extend %vw-hide; }
++
++/* Hide Two-Factor menu in Organization settings */
++app-org-settings a[href$="/settings/two-factor"] { @extend %vw-hide; }
++
++/* Hide organization plans */
++app-organization-plans > form > div.form-check { @extend %vw-hide; }
++app-organization-plans > form > h2.mt-5 { @extend %vw-hide; }
++
++/* Hide the `This account is owned by a business` checkbox and label */
++#ownedBusiness, label[for^=ownedBusiness] { @extend %vw-hide; }
++
++/* Hide External Id field for Collections */
++app-collection-add-edit form div.form-group:nth-child(2) { @extend %vw-hide; }
++
++/* Hide the radio button and label for the `Custom` org user type */
++#userTypeCustom, label[for^=userTypeCustom] { @extend %vw-hide; }
++
++/* Hide the warning that policy config is moving to Business Portal */
++app-org-policies > app-callout { @extend %vw-hide; }
++
++/* Hide Business Name and Identifier */
++app-org-account form div.form-group:nth-child(3) { display: none; }
++app-org-account form div.form-group:nth-child(4) { display: none; }
++
++/* Hide Tax Info and Form in Organization settings */
++app-org-account > div.secondary-header:nth-child(3) { @extend %vw-hide; }
++app-org-account > div.secondary-header:nth-child(3) + p { @extend %vw-hide; }
++app-org-account > div.secondary-header:nth-child(3) + p + form { @extend %vw-hide; }
++/**** END Vaultwarden CHANGES ****/
+diff --git a/src/services/webPlatformUtils.service.ts b/src/services/webPlatformUtils.service.ts
+index 0c9b56fa..297d4bc5 100644
+--- a/src/services/webPlatformUtils.service.ts
++++ b/src/services/webPlatformUtils.service.ts
+@@ -238,11 +238,11 @@ export class WebPlatformUtilsService implements PlatformUtilsService {
+   }
+ 
+   isDev(): boolean {
+-    return process.env.NODE_ENV === "development";
++    return false;
+   }
+ 
+   isSelfHost(): boolean {
+-    return process.env.ENV.toString() === "selfhosted";
++    return false;
+   }
+ 
+   copyToClipboard(text: string, options?: any): void | boolean {
diff --git a/srcpkgs/vaultwarden-web/template b/srcpkgs/vaultwarden-web/template
new file mode 100644
index 000000000000..3f825f076fcb
--- /dev/null
+++ b/srcpkgs/vaultwarden-web/template
@@ -0,0 +1,34 @@
+# Template file for 'vaultwarden-web'
+pkgname=vaultwarden-web
+version=2.28.1
+revision=1
+wrksrc="web-${version}"
+_jslib_commit=e595c0548ed1a481dbd024ec66975e3a453bd471
+hostmakedepends="git nodejs"
+short_desc="Web vault builds for vaultwarden"
+maintainer="Joel Beckmeyer <joel@beckmeyer.us>"
+license="GPL-3.0-or-later"
+homepage="https://github.com/dani-garcia/bw_web_builds"
+distfiles="https://github.com/bitwarden/web/archive/v${version}.tar.gz
+ https://github.com/bitwarden/jslib/archive/${_jslib_commit}.tar.gz"
+checksum="143a32842219e3a25f9a91cc29c4595a177e4a7915938938f3d4c2776b19bb0e
+ 604a3696fccf315fedeeda2a2547eee88f74b8067ba21ed58717173820719f62"
+
+post_extract() {
+	pwd
+	rmdir jslib
+	mv ../jslib-* jslib
+}
+
+do_configure() {
+	npm ci --ignore-scripts
+}
+
+do_build() {
+	npm run dist:oss:selfhost
+}
+
+do_install() {
+	vmkdir usr/share/webapps/vaultwarden-web
+	vcopy build/* usr/share/webapps/vaultwarden-web
+}

From e3be989dff0892efe86a2644c44653b19465b026 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Thu, 17 Feb 2022 13:25:21 -0500
Subject: [PATCH 11/11] New package: vaultwarden-1.25.0

---
 srcpkgs/vaultwarden/files/vaultwarden/log/run |  1 +
 srcpkgs/vaultwarden/files/vaultwarden/run     |  6 ++
 srcpkgs/vaultwarden/patches/Cargo.toml.patch  | 25 ++++++
 srcpkgs/vaultwarden/patches/config.patch      | 41 +++++++++
 .../dashmap_available_parallelism.patch       | 31 +++++++
 .../vaultwarden/patches/format_strings.patch  | 89 +++++++++++++++++++
 srcpkgs/vaultwarden/template                  | 33 +++++++
 7 files changed, 226 insertions(+)
 create mode 120000 srcpkgs/vaultwarden/files/vaultwarden/log/run
 create mode 100644 srcpkgs/vaultwarden/files/vaultwarden/run
 create mode 100644 srcpkgs/vaultwarden/patches/Cargo.toml.patch
 create mode 100644 srcpkgs/vaultwarden/patches/config.patch
 create mode 100644 srcpkgs/vaultwarden/patches/dashmap_available_parallelism.patch
 create mode 100644 srcpkgs/vaultwarden/patches/format_strings.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/Cargo.toml.patch b/srcpkgs/vaultwarden/patches/Cargo.toml.patch
new file mode 100644
index 000000000000..bdd64d443e21
--- /dev/null
+++ b/srcpkgs/vaultwarden/patches/Cargo.toml.patch
@@ -0,0 +1,25 @@
+diff --git a/Cargo.toml b/Cargo.toml
+index e9dc2aa..e3736f2 100644
+--- a/Cargo.toml
++++ b/Cargo.toml
+@@ -3,7 +3,7 @@ name = "vaultwarden"
+ version = "1.0.0"
+ authors = ["Daniel García <dani-garcia@users.noreply.github.com>"]
+ edition = "2021"
+-rust-version = "1.60"
++rust-version = "1.57"
+ resolver = "2"
+ 
+ repository = "https://github.com/dani-garcia/vaultwarden"
+@@ -154,10 +154,10 @@ mimalloc = { version = "0.1.29", features = ["secure"], default-features = false
+ # that wasn't previously supported (https://github.com/zslayton/cron/pull/64).
+ # 2022-05-04: Forked/Updated the job_scheduler again use the latest dependencies and some fixes.
+ job_scheduler = { git = 'https://github.com/BlackDex/job_scheduler', rev = '9100fc596a083fd9c0b560f8f11f108e0a19d07e' }
++dashmap = { path = './dashmap' }
+ 
+ # Strip debuginfo from the release builds
+ # Also enable thin LTO for some optimizations
+ [profile.release]
+-strip = "debuginfo"
+ lto = "thin"
+ patch.crates-io.dashmap = { path = './dashmap' }
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/patches/dashmap_available_parallelism.patch b/srcpkgs/vaultwarden/patches/dashmap_available_parallelism.patch
new file mode 100644
index 000000000000..8601dac8b4ea
--- /dev/null
+++ b/srcpkgs/vaultwarden/patches/dashmap_available_parallelism.patch
@@ -0,0 +1,31 @@
+commit 1008b24de43aabaaa87d35171d588d09aba0865d
+Author: Joel Beckmeyer <joel@beckmeyer.us>
+Date:   Mon May 23 13:04:15 2022 -0400
+
+    Use `num_cpus` in place of `std::thread::available_parallelism`
+
+diff --git a/dashmap/Cargo.toml b/dashmap/Cargo.toml
+index 5786133..bc1f076 100644
+--- a/dashmap/Cargo.toml
++++ b/dashmap/Cargo.toml
+@@ -16,6 +16,7 @@ categories = ["concurrency", "algorithms", "data-structures"]
+ raw-api = []
+ 
+ [dependencies]
++num_cpus = "1.13.1"
+ lock_api = "0.4.7"
+ hashbrown = { version = "0.12.0", default-features = false }
+ serde = { version = "1.0.136", optional = true, features = ["derive"] }
+diff --git a/dashmap/src/lib.rs b/src/lib.rs
+index 627b513..4b8875a 100644
+--- a/dashmap/src/lib.rs
++++ b/src/lib.rs
+@@ -52,7 +52,7 @@ cfg_if! {
+ pub(crate) type HashMap<K, V, S> = hashbrown::HashMap<K, SharedValue<V>, S>;
+ 
+ fn default_shard_amount() -> usize {
+-    (std::thread::available_parallelism().map_or(1, usize::from) * 4).next_power_of_two()
++    (num_cpus::get() * 4).next_power_of_two()
+ }
+ 
+ fn ncb(shard_amount: usize) -> usize {
diff --git a/srcpkgs/vaultwarden/patches/format_strings.patch b/srcpkgs/vaultwarden/patches/format_strings.patch
new file mode 100644
index 000000000000..a20ab1ca812b
--- /dev/null
+++ b/srcpkgs/vaultwarden/patches/format_strings.patch
@@ -0,0 +1,89 @@
+diff --git a/src/api/icons.rs b/src/api/icons.rs
+index 71c4899..75e45ee 100644
+--- a/src/api/icons.rs
++++ b/src/api/icons.rs
+@@ -60,7 +60,7 @@ static CLIENT: Lazy<Client> = Lazy::new(|| {
+     match client.build() {
+         Ok(client) => client,
+         Err(e) => {
+-            error!("Possible trust-dns error, trying with trust-dns disabled: '{e}'");
++            error!("Possible trust-dns error, trying with trust-dns disabled: '{}'", e);
+             get_reqwest_client_builder()
+                 .cookie_provider(cookie_store)
+                 .timeout(Duration::from_secs(CONFIG.icon_download_timeout()))
+@@ -454,7 +454,7 @@ async fn get_favicons_node(
+                     }
+                 } else if tag.name == TAG_BASE && tag.attributes.contains_key(ATTR_HREF) {
+                     let href = std::str::from_utf8(tag.attributes.get(ATTR_HREF).unwrap()).unwrap_or_default();
+-                    debug!("Found base href: {href}");
++                    debug!("Found base href: {}", href);
+                     base_url = match base_url.join(href) {
+                         Ok(inner_url) => inner_url,
+                         _ => url.clone(),
+@@ -503,8 +503,8 @@ struct IconUrlResult {
+ /// ```
+ async fn get_icon_url(domain: &str) -> Result<IconUrlResult, Error> {
+     // Default URL with secure and insecure schemes
+-    let ssldomain = format!("https://{domain}");
+-    let httpdomain = format!("http://{domain}");
++    let ssldomain = format!("https://{}", domain);
++    let httpdomain = format!("http://{}", domain);
+ 
+     // First check the domain as given during the request for both HTTPS and HTTP.
+     let resp = match get_page(&ssldomain).or_else(|_| get_page(&httpdomain)).await {
+@@ -522,20 +522,20 @@ async fn get_icon_url(domain: &str) -> Result<IconUrlResult, Error> {
+                     base = domain_parts.next_back().unwrap()
+                 );
+                 if is_valid_domain(&base_domain).await {
+-                    let sslbase = format!("https://{base_domain}");
+-                    let httpbase = format!("http://{base_domain}");
+-                    debug!("[get_icon_url]: Trying without subdomains '{base_domain}'");
++                    let sslbase = format!("https://{}", base_domain);
++                    let httpbase = format!("http://{}", base_domain);
++                    debug!("[get_icon_url]: Trying without subdomains '{}'", base_domain);
+ 
+                     sub_resp = get_page(&sslbase).or_else(|_| get_page(&httpbase)).await;
+                 }
+ 
+             // When the domain is not an IP, and has less then 2 dots, try to add www. infront of it.
+             } else if is_ip.is_err() && domain.matches('.').count() < 2 {
+-                let www_domain = format!("www.{domain}");
++                let www_domain = format!("www.{}", domain);
+                 if is_valid_domain(&www_domain).await {
+-                    let sslwww = format!("https://{www_domain}");
+-                    let httpwww = format!("http://{www_domain}");
+-                    debug!("[get_icon_url]: Trying with www. prefix '{www_domain}'");
++                    let sslwww = format!("https://{}", www_domain);
++                    let httpwww = format!("http://{}", www_domain);
++                    debug!("[get_icon_url]: Trying with www. prefix '{}'", www_domain);
+ 
+                     sub_resp = get_page(&sslwww).or_else(|_| get_page(&httpwww)).await;
+                 }
+@@ -567,10 +567,10 @@ async fn get_icon_url(domain: &str) -> Result<IconUrlResult, Error> {
+         get_favicons_node(dom, &mut iconlist, &url).await;
+     } else {
+         // Add the default favicon.ico to the list with just the given domain
+-        iconlist.push(Icon::new(35, format!("{ssldomain}/favicon.ico")));
+-        iconlist.push(Icon::new(40, format!("{ssldomain}/apple-touch-icon.png")));
+-        iconlist.push(Icon::new(35, format!("{httpdomain}/favicon.ico")));
+-        iconlist.push(Icon::new(40, format!("{httpdomain}/apple-touch-icon.png")));
++        iconlist.push(Icon::new(35, format!("{}/favicon.ico", ssldomain)));
++        iconlist.push(Icon::new(40, format!("{}/apple-touch-icon.png", ssldomain)));
++        iconlist.push(Icon::new(35, format!("{}/favicon.ico", httpdomain)));
++        iconlist.push(Icon::new(40, format!("{}/apple-touch-icon.png", httpdomain)));
+     }
+ 
+     // Sort the iconlist by priority
+diff --git a/src/util.rs b/src/util.rs
+index de61a35..d8cc111 100644
+--- a/src/util.rs
++++ b/src/util.rs
+@@ -619,7 +619,7 @@ pub fn get_reqwest_client() -> Client {
+     match get_reqwest_client_builder().build() {
+         Ok(client) => client,
+         Err(e) => {
+-            error!("Possible trust-dns error, trying with trust-dns disabled: '{e}'");
++            error!("Possible trust-dns error, trying with trust-dns disabled: '{}'", e);
+             get_reqwest_client_builder().trust_dns(false).build().expect("Failed to build client")
+         }
+     }
diff --git a/srcpkgs/vaultwarden/template b/srcpkgs/vaultwarden/template
new file mode 100644
index 000000000000..965cf510465f
--- /dev/null
+++ b/srcpkgs/vaultwarden/template
@@ -0,0 +1,33 @@
+# 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 <joel@beckmeyer.us>"
+license="GPL-3.0-or-later"
+homepage="https://github.com/dani-garcia/vaultwarden"
+# Need to patch dashmap to be 1.57 compatible, can be removed when Rust >=1.59 
+# in repo, otherwise bump dashmap version if it changes in Cargo.lock
+distfiles="https://github.com/dani-garcia/vaultwarden/archive/${version}.tar.gz
+ https://github.com/xacrimon/dashmap/archive/v5.3.3.tar.gz>dashmap-${version}.tar.gz"
+checksum="5391f60b3afa9b66cad03cc19903ccc5ad229cbfde142041c7f910d60fd2d2cf
+ 687847d079c6dabac7d6b2bc4954a75278465a3591e5e501d5a0e01b14175e47"
+
+system_accounts="_vaultwarden"
+_vaultwarden_homedir="/var/lib/vaultwarden"
+
+make_dirs="/var/lib/vaultwarden 0750 _vaultwarden _vaultwarden"
+
+post_extract() {
+	mv ../dashmap-* dashmap
+}
+
+post_install() {
+	vsconf .env.template vaultwarden.conf
+	vsv vaultwarden
+}

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PR PATCH] [Updated] New packages: vaultwarden-web-2.28.1, vaultwarden-1.25.0
  2022-05-23 17:23 [PR PATCH] New packages: vaultwarden-web-2.28.1, vaultwarden-1.25.0 TinfoilSubmarine
                   ` (7 preceding siblings ...)
  2022-05-23 20:30 ` [PR PATCH] [Updated] " TinfoilSubmarine
@ 2022-05-23 20:32 ` TinfoilSubmarine
  2022-05-24 11:58 ` TinfoilSubmarine
                   ` (14 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: TinfoilSubmarine @ 2022-05-23 20:32 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1277 bytes --]

There is an updated pull request by TinfoilSubmarine against master on the void-packages repository

https://github.com/TinfoilSubmarine/void-packages maint/vaultwarden
https://github.com/void-linux/void-packages/pull/37258

New packages: vaultwarden-web-2.28.1, vaultwarden-1.25.0
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **YES**

#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/37258.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-maint/vaultwarden-37258.patch --]
[-- Type: text/x-diff, Size: 26078 bytes --]

From b8146a4311b4ca302d76197ccce17631f445687b Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Sat, 26 Mar 2022 20:55:52 -0400
Subject: [PATCH 1/2] New package: vaultwarden-web-2.28.1

---
 srcpkgs/vaultwarden-web/patches/v2.28.0.patch | 271 ++++++++++++++++++
 srcpkgs/vaultwarden-web/template              |  34 +++
 2 files changed, 305 insertions(+)
 create mode 100644 srcpkgs/vaultwarden-web/patches/v2.28.0.patch
 create mode 100644 srcpkgs/vaultwarden-web/template

diff --git a/srcpkgs/vaultwarden-web/patches/v2.28.0.patch b/srcpkgs/vaultwarden-web/patches/v2.28.0.patch
new file mode 100644
index 000000000000..77ae1affb2b4
--- /dev/null
+++ b/srcpkgs/vaultwarden-web/patches/v2.28.0.patch
@@ -0,0 +1,271 @@
+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<any>;
+   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 @@
+         </a>
+       </p>
+       <p>
+-        You can <a href="/">return to the web vault</a>, check our
+-        <a href="https://status.bitwarden.com/">status page</a> or
+-        <a href="https://bitwarden.com/contact/">contact us</a>.
++        You can <a href="/">return to the web vault</a>, or
++        <a href="https://github.com/dani-garcia/vaultwarden">contact us</a>.
+       </p>
+     </div>
+-    <div class="container footer text-muted content">© Copyright 2022 Bitwarden, Inc.</div>
++    <div class="container footer text-muted content">© Copyright 2022 Bitwarden, Inc. (Powered by Vaultwarden)</div>
+   </body>
+ </html>
+diff --git a/src/app/app.component.ts b/src/app/app.component.ts
+index cd94408f..56bc4bdb 100644
+--- a/src/app/app.component.ts
++++ b/src/app/app.component.ts
+@@ -159,6 +159,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 @@
+ <div class="container footer text-muted">
+   <div class="row">
+-    <div class="col">&copy; {{ year }}, Bitwarden Inc.</div>
++    <div class="col">&copy; {{ year }}, Bitwarden Inc. (Powered by Vaultwarden)</div>
+     <div class="col text-center"></div>
+     <div class="col text-right">
+       {{ "versionNumber" | i18n: version }}
+diff --git a/src/app/layouts/frontend-layout.component.html b/src/app/layouts/frontend-layout.component.html
+index 479302d3..84930683 100644
+--- a/src/app/layouts/frontend-layout.component.html
++++ b/src/app/layouts/frontend-layout.component.html
+@@ -1,5 +1,5 @@
+ <router-outlet></router-outlet>
+ <div class="container my-5 text-muted text-center">
+-  &copy; {{ year }}, Bitwarden Inc. <br />
++  &copy; {{ year }}, Bitwarden Inc. (Powered by Vaultwarden)<br />
+   {{ "versionNumber" | i18n: version }}
+ </div>
+diff --git a/src/app/layouts/navbar.component.html b/src/app/layouts/navbar.component.html
+index c03c2bdf..a074e0c2 100644
+--- a/src/app/layouts/navbar.component.html
++++ b/src/app/layouts/navbar.component.html
+@@ -65,7 +65,7 @@
+           </a>
+           <a
+             class="dropdown-item"
+-            href="https://bitwarden.com/help/"
++            href="https://github.com/dani-garcia/vaultwarden"
+             target="_blank"
+             rel="noopener"
+           >
+diff --git a/src/app/organizations/vault/vault.component.ts b/src/app/organizations/vault/vault.component.ts
+index ea7d683e..2b534e05 100644
+--- a/src/app/organizations/vault/vault.component.ts
++++ b/src/app/organizations/vault/vault.component.ts
+@@ -68,11 +68,7 @@ export class VaultComponent implements OnInit, OnDestroy {
+   ) {}
+ 
+   ngOnInit() {
+-    this.trashCleanupWarning = this.i18nService.t(
+-      this.platformUtilsService.isSelfHost()
+-        ? "trashCleanupWarningSelfHosted"
+-        : "trashCleanupWarning"
+-    );
++    this.trashCleanupWarning = this.i18nService.t("trashCleanupWarningSelfHosted");
+     this.route.parent.params.pipe(first()).subscribe(async (params) => {
+       this.organization = await this.organizationService.get(params.organizationId);
+       this.groupingsComponent.organization = this.organization;
+diff --git a/src/app/send/access.component.html b/src/app/send/access.component.html
+index 19bc107b..7e1dbcc7 100644
+--- a/src/app/send/access.component.html
++++ b/src/app/send/access.component.html
+@@ -137,15 +137,6 @@
+     <div class="col-12 text-center mt-5 text-muted">
+       <p class="mb-0">
+         {{ "sendAccessTaglineProductDesc" | i18n }}<br />
+-        {{ "sendAccessTaglineLearnMore" | i18n }}
+-        <a href="https://www.bitwarden.com/products/send?source=web-vault" target="_blank"
+-          >Bitwarden Send</a
+-        >
+-        {{ "sendAccessTaglineOr" | i18n }}
+-        <a href="https://vault.bitwarden.com/#/register" target="_blank">{{
+-          "sendAccessTaglineSignUp" | i18n
+-        }}</a>
+-        {{ "sendAccessTaglineTryToday" | i18n }}
+       </p>
+     </div>
+   </div>
+diff --git a/src/app/services/services.module.ts b/src/app/services/services.module.ts
+index c8e95320..88f5240c 100644
+--- a/src/app/services/services.module.ts
++++ b/src/app/services/services.module.ts
+@@ -65,11 +65,23 @@ export function initFactory(
+   platformUtilsService: PlatformUtilsServiceAbstraction,
+   cryptoService: CryptoServiceAbstraction
+ ): () => void {
++  function getBaseUrl() {
++      // If the base URL is `https://vaultwarden.example.com/base/path/`,
++      // `window.location.href` should have one of the following forms:
++      //
++      // - `https://vaultwarden.example.com/base/path/`
++      // - `https://vaultwarden.example.com/base/path/#/some/route[?queryParam=...]`
++      //
++      // We want to get to just `https://vaultwarden.example.com/base/path`.
++      let baseUrl = window.location.href;
++      baseUrl = baseUrl.replace(/#.*/, '');  // Strip off `#` and everything after.
++      baseUrl = baseUrl.replace(/\/+$/, ''); // Trim any trailing `/` chars.
++      return baseUrl;
++  }
+   return async () => {
+     await stateService.init();
+ 
+-    const urls = process.env.URLS as Urls;
+-    urls.base ??= window.location.origin;
++    const urls = {base: getBaseUrl()};
+     environmentService.setUrls(urls);
+ 
+     setTimeout(() => notificationsService.init(), 3000);
+diff --git a/src/app/vault/vault.component.ts b/src/app/vault/vault.component.ts
+index c3730bfa..3fab9245 100644
+--- a/src/app/vault/vault.component.ts
++++ b/src/app/vault/vault.component.ts
+@@ -91,11 +91,7 @@ export class VaultComponent implements OnInit, OnDestroy {
+   async ngOnInit() {
+     this.showVerifyEmail = !(await this.tokenService.getEmailVerified());
+     this.showBrowserOutdated = window.navigator.userAgent.indexOf("MSIE") !== -1;
+-    this.trashCleanupWarning = this.i18nService.t(
+-      this.platformUtilsService.isSelfHost()
+-        ? "trashCleanupWarningSelfHosted"
+-        : "trashCleanupWarning"
+-    );
++    this.trashCleanupWarning = this.i18nService.t('trashCleanupWarningSelfHosted');
+ 
+     this.route.queryParams.pipe(first()).subscribe(async (params) => {
+       await this.syncService.fullSync(false);
+diff --git a/src/scss/styles.scss b/src/scss/styles.scss
+index d2678ac8..fb467a7e 100644
+--- a/src/scss/styles.scss
++++ b/src/scss/styles.scss
+@@ -56,3 +56,55 @@
+ @import "./plugins";
+ @import "./tables";
+ @import "./toasts";
++
++
++/**** START Vaultwarden CHANGES ****/
++/* This combines all selectors extending it into one */
++%vw-hide { display: none !important; }
++
++/* This allows searching for the combined style in the browsers dev-tools (look into the head tag) */
++#vw-hide, head { @extend %vw-hide; }
++
++/* Hide any link pointing to billing */
++a[href$="/settings/billing"] { @extend %vw-hide; }
++
++/* Hide any link pointing to subscriptions */
++a[href$="/settings/subscription"] { @extend %vw-hide; }
++
++/* Hide any link pointing to Sponsored Families */
++a[href$="/settings/sponsored-families"] { @extend %vw-hide; }
++
++/* Hide the `Enterprise Single Sign-On` button on the login page */
++a[href$="/sso"] { @extend %vw-hide; }
++
++/* Hide the info box that advertises Bitwarden Send */
++app-send-info.d-block { @extend %vw-hide; }
++
++/* Hide Two-Factor menu in Organization settings */
++app-org-settings a[href$="/settings/two-factor"] { @extend %vw-hide; }
++
++/* Hide organization plans */
++app-organization-plans > form > div.form-check { @extend %vw-hide; }
++app-organization-plans > form > h2.mt-5 { @extend %vw-hide; }
++
++/* Hide the `This account is owned by a business` checkbox and label */
++#ownedBusiness, label[for^=ownedBusiness] { @extend %vw-hide; }
++
++/* Hide External Id field for Collections */
++app-collection-add-edit form div.form-group:nth-child(2) { @extend %vw-hide; }
++
++/* Hide the radio button and label for the `Custom` org user type */
++#userTypeCustom, label[for^=userTypeCustom] { @extend %vw-hide; }
++
++/* Hide the warning that policy config is moving to Business Portal */
++app-org-policies > app-callout { @extend %vw-hide; }
++
++/* Hide Business Name and Identifier */
++app-org-account form div.form-group:nth-child(3) { display: none; }
++app-org-account form div.form-group:nth-child(4) { display: none; }
++
++/* Hide Tax Info and Form in Organization settings */
++app-org-account > div.secondary-header:nth-child(3) { @extend %vw-hide; }
++app-org-account > div.secondary-header:nth-child(3) + p { @extend %vw-hide; }
++app-org-account > div.secondary-header:nth-child(3) + p + form { @extend %vw-hide; }
++/**** END Vaultwarden CHANGES ****/
+diff --git a/src/services/webPlatformUtils.service.ts b/src/services/webPlatformUtils.service.ts
+index 0c9b56fa..297d4bc5 100644
+--- a/src/services/webPlatformUtils.service.ts
++++ b/src/services/webPlatformUtils.service.ts
+@@ -238,11 +238,11 @@ export class WebPlatformUtilsService implements PlatformUtilsService {
+   }
+ 
+   isDev(): boolean {
+-    return process.env.NODE_ENV === "development";
++    return false;
+   }
+ 
+   isSelfHost(): boolean {
+-    return process.env.ENV.toString() === "selfhosted";
++    return false;
+   }
+ 
+   copyToClipboard(text: string, options?: any): void | boolean {
diff --git a/srcpkgs/vaultwarden-web/template b/srcpkgs/vaultwarden-web/template
new file mode 100644
index 000000000000..3f825f076fcb
--- /dev/null
+++ b/srcpkgs/vaultwarden-web/template
@@ -0,0 +1,34 @@
+# Template file for 'vaultwarden-web'
+pkgname=vaultwarden-web
+version=2.28.1
+revision=1
+wrksrc="web-${version}"
+_jslib_commit=e595c0548ed1a481dbd024ec66975e3a453bd471
+hostmakedepends="git nodejs"
+short_desc="Web vault builds for vaultwarden"
+maintainer="Joel Beckmeyer <joel@beckmeyer.us>"
+license="GPL-3.0-or-later"
+homepage="https://github.com/dani-garcia/bw_web_builds"
+distfiles="https://github.com/bitwarden/web/archive/v${version}.tar.gz
+ https://github.com/bitwarden/jslib/archive/${_jslib_commit}.tar.gz"
+checksum="143a32842219e3a25f9a91cc29c4595a177e4a7915938938f3d4c2776b19bb0e
+ 604a3696fccf315fedeeda2a2547eee88f74b8067ba21ed58717173820719f62"
+
+post_extract() {
+	pwd
+	rmdir jslib
+	mv ../jslib-* jslib
+}
+
+do_configure() {
+	npm ci --ignore-scripts
+}
+
+do_build() {
+	npm run dist:oss:selfhost
+}
+
+do_install() {
+	vmkdir usr/share/webapps/vaultwarden-web
+	vcopy build/* usr/share/webapps/vaultwarden-web
+}

From aecac143c3d080e3a8a900b85eceea85f84cfdcb Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Thu, 17 Feb 2022 13:25:21 -0500
Subject: [PATCH 2/2] New package: vaultwarden-1.25.0

---
 srcpkgs/vaultwarden/files/vaultwarden/log/run |  1 +
 srcpkgs/vaultwarden/files/vaultwarden/run     |  6 ++
 srcpkgs/vaultwarden/patches/Cargo.toml.patch  | 25 ++++++
 srcpkgs/vaultwarden/patches/config.patch      | 41 +++++++++
 .../dashmap_available_parallelism.patch       | 31 +++++++
 .../vaultwarden/patches/format_strings.patch  | 89 +++++++++++++++++++
 srcpkgs/vaultwarden/template                  | 33 +++++++
 7 files changed, 226 insertions(+)
 create mode 120000 srcpkgs/vaultwarden/files/vaultwarden/log/run
 create mode 100644 srcpkgs/vaultwarden/files/vaultwarden/run
 create mode 100644 srcpkgs/vaultwarden/patches/Cargo.toml.patch
 create mode 100644 srcpkgs/vaultwarden/patches/config.patch
 create mode 100644 srcpkgs/vaultwarden/patches/dashmap_available_parallelism.patch
 create mode 100644 srcpkgs/vaultwarden/patches/format_strings.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/Cargo.toml.patch b/srcpkgs/vaultwarden/patches/Cargo.toml.patch
new file mode 100644
index 000000000000..bdd64d443e21
--- /dev/null
+++ b/srcpkgs/vaultwarden/patches/Cargo.toml.patch
@@ -0,0 +1,25 @@
+diff --git a/Cargo.toml b/Cargo.toml
+index e9dc2aa..e3736f2 100644
+--- a/Cargo.toml
++++ b/Cargo.toml
+@@ -3,7 +3,7 @@ name = "vaultwarden"
+ version = "1.0.0"
+ authors = ["Daniel García <dani-garcia@users.noreply.github.com>"]
+ edition = "2021"
+-rust-version = "1.60"
++rust-version = "1.57"
+ resolver = "2"
+ 
+ repository = "https://github.com/dani-garcia/vaultwarden"
+@@ -154,10 +154,10 @@ mimalloc = { version = "0.1.29", features = ["secure"], default-features = false
+ # that wasn't previously supported (https://github.com/zslayton/cron/pull/64).
+ # 2022-05-04: Forked/Updated the job_scheduler again use the latest dependencies and some fixes.
+ job_scheduler = { git = 'https://github.com/BlackDex/job_scheduler', rev = '9100fc596a083fd9c0b560f8f11f108e0a19d07e' }
++dashmap = { path = './dashmap' }
+ 
+ # Strip debuginfo from the release builds
+ # Also enable thin LTO for some optimizations
+ [profile.release]
+-strip = "debuginfo"
+ lto = "thin"
+ patch.crates-io.dashmap = { path = './dashmap' }
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/patches/dashmap_available_parallelism.patch b/srcpkgs/vaultwarden/patches/dashmap_available_parallelism.patch
new file mode 100644
index 000000000000..8601dac8b4ea
--- /dev/null
+++ b/srcpkgs/vaultwarden/patches/dashmap_available_parallelism.patch
@@ -0,0 +1,31 @@
+commit 1008b24de43aabaaa87d35171d588d09aba0865d
+Author: Joel Beckmeyer <joel@beckmeyer.us>
+Date:   Mon May 23 13:04:15 2022 -0400
+
+    Use `num_cpus` in place of `std::thread::available_parallelism`
+
+diff --git a/dashmap/Cargo.toml b/dashmap/Cargo.toml
+index 5786133..bc1f076 100644
+--- a/dashmap/Cargo.toml
++++ b/dashmap/Cargo.toml
+@@ -16,6 +16,7 @@ categories = ["concurrency", "algorithms", "data-structures"]
+ raw-api = []
+ 
+ [dependencies]
++num_cpus = "1.13.1"
+ lock_api = "0.4.7"
+ hashbrown = { version = "0.12.0", default-features = false }
+ serde = { version = "1.0.136", optional = true, features = ["derive"] }
+diff --git a/dashmap/src/lib.rs b/src/lib.rs
+index 627b513..4b8875a 100644
+--- a/dashmap/src/lib.rs
++++ b/src/lib.rs
+@@ -52,7 +52,7 @@ cfg_if! {
+ pub(crate) type HashMap<K, V, S> = hashbrown::HashMap<K, SharedValue<V>, S>;
+ 
+ fn default_shard_amount() -> usize {
+-    (std::thread::available_parallelism().map_or(1, usize::from) * 4).next_power_of_two()
++    (num_cpus::get() * 4).next_power_of_two()
+ }
+ 
+ fn ncb(shard_amount: usize) -> usize {
diff --git a/srcpkgs/vaultwarden/patches/format_strings.patch b/srcpkgs/vaultwarden/patches/format_strings.patch
new file mode 100644
index 000000000000..a20ab1ca812b
--- /dev/null
+++ b/srcpkgs/vaultwarden/patches/format_strings.patch
@@ -0,0 +1,89 @@
+diff --git a/src/api/icons.rs b/src/api/icons.rs
+index 71c4899..75e45ee 100644
+--- a/src/api/icons.rs
++++ b/src/api/icons.rs
+@@ -60,7 +60,7 @@ static CLIENT: Lazy<Client> = Lazy::new(|| {
+     match client.build() {
+         Ok(client) => client,
+         Err(e) => {
+-            error!("Possible trust-dns error, trying with trust-dns disabled: '{e}'");
++            error!("Possible trust-dns error, trying with trust-dns disabled: '{}'", e);
+             get_reqwest_client_builder()
+                 .cookie_provider(cookie_store)
+                 .timeout(Duration::from_secs(CONFIG.icon_download_timeout()))
+@@ -454,7 +454,7 @@ async fn get_favicons_node(
+                     }
+                 } else if tag.name == TAG_BASE && tag.attributes.contains_key(ATTR_HREF) {
+                     let href = std::str::from_utf8(tag.attributes.get(ATTR_HREF).unwrap()).unwrap_or_default();
+-                    debug!("Found base href: {href}");
++                    debug!("Found base href: {}", href);
+                     base_url = match base_url.join(href) {
+                         Ok(inner_url) => inner_url,
+                         _ => url.clone(),
+@@ -503,8 +503,8 @@ struct IconUrlResult {
+ /// ```
+ async fn get_icon_url(domain: &str) -> Result<IconUrlResult, Error> {
+     // Default URL with secure and insecure schemes
+-    let ssldomain = format!("https://{domain}");
+-    let httpdomain = format!("http://{domain}");
++    let ssldomain = format!("https://{}", domain);
++    let httpdomain = format!("http://{}", domain);
+ 
+     // First check the domain as given during the request for both HTTPS and HTTP.
+     let resp = match get_page(&ssldomain).or_else(|_| get_page(&httpdomain)).await {
+@@ -522,20 +522,20 @@ async fn get_icon_url(domain: &str) -> Result<IconUrlResult, Error> {
+                     base = domain_parts.next_back().unwrap()
+                 );
+                 if is_valid_domain(&base_domain).await {
+-                    let sslbase = format!("https://{base_domain}");
+-                    let httpbase = format!("http://{base_domain}");
+-                    debug!("[get_icon_url]: Trying without subdomains '{base_domain}'");
++                    let sslbase = format!("https://{}", base_domain);
++                    let httpbase = format!("http://{}", base_domain);
++                    debug!("[get_icon_url]: Trying without subdomains '{}'", base_domain);
+ 
+                     sub_resp = get_page(&sslbase).or_else(|_| get_page(&httpbase)).await;
+                 }
+ 
+             // When the domain is not an IP, and has less then 2 dots, try to add www. infront of it.
+             } else if is_ip.is_err() && domain.matches('.').count() < 2 {
+-                let www_domain = format!("www.{domain}");
++                let www_domain = format!("www.{}", domain);
+                 if is_valid_domain(&www_domain).await {
+-                    let sslwww = format!("https://{www_domain}");
+-                    let httpwww = format!("http://{www_domain}");
+-                    debug!("[get_icon_url]: Trying with www. prefix '{www_domain}'");
++                    let sslwww = format!("https://{}", www_domain);
++                    let httpwww = format!("http://{}", www_domain);
++                    debug!("[get_icon_url]: Trying with www. prefix '{}'", www_domain);
+ 
+                     sub_resp = get_page(&sslwww).or_else(|_| get_page(&httpwww)).await;
+                 }
+@@ -567,10 +567,10 @@ async fn get_icon_url(domain: &str) -> Result<IconUrlResult, Error> {
+         get_favicons_node(dom, &mut iconlist, &url).await;
+     } else {
+         // Add the default favicon.ico to the list with just the given domain
+-        iconlist.push(Icon::new(35, format!("{ssldomain}/favicon.ico")));
+-        iconlist.push(Icon::new(40, format!("{ssldomain}/apple-touch-icon.png")));
+-        iconlist.push(Icon::new(35, format!("{httpdomain}/favicon.ico")));
+-        iconlist.push(Icon::new(40, format!("{httpdomain}/apple-touch-icon.png")));
++        iconlist.push(Icon::new(35, format!("{}/favicon.ico", ssldomain)));
++        iconlist.push(Icon::new(40, format!("{}/apple-touch-icon.png", ssldomain)));
++        iconlist.push(Icon::new(35, format!("{}/favicon.ico", httpdomain)));
++        iconlist.push(Icon::new(40, format!("{}/apple-touch-icon.png", httpdomain)));
+     }
+ 
+     // Sort the iconlist by priority
+diff --git a/src/util.rs b/src/util.rs
+index de61a35..d8cc111 100644
+--- a/src/util.rs
++++ b/src/util.rs
+@@ -619,7 +619,7 @@ pub fn get_reqwest_client() -> Client {
+     match get_reqwest_client_builder().build() {
+         Ok(client) => client,
+         Err(e) => {
+-            error!("Possible trust-dns error, trying with trust-dns disabled: '{e}'");
++            error!("Possible trust-dns error, trying with trust-dns disabled: '{}'", e);
+             get_reqwest_client_builder().trust_dns(false).build().expect("Failed to build client")
+         }
+     }
diff --git a/srcpkgs/vaultwarden/template b/srcpkgs/vaultwarden/template
new file mode 100644
index 000000000000..965cf510465f
--- /dev/null
+++ b/srcpkgs/vaultwarden/template
@@ -0,0 +1,33 @@
+# 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 <joel@beckmeyer.us>"
+license="GPL-3.0-or-later"
+homepage="https://github.com/dani-garcia/vaultwarden"
+# Need to patch dashmap to be 1.57 compatible, can be removed when Rust >=1.59 
+# in repo, otherwise bump dashmap version if it changes in Cargo.lock
+distfiles="https://github.com/dani-garcia/vaultwarden/archive/${version}.tar.gz
+ https://github.com/xacrimon/dashmap/archive/v5.3.3.tar.gz>dashmap-${version}.tar.gz"
+checksum="5391f60b3afa9b66cad03cc19903ccc5ad229cbfde142041c7f910d60fd2d2cf
+ 687847d079c6dabac7d6b2bc4954a75278465a3591e5e501d5a0e01b14175e47"
+
+system_accounts="_vaultwarden"
+_vaultwarden_homedir="/var/lib/vaultwarden"
+
+make_dirs="/var/lib/vaultwarden 0750 _vaultwarden _vaultwarden"
+
+post_extract() {
+	mv ../dashmap-* dashmap
+}
+
+post_install() {
+	vsconf .env.template vaultwarden.conf
+	vsv vaultwarden
+}

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PR PATCH] [Updated] New packages: vaultwarden-web-2.28.1, vaultwarden-1.25.0
  2022-05-23 17:23 [PR PATCH] New packages: vaultwarden-web-2.28.1, vaultwarden-1.25.0 TinfoilSubmarine
                   ` (8 preceding siblings ...)
  2022-05-23 20:32 ` TinfoilSubmarine
@ 2022-05-24 11:58 ` TinfoilSubmarine
  2022-06-06 13:10 ` TinfoilSubmarine
                   ` (13 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: TinfoilSubmarine @ 2022-05-24 11:58 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1277 bytes --]

There is an updated pull request by TinfoilSubmarine against master on the void-packages repository

https://github.com/TinfoilSubmarine/void-packages maint/vaultwarden
https://github.com/void-linux/void-packages/pull/37258

New packages: vaultwarden-web-2.28.1, vaultwarden-1.25.0
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **YES**

#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/37258.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-maint/vaultwarden-37258.patch --]
[-- Type: text/x-diff, Size: 26072 bytes --]

From d17b504d93b563cac855c2952f168056bf5647b5 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Sat, 26 Mar 2022 20:55:52 -0400
Subject: [PATCH 1/2] New package: vaultwarden-web-2.28.1

---
 srcpkgs/vaultwarden-web/patches/v2.28.0.patch | 271 ++++++++++++++++++
 srcpkgs/vaultwarden-web/template              |  33 +++
 2 files changed, 304 insertions(+)
 create mode 100644 srcpkgs/vaultwarden-web/patches/v2.28.0.patch
 create mode 100644 srcpkgs/vaultwarden-web/template

diff --git a/srcpkgs/vaultwarden-web/patches/v2.28.0.patch b/srcpkgs/vaultwarden-web/patches/v2.28.0.patch
new file mode 100644
index 000000000000..77ae1affb2b4
--- /dev/null
+++ b/srcpkgs/vaultwarden-web/patches/v2.28.0.patch
@@ -0,0 +1,271 @@
+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<any>;
+   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 @@
+         </a>
+       </p>
+       <p>
+-        You can <a href="/">return to the web vault</a>, check our
+-        <a href="https://status.bitwarden.com/">status page</a> or
+-        <a href="https://bitwarden.com/contact/">contact us</a>.
++        You can <a href="/">return to the web vault</a>, or
++        <a href="https://github.com/dani-garcia/vaultwarden">contact us</a>.
+       </p>
+     </div>
+-    <div class="container footer text-muted content">© Copyright 2022 Bitwarden, Inc.</div>
++    <div class="container footer text-muted content">© Copyright 2022 Bitwarden, Inc. (Powered by Vaultwarden)</div>
+   </body>
+ </html>
+diff --git a/src/app/app.component.ts b/src/app/app.component.ts
+index cd94408f..56bc4bdb 100644
+--- a/src/app/app.component.ts
++++ b/src/app/app.component.ts
+@@ -159,6 +159,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 @@
+ <div class="container footer text-muted">
+   <div class="row">
+-    <div class="col">&copy; {{ year }}, Bitwarden Inc.</div>
++    <div class="col">&copy; {{ year }}, Bitwarden Inc. (Powered by Vaultwarden)</div>
+     <div class="col text-center"></div>
+     <div class="col text-right">
+       {{ "versionNumber" | i18n: version }}
+diff --git a/src/app/layouts/frontend-layout.component.html b/src/app/layouts/frontend-layout.component.html
+index 479302d3..84930683 100644
+--- a/src/app/layouts/frontend-layout.component.html
++++ b/src/app/layouts/frontend-layout.component.html
+@@ -1,5 +1,5 @@
+ <router-outlet></router-outlet>
+ <div class="container my-5 text-muted text-center">
+-  &copy; {{ year }}, Bitwarden Inc. <br />
++  &copy; {{ year }}, Bitwarden Inc. (Powered by Vaultwarden)<br />
+   {{ "versionNumber" | i18n: version }}
+ </div>
+diff --git a/src/app/layouts/navbar.component.html b/src/app/layouts/navbar.component.html
+index c03c2bdf..a074e0c2 100644
+--- a/src/app/layouts/navbar.component.html
++++ b/src/app/layouts/navbar.component.html
+@@ -65,7 +65,7 @@
+           </a>
+           <a
+             class="dropdown-item"
+-            href="https://bitwarden.com/help/"
++            href="https://github.com/dani-garcia/vaultwarden"
+             target="_blank"
+             rel="noopener"
+           >
+diff --git a/src/app/organizations/vault/vault.component.ts b/src/app/organizations/vault/vault.component.ts
+index ea7d683e..2b534e05 100644
+--- a/src/app/organizations/vault/vault.component.ts
++++ b/src/app/organizations/vault/vault.component.ts
+@@ -68,11 +68,7 @@ export class VaultComponent implements OnInit, OnDestroy {
+   ) {}
+ 
+   ngOnInit() {
+-    this.trashCleanupWarning = this.i18nService.t(
+-      this.platformUtilsService.isSelfHost()
+-        ? "trashCleanupWarningSelfHosted"
+-        : "trashCleanupWarning"
+-    );
++    this.trashCleanupWarning = this.i18nService.t("trashCleanupWarningSelfHosted");
+     this.route.parent.params.pipe(first()).subscribe(async (params) => {
+       this.organization = await this.organizationService.get(params.organizationId);
+       this.groupingsComponent.organization = this.organization;
+diff --git a/src/app/send/access.component.html b/src/app/send/access.component.html
+index 19bc107b..7e1dbcc7 100644
+--- a/src/app/send/access.component.html
++++ b/src/app/send/access.component.html
+@@ -137,15 +137,6 @@
+     <div class="col-12 text-center mt-5 text-muted">
+       <p class="mb-0">
+         {{ "sendAccessTaglineProductDesc" | i18n }}<br />
+-        {{ "sendAccessTaglineLearnMore" | i18n }}
+-        <a href="https://www.bitwarden.com/products/send?source=web-vault" target="_blank"
+-          >Bitwarden Send</a
+-        >
+-        {{ "sendAccessTaglineOr" | i18n }}
+-        <a href="https://vault.bitwarden.com/#/register" target="_blank">{{
+-          "sendAccessTaglineSignUp" | i18n
+-        }}</a>
+-        {{ "sendAccessTaglineTryToday" | i18n }}
+       </p>
+     </div>
+   </div>
+diff --git a/src/app/services/services.module.ts b/src/app/services/services.module.ts
+index c8e95320..88f5240c 100644
+--- a/src/app/services/services.module.ts
++++ b/src/app/services/services.module.ts
+@@ -65,11 +65,23 @@ export function initFactory(
+   platformUtilsService: PlatformUtilsServiceAbstraction,
+   cryptoService: CryptoServiceAbstraction
+ ): () => void {
++  function getBaseUrl() {
++      // If the base URL is `https://vaultwarden.example.com/base/path/`,
++      // `window.location.href` should have one of the following forms:
++      //
++      // - `https://vaultwarden.example.com/base/path/`
++      // - `https://vaultwarden.example.com/base/path/#/some/route[?queryParam=...]`
++      //
++      // We want to get to just `https://vaultwarden.example.com/base/path`.
++      let baseUrl = window.location.href;
++      baseUrl = baseUrl.replace(/#.*/, '');  // Strip off `#` and everything after.
++      baseUrl = baseUrl.replace(/\/+$/, ''); // Trim any trailing `/` chars.
++      return baseUrl;
++  }
+   return async () => {
+     await stateService.init();
+ 
+-    const urls = process.env.URLS as Urls;
+-    urls.base ??= window.location.origin;
++    const urls = {base: getBaseUrl()};
+     environmentService.setUrls(urls);
+ 
+     setTimeout(() => notificationsService.init(), 3000);
+diff --git a/src/app/vault/vault.component.ts b/src/app/vault/vault.component.ts
+index c3730bfa..3fab9245 100644
+--- a/src/app/vault/vault.component.ts
++++ b/src/app/vault/vault.component.ts
+@@ -91,11 +91,7 @@ export class VaultComponent implements OnInit, OnDestroy {
+   async ngOnInit() {
+     this.showVerifyEmail = !(await this.tokenService.getEmailVerified());
+     this.showBrowserOutdated = window.navigator.userAgent.indexOf("MSIE") !== -1;
+-    this.trashCleanupWarning = this.i18nService.t(
+-      this.platformUtilsService.isSelfHost()
+-        ? "trashCleanupWarningSelfHosted"
+-        : "trashCleanupWarning"
+-    );
++    this.trashCleanupWarning = this.i18nService.t('trashCleanupWarningSelfHosted');
+ 
+     this.route.queryParams.pipe(first()).subscribe(async (params) => {
+       await this.syncService.fullSync(false);
+diff --git a/src/scss/styles.scss b/src/scss/styles.scss
+index d2678ac8..fb467a7e 100644
+--- a/src/scss/styles.scss
++++ b/src/scss/styles.scss
+@@ -56,3 +56,55 @@
+ @import "./plugins";
+ @import "./tables";
+ @import "./toasts";
++
++
++/**** START Vaultwarden CHANGES ****/
++/* This combines all selectors extending it into one */
++%vw-hide { display: none !important; }
++
++/* This allows searching for the combined style in the browsers dev-tools (look into the head tag) */
++#vw-hide, head { @extend %vw-hide; }
++
++/* Hide any link pointing to billing */
++a[href$="/settings/billing"] { @extend %vw-hide; }
++
++/* Hide any link pointing to subscriptions */
++a[href$="/settings/subscription"] { @extend %vw-hide; }
++
++/* Hide any link pointing to Sponsored Families */
++a[href$="/settings/sponsored-families"] { @extend %vw-hide; }
++
++/* Hide the `Enterprise Single Sign-On` button on the login page */
++a[href$="/sso"] { @extend %vw-hide; }
++
++/* Hide the info box that advertises Bitwarden Send */
++app-send-info.d-block { @extend %vw-hide; }
++
++/* Hide Two-Factor menu in Organization settings */
++app-org-settings a[href$="/settings/two-factor"] { @extend %vw-hide; }
++
++/* Hide organization plans */
++app-organization-plans > form > div.form-check { @extend %vw-hide; }
++app-organization-plans > form > h2.mt-5 { @extend %vw-hide; }
++
++/* Hide the `This account is owned by a business` checkbox and label */
++#ownedBusiness, label[for^=ownedBusiness] { @extend %vw-hide; }
++
++/* Hide External Id field for Collections */
++app-collection-add-edit form div.form-group:nth-child(2) { @extend %vw-hide; }
++
++/* Hide the radio button and label for the `Custom` org user type */
++#userTypeCustom, label[for^=userTypeCustom] { @extend %vw-hide; }
++
++/* Hide the warning that policy config is moving to Business Portal */
++app-org-policies > app-callout { @extend %vw-hide; }
++
++/* Hide Business Name and Identifier */
++app-org-account form div.form-group:nth-child(3) { display: none; }
++app-org-account form div.form-group:nth-child(4) { display: none; }
++
++/* Hide Tax Info and Form in Organization settings */
++app-org-account > div.secondary-header:nth-child(3) { @extend %vw-hide; }
++app-org-account > div.secondary-header:nth-child(3) + p { @extend %vw-hide; }
++app-org-account > div.secondary-header:nth-child(3) + p + form { @extend %vw-hide; }
++/**** END Vaultwarden CHANGES ****/
+diff --git a/src/services/webPlatformUtils.service.ts b/src/services/webPlatformUtils.service.ts
+index 0c9b56fa..297d4bc5 100644
+--- a/src/services/webPlatformUtils.service.ts
++++ b/src/services/webPlatformUtils.service.ts
+@@ -238,11 +238,11 @@ export class WebPlatformUtilsService implements PlatformUtilsService {
+   }
+ 
+   isDev(): boolean {
+-    return process.env.NODE_ENV === "development";
++    return false;
+   }
+ 
+   isSelfHost(): boolean {
+-    return process.env.ENV.toString() === "selfhosted";
++    return false;
+   }
+ 
+   copyToClipboard(text: string, options?: any): void | boolean {
diff --git a/srcpkgs/vaultwarden-web/template b/srcpkgs/vaultwarden-web/template
new file mode 100644
index 000000000000..c02b93f46571
--- /dev/null
+++ b/srcpkgs/vaultwarden-web/template
@@ -0,0 +1,33 @@
+# Template file for 'vaultwarden-web'
+pkgname=vaultwarden-web
+version=2.28.1
+revision=1
+wrksrc="web-${version}"
+_jslib_commit=e595c0548ed1a481dbd024ec66975e3a453bd471
+hostmakedepends="git nodejs"
+short_desc="Web vault builds for vaultwarden"
+maintainer="Joel Beckmeyer <joel@beckmeyer.us>"
+license="GPL-3.0-or-later"
+homepage="https://github.com/dani-garcia/bw_web_builds"
+distfiles="https://github.com/bitwarden/web/archive/v${version}.tar.gz
+ https://github.com/bitwarden/jslib/archive/${_jslib_commit}.tar.gz"
+checksum="143a32842219e3a25f9a91cc29c4595a177e4a7915938938f3d4c2776b19bb0e
+ 604a3696fccf315fedeeda2a2547eee88f74b8067ba21ed58717173820719f62"
+
+post_extract() {
+	rmdir jslib
+	mv ../jslib-* jslib
+}
+
+do_configure() {
+	npm ci --ignore-scripts
+}
+
+do_build() {
+	npm run dist:oss:selfhost
+}
+
+do_install() {
+	vmkdir usr/share/webapps/vaultwarden-web
+	vcopy build/* usr/share/webapps/vaultwarden-web
+}

From 3f1e7fd63a17670ffc89f771456496015fbade5d Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Thu, 17 Feb 2022 13:25:21 -0500
Subject: [PATCH 2/2] New package: vaultwarden-1.25.0

---
 srcpkgs/vaultwarden/files/vaultwarden/log/run |  1 +
 srcpkgs/vaultwarden/files/vaultwarden/run     |  6 ++
 srcpkgs/vaultwarden/patches/Cargo.toml.patch  | 25 ++++++
 srcpkgs/vaultwarden/patches/config.patch      | 41 +++++++++
 .../dashmap_available_parallelism.patch       | 31 +++++++
 .../vaultwarden/patches/format_strings.patch  | 89 +++++++++++++++++++
 srcpkgs/vaultwarden/template                  | 33 +++++++
 7 files changed, 226 insertions(+)
 create mode 120000 srcpkgs/vaultwarden/files/vaultwarden/log/run
 create mode 100644 srcpkgs/vaultwarden/files/vaultwarden/run
 create mode 100644 srcpkgs/vaultwarden/patches/Cargo.toml.patch
 create mode 100644 srcpkgs/vaultwarden/patches/config.patch
 create mode 100644 srcpkgs/vaultwarden/patches/dashmap_available_parallelism.patch
 create mode 100644 srcpkgs/vaultwarden/patches/format_strings.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/Cargo.toml.patch b/srcpkgs/vaultwarden/patches/Cargo.toml.patch
new file mode 100644
index 000000000000..bdd64d443e21
--- /dev/null
+++ b/srcpkgs/vaultwarden/patches/Cargo.toml.patch
@@ -0,0 +1,25 @@
+diff --git a/Cargo.toml b/Cargo.toml
+index e9dc2aa..e3736f2 100644
+--- a/Cargo.toml
++++ b/Cargo.toml
+@@ -3,7 +3,7 @@ name = "vaultwarden"
+ version = "1.0.0"
+ authors = ["Daniel García <dani-garcia@users.noreply.github.com>"]
+ edition = "2021"
+-rust-version = "1.60"
++rust-version = "1.57"
+ resolver = "2"
+ 
+ repository = "https://github.com/dani-garcia/vaultwarden"
+@@ -154,10 +154,10 @@ mimalloc = { version = "0.1.29", features = ["secure"], default-features = false
+ # that wasn't previously supported (https://github.com/zslayton/cron/pull/64).
+ # 2022-05-04: Forked/Updated the job_scheduler again use the latest dependencies and some fixes.
+ job_scheduler = { git = 'https://github.com/BlackDex/job_scheduler', rev = '9100fc596a083fd9c0b560f8f11f108e0a19d07e' }
++dashmap = { path = './dashmap' }
+ 
+ # Strip debuginfo from the release builds
+ # Also enable thin LTO for some optimizations
+ [profile.release]
+-strip = "debuginfo"
+ lto = "thin"
+ patch.crates-io.dashmap = { path = './dashmap' }
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/patches/dashmap_available_parallelism.patch b/srcpkgs/vaultwarden/patches/dashmap_available_parallelism.patch
new file mode 100644
index 000000000000..8601dac8b4ea
--- /dev/null
+++ b/srcpkgs/vaultwarden/patches/dashmap_available_parallelism.patch
@@ -0,0 +1,31 @@
+commit 1008b24de43aabaaa87d35171d588d09aba0865d
+Author: Joel Beckmeyer <joel@beckmeyer.us>
+Date:   Mon May 23 13:04:15 2022 -0400
+
+    Use `num_cpus` in place of `std::thread::available_parallelism`
+
+diff --git a/dashmap/Cargo.toml b/dashmap/Cargo.toml
+index 5786133..bc1f076 100644
+--- a/dashmap/Cargo.toml
++++ b/dashmap/Cargo.toml
+@@ -16,6 +16,7 @@ categories = ["concurrency", "algorithms", "data-structures"]
+ raw-api = []
+ 
+ [dependencies]
++num_cpus = "1.13.1"
+ lock_api = "0.4.7"
+ hashbrown = { version = "0.12.0", default-features = false }
+ serde = { version = "1.0.136", optional = true, features = ["derive"] }
+diff --git a/dashmap/src/lib.rs b/src/lib.rs
+index 627b513..4b8875a 100644
+--- a/dashmap/src/lib.rs
++++ b/src/lib.rs
+@@ -52,7 +52,7 @@ cfg_if! {
+ pub(crate) type HashMap<K, V, S> = hashbrown::HashMap<K, SharedValue<V>, S>;
+ 
+ fn default_shard_amount() -> usize {
+-    (std::thread::available_parallelism().map_or(1, usize::from) * 4).next_power_of_two()
++    (num_cpus::get() * 4).next_power_of_two()
+ }
+ 
+ fn ncb(shard_amount: usize) -> usize {
diff --git a/srcpkgs/vaultwarden/patches/format_strings.patch b/srcpkgs/vaultwarden/patches/format_strings.patch
new file mode 100644
index 000000000000..a20ab1ca812b
--- /dev/null
+++ b/srcpkgs/vaultwarden/patches/format_strings.patch
@@ -0,0 +1,89 @@
+diff --git a/src/api/icons.rs b/src/api/icons.rs
+index 71c4899..75e45ee 100644
+--- a/src/api/icons.rs
++++ b/src/api/icons.rs
+@@ -60,7 +60,7 @@ static CLIENT: Lazy<Client> = Lazy::new(|| {
+     match client.build() {
+         Ok(client) => client,
+         Err(e) => {
+-            error!("Possible trust-dns error, trying with trust-dns disabled: '{e}'");
++            error!("Possible trust-dns error, trying with trust-dns disabled: '{}'", e);
+             get_reqwest_client_builder()
+                 .cookie_provider(cookie_store)
+                 .timeout(Duration::from_secs(CONFIG.icon_download_timeout()))
+@@ -454,7 +454,7 @@ async fn get_favicons_node(
+                     }
+                 } else if tag.name == TAG_BASE && tag.attributes.contains_key(ATTR_HREF) {
+                     let href = std::str::from_utf8(tag.attributes.get(ATTR_HREF).unwrap()).unwrap_or_default();
+-                    debug!("Found base href: {href}");
++                    debug!("Found base href: {}", href);
+                     base_url = match base_url.join(href) {
+                         Ok(inner_url) => inner_url,
+                         _ => url.clone(),
+@@ -503,8 +503,8 @@ struct IconUrlResult {
+ /// ```
+ async fn get_icon_url(domain: &str) -> Result<IconUrlResult, Error> {
+     // Default URL with secure and insecure schemes
+-    let ssldomain = format!("https://{domain}");
+-    let httpdomain = format!("http://{domain}");
++    let ssldomain = format!("https://{}", domain);
++    let httpdomain = format!("http://{}", domain);
+ 
+     // First check the domain as given during the request for both HTTPS and HTTP.
+     let resp = match get_page(&ssldomain).or_else(|_| get_page(&httpdomain)).await {
+@@ -522,20 +522,20 @@ async fn get_icon_url(domain: &str) -> Result<IconUrlResult, Error> {
+                     base = domain_parts.next_back().unwrap()
+                 );
+                 if is_valid_domain(&base_domain).await {
+-                    let sslbase = format!("https://{base_domain}");
+-                    let httpbase = format!("http://{base_domain}");
+-                    debug!("[get_icon_url]: Trying without subdomains '{base_domain}'");
++                    let sslbase = format!("https://{}", base_domain);
++                    let httpbase = format!("http://{}", base_domain);
++                    debug!("[get_icon_url]: Trying without subdomains '{}'", base_domain);
+ 
+                     sub_resp = get_page(&sslbase).or_else(|_| get_page(&httpbase)).await;
+                 }
+ 
+             // When the domain is not an IP, and has less then 2 dots, try to add www. infront of it.
+             } else if is_ip.is_err() && domain.matches('.').count() < 2 {
+-                let www_domain = format!("www.{domain}");
++                let www_domain = format!("www.{}", domain);
+                 if is_valid_domain(&www_domain).await {
+-                    let sslwww = format!("https://{www_domain}");
+-                    let httpwww = format!("http://{www_domain}");
+-                    debug!("[get_icon_url]: Trying with www. prefix '{www_domain}'");
++                    let sslwww = format!("https://{}", www_domain);
++                    let httpwww = format!("http://{}", www_domain);
++                    debug!("[get_icon_url]: Trying with www. prefix '{}'", www_domain);
+ 
+                     sub_resp = get_page(&sslwww).or_else(|_| get_page(&httpwww)).await;
+                 }
+@@ -567,10 +567,10 @@ async fn get_icon_url(domain: &str) -> Result<IconUrlResult, Error> {
+         get_favicons_node(dom, &mut iconlist, &url).await;
+     } else {
+         // Add the default favicon.ico to the list with just the given domain
+-        iconlist.push(Icon::new(35, format!("{ssldomain}/favicon.ico")));
+-        iconlist.push(Icon::new(40, format!("{ssldomain}/apple-touch-icon.png")));
+-        iconlist.push(Icon::new(35, format!("{httpdomain}/favicon.ico")));
+-        iconlist.push(Icon::new(40, format!("{httpdomain}/apple-touch-icon.png")));
++        iconlist.push(Icon::new(35, format!("{}/favicon.ico", ssldomain)));
++        iconlist.push(Icon::new(40, format!("{}/apple-touch-icon.png", ssldomain)));
++        iconlist.push(Icon::new(35, format!("{}/favicon.ico", httpdomain)));
++        iconlist.push(Icon::new(40, format!("{}/apple-touch-icon.png", httpdomain)));
+     }
+ 
+     // Sort the iconlist by priority
+diff --git a/src/util.rs b/src/util.rs
+index de61a35..d8cc111 100644
+--- a/src/util.rs
++++ b/src/util.rs
+@@ -619,7 +619,7 @@ pub fn get_reqwest_client() -> Client {
+     match get_reqwest_client_builder().build() {
+         Ok(client) => client,
+         Err(e) => {
+-            error!("Possible trust-dns error, trying with trust-dns disabled: '{e}'");
++            error!("Possible trust-dns error, trying with trust-dns disabled: '{}'", e);
+             get_reqwest_client_builder().trust_dns(false).build().expect("Failed to build client")
+         }
+     }
diff --git a/srcpkgs/vaultwarden/template b/srcpkgs/vaultwarden/template
new file mode 100644
index 000000000000..965cf510465f
--- /dev/null
+++ b/srcpkgs/vaultwarden/template
@@ -0,0 +1,33 @@
+# 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 <joel@beckmeyer.us>"
+license="GPL-3.0-or-later"
+homepage="https://github.com/dani-garcia/vaultwarden"
+# Need to patch dashmap to be 1.57 compatible, can be removed when Rust >=1.59 
+# in repo, otherwise bump dashmap version if it changes in Cargo.lock
+distfiles="https://github.com/dani-garcia/vaultwarden/archive/${version}.tar.gz
+ https://github.com/xacrimon/dashmap/archive/v5.3.3.tar.gz>dashmap-${version}.tar.gz"
+checksum="5391f60b3afa9b66cad03cc19903ccc5ad229cbfde142041c7f910d60fd2d2cf
+ 687847d079c6dabac7d6b2bc4954a75278465a3591e5e501d5a0e01b14175e47"
+
+system_accounts="_vaultwarden"
+_vaultwarden_homedir="/var/lib/vaultwarden"
+
+make_dirs="/var/lib/vaultwarden 0750 _vaultwarden _vaultwarden"
+
+post_extract() {
+	mv ../dashmap-* dashmap
+}
+
+post_install() {
+	vsconf .env.template vaultwarden.conf
+	vsv vaultwarden
+}

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PR PATCH] [Updated] New packages: vaultwarden-web-2.28.1, vaultwarden-1.25.0
  2022-05-23 17:23 [PR PATCH] New packages: vaultwarden-web-2.28.1, vaultwarden-1.25.0 TinfoilSubmarine
                   ` (9 preceding siblings ...)
  2022-05-24 11:58 ` TinfoilSubmarine
@ 2022-06-06 13:10 ` TinfoilSubmarine
  2022-06-07 18:13 ` [PR PATCH] [Updated] New packages: vaultwarden-web-2022.05.0, vaultwarden-1.25.0 TinfoilSubmarine
                   ` (12 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: TinfoilSubmarine @ 2022-06-06 13:10 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1277 bytes --]

There is an updated pull request by TinfoilSubmarine against master on the void-packages repository

https://github.com/TinfoilSubmarine/void-packages maint/vaultwarden
https://github.com/void-linux/void-packages/pull/37258

New packages: vaultwarden-web-2.28.1, vaultwarden-1.25.0
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **YES**

#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/37258.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-maint/vaultwarden-37258.patch --]
[-- Type: text/x-diff, Size: 28569 bytes --]

From 97e79259607f0300a7ece1e3cb6963295352d12b Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Sat, 26 Mar 2022 20:55:52 -0400
Subject: [PATCH 1/2] New package: vaultwarden-web-2022.05.0

---
 .../vaultwarden-web/patches/v2022.05.0.patch  | 312 ++++++++++++++++++
 srcpkgs/vaultwarden-web/template              |  33 ++
 2 files changed, 345 insertions(+)
 create mode 100644 srcpkgs/vaultwarden-web/patches/v2022.05.0.patch
 create mode 100644 srcpkgs/vaultwarden-web/template

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<any>;
+   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 @@
+         </a>
+       </p>
+       <p>
+-        You can <a href="/">return to the web vault</a>, check our
+-        <a href="https://status.bitwarden.com/">status page</a> or
+-        <a href="https://bitwarden.com/contact/">contact us</a>.
++        You can <a href="/">return to the web vault</a>, or
++        <a href="https://github.com/dani-garcia/vaultwarden">contact us</a>.
+       </p>
+     </div>
+-    <div class="container footer text-muted content">© Copyright 2022 Bitwarden, Inc.</div>
++    <div class="container footer text-muted content">© Copyright 2022 Bitwarden, Inc. (Powered by Vaultwarden)</div>
+   </body>
+ </html>
+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 @@
+ <div class="container footer text-muted">
+   <div class="row">
+-    <div class="col">&copy; {{ year }}, Bitwarden Inc.</div>
++    <div class="col">&copy; {{ year }}, Bitwarden Inc. (Powered by Vaultwarden)</div>
+     <div class="col text-center"></div>
+     <div class="col text-right">
+       {{ "versionNumber" | i18n: version }}
+diff --git a/src/app/layouts/frontend-layout.component.html b/src/app/layouts/frontend-layout.component.html
+index 479302d3..84930683 100644
+--- a/src/app/layouts/frontend-layout.component.html
++++ b/src/app/layouts/frontend-layout.component.html
+@@ -1,5 +1,5 @@
+ <router-outlet></router-outlet>
+ <div class="container my-5 text-muted text-center">
+-  &copy; {{ year }}, Bitwarden Inc. <br />
++  &copy; {{ year }}, Bitwarden Inc. (Powered by Vaultwarden)<br />
+   {{ "versionNumber" | i18n: version }}
+ </div>
+diff --git a/src/app/layouts/navbar.component.html b/src/app/layouts/navbar.component.html
+index 9bbd8d2e..d2438cae 100644
+--- a/src/app/layouts/navbar.component.html
++++ b/src/app/layouts/navbar.component.html
+@@ -69,7 +69,7 @@
+               <i class="bwi bwi-fw bwi-user" aria-hidden="true"></i>
+               {{ "accountSettings" | i18n }}
+             </a>
+-            <a bit-menu-item href="https://bitwarden.com/help/" target="_blank" rel="noopener">
++            <a bit-menu-item href="https://github.com/dani-garcia/vaultwarden/" target="_blank" rel="noopener">
+               <i class="bwi bwi-fw bwi-question-circle" aria-hidden="true"></i>
+               {{ "getHelp" | i18n }}
+             </a>
+diff --git a/src/app/modules/vault/modules/individual-vault/individual-vault.component.ts b/src/app/modules/vault/modules/individual-vault/individual-vault.component.ts
+index 47e1906a..def8164c 100644
+--- a/src/app/modules/vault/modules/individual-vault/individual-vault.component.ts
++++ b/src/app/modules/vault/modules/individual-vault/individual-vault.component.ts
+@@ -94,11 +94,7 @@ export class IndividualVaultComponent implements OnInit, OnDestroy {
+   async ngOnInit() {
+     this.showVerifyEmail = !(await this.tokenService.getEmailVerified());
+     this.showBrowserOutdated = window.navigator.userAgent.indexOf("MSIE") !== -1;
+-    this.trashCleanupWarning = this.i18nService.t(
+-      this.platformUtilsService.isSelfHost()
+-        ? "trashCleanupWarningSelfHosted"
+-        : "trashCleanupWarning"
+-    );
++    this.trashCleanupWarning = this.i18nService.t("trashCleanupWarningSelfHosted");
+ 
+     this.route.queryParams.pipe(first()).subscribe(async (params) => {
+       await this.syncService.fullSync(false);
+diff --git a/src/app/modules/vault/modules/organization-vault/organization-vault.component.ts b/src/app/modules/vault/modules/organization-vault/organization-vault.component.ts
+index c7edcbe0..0e0d4807 100644
+--- a/src/app/modules/vault/modules/organization-vault/organization-vault.component.ts
++++ b/src/app/modules/vault/modules/organization-vault/organization-vault.component.ts
+@@ -75,11 +75,7 @@ export class OrganizationVaultComponent implements OnInit, OnDestroy {
+   ) {}
+ 
+   ngOnInit() {
+-    this.trashCleanupWarning = this.i18nService.t(
+-      this.platformUtilsService.isSelfHost()
+-        ? "trashCleanupWarningSelfHosted"
+-        : "trashCleanupWarning"
+-    );
++    this.trashCleanupWarning = this.i18nService.t("trashCleanupWarningSelfHosted");
+     this.route.parent.params.subscribe(async (params: any) => {
+       this.organization = await this.organizationService.get(params.organizationId);
+       this.vaultFilterComponent.organization = this.organization;
+diff --git a/src/app/send/access.component.html b/src/app/send/access.component.html
+index 19bc107b..7e1dbcc7 100644
+--- a/src/app/send/access.component.html
++++ b/src/app/send/access.component.html
+@@ -137,15 +137,6 @@
+     <div class="col-12 text-center mt-5 text-muted">
+       <p class="mb-0">
+         {{ "sendAccessTaglineProductDesc" | i18n }}<br />
+-        {{ "sendAccessTaglineLearnMore" | i18n }}
+-        <a href="https://www.bitwarden.com/products/send?source=web-vault" target="_blank"
+-          >Bitwarden Send</a
+-        >
+-        {{ "sendAccessTaglineOr" | i18n }}
+-        <a href="https://vault.bitwarden.com/#/register" target="_blank">{{
+-          "sendAccessTaglineSignUp" | i18n
+-        }}</a>
+-        {{ "sendAccessTaglineTryToday" | i18n }}
+       </p>
+     </div>
+   </div>
+diff --git a/src/app/services/init.service.ts b/src/app/services/init.service.ts
+index eacfea97..c2f81033 100644
+--- a/src/app/services/init.service.ts
++++ b/src/app/services/init.service.ts
+@@ -36,11 +36,23 @@ export class InitService {
+   ) {}
+ 
+   init() {
++    function getBaseUrl() {
++        // If the base URL is `https://vaultwarden.example.com/base/path/`,
++        // `window.location.href` should have one of the following forms:
++        //
++        // - `https://vaultwarden.example.com/base/path/`
++        // - `https://vaultwarden.example.com/base/path/#/some/route[?queryParam=...]`
++        //
++        // We want to get to just `https://vaultwarden.example.com/base/path`.
++        let baseUrl = window.location.href;
++        baseUrl = baseUrl.replace(/#.*/, '');  // Strip off `#` and everything after.
++        baseUrl = baseUrl.replace(/\/+$/, ''); // Trim any trailing `/` chars.
++        return baseUrl;
++    }
+     return async () => {
+       await this.stateService.init();
+ 
+-      const urls = process.env.URLS as Urls;
+-      urls.base ??= this.win.location.origin;
++      const urls = {base: getBaseUrl()};
+       this.environmentService.setUrls(urls);
+ 
+       setTimeout(() => this.notificationsService.init(), 3000);
+diff --git a/src/app/settings/settings.component.ts b/src/app/settings/settings.component.ts
+index 9756ba41..348c3843 100644
+--- a/src/app/settings/settings.component.ts
++++ b/src/app/settings/settings.component.ts
+@@ -55,10 +55,6 @@ export class SettingsComponent implements OnInit, OnDestroy {
+     this.hasFamilySponsorshipAvailable = await this.organizationService.canManageSponsorships();
+     const hasPremiumFromOrg = await this.stateService.getCanAccessPremium();
+     let billing = null;
+-    if (!this.selfHosted) {
+-      billing = await this.apiService.getUserBillingHistory();
+-    }
+-    this.hideSubscription =
+-      !this.premium && hasPremiumFromOrg && (this.selfHosted || billing?.hasNoHistory);
++    this.hideSubscription = true;
+   }
+ }
+diff --git a/src/app/settings/user-billing-history.component.ts b/src/app/settings/user-billing-history.component.ts
+index ae26862d..69ff16a0 100644
+--- a/src/app/settings/user-billing-history.component.ts
++++ b/src/app/settings/user-billing-history.component.ts
+@@ -39,7 +39,7 @@ export class UserBillingHistoryComponent implements OnInit {
+       return;
+     }
+     this.loading = true;
+-    this.billing = await this.apiService.getUserBillingHistory();
++    this.billing = null;
+     this.loading = false;
+   }
+ 
+diff --git a/src/app/vault/add-edit.component.html b/src/app/vault/add-edit.component.html
+index 37410ea5..8c9e1a6f 100644
+--- a/src/app/vault/add-edit.component.html
++++ b/src/app/vault/add-edit.component.html
+@@ -182,7 +182,7 @@
+             <div class="col-6 form-group totp d-flex align-items-end" [ngClass]="{ low: totpLow }">
+               <div *ngIf="!cipher.login.totp || !totpCode">
+                 <img
+-                  src="../../images/totp-countdown.png"
++                  src="images/totp-countdown.png"
+                   id="totpImage"
+                   title="{{ 'verificationCodeTotp' | i18n }}"
+                   class="ml-2"
+diff --git a/src/scss/styles.scss b/src/scss/styles.scss
+index 26c5e5c7..b42df01b 100644
+--- a/src/scss/styles.scss
++++ b/src/scss/styles.scss
+@@ -58,3 +58,54 @@
+ @import "./tables";
+ @import "./toasts";
+ @import "./vault-filters";
++
++/**** START Vaultwarden CHANGES ****/
++/* This combines all selectors extending it into one */
++%vw-hide { display: none !important; }
++
++/* This allows searching for the combined style in the browsers dev-tools (look into the head tag) */
++#vw-hide, head { @extend %vw-hide; }
++
++/* Hide any link pointing to billing */
++a[href$="/settings/billing"] { @extend %vw-hide; }
++
++/* Hide any link pointing to subscriptions */
++a[href$="/settings/subscription"] { @extend %vw-hide; }
++
++/* Hide any link pointing to Sponsored Families */
++a[href$="/settings/sponsored-families"] { @extend %vw-hide; }
++
++/* Hide the `Enterprise Single Sign-On` button on the login page */
++a[href$="/sso"] { @extend %vw-hide; }
++
++/* Hide the info box that advertises Bitwarden Send */
++app-send-info.d-block { @extend %vw-hide; }
++
++/* Hide Two-Factor menu in Organization settings */
++app-org-settings a[href$="/settings/two-factor"] { @extend %vw-hide; }
++
++/* Hide organization plans */
++app-organization-plans > form > div.form-check { @extend %vw-hide; }
++app-organization-plans > form > h2.mt-5 { @extend %vw-hide; }
++
++/* Hide the `This account is owned by a business` checkbox and label */
++#ownedBusiness, label[for^=ownedBusiness] { @extend %vw-hide; }
++
++/* Hide External Id field for Collections */
++app-collection-add-edit form div.form-group:nth-child(2) { @extend %vw-hide; }
++
++/* Hide the radio button and label for the `Custom` org user type */
++#userTypeCustom, label[for^=userTypeCustom] { @extend %vw-hide; }
++
++/* Hide the warning that policy config is moving to Business Portal */
++app-org-policies > app-callout { @extend %vw-hide; }
++
++/* Hide Business Name and Identifier */
++app-org-account form div.form-group:nth-child(3) { display: none; }
++app-org-account form div.form-group:nth-child(4) { display: none; }
++
++/* Hide Tax Info and Form in Organization settings */
++app-org-account > div.secondary-header:nth-child(3) { @extend %vw-hide; }
++app-org-account > div.secondary-header:nth-child(3) + p { @extend %vw-hide; }
++app-org-account > div.secondary-header:nth-child(3) + p + form { @extend %vw-hide; }
++/**** END Vaultwarden CHANGES ****/
+diff --git a/src/services/webPlatformUtils.service.ts b/src/services/webPlatformUtils.service.ts
+index 755600a1..25f4561e 100644
+--- a/src/services/webPlatformUtils.service.ts
++++ b/src/services/webPlatformUtils.service.ts
+@@ -240,11 +240,11 @@ export class WebPlatformUtilsService implements PlatformUtilsService {
+   }
+ 
+   isDev(): boolean {
+-    return process.env.NODE_ENV === "development";
++    return false;
+   }
+ 
+   isSelfHost(): boolean {
+-    return process.env.ENV.toString() === "selfhosted";
++    return false;
+   }
+ 
+   copyToClipboard(text: string, options?: any): void | boolean {
diff --git a/srcpkgs/vaultwarden-web/template b/srcpkgs/vaultwarden-web/template
new file mode 100644
index 000000000000..5db02bb4845b
--- /dev/null
+++ b/srcpkgs/vaultwarden-web/template
@@ -0,0 +1,33 @@
+# Template file for 'vaultwarden-web'
+pkgname=vaultwarden-web
+version=2022.05.0
+revision=1
+wrksrc="web-${version}"
+_jslib_commit=1cc4bed67170ac92b92cb46e8bbcf7c59ea166db
+hostmakedepends="git nodejs"
+short_desc="Web vault builds for vaultwarden"
+maintainer="Joel Beckmeyer <joel@beckmeyer.us>"
+license="GPL-3.0-or-later"
+homepage="https://github.com/dani-garcia/bw_web_builds"
+distfiles="https://github.com/bitwarden/web/archive/${version}.tar.gz
+ https://github.com/bitwarden/jslib/archive/${_jslib_commit}.tar.gz"
+checksum="3e4671498e19f383891d4eb59b3f2c68624041b8e2b9e07597ad57673d8602c3
+ 6c47021b3b1809dca2f9826f7de3ae043eeff7d7d1235ae148db7c6e56e0fbcf"
+
+post_extract() {
+	rmdir jslib
+	mv ../jslib-* jslib
+}
+
+do_configure() {
+	npm ci --ignore-scripts
+}
+
+do_build() {
+	npm run dist:oss:selfhost
+}
+
+do_install() {
+	vmkdir usr/share/webapps/vaultwarden-web
+	vcopy build/* usr/share/webapps/vaultwarden-web
+}

From 0551245575a8bbcd458bc2a0b83ad9edf7c4e2ce Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Thu, 17 Feb 2022 13:25:21 -0500
Subject: [PATCH 2/2] New package: vaultwarden-1.25.0

---
 srcpkgs/vaultwarden/files/vaultwarden/log/run |  1 +
 srcpkgs/vaultwarden/files/vaultwarden/run     |  6 ++
 srcpkgs/vaultwarden/patches/Cargo.toml.patch  | 25 ++++++
 srcpkgs/vaultwarden/patches/config.patch      | 41 +++++++++
 .../dashmap_available_parallelism.patch       | 31 +++++++
 .../vaultwarden/patches/format_strings.patch  | 89 +++++++++++++++++++
 srcpkgs/vaultwarden/template                  | 33 +++++++
 7 files changed, 226 insertions(+)
 create mode 120000 srcpkgs/vaultwarden/files/vaultwarden/log/run
 create mode 100644 srcpkgs/vaultwarden/files/vaultwarden/run
 create mode 100644 srcpkgs/vaultwarden/patches/Cargo.toml.patch
 create mode 100644 srcpkgs/vaultwarden/patches/config.patch
 create mode 100644 srcpkgs/vaultwarden/patches/dashmap_available_parallelism.patch
 create mode 100644 srcpkgs/vaultwarden/patches/format_strings.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/Cargo.toml.patch b/srcpkgs/vaultwarden/patches/Cargo.toml.patch
new file mode 100644
index 000000000000..bdd64d443e21
--- /dev/null
+++ b/srcpkgs/vaultwarden/patches/Cargo.toml.patch
@@ -0,0 +1,25 @@
+diff --git a/Cargo.toml b/Cargo.toml
+index e9dc2aa..e3736f2 100644
+--- a/Cargo.toml
++++ b/Cargo.toml
+@@ -3,7 +3,7 @@ name = "vaultwarden"
+ version = "1.0.0"
+ authors = ["Daniel García <dani-garcia@users.noreply.github.com>"]
+ edition = "2021"
+-rust-version = "1.60"
++rust-version = "1.57"
+ resolver = "2"
+ 
+ repository = "https://github.com/dani-garcia/vaultwarden"
+@@ -154,10 +154,10 @@ mimalloc = { version = "0.1.29", features = ["secure"], default-features = false
+ # that wasn't previously supported (https://github.com/zslayton/cron/pull/64).
+ # 2022-05-04: Forked/Updated the job_scheduler again use the latest dependencies and some fixes.
+ job_scheduler = { git = 'https://github.com/BlackDex/job_scheduler', rev = '9100fc596a083fd9c0b560f8f11f108e0a19d07e' }
++dashmap = { path = './dashmap' }
+ 
+ # Strip debuginfo from the release builds
+ # Also enable thin LTO for some optimizations
+ [profile.release]
+-strip = "debuginfo"
+ lto = "thin"
+ patch.crates-io.dashmap = { path = './dashmap' }
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/patches/dashmap_available_parallelism.patch b/srcpkgs/vaultwarden/patches/dashmap_available_parallelism.patch
new file mode 100644
index 000000000000..8601dac8b4ea
--- /dev/null
+++ b/srcpkgs/vaultwarden/patches/dashmap_available_parallelism.patch
@@ -0,0 +1,31 @@
+commit 1008b24de43aabaaa87d35171d588d09aba0865d
+Author: Joel Beckmeyer <joel@beckmeyer.us>
+Date:   Mon May 23 13:04:15 2022 -0400
+
+    Use `num_cpus` in place of `std::thread::available_parallelism`
+
+diff --git a/dashmap/Cargo.toml b/dashmap/Cargo.toml
+index 5786133..bc1f076 100644
+--- a/dashmap/Cargo.toml
++++ b/dashmap/Cargo.toml
+@@ -16,6 +16,7 @@ categories = ["concurrency", "algorithms", "data-structures"]
+ raw-api = []
+ 
+ [dependencies]
++num_cpus = "1.13.1"
+ lock_api = "0.4.7"
+ hashbrown = { version = "0.12.0", default-features = false }
+ serde = { version = "1.0.136", optional = true, features = ["derive"] }
+diff --git a/dashmap/src/lib.rs b/src/lib.rs
+index 627b513..4b8875a 100644
+--- a/dashmap/src/lib.rs
++++ b/src/lib.rs
+@@ -52,7 +52,7 @@ cfg_if! {
+ pub(crate) type HashMap<K, V, S> = hashbrown::HashMap<K, SharedValue<V>, S>;
+ 
+ fn default_shard_amount() -> usize {
+-    (std::thread::available_parallelism().map_or(1, usize::from) * 4).next_power_of_two()
++    (num_cpus::get() * 4).next_power_of_two()
+ }
+ 
+ fn ncb(shard_amount: usize) -> usize {
diff --git a/srcpkgs/vaultwarden/patches/format_strings.patch b/srcpkgs/vaultwarden/patches/format_strings.patch
new file mode 100644
index 000000000000..a20ab1ca812b
--- /dev/null
+++ b/srcpkgs/vaultwarden/patches/format_strings.patch
@@ -0,0 +1,89 @@
+diff --git a/src/api/icons.rs b/src/api/icons.rs
+index 71c4899..75e45ee 100644
+--- a/src/api/icons.rs
++++ b/src/api/icons.rs
+@@ -60,7 +60,7 @@ static CLIENT: Lazy<Client> = Lazy::new(|| {
+     match client.build() {
+         Ok(client) => client,
+         Err(e) => {
+-            error!("Possible trust-dns error, trying with trust-dns disabled: '{e}'");
++            error!("Possible trust-dns error, trying with trust-dns disabled: '{}'", e);
+             get_reqwest_client_builder()
+                 .cookie_provider(cookie_store)
+                 .timeout(Duration::from_secs(CONFIG.icon_download_timeout()))
+@@ -454,7 +454,7 @@ async fn get_favicons_node(
+                     }
+                 } else if tag.name == TAG_BASE && tag.attributes.contains_key(ATTR_HREF) {
+                     let href = std::str::from_utf8(tag.attributes.get(ATTR_HREF).unwrap()).unwrap_or_default();
+-                    debug!("Found base href: {href}");
++                    debug!("Found base href: {}", href);
+                     base_url = match base_url.join(href) {
+                         Ok(inner_url) => inner_url,
+                         _ => url.clone(),
+@@ -503,8 +503,8 @@ struct IconUrlResult {
+ /// ```
+ async fn get_icon_url(domain: &str) -> Result<IconUrlResult, Error> {
+     // Default URL with secure and insecure schemes
+-    let ssldomain = format!("https://{domain}");
+-    let httpdomain = format!("http://{domain}");
++    let ssldomain = format!("https://{}", domain);
++    let httpdomain = format!("http://{}", domain);
+ 
+     // First check the domain as given during the request for both HTTPS and HTTP.
+     let resp = match get_page(&ssldomain).or_else(|_| get_page(&httpdomain)).await {
+@@ -522,20 +522,20 @@ async fn get_icon_url(domain: &str) -> Result<IconUrlResult, Error> {
+                     base = domain_parts.next_back().unwrap()
+                 );
+                 if is_valid_domain(&base_domain).await {
+-                    let sslbase = format!("https://{base_domain}");
+-                    let httpbase = format!("http://{base_domain}");
+-                    debug!("[get_icon_url]: Trying without subdomains '{base_domain}'");
++                    let sslbase = format!("https://{}", base_domain);
++                    let httpbase = format!("http://{}", base_domain);
++                    debug!("[get_icon_url]: Trying without subdomains '{}'", base_domain);
+ 
+                     sub_resp = get_page(&sslbase).or_else(|_| get_page(&httpbase)).await;
+                 }
+ 
+             // When the domain is not an IP, and has less then 2 dots, try to add www. infront of it.
+             } else if is_ip.is_err() && domain.matches('.').count() < 2 {
+-                let www_domain = format!("www.{domain}");
++                let www_domain = format!("www.{}", domain);
+                 if is_valid_domain(&www_domain).await {
+-                    let sslwww = format!("https://{www_domain}");
+-                    let httpwww = format!("http://{www_domain}");
+-                    debug!("[get_icon_url]: Trying with www. prefix '{www_domain}'");
++                    let sslwww = format!("https://{}", www_domain);
++                    let httpwww = format!("http://{}", www_domain);
++                    debug!("[get_icon_url]: Trying with www. prefix '{}'", www_domain);
+ 
+                     sub_resp = get_page(&sslwww).or_else(|_| get_page(&httpwww)).await;
+                 }
+@@ -567,10 +567,10 @@ async fn get_icon_url(domain: &str) -> Result<IconUrlResult, Error> {
+         get_favicons_node(dom, &mut iconlist, &url).await;
+     } else {
+         // Add the default favicon.ico to the list with just the given domain
+-        iconlist.push(Icon::new(35, format!("{ssldomain}/favicon.ico")));
+-        iconlist.push(Icon::new(40, format!("{ssldomain}/apple-touch-icon.png")));
+-        iconlist.push(Icon::new(35, format!("{httpdomain}/favicon.ico")));
+-        iconlist.push(Icon::new(40, format!("{httpdomain}/apple-touch-icon.png")));
++        iconlist.push(Icon::new(35, format!("{}/favicon.ico", ssldomain)));
++        iconlist.push(Icon::new(40, format!("{}/apple-touch-icon.png", ssldomain)));
++        iconlist.push(Icon::new(35, format!("{}/favicon.ico", httpdomain)));
++        iconlist.push(Icon::new(40, format!("{}/apple-touch-icon.png", httpdomain)));
+     }
+ 
+     // Sort the iconlist by priority
+diff --git a/src/util.rs b/src/util.rs
+index de61a35..d8cc111 100644
+--- a/src/util.rs
++++ b/src/util.rs
+@@ -619,7 +619,7 @@ pub fn get_reqwest_client() -> Client {
+     match get_reqwest_client_builder().build() {
+         Ok(client) => client,
+         Err(e) => {
+-            error!("Possible trust-dns error, trying with trust-dns disabled: '{e}'");
++            error!("Possible trust-dns error, trying with trust-dns disabled: '{}'", e);
+             get_reqwest_client_builder().trust_dns(false).build().expect("Failed to build client")
+         }
+     }
diff --git a/srcpkgs/vaultwarden/template b/srcpkgs/vaultwarden/template
new file mode 100644
index 000000000000..965cf510465f
--- /dev/null
+++ b/srcpkgs/vaultwarden/template
@@ -0,0 +1,33 @@
+# 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 <joel@beckmeyer.us>"
+license="GPL-3.0-or-later"
+homepage="https://github.com/dani-garcia/vaultwarden"
+# Need to patch dashmap to be 1.57 compatible, can be removed when Rust >=1.59 
+# in repo, otherwise bump dashmap version if it changes in Cargo.lock
+distfiles="https://github.com/dani-garcia/vaultwarden/archive/${version}.tar.gz
+ https://github.com/xacrimon/dashmap/archive/v5.3.3.tar.gz>dashmap-${version}.tar.gz"
+checksum="5391f60b3afa9b66cad03cc19903ccc5ad229cbfde142041c7f910d60fd2d2cf
+ 687847d079c6dabac7d6b2bc4954a75278465a3591e5e501d5a0e01b14175e47"
+
+system_accounts="_vaultwarden"
+_vaultwarden_homedir="/var/lib/vaultwarden"
+
+make_dirs="/var/lib/vaultwarden 0750 _vaultwarden _vaultwarden"
+
+post_extract() {
+	mv ../dashmap-* dashmap
+}
+
+post_install() {
+	vsconf .env.template vaultwarden.conf
+	vsv vaultwarden
+}

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PR PATCH] [Updated] New packages: vaultwarden-web-2022.05.0, vaultwarden-1.25.0
  2022-05-23 17:23 [PR PATCH] New packages: vaultwarden-web-2.28.1, vaultwarden-1.25.0 TinfoilSubmarine
                   ` (10 preceding siblings ...)
  2022-06-06 13:10 ` TinfoilSubmarine
@ 2022-06-07 18:13 ` TinfoilSubmarine
  2022-06-08 12:23 ` TinfoilSubmarine
                   ` (11 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: TinfoilSubmarine @ 2022-06-07 18:13 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1280 bytes --]

There is an updated pull request by TinfoilSubmarine against master on the void-packages repository

https://github.com/TinfoilSubmarine/void-packages maint/vaultwarden
https://github.com/void-linux/void-packages/pull/37258

New packages: vaultwarden-web-2022.05.0, vaultwarden-1.25.0
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **YES**

#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/37258.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-maint/vaultwarden-37258.patch --]
[-- Type: text/x-diff, Size: 19878 bytes --]

From 591468dd7907e699983091fa7924edcf29147ba1 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Sat, 26 Mar 2022 20:55:52 -0400
Subject: [PATCH 1/2] New package: vaultwarden-web-2022.05.0

---
 .../vaultwarden-web/patches/v2022.05.0.patch  | 312 ++++++++++++++++++
 srcpkgs/vaultwarden-web/template              |  33 ++
 2 files changed, 345 insertions(+)
 create mode 100644 srcpkgs/vaultwarden-web/patches/v2022.05.0.patch
 create mode 100644 srcpkgs/vaultwarden-web/template

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<any>;
+   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 @@
+         </a>
+       </p>
+       <p>
+-        You can <a href="/">return to the web vault</a>, check our
+-        <a href="https://status.bitwarden.com/">status page</a> or
+-        <a href="https://bitwarden.com/contact/">contact us</a>.
++        You can <a href="/">return to the web vault</a>, or
++        <a href="https://github.com/dani-garcia/vaultwarden">contact us</a>.
+       </p>
+     </div>
+-    <div class="container footer text-muted content">© Copyright 2022 Bitwarden, Inc.</div>
++    <div class="container footer text-muted content">© Copyright 2022 Bitwarden, Inc. (Powered by Vaultwarden)</div>
+   </body>
+ </html>
+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 @@
+ <div class="container footer text-muted">
+   <div class="row">
+-    <div class="col">&copy; {{ year }}, Bitwarden Inc.</div>
++    <div class="col">&copy; {{ year }}, Bitwarden Inc. (Powered by Vaultwarden)</div>
+     <div class="col text-center"></div>
+     <div class="col text-right">
+       {{ "versionNumber" | i18n: version }}
+diff --git a/src/app/layouts/frontend-layout.component.html b/src/app/layouts/frontend-layout.component.html
+index 479302d3..84930683 100644
+--- a/src/app/layouts/frontend-layout.component.html
++++ b/src/app/layouts/frontend-layout.component.html
+@@ -1,5 +1,5 @@
+ <router-outlet></router-outlet>
+ <div class="container my-5 text-muted text-center">
+-  &copy; {{ year }}, Bitwarden Inc. <br />
++  &copy; {{ year }}, Bitwarden Inc. (Powered by Vaultwarden)<br />
+   {{ "versionNumber" | i18n: version }}
+ </div>
+diff --git a/src/app/layouts/navbar.component.html b/src/app/layouts/navbar.component.html
+index 9bbd8d2e..d2438cae 100644
+--- a/src/app/layouts/navbar.component.html
++++ b/src/app/layouts/navbar.component.html
+@@ -69,7 +69,7 @@
+               <i class="bwi bwi-fw bwi-user" aria-hidden="true"></i>
+               {{ "accountSettings" | i18n }}
+             </a>
+-            <a bit-menu-item href="https://bitwarden.com/help/" target="_blank" rel="noopener">
++            <a bit-menu-item href="https://github.com/dani-garcia/vaultwarden/" target="_blank" rel="noopener">
+               <i class="bwi bwi-fw bwi-question-circle" aria-hidden="true"></i>
+               {{ "getHelp" | i18n }}
+             </a>
+diff --git a/src/app/modules/vault/modules/individual-vault/individual-vault.component.ts b/src/app/modules/vault/modules/individual-vault/individual-vault.component.ts
+index 47e1906a..def8164c 100644
+--- a/src/app/modules/vault/modules/individual-vault/individual-vault.component.ts
++++ b/src/app/modules/vault/modules/individual-vault/individual-vault.component.ts
+@@ -94,11 +94,7 @@ export class IndividualVaultComponent implements OnInit, OnDestroy {
+   async ngOnInit() {
+     this.showVerifyEmail = !(await this.tokenService.getEmailVerified());
+     this.showBrowserOutdated = window.navigator.userAgent.indexOf("MSIE") !== -1;
+-    this.trashCleanupWarning = this.i18nService.t(
+-      this.platformUtilsService.isSelfHost()
+-        ? "trashCleanupWarningSelfHosted"
+-        : "trashCleanupWarning"
+-    );
++    this.trashCleanupWarning = this.i18nService.t("trashCleanupWarningSelfHosted");
+ 
+     this.route.queryParams.pipe(first()).subscribe(async (params) => {
+       await this.syncService.fullSync(false);
+diff --git a/src/app/modules/vault/modules/organization-vault/organization-vault.component.ts b/src/app/modules/vault/modules/organization-vault/organization-vault.component.ts
+index c7edcbe0..0e0d4807 100644
+--- a/src/app/modules/vault/modules/organization-vault/organization-vault.component.ts
++++ b/src/app/modules/vault/modules/organization-vault/organization-vault.component.ts
+@@ -75,11 +75,7 @@ export class OrganizationVaultComponent implements OnInit, OnDestroy {
+   ) {}
+ 
+   ngOnInit() {
+-    this.trashCleanupWarning = this.i18nService.t(
+-      this.platformUtilsService.isSelfHost()
+-        ? "trashCleanupWarningSelfHosted"
+-        : "trashCleanupWarning"
+-    );
++    this.trashCleanupWarning = this.i18nService.t("trashCleanupWarningSelfHosted");
+     this.route.parent.params.subscribe(async (params: any) => {
+       this.organization = await this.organizationService.get(params.organizationId);
+       this.vaultFilterComponent.organization = this.organization;
+diff --git a/src/app/send/access.component.html b/src/app/send/access.component.html
+index 19bc107b..7e1dbcc7 100644
+--- a/src/app/send/access.component.html
++++ b/src/app/send/access.component.html
+@@ -137,15 +137,6 @@
+     <div class="col-12 text-center mt-5 text-muted">
+       <p class="mb-0">
+         {{ "sendAccessTaglineProductDesc" | i18n }}<br />
+-        {{ "sendAccessTaglineLearnMore" | i18n }}
+-        <a href="https://www.bitwarden.com/products/send?source=web-vault" target="_blank"
+-          >Bitwarden Send</a
+-        >
+-        {{ "sendAccessTaglineOr" | i18n }}
+-        <a href="https://vault.bitwarden.com/#/register" target="_blank">{{
+-          "sendAccessTaglineSignUp" | i18n
+-        }}</a>
+-        {{ "sendAccessTaglineTryToday" | i18n }}
+       </p>
+     </div>
+   </div>
+diff --git a/src/app/services/init.service.ts b/src/app/services/init.service.ts
+index eacfea97..c2f81033 100644
+--- a/src/app/services/init.service.ts
++++ b/src/app/services/init.service.ts
+@@ -36,11 +36,23 @@ export class InitService {
+   ) {}
+ 
+   init() {
++    function getBaseUrl() {
++        // If the base URL is `https://vaultwarden.example.com/base/path/`,
++        // `window.location.href` should have one of the following forms:
++        //
++        // - `https://vaultwarden.example.com/base/path/`
++        // - `https://vaultwarden.example.com/base/path/#/some/route[?queryParam=...]`
++        //
++        // We want to get to just `https://vaultwarden.example.com/base/path`.
++        let baseUrl = window.location.href;
++        baseUrl = baseUrl.replace(/#.*/, '');  // Strip off `#` and everything after.
++        baseUrl = baseUrl.replace(/\/+$/, ''); // Trim any trailing `/` chars.
++        return baseUrl;
++    }
+     return async () => {
+       await this.stateService.init();
+ 
+-      const urls = process.env.URLS as Urls;
+-      urls.base ??= this.win.location.origin;
++      const urls = {base: getBaseUrl()};
+       this.environmentService.setUrls(urls);
+ 
+       setTimeout(() => this.notificationsService.init(), 3000);
+diff --git a/src/app/settings/settings.component.ts b/src/app/settings/settings.component.ts
+index 9756ba41..348c3843 100644
+--- a/src/app/settings/settings.component.ts
++++ b/src/app/settings/settings.component.ts
+@@ -55,10 +55,6 @@ export class SettingsComponent implements OnInit, OnDestroy {
+     this.hasFamilySponsorshipAvailable = await this.organizationService.canManageSponsorships();
+     const hasPremiumFromOrg = await this.stateService.getCanAccessPremium();
+     let billing = null;
+-    if (!this.selfHosted) {
+-      billing = await this.apiService.getUserBillingHistory();
+-    }
+-    this.hideSubscription =
+-      !this.premium && hasPremiumFromOrg && (this.selfHosted || billing?.hasNoHistory);
++    this.hideSubscription = true;
+   }
+ }
+diff --git a/src/app/settings/user-billing-history.component.ts b/src/app/settings/user-billing-history.component.ts
+index ae26862d..69ff16a0 100644
+--- a/src/app/settings/user-billing-history.component.ts
++++ b/src/app/settings/user-billing-history.component.ts
+@@ -39,7 +39,7 @@ export class UserBillingHistoryComponent implements OnInit {
+       return;
+     }
+     this.loading = true;
+-    this.billing = await this.apiService.getUserBillingHistory();
++    this.billing = null;
+     this.loading = false;
+   }
+ 
+diff --git a/src/app/vault/add-edit.component.html b/src/app/vault/add-edit.component.html
+index 37410ea5..8c9e1a6f 100644
+--- a/src/app/vault/add-edit.component.html
++++ b/src/app/vault/add-edit.component.html
+@@ -182,7 +182,7 @@
+             <div class="col-6 form-group totp d-flex align-items-end" [ngClass]="{ low: totpLow }">
+               <div *ngIf="!cipher.login.totp || !totpCode">
+                 <img
+-                  src="../../images/totp-countdown.png"
++                  src="images/totp-countdown.png"
+                   id="totpImage"
+                   title="{{ 'verificationCodeTotp' | i18n }}"
+                   class="ml-2"
+diff --git a/src/scss/styles.scss b/src/scss/styles.scss
+index 26c5e5c7..b42df01b 100644
+--- a/src/scss/styles.scss
++++ b/src/scss/styles.scss
+@@ -58,3 +58,54 @@
+ @import "./tables";
+ @import "./toasts";
+ @import "./vault-filters";
++
++/**** START Vaultwarden CHANGES ****/
++/* This combines all selectors extending it into one */
++%vw-hide { display: none !important; }
++
++/* This allows searching for the combined style in the browsers dev-tools (look into the head tag) */
++#vw-hide, head { @extend %vw-hide; }
++
++/* Hide any link pointing to billing */
++a[href$="/settings/billing"] { @extend %vw-hide; }
++
++/* Hide any link pointing to subscriptions */
++a[href$="/settings/subscription"] { @extend %vw-hide; }
++
++/* Hide any link pointing to Sponsored Families */
++a[href$="/settings/sponsored-families"] { @extend %vw-hide; }
++
++/* Hide the `Enterprise Single Sign-On` button on the login page */
++a[href$="/sso"] { @extend %vw-hide; }
++
++/* Hide the info box that advertises Bitwarden Send */
++app-send-info.d-block { @extend %vw-hide; }
++
++/* Hide Two-Factor menu in Organization settings */
++app-org-settings a[href$="/settings/two-factor"] { @extend %vw-hide; }
++
++/* Hide organization plans */
++app-organization-plans > form > div.form-check { @extend %vw-hide; }
++app-organization-plans > form > h2.mt-5 { @extend %vw-hide; }
++
++/* Hide the `This account is owned by a business` checkbox and label */
++#ownedBusiness, label[for^=ownedBusiness] { @extend %vw-hide; }
++
++/* Hide External Id field for Collections */
++app-collection-add-edit form div.form-group:nth-child(2) { @extend %vw-hide; }
++
++/* Hide the radio button and label for the `Custom` org user type */
++#userTypeCustom, label[for^=userTypeCustom] { @extend %vw-hide; }
++
++/* Hide the warning that policy config is moving to Business Portal */
++app-org-policies > app-callout { @extend %vw-hide; }
++
++/* Hide Business Name and Identifier */
++app-org-account form div.form-group:nth-child(3) { display: none; }
++app-org-account form div.form-group:nth-child(4) { display: none; }
++
++/* Hide Tax Info and Form in Organization settings */
++app-org-account > div.secondary-header:nth-child(3) { @extend %vw-hide; }
++app-org-account > div.secondary-header:nth-child(3) + p { @extend %vw-hide; }
++app-org-account > div.secondary-header:nth-child(3) + p + form { @extend %vw-hide; }
++/**** END Vaultwarden CHANGES ****/
+diff --git a/src/services/webPlatformUtils.service.ts b/src/services/webPlatformUtils.service.ts
+index 755600a1..25f4561e 100644
+--- a/src/services/webPlatformUtils.service.ts
++++ b/src/services/webPlatformUtils.service.ts
+@@ -240,11 +240,11 @@ export class WebPlatformUtilsService implements PlatformUtilsService {
+   }
+ 
+   isDev(): boolean {
+-    return process.env.NODE_ENV === "development";
++    return false;
+   }
+ 
+   isSelfHost(): boolean {
+-    return process.env.ENV.toString() === "selfhosted";
++    return false;
+   }
+ 
+   copyToClipboard(text: string, options?: any): void | boolean {
diff --git a/srcpkgs/vaultwarden-web/template b/srcpkgs/vaultwarden-web/template
new file mode 100644
index 000000000000..5db02bb4845b
--- /dev/null
+++ b/srcpkgs/vaultwarden-web/template
@@ -0,0 +1,33 @@
+# Template file for 'vaultwarden-web'
+pkgname=vaultwarden-web
+version=2022.05.0
+revision=1
+wrksrc="web-${version}"
+_jslib_commit=1cc4bed67170ac92b92cb46e8bbcf7c59ea166db
+hostmakedepends="git nodejs"
+short_desc="Web vault builds for vaultwarden"
+maintainer="Joel Beckmeyer <joel@beckmeyer.us>"
+license="GPL-3.0-or-later"
+homepage="https://github.com/dani-garcia/bw_web_builds"
+distfiles="https://github.com/bitwarden/web/archive/${version}.tar.gz
+ https://github.com/bitwarden/jslib/archive/${_jslib_commit}.tar.gz"
+checksum="3e4671498e19f383891d4eb59b3f2c68624041b8e2b9e07597ad57673d8602c3
+ 6c47021b3b1809dca2f9826f7de3ae043eeff7d7d1235ae148db7c6e56e0fbcf"
+
+post_extract() {
+	rmdir jslib
+	mv ../jslib-* jslib
+}
+
+do_configure() {
+	npm ci --ignore-scripts
+}
+
+do_build() {
+	npm run dist:oss:selfhost
+}
+
+do_install() {
+	vmkdir usr/share/webapps/vaultwarden-web
+	vcopy build/* usr/share/webapps/vaultwarden-web
+}

From 84686ffeee7132bbffe45ca530984e75027f29dd Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Thu, 17 Feb 2022 13:25:21 -0500
Subject: [PATCH 2/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 <joel@beckmeyer.us>"
+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
+}

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: New packages: vaultwarden-web-2022.05.0, vaultwarden-1.25.0
  2022-05-23 17:23 [PR PATCH] New packages: vaultwarden-web-2.28.1, vaultwarden-1.25.0 TinfoilSubmarine
                   ` (11 preceding siblings ...)
  2022-06-07 18:13 ` [PR PATCH] [Updated] New packages: vaultwarden-web-2022.05.0, vaultwarden-1.25.0 TinfoilSubmarine
@ 2022-06-08 12:23 ` TinfoilSubmarine
  2022-06-28 13:48 ` [PR PATCH] [Updated] " TinfoilSubmarine
                   ` (10 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: TinfoilSubmarine @ 2022-06-08 12:23 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 227 bytes --]

New comment by TinfoilSubmarine on void-packages repository

https://github.com/void-linux/void-packages/pull/37258#issuecomment-1149845674

Comment:
Removed all the patches as they are no longer needed with Rust 1.61 in repo.

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PR PATCH] [Updated] New packages: vaultwarden-web-2022.05.0, vaultwarden-1.25.0
  2022-05-23 17:23 [PR PATCH] New packages: vaultwarden-web-2.28.1, vaultwarden-1.25.0 TinfoilSubmarine
                   ` (12 preceding siblings ...)
  2022-06-08 12:23 ` TinfoilSubmarine
@ 2022-06-28 13:48 ` TinfoilSubmarine
  2022-06-28 13:49 ` TinfoilSubmarine
                   ` (9 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: TinfoilSubmarine @ 2022-06-28 13:48 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1280 bytes --]

There is an updated pull request by TinfoilSubmarine against master on the void-packages repository

https://github.com/TinfoilSubmarine/void-packages maint/vaultwarden
https://github.com/void-linux/void-packages/pull/37258

New packages: vaultwarden-web-2022.05.0, vaultwarden-1.25.0
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **YES**

#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/37258.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-maint/vaultwarden-37258.patch --]
[-- Type: text/x-diff, Size: 20393 bytes --]

From 062bae3ae2d1003188ae1457f46a8ad48a3686c9 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
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 <joel@beckmeyer.us>"
+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 <joel@beckmeyer.us>
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<any>;
+   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 @@
+         </a>
+       </p>
+       <p>
+-        You can <a href="/">return to the web vault</a>, check our
+-        <a href="https://status.bitwarden.com/">status page</a> or
+-        <a href="https://bitwarden.com/contact/">contact us</a>.
++        You can <a href="/">return to the web vault</a>, or
++        <a href="https://github.com/dani-garcia/vaultwarden">contact us</a>.
+       </p>
+     </div>
+-    <div class="container footer text-muted content">© Copyright 2022 Bitwarden, Inc.</div>
++    <div class="container footer text-muted content">© Copyright 2022 Bitwarden, Inc. (Powered by Vaultwarden)</div>
+   </body>
+ </html>
+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 @@
+ <div class="container footer text-muted">
+   <div class="row">
+-    <div class="col">&copy; {{ year }}, Bitwarden Inc.</div>
++    <div class="col">&copy; {{ year }}, Bitwarden Inc. (Powered by Vaultwarden)</div>
+     <div class="col text-center"></div>
+     <div class="col text-right">
+       {{ "versionNumber" | i18n: version }}
+diff --git a/src/app/layouts/frontend-layout.component.html b/src/app/layouts/frontend-layout.component.html
+index 479302d3..84930683 100644
+--- a/src/app/layouts/frontend-layout.component.html
++++ b/src/app/layouts/frontend-layout.component.html
+@@ -1,5 +1,5 @@
+ <router-outlet></router-outlet>
+ <div class="container my-5 text-muted text-center">
+-  &copy; {{ year }}, Bitwarden Inc. <br />
++  &copy; {{ year }}, Bitwarden Inc. (Powered by Vaultwarden)<br />
+   {{ "versionNumber" | i18n: version }}
+ </div>
+diff --git a/src/app/layouts/navbar.component.html b/src/app/layouts/navbar.component.html
+index 9bbd8d2e..d2438cae 100644
+--- a/src/app/layouts/navbar.component.html
++++ b/src/app/layouts/navbar.component.html
+@@ -69,7 +69,7 @@
+               <i class="bwi bwi-fw bwi-user" aria-hidden="true"></i>
+               {{ "accountSettings" | i18n }}
+             </a>
+-            <a bit-menu-item href="https://bitwarden.com/help/" target="_blank" rel="noopener">
++            <a bit-menu-item href="https://github.com/dani-garcia/vaultwarden/" target="_blank" rel="noopener">
+               <i class="bwi bwi-fw bwi-question-circle" aria-hidden="true"></i>
+               {{ "getHelp" | i18n }}
+             </a>
+diff --git a/src/app/modules/vault/modules/individual-vault/individual-vault.component.ts b/src/app/modules/vault/modules/individual-vault/individual-vault.component.ts
+index 47e1906a..def8164c 100644
+--- a/src/app/modules/vault/modules/individual-vault/individual-vault.component.ts
++++ b/src/app/modules/vault/modules/individual-vault/individual-vault.component.ts
+@@ -94,11 +94,7 @@ export class IndividualVaultComponent implements OnInit, OnDestroy {
+   async ngOnInit() {
+     this.showVerifyEmail = !(await this.tokenService.getEmailVerified());
+     this.showBrowserOutdated = window.navigator.userAgent.indexOf("MSIE") !== -1;
+-    this.trashCleanupWarning = this.i18nService.t(
+-      this.platformUtilsService.isSelfHost()
+-        ? "trashCleanupWarningSelfHosted"
+-        : "trashCleanupWarning"
+-    );
++    this.trashCleanupWarning = this.i18nService.t("trashCleanupWarningSelfHosted");
+ 
+     this.route.queryParams.pipe(first()).subscribe(async (params) => {
+       await this.syncService.fullSync(false);
+diff --git a/src/app/modules/vault/modules/organization-vault/organization-vault.component.ts b/src/app/modules/vault/modules/organization-vault/organization-vault.component.ts
+index c7edcbe0..0e0d4807 100644
+--- a/src/app/modules/vault/modules/organization-vault/organization-vault.component.ts
++++ b/src/app/modules/vault/modules/organization-vault/organization-vault.component.ts
+@@ -75,11 +75,7 @@ export class OrganizationVaultComponent implements OnInit, OnDestroy {
+   ) {}
+ 
+   ngOnInit() {
+-    this.trashCleanupWarning = this.i18nService.t(
+-      this.platformUtilsService.isSelfHost()
+-        ? "trashCleanupWarningSelfHosted"
+-        : "trashCleanupWarning"
+-    );
++    this.trashCleanupWarning = this.i18nService.t("trashCleanupWarningSelfHosted");
+     this.route.parent.params.subscribe(async (params: any) => {
+       this.organization = await this.organizationService.get(params.organizationId);
+       this.vaultFilterComponent.organization = this.organization;
+diff --git a/src/app/send/access.component.html b/src/app/send/access.component.html
+index 19bc107b..7e1dbcc7 100644
+--- a/src/app/send/access.component.html
++++ b/src/app/send/access.component.html
+@@ -137,15 +137,6 @@
+     <div class="col-12 text-center mt-5 text-muted">
+       <p class="mb-0">
+         {{ "sendAccessTaglineProductDesc" | i18n }}<br />
+-        {{ "sendAccessTaglineLearnMore" | i18n }}
+-        <a href="https://www.bitwarden.com/products/send?source=web-vault" target="_blank"
+-          >Bitwarden Send</a
+-        >
+-        {{ "sendAccessTaglineOr" | i18n }}
+-        <a href="https://vault.bitwarden.com/#/register" target="_blank">{{
+-          "sendAccessTaglineSignUp" | i18n
+-        }}</a>
+-        {{ "sendAccessTaglineTryToday" | i18n }}
+       </p>
+     </div>
+   </div>
+diff --git a/src/app/services/init.service.ts b/src/app/services/init.service.ts
+index eacfea97..c2f81033 100644
+--- a/src/app/services/init.service.ts
++++ b/src/app/services/init.service.ts
+@@ -36,11 +36,23 @@ export class InitService {
+   ) {}
+ 
+   init() {
++    function getBaseUrl() {
++        // If the base URL is `https://vaultwarden.example.com/base/path/`,
++        // `window.location.href` should have one of the following forms:
++        //
++        // - `https://vaultwarden.example.com/base/path/`
++        // - `https://vaultwarden.example.com/base/path/#/some/route[?queryParam=...]`
++        //
++        // We want to get to just `https://vaultwarden.example.com/base/path`.
++        let baseUrl = window.location.href;
++        baseUrl = baseUrl.replace(/#.*/, '');  // Strip off `#` and everything after.
++        baseUrl = baseUrl.replace(/\/+$/, ''); // Trim any trailing `/` chars.
++        return baseUrl;
++    }
+     return async () => {
+       await this.stateService.init();
+ 
+-      const urls = process.env.URLS as Urls;
+-      urls.base ??= this.win.location.origin;
++      const urls = {base: getBaseUrl()};
+       this.environmentService.setUrls(urls);
+ 
+       setTimeout(() => this.notificationsService.init(), 3000);
+diff --git a/src/app/settings/settings.component.ts b/src/app/settings/settings.component.ts
+index 9756ba41..348c3843 100644
+--- a/src/app/settings/settings.component.ts
++++ b/src/app/settings/settings.component.ts
+@@ -55,10 +55,6 @@ export class SettingsComponent implements OnInit, OnDestroy {
+     this.hasFamilySponsorshipAvailable = await this.organizationService.canManageSponsorships();
+     const hasPremiumFromOrg = await this.stateService.getCanAccessPremium();
+     let billing = null;
+-    if (!this.selfHosted) {
+-      billing = await this.apiService.getUserBillingHistory();
+-    }
+-    this.hideSubscription =
+-      !this.premium && hasPremiumFromOrg && (this.selfHosted || billing?.hasNoHistory);
++    this.hideSubscription = true;
+   }
+ }
+diff --git a/src/app/settings/user-billing-history.component.ts b/src/app/settings/user-billing-history.component.ts
+index ae26862d..69ff16a0 100644
+--- a/src/app/settings/user-billing-history.component.ts
++++ b/src/app/settings/user-billing-history.component.ts
+@@ -39,7 +39,7 @@ export class UserBillingHistoryComponent implements OnInit {
+       return;
+     }
+     this.loading = true;
+-    this.billing = await this.apiService.getUserBillingHistory();
++    this.billing = null;
+     this.loading = false;
+   }
+ 
+diff --git a/src/app/vault/add-edit.component.html b/src/app/vault/add-edit.component.html
+index 37410ea5..8c9e1a6f 100644
+--- a/src/app/vault/add-edit.component.html
++++ b/src/app/vault/add-edit.component.html
+@@ -182,7 +182,7 @@
+             <div class="col-6 form-group totp d-flex align-items-end" [ngClass]="{ low: totpLow }">
+               <div *ngIf="!cipher.login.totp || !totpCode">
+                 <img
+-                  src="../../images/totp-countdown.png"
++                  src="images/totp-countdown.png"
+                   id="totpImage"
+                   title="{{ 'verificationCodeTotp' | i18n }}"
+                   class="ml-2"
+diff --git a/src/scss/styles.scss b/src/scss/styles.scss
+index 26c5e5c7..b42df01b 100644
+--- a/src/scss/styles.scss
++++ b/src/scss/styles.scss
+@@ -58,3 +58,54 @@
+ @import "./tables";
+ @import "./toasts";
+ @import "./vault-filters";
++
++/**** START Vaultwarden CHANGES ****/
++/* This combines all selectors extending it into one */
++%vw-hide { display: none !important; }
++
++/* This allows searching for the combined style in the browsers dev-tools (look into the head tag) */
++#vw-hide, head { @extend %vw-hide; }
++
++/* Hide any link pointing to billing */
++a[href$="/settings/billing"] { @extend %vw-hide; }
++
++/* Hide any link pointing to subscriptions */
++a[href$="/settings/subscription"] { @extend %vw-hide; }
++
++/* Hide any link pointing to Sponsored Families */
++a[href$="/settings/sponsored-families"] { @extend %vw-hide; }
++
++/* Hide the `Enterprise Single Sign-On` button on the login page */
++a[href$="/sso"] { @extend %vw-hide; }
++
++/* Hide the info box that advertises Bitwarden Send */
++app-send-info.d-block { @extend %vw-hide; }
++
++/* Hide Two-Factor menu in Organization settings */
++app-org-settings a[href$="/settings/two-factor"] { @extend %vw-hide; }
++
++/* Hide organization plans */
++app-organization-plans > form > div.form-check { @extend %vw-hide; }
++app-organization-plans > form > h2.mt-5 { @extend %vw-hide; }
++
++/* Hide the `This account is owned by a business` checkbox and label */
++#ownedBusiness, label[for^=ownedBusiness] { @extend %vw-hide; }
++
++/* Hide External Id field for Collections */
++app-collection-add-edit form div.form-group:nth-child(2) { @extend %vw-hide; }
++
++/* Hide the radio button and label for the `Custom` org user type */
++#userTypeCustom, label[for^=userTypeCustom] { @extend %vw-hide; }
++
++/* Hide the warning that policy config is moving to Business Portal */
++app-org-policies > app-callout { @extend %vw-hide; }
++
++/* Hide Business Name and Identifier */
++app-org-account form div.form-group:nth-child(3) { display: none; }
++app-org-account form div.form-group:nth-child(4) { display: none; }
++
++/* Hide Tax Info and Form in Organization settings */
++app-org-account > div.secondary-header:nth-child(3) { @extend %vw-hide; }
++app-org-account > div.secondary-header:nth-child(3) + p { @extend %vw-hide; }
++app-org-account > div.secondary-header:nth-child(3) + p + form { @extend %vw-hide; }
++/**** END Vaultwarden CHANGES ****/
+diff --git a/src/services/webPlatformUtils.service.ts b/src/services/webPlatformUtils.service.ts
+index 755600a1..25f4561e 100644
+--- a/src/services/webPlatformUtils.service.ts
++++ b/src/services/webPlatformUtils.service.ts
+@@ -240,11 +240,11 @@ export class WebPlatformUtilsService implements PlatformUtilsService {
+   }
+ 
+   isDev(): boolean {
+-    return process.env.NODE_ENV === "development";
++    return false;
+   }
+ 
+   isSelfHost(): boolean {
+-    return process.env.ENV.toString() === "selfhosted";
++    return false;
+   }
+ 
+   copyToClipboard(text: string, options?: any): void | boolean {
diff --git a/srcpkgs/vaultwarden-web/template b/srcpkgs/vaultwarden-web/template
new file mode 100644
index 000000000000..1031961a130f
--- /dev/null
+++ b/srcpkgs/vaultwarden-web/template
@@ -0,0 +1,36 @@
+# Template file for 'vaultwarden-web'
+pkgname=vaultwarden-web
+version=2022.05.0
+revision=1
+wrksrc="web-${version}"
+_jslib_commit=1cc4bed67170ac92b92cb46e8bbcf7c59ea166db
+hostmakedepends="git nodejs"
+short_desc="Web vault builds for vaultwarden"
+maintainer="Joel Beckmeyer <joel@beckmeyer.us>"
+license="GPL-3.0-or-later"
+# patches need to be pulled from 
+# https://github.com/dani-garcia/bw_web_builds/tree/master/patches into the
+# patches directory
+homepage="https://github.com/dani-garcia/bw_web_builds"
+distfiles="https://github.com/bitwarden/web/archive/${version}.tar.gz
+ https://github.com/bitwarden/jslib/archive/${_jslib_commit}.tar.gz"
+checksum="3e4671498e19f383891d4eb59b3f2c68624041b8e2b9e07597ad57673d8602c3
+ 6c47021b3b1809dca2f9826f7de3ae043eeff7d7d1235ae148db7c6e56e0fbcf"
+
+post_extract() {
+	rmdir jslib
+	mv ../jslib-* jslib
+}
+
+do_configure() {
+	npm ci --ignore-scripts
+}
+
+do_build() {
+	npm run dist:oss:selfhost
+}
+
+do_install() {
+	vmkdir usr/share/webapps/vaultwarden-web
+	vcopy build/* usr/share/webapps/vaultwarden-web
+}
diff --git a/srcpkgs/vaultwarden-web/update b/srcpkgs/vaultwarden-web/update
new file mode 100644
index 000000000000..7d10386dd670
--- /dev/null
+++ b/srcpkgs/vaultwarden-web/update
@@ -0,0 +1,2 @@
+pkgname=bw_web
+site="https://github.com/dani-garcia/bw_web_builds/releases"

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PR PATCH] [Updated] New packages: vaultwarden-web-2022.05.0, vaultwarden-1.25.0
  2022-05-23 17:23 [PR PATCH] New packages: vaultwarden-web-2.28.1, vaultwarden-1.25.0 TinfoilSubmarine
                   ` (13 preceding siblings ...)
  2022-06-28 13:48 ` [PR PATCH] [Updated] " TinfoilSubmarine
@ 2022-06-28 13:49 ` TinfoilSubmarine
  2022-07-11 13:00 ` [PR PATCH] [Updated] New packages: vaultwarden-web-2022.5.2, vaultwarden-1.25.0 TinfoilSubmarine
                   ` (8 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: TinfoilSubmarine @ 2022-06-28 13:49 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1280 bytes --]

There is an updated pull request by TinfoilSubmarine against master on the void-packages repository

https://github.com/TinfoilSubmarine/void-packages maint/vaultwarden
https://github.com/void-linux/void-packages/pull/37258

New packages: vaultwarden-web-2022.05.0, vaultwarden-1.25.0
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **YES**

#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/37258.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-maint/vaultwarden-37258.patch --]
[-- Type: text/x-diff, Size: 20388 bytes --]

From 062bae3ae2d1003188ae1457f46a8ad48a3686c9 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
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 <joel@beckmeyer.us>"
+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 0bdc4756b5afc9ee4df06fe7249beb7907e668e8 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Sat, 26 Mar 2022 20:55:52 -0400
Subject: [PATCH 2/2] New package: vaultwarden-web-2022.5.2

---
 .../vaultwarden-web/patches/v2022.5.2.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.5.2.patch
 create mode 100644 srcpkgs/vaultwarden-web/template
 create mode 100644 srcpkgs/vaultwarden-web/update

diff --git a/srcpkgs/vaultwarden-web/patches/v2022.5.2.patch b/srcpkgs/vaultwarden-web/patches/v2022.5.2.patch
new file mode 100644
index 000000000000..11f959177fb7
--- /dev/null
+++ b/srcpkgs/vaultwarden-web/patches/v2022.5.2.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<any>;
+   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 @@
+         </a>
+       </p>
+       <p>
+-        You can <a href="/">return to the web vault</a>, check our
+-        <a href="https://status.bitwarden.com/">status page</a> or
+-        <a href="https://bitwarden.com/contact/">contact us</a>.
++        You can <a href="/">return to the web vault</a>, or
++        <a href="https://github.com/dani-garcia/vaultwarden">contact us</a>.
+       </p>
+     </div>
+-    <div class="container footer text-muted content">© Copyright 2022 Bitwarden, Inc.</div>
++    <div class="container footer text-muted content">© Copyright 2022 Bitwarden, Inc. (Powered by Vaultwarden)</div>
+   </body>
+ </html>
+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 @@
+ <div class="container footer text-muted">
+   <div class="row">
+-    <div class="col">&copy; {{ year }}, Bitwarden Inc.</div>
++    <div class="col">&copy; {{ year }}, Bitwarden Inc. (Powered by Vaultwarden)</div>
+     <div class="col text-center"></div>
+     <div class="col text-right">
+       {{ "versionNumber" | i18n: version }}
+diff --git a/src/app/layouts/frontend-layout.component.html b/src/app/layouts/frontend-layout.component.html
+index 479302d3..84930683 100644
+--- a/src/app/layouts/frontend-layout.component.html
++++ b/src/app/layouts/frontend-layout.component.html
+@@ -1,5 +1,5 @@
+ <router-outlet></router-outlet>
+ <div class="container my-5 text-muted text-center">
+-  &copy; {{ year }}, Bitwarden Inc. <br />
++  &copy; {{ year }}, Bitwarden Inc. (Powered by Vaultwarden)<br />
+   {{ "versionNumber" | i18n: version }}
+ </div>
+diff --git a/src/app/layouts/navbar.component.html b/src/app/layouts/navbar.component.html
+index 9bbd8d2e..d2438cae 100644
+--- a/src/app/layouts/navbar.component.html
++++ b/src/app/layouts/navbar.component.html
+@@ -69,7 +69,7 @@
+               <i class="bwi bwi-fw bwi-user" aria-hidden="true"></i>
+               {{ "accountSettings" | i18n }}
+             </a>
+-            <a bit-menu-item href="https://bitwarden.com/help/" target="_blank" rel="noopener">
++            <a bit-menu-item href="https://github.com/dani-garcia/vaultwarden/" target="_blank" rel="noopener">
+               <i class="bwi bwi-fw bwi-question-circle" aria-hidden="true"></i>
+               {{ "getHelp" | i18n }}
+             </a>
+diff --git a/src/app/modules/vault/modules/individual-vault/individual-vault.component.ts b/src/app/modules/vault/modules/individual-vault/individual-vault.component.ts
+index 47e1906a..def8164c 100644
+--- a/src/app/modules/vault/modules/individual-vault/individual-vault.component.ts
++++ b/src/app/modules/vault/modules/individual-vault/individual-vault.component.ts
+@@ -94,11 +94,7 @@ export class IndividualVaultComponent implements OnInit, OnDestroy {
+   async ngOnInit() {
+     this.showVerifyEmail = !(await this.tokenService.getEmailVerified());
+     this.showBrowserOutdated = window.navigator.userAgent.indexOf("MSIE") !== -1;
+-    this.trashCleanupWarning = this.i18nService.t(
+-      this.platformUtilsService.isSelfHost()
+-        ? "trashCleanupWarningSelfHosted"
+-        : "trashCleanupWarning"
+-    );
++    this.trashCleanupWarning = this.i18nService.t("trashCleanupWarningSelfHosted");
+ 
+     this.route.queryParams.pipe(first()).subscribe(async (params) => {
+       await this.syncService.fullSync(false);
+diff --git a/src/app/modules/vault/modules/organization-vault/organization-vault.component.ts b/src/app/modules/vault/modules/organization-vault/organization-vault.component.ts
+index 59d97bf7..fd96ed3b 100644
+--- a/src/app/modules/vault/modules/organization-vault/organization-vault.component.ts
++++ b/src/app/modules/vault/modules/organization-vault/organization-vault.component.ts
+@@ -81,11 +81,7 @@ export class OrganizationVaultComponent implements OnInit, OnDestroy {
+   ) {}
+ 
+   ngOnInit() {
+-    this.trashCleanupWarning = this.i18nService.t(
+-      this.platformUtilsService.isSelfHost()
+-        ? "trashCleanupWarningSelfHosted"
+-        : "trashCleanupWarning"
+-    );
++    this.trashCleanupWarning = this.i18nService.t("trashCleanupWarningSelfHosted");
+     this.route.parent.params.subscribe(async (params: any) => {
+       this.organization = await this.organizationService.get(params.organizationId);
+       this.vaultFilterComponent.organization = this.organization;
+diff --git a/src/app/send/access.component.html b/src/app/send/access.component.html
+index 19bc107b..7e1dbcc7 100644
+--- a/src/app/send/access.component.html
++++ b/src/app/send/access.component.html
+@@ -137,15 +137,6 @@
+     <div class="col-12 text-center mt-5 text-muted">
+       <p class="mb-0">
+         {{ "sendAccessTaglineProductDesc" | i18n }}<br />
+-        {{ "sendAccessTaglineLearnMore" | i18n }}
+-        <a href="https://www.bitwarden.com/products/send?source=web-vault" target="_blank"
+-          >Bitwarden Send</a
+-        >
+-        {{ "sendAccessTaglineOr" | i18n }}
+-        <a href="https://vault.bitwarden.com/#/register" target="_blank">{{
+-          "sendAccessTaglineSignUp" | i18n
+-        }}</a>
+-        {{ "sendAccessTaglineTryToday" | i18n }}
+       </p>
+     </div>
+   </div>
+diff --git a/src/app/services/init.service.ts b/src/app/services/init.service.ts
+index eacfea97..c2f81033 100644
+--- a/src/app/services/init.service.ts
++++ b/src/app/services/init.service.ts
+@@ -36,11 +36,23 @@ export class InitService {
+   ) {}
+ 
+   init() {
++    function getBaseUrl() {
++        // If the base URL is `https://vaultwarden.example.com/base/path/`,
++        // `window.location.href` should have one of the following forms:
++        //
++        // - `https://vaultwarden.example.com/base/path/`
++        // - `https://vaultwarden.example.com/base/path/#/some/route[?queryParam=...]`
++        //
++        // We want to get to just `https://vaultwarden.example.com/base/path`.
++        let baseUrl = window.location.href;
++        baseUrl = baseUrl.replace(/#.*/, '');  // Strip off `#` and everything after.
++        baseUrl = baseUrl.replace(/\/+$/, ''); // Trim any trailing `/` chars.
++        return baseUrl;
++    }
+     return async () => {
+       await this.stateService.init();
+ 
+-      const urls = process.env.URLS as Urls;
+-      urls.base ??= this.win.location.origin;
++      const urls = {base: getBaseUrl()};
+       this.environmentService.setUrls(urls);
+ 
+       setTimeout(() => this.notificationsService.init(), 3000);
+diff --git a/src/app/settings/settings.component.ts b/src/app/settings/settings.component.ts
+index 9756ba41..348c3843 100644
+--- a/src/app/settings/settings.component.ts
++++ b/src/app/settings/settings.component.ts
+@@ -55,10 +55,6 @@ export class SettingsComponent implements OnInit, OnDestroy {
+     this.hasFamilySponsorshipAvailable = await this.organizationService.canManageSponsorships();
+     const hasPremiumFromOrg = await this.stateService.getCanAccessPremium();
+     let billing = null;
+-    if (!this.selfHosted) {
+-      billing = await this.apiService.getUserBillingHistory();
+-    }
+-    this.hideSubscription =
+-      !this.premium && hasPremiumFromOrg && (this.selfHosted || billing?.hasNoHistory);
++    this.hideSubscription = true;
+   }
+ }
+diff --git a/src/app/settings/user-billing-history.component.ts b/src/app/settings/user-billing-history.component.ts
+index ae26862d..69ff16a0 100644
+--- a/src/app/settings/user-billing-history.component.ts
++++ b/src/app/settings/user-billing-history.component.ts
+@@ -39,7 +39,7 @@ export class UserBillingHistoryComponent implements OnInit {
+       return;
+     }
+     this.loading = true;
+-    this.billing = await this.apiService.getUserBillingHistory();
++    this.billing = null;
+     this.loading = false;
+   }
+ 
+diff --git a/src/app/vault/add-edit.component.html b/src/app/vault/add-edit.component.html
+index 37410ea5..8c9e1a6f 100644
+--- a/src/app/vault/add-edit.component.html
++++ b/src/app/vault/add-edit.component.html
+@@ -182,7 +182,7 @@
+             <div class="col-6 form-group totp d-flex align-items-end" [ngClass]="{ low: totpLow }">
+               <div *ngIf="!cipher.login.totp || !totpCode">
+                 <img
+-                  src="../../images/totp-countdown.png"
++                  src="images/totp-countdown.png"
+                   id="totpImage"
+                   title="{{ 'verificationCodeTotp' | i18n }}"
+                   class="ml-2"
+diff --git a/src/scss/styles.scss b/src/scss/styles.scss
+index 26c5e5c7..b42df01b 100644
+--- a/src/scss/styles.scss
++++ b/src/scss/styles.scss
+@@ -58,3 +58,54 @@
+ @import "./tables";
+ @import "./toasts";
+ @import "./vault-filters";
++
++/**** START Vaultwarden CHANGES ****/
++/* This combines all selectors extending it into one */
++%vw-hide { display: none !important; }
++
++/* This allows searching for the combined style in the browsers dev-tools (look into the head tag) */
++#vw-hide, head { @extend %vw-hide; }
++
++/* Hide any link pointing to billing */
++a[href$="/settings/billing"] { @extend %vw-hide; }
++
++/* Hide any link pointing to subscriptions */
++a[href$="/settings/subscription"] { @extend %vw-hide; }
++
++/* Hide any link pointing to Sponsored Families */
++a[href$="/settings/sponsored-families"] { @extend %vw-hide; }
++
++/* Hide the `Enterprise Single Sign-On` button on the login page */
++a[href$="/sso"] { @extend %vw-hide; }
++
++/* Hide the info box that advertises Bitwarden Send */
++app-send-info.d-block { @extend %vw-hide; }
++
++/* Hide Two-Factor menu in Organization settings */
++app-org-settings a[href$="/settings/two-factor"] { @extend %vw-hide; }
++
++/* Hide organization plans */
++app-organization-plans > form > div.form-check { @extend %vw-hide; }
++app-organization-plans > form > h2.mt-5 { @extend %vw-hide; }
++
++/* Hide the `This account is owned by a business` checkbox and label */
++#ownedBusiness, label[for^=ownedBusiness] { @extend %vw-hide; }
++
++/* Hide External Id field for Collections */
++app-collection-add-edit form div.form-group:nth-child(2) { @extend %vw-hide; }
++
++/* Hide the radio button and label for the `Custom` org user type */
++#userTypeCustom, label[for^=userTypeCustom] { @extend %vw-hide; }
++
++/* Hide the warning that policy config is moving to Business Portal */
++app-org-policies > app-callout { @extend %vw-hide; }
++
++/* Hide Business Name and Identifier */
++app-org-account form div.form-group:nth-child(3) { display: none; }
++app-org-account form div.form-group:nth-child(4) { display: none; }
++
++/* Hide Tax Info and Form in Organization settings */
++app-org-account > div.secondary-header:nth-child(3) { @extend %vw-hide; }
++app-org-account > div.secondary-header:nth-child(3) + p { @extend %vw-hide; }
++app-org-account > div.secondary-header:nth-child(3) + p + form { @extend %vw-hide; }
++/**** END Vaultwarden CHANGES ****/
+diff --git a/src/services/webPlatformUtils.service.ts b/src/services/webPlatformUtils.service.ts
+index 755600a1..25f4561e 100644
+--- a/src/services/webPlatformUtils.service.ts
++++ b/src/services/webPlatformUtils.service.ts
+@@ -240,11 +240,11 @@ export class WebPlatformUtilsService implements PlatformUtilsService {
+   }
+ 
+   isDev(): boolean {
+-    return process.env.NODE_ENV === "development";
++    return false;
+   }
+ 
+   isSelfHost(): boolean {
+-    return process.env.ENV.toString() === "selfhosted";
++    return false;
+   }
+ 
+   copyToClipboard(text: string, options?: any): void | boolean {
diff --git a/srcpkgs/vaultwarden-web/template b/srcpkgs/vaultwarden-web/template
new file mode 100644
index 000000000000..c1b5d3d27d7a
--- /dev/null
+++ b/srcpkgs/vaultwarden-web/template
@@ -0,0 +1,36 @@
+# Template file for 'vaultwarden-web'
+pkgname=vaultwarden-web
+version=2022.5.2
+revision=1
+wrksrc="web-${version}"
+_jslib_commit=6f117b990192ddbe3b630effc77f4ef3c2bf248c
+hostmakedepends="git nodejs"
+short_desc="Web vault builds for vaultwarden"
+maintainer="Joel Beckmeyer <joel@beckmeyer.us>"
+license="GPL-3.0-or-later"
+# patches need to be pulled from 
+# https://github.com/dani-garcia/bw_web_builds/tree/master/patches into the
+# patches directory
+homepage="https://github.com/dani-garcia/bw_web_builds"
+distfiles="https://github.com/bitwarden/web/archive/v${version}.tar.gz
+ https://github.com/bitwarden/jslib/archive/${_jslib_commit}.tar.gz"
+checksum="20f90c5cec0710732aa785d7f3434c255cb26e8437beaffe35fb293d47b0313e
+ 973f9f59d171105ff74a82beae367f1fe7cc8c0c47bf7f93e5cc8dd7f63d9d7b"
+
+post_extract() {
+	rmdir jslib
+	mv ../jslib-* jslib
+}
+
+do_configure() {
+	npm ci --ignore-scripts
+}
+
+do_build() {
+	npm run dist:oss:selfhost
+}
+
+do_install() {
+	vmkdir usr/share/webapps/vaultwarden-web
+	vcopy build/* usr/share/webapps/vaultwarden-web
+}
diff --git a/srcpkgs/vaultwarden-web/update b/srcpkgs/vaultwarden-web/update
new file mode 100644
index 000000000000..7d10386dd670
--- /dev/null
+++ b/srcpkgs/vaultwarden-web/update
@@ -0,0 +1,2 @@
+pkgname=bw_web
+site="https://github.com/dani-garcia/bw_web_builds/releases"

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PR PATCH] [Updated] New packages: vaultwarden-web-2022.5.2, vaultwarden-1.25.0
  2022-05-23 17:23 [PR PATCH] New packages: vaultwarden-web-2.28.1, vaultwarden-1.25.0 TinfoilSubmarine
                   ` (14 preceding siblings ...)
  2022-06-28 13:49 ` TinfoilSubmarine
@ 2022-07-11 13:00 ` TinfoilSubmarine
  2022-07-19 15:53 ` [PR PATCH] [Updated] New packages: vaultwarden-web-2022.6.0, vaultwarden-1.25.0 TinfoilSubmarine
                   ` (7 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: TinfoilSubmarine @ 2022-07-11 13:00 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1279 bytes --]

There is an updated pull request by TinfoilSubmarine against master on the void-packages repository

https://github.com/TinfoilSubmarine/void-packages maint/vaultwarden
https://github.com/void-linux/void-packages/pull/37258

New packages: vaultwarden-web-2022.5.2, vaultwarden-1.25.0
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **YES**

#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/37258.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-maint/vaultwarden-37258.patch --]
[-- Type: text/x-diff, Size: 20852 bytes --]

From 79b41cec0b433db52082fe0bdc0a89a5b11a949e Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
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 <joel@beckmeyer.us>"
+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 <joel@beckmeyer.us>
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 @@
+         </a>
+       </p>
+       <p>
+-        You can <a href="/">return to the web vault</a>, check our
+-        <a href="https://status.bitwarden.com/">status page</a> or
+-        <a href="https://bitwarden.com/contact/">contact us</a>.
++        You can <a href="/">return to the web vault</a>, or
++        <a href="https://github.com/dani-garcia/vaultwarden">contact us</a>.
+       </p>
+     </div>
+-    <div class="container footer text-muted content">© Copyright 2022 Bitwarden, Inc.</div>
++    <div class="container footer text-muted content">© Copyright 2022 Bitwarden, Inc. (Powered by Vaultwarden)</div>
+   </body>
+ </html>
+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 @@
+ <div class="container footer text-muted">
+   <div class="row">
+-    <div class="col">&copy; {{ year }} Bitwarden Inc.</div>
++    <div class="col">&copy; {{ year }} Bitwarden Inc. (Powered by Vaultwarden)</div>
+     <div class="col text-center"></div>
+     <div class="col text-right">
+       {{ "versionNumber" | i18n: version }}
+diff --git a/apps/web/src/app/layouts/frontend-layout.component.html b/apps/web/src/app/layouts/frontend-layout.component.html
+index d737bc9f0..8db146fe9 100644
+--- a/apps/web/src/app/layouts/frontend-layout.component.html
++++ b/apps/web/src/app/layouts/frontend-layout.component.html
+@@ -1,5 +1,5 @@
+ <router-outlet></router-outlet>
+ <div class="container my-5 text-muted text-center">
+-  &copy; {{ year }} Bitwarden Inc. <br />
++  &copy; {{ year }} Bitwarden Inc. (Powered by Vaultwarden)<br />
+   {{ "versionNumber" | i18n: version }}
+ </div>
+diff --git a/apps/web/src/app/layouts/navbar.component.html b/apps/web/src/app/layouts/navbar.component.html
+index edc5d34d6..f6ae1a323 100644
+--- a/apps/web/src/app/layouts/navbar.component.html
++++ b/apps/web/src/app/layouts/navbar.component.html
+@@ -69,7 +69,7 @@
+               <i class="bwi bwi-fw bwi-user" aria-hidden="true"></i>
+               {{ "accountSettings" | i18n }}
+             </a>
+-            <a bitMenuItem href="https://bitwarden.com/help/" target="_blank" rel="noopener">
++            <a bitMenuItem href="https://github.com/dani-garcia/vaultwarden/" target="_blank" rel="noopener">
+               <i class="bwi bwi-fw bwi-question-circle" aria-hidden="true"></i>
+               {{ "getHelp" | i18n }}
+             </a>
+diff --git a/apps/web/src/app/modules/vault/modules/individual-vault/individual-vault.component.ts b/apps/web/src/app/modules/vault/modules/individual-vault/individual-vault.component.ts
+index 47a0f433c..5c4de87bf 100644
+--- a/apps/web/src/app/modules/vault/modules/individual-vault/individual-vault.component.ts
++++ b/apps/web/src/app/modules/vault/modules/individual-vault/individual-vault.component.ts
+@@ -94,11 +94,7 @@ export class IndividualVaultComponent implements OnInit, OnDestroy {
+   async ngOnInit() {
+     this.showVerifyEmail = !(await this.tokenService.getEmailVerified());
+     this.showBrowserOutdated = window.navigator.userAgent.indexOf("MSIE") !== -1;
+-    this.trashCleanupWarning = this.i18nService.t(
+-      this.platformUtilsService.isSelfHost()
+-        ? "trashCleanupWarningSelfHosted"
+-        : "trashCleanupWarning"
+-    );
++    this.trashCleanupWarning = this.i18nService.t("trashCleanupWarningSelfHosted");
+ 
+     this.route.queryParams.pipe(first()).subscribe(async (params) => {
+       await this.syncService.fullSync(false);
+diff --git a/apps/web/src/app/modules/vault/modules/organization-vault/organization-vault.component.ts b/apps/web/src/app/modules/vault/modules/organization-vault/organization-vault.component.ts
+index 451e9ca50..0ce25610e 100644
+--- a/apps/web/src/app/modules/vault/modules/organization-vault/organization-vault.component.ts
++++ b/apps/web/src/app/modules/vault/modules/organization-vault/organization-vault.component.ts
+@@ -81,11 +81,7 @@ export class OrganizationVaultComponent implements OnInit, OnDestroy {
+   ) {}
+ 
+   ngOnInit() {
+-    this.trashCleanupWarning = this.i18nService.t(
+-      this.platformUtilsService.isSelfHost()
+-        ? "trashCleanupWarningSelfHosted"
+-        : "trashCleanupWarning"
+-    );
++    this.trashCleanupWarning = this.i18nService.t("trashCleanupWarningSelfHosted");
+     this.route.parent.params.subscribe(async (params: any) => {
+       this.organization = await this.organizationService.get(params.organizationId);
+       this.vaultFilterComponent.organization = this.organization;
+diff --git a/apps/web/src/app/send/access.component.html b/apps/web/src/app/send/access.component.html
+index b58186102..bfcbc352b 100644
+--- a/apps/web/src/app/send/access.component.html
++++ b/apps/web/src/app/send/access.component.html
+@@ -137,15 +137,6 @@
+     <div class="col-12 text-center mt-5 text-muted">
+       <p class="mb-0">
+         {{ "sendAccessTaglineProductDesc" | i18n }}<br />
+-        {{ "sendAccessTaglineLearnMore" | i18n }}
+-        <a href="https://www.bitwarden.com/products/send?source=web-vault" target="_blank"
+-          >Bitwarden Send</a
+-        >
+-        {{ "sendAccessTaglineOr" | i18n }}
+-        <a href="https://vault.bitwarden.com/#/register" target="_blank">{{
+-          "sendAccessTaglineSignUp" | i18n
+-        }}</a>
+-        {{ "sendAccessTaglineTryToday" | i18n }}
+       </p>
+     </div>
+   </div>
+diff --git a/apps/web/src/app/services/init.service.ts b/apps/web/src/app/services/init.service.ts
+index eacfea977..c2f810338 100644
+--- a/apps/web/src/app/services/init.service.ts
++++ b/apps/web/src/app/services/init.service.ts
+@@ -36,11 +36,23 @@ export class InitService {
+   ) {}
+ 
+   init() {
++    function getBaseUrl() {
++        // If the base URL is `https://vaultwarden.example.com/base/path/`,
++        // `window.location.href` should have one of the following forms:
++        //
++        // - `https://vaultwarden.example.com/base/path/`
++        // - `https://vaultwarden.example.com/base/path/#/some/route[?queryParam=...]`
++        //
++        // We want to get to just `https://vaultwarden.example.com/base/path`.
++        let baseUrl = window.location.href;
++        baseUrl = baseUrl.replace(/#.*/, '');  // Strip off `#` and everything after.
++        baseUrl = baseUrl.replace(/\/+$/, ''); // Trim any trailing `/` chars.
++        return baseUrl;
++    }
+     return async () => {
+       await this.stateService.init();
+ 
+-      const urls = process.env.URLS as Urls;
+-      urls.base ??= this.win.location.origin;
++      const urls = {base: getBaseUrl()};
+       this.environmentService.setUrls(urls);
+ 
+       setTimeout(() => this.notificationsService.init(), 3000);
+diff --git a/apps/web/src/app/settings/settings.component.ts b/apps/web/src/app/settings/settings.component.ts
+index f0559b8dc..b728e3601 100644
+--- a/apps/web/src/app/settings/settings.component.ts
++++ b/apps/web/src/app/settings/settings.component.ts
+@@ -55,10 +55,6 @@ export class SettingsComponent implements OnInit, OnDestroy {
+     this.hasFamilySponsorshipAvailable = await this.organizationService.canManageSponsorships();
+     const hasPremiumFromOrg = await this.stateService.getHasPremiumFromOrganization();
+     let billing = null;
+-    if (!this.selfHosted) {
+-      billing = await this.apiService.getUserBillingHistory();
+-    }
+-    this.hideSubscription =
+-      !this.premium && hasPremiumFromOrg && (this.selfHosted || billing?.hasNoHistory);
++    this.hideSubscription = true;
+   }
+ }
+diff --git a/apps/web/src/app/settings/user-billing-history.component.ts b/apps/web/src/app/settings/user-billing-history.component.ts
+index ae26862d0..69ff16a07 100644
+--- a/apps/web/src/app/settings/user-billing-history.component.ts
++++ b/apps/web/src/app/settings/user-billing-history.component.ts
+@@ -39,7 +39,7 @@ export class UserBillingHistoryComponent implements OnInit {
+       return;
+     }
+     this.loading = true;
+-    this.billing = await this.apiService.getUserBillingHistory();
++    this.billing = null;
+     this.loading = false;
+   }
+ 
+diff --git a/apps/web/src/app/vault/add-edit.component.html b/apps/web/src/app/vault/add-edit.component.html
+index 37410ea59..8c9e1a6f4 100644
+--- a/apps/web/src/app/vault/add-edit.component.html
++++ b/apps/web/src/app/vault/add-edit.component.html
+@@ -182,7 +182,7 @@
+             <div class="col-6 form-group totp d-flex align-items-end" [ngClass]="{ low: totpLow }">
+               <div *ngIf="!cipher.login.totp || !totpCode">
+                 <img
+-                  src="../../images/totp-countdown.png"
++                  src="images/totp-countdown.png"
+                   id="totpImage"
+                   title="{{ 'verificationCodeTotp' | i18n }}"
+                   class="ml-2"
+diff --git a/apps/web/src/scss/styles.scss b/apps/web/src/scss/styles.scss
+index 9b5c9e906..fcef55848 100644
+--- a/apps/web/src/scss/styles.scss
++++ b/apps/web/src/scss/styles.scss
+@@ -61,3 +61,54 @@ $card-icons-base: "../../../../libs/angular/src/images/cards/";
+ @import "./tables";
+ @import "./toasts";
+ @import "./vault-filters";
++
++/**** START Vaultwarden CHANGES ****/
++/* This combines all selectors extending it into one */
++%vw-hide { display: none !important; }
++
++/* This allows searching for the combined style in the browsers dev-tools (look into the head tag) */
++#vw-hide, head { @extend %vw-hide; }
++
++/* Hide any link pointing to billing */
++a[href$="/settings/billing"] { @extend %vw-hide; }
++
++/* Hide any link pointing to subscriptions */
++a[href$="/settings/subscription"] { @extend %vw-hide; }
++
++/* Hide any link pointing to Sponsored Families */
++a[href$="/settings/sponsored-families"] { @extend %vw-hide; }
++
++/* Hide the `Enterprise Single Sign-On` button on the login page */
++a[href$="/sso"] { @extend %vw-hide; }
++
++/* Hide the info box that advertises Bitwarden Send */
++app-send-info.d-block { @extend %vw-hide; }
++
++/* Hide Two-Factor menu in Organization settings */
++app-org-settings a[href$="/settings/two-factor"] { @extend %vw-hide; }
++
++/* Hide organization plans */
++app-organization-plans > form > div.form-check { @extend %vw-hide; }
++app-organization-plans > form > h2.mt-5 { @extend %vw-hide; }
++
++/* Hide the `This account is owned by a business` checkbox and label */
++#ownedBusiness, label[for^=ownedBusiness] { @extend %vw-hide; }
++
++/* Hide External Id field for Collections */
++app-collection-add-edit form div.form-group:nth-child(2) { @extend %vw-hide; }
++
++/* Hide the radio button and label for the `Custom` org user type */
++#userTypeCustom, label[for^=userTypeCustom] { @extend %vw-hide; }
++
++/* Hide the warning that policy config is moving to Business Portal */
++app-org-policies > app-callout { @extend %vw-hide; }
++
++/* Hide Business Name and Identifier */
++app-org-account form div.form-group:nth-child(3) { display: none; }
++app-org-account form div.form-group:nth-child(4) { display: none; }
++
++/* Hide Tax Info and Form in Organization settings */
++app-org-account > div.secondary-header:nth-child(3) { @extend %vw-hide; }
++app-org-account > div.secondary-header:nth-child(3) + p { @extend %vw-hide; }
++app-org-account > div.secondary-header:nth-child(3) + p + form { @extend %vw-hide; }
++/**** END Vaultwarden CHANGES ****/
+diff --git a/apps/web/src/services/webPlatformUtils.service.ts b/apps/web/src/services/webPlatformUtils.service.ts
+index 755600a15..25f4561e1 100644
+--- a/apps/web/src/services/webPlatformUtils.service.ts
++++ b/apps/web/src/services/webPlatformUtils.service.ts
+@@ -240,11 +240,11 @@ export class WebPlatformUtilsService implements PlatformUtilsService {
+   }
+ 
+   isDev(): boolean {
+-    return process.env.NODE_ENV === "development";
++    return false;
+   }
+ 
+   isSelfHost(): boolean {
+-    return process.env.ENV.toString() === "selfhosted";
++    return false;
+   }
+ 
+   copyToClipboard(text: string, options?: any): void | boolean {
+diff --git a/libs/angular/src/components/register.component.ts b/libs/angular/src/components/register.component.ts
+index d4b99e17a..c16262007 100644
+--- a/libs/angular/src/components/register.component.ts
++++ b/libs/angular/src/components/register.component.ts
+@@ -28,7 +28,7 @@ export class RegisterComponent extends CaptchaProtectedComponent implements OnIn
+   formPromise: Promise<any>;
+   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/srcpkgs/vaultwarden-web/template b/srcpkgs/vaultwarden-web/template
new file mode 100644
index 000000000000..fb208765196a
--- /dev/null
+++ b/srcpkgs/vaultwarden-web/template
@@ -0,0 +1,36 @@
+# Template file for 'vaultwarden-web'
+pkgname=vaultwarden-web
+version=2022.6.0
+revision=1
+wrksrc="clients-web-v${version}"
+#_jslib_commit=6f117b990192ddbe3b630effc77f4ef3c2bf248c
+hostmakedepends="git nodejs"
+short_desc="Web vault builds for vaultwarden"
+maintainer="Joel Beckmeyer <joel@beckmeyer.us>"
+license="GPL-3.0-or-later"
+# patches need to be pulled from
+# https://github.com/dani-garcia/bw_web_builds/tree/master/patches into the
+# patches directory
+homepage="https://github.com/dani-garcia/bw_web_builds"
+distfiles="https://github.com/bitwarden/clients/archive/web-v${version}.tar.gz"
+checksum=edd31698e4ecb90b8a2b330b0eec3770237a2959f59171aa560e2316ffbad992
+
+#post_extract() {
+#	rmdir jslib
+#	mv ../jslib-* jslib
+#}
+
+do_configure() {
+	npm ci --ignore-scripts
+}
+
+do_build() {
+	cd apps/web
+	npm run dist:oss:selfhost
+}
+
+do_install() {
+	cd apps/web
+	vmkdir usr/share/webapps/vaultwarden-web
+	vcopy build/* usr/share/webapps/vaultwarden-web
+}
diff --git a/srcpkgs/vaultwarden-web/update b/srcpkgs/vaultwarden-web/update
new file mode 100644
index 000000000000..7d10386dd670
--- /dev/null
+++ b/srcpkgs/vaultwarden-web/update
@@ -0,0 +1,2 @@
+pkgname=bw_web
+site="https://github.com/dani-garcia/bw_web_builds/releases"

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PR PATCH] [Updated] New packages: vaultwarden-web-2022.6.0, vaultwarden-1.25.0
  2022-05-23 17:23 [PR PATCH] New packages: vaultwarden-web-2.28.1, vaultwarden-1.25.0 TinfoilSubmarine
                   ` (15 preceding siblings ...)
  2022-07-11 13:00 ` [PR PATCH] [Updated] New packages: vaultwarden-web-2022.5.2, vaultwarden-1.25.0 TinfoilSubmarine
@ 2022-07-19 15:53 ` TinfoilSubmarine
  2022-07-28 19:40 ` [PR PATCH] [Updated] New packages: vaultwarden-web-2022.6.2, vaultwarden-1.25.1 TinfoilSubmarine
                   ` (6 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: TinfoilSubmarine @ 2022-07-19 15:53 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1279 bytes --]

There is an updated pull request by TinfoilSubmarine against master on the void-packages repository

https://github.com/TinfoilSubmarine/void-packages maint/vaultwarden
https://github.com/void-linux/void-packages/pull/37258

New packages: vaultwarden-web-2022.6.0, vaultwarden-1.25.0
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **YES**

#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/37258.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-maint/vaultwarden-37258.patch --]
[-- Type: text/x-diff, Size: 20654 bytes --]

From ab5f1cd79691f65fd348fa67e940869623be7884 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
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 <joel@beckmeyer.us>"
+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 <joel@beckmeyer.us>
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 @@
+         </a>
+       </p>
+       <p>
+-        You can <a href="/">return to the web vault</a>, check our
+-        <a href="https://status.bitwarden.com/">status page</a> or
+-        <a href="https://bitwarden.com/contact/">contact us</a>.
++        You can <a href="/">return to the web vault</a>, or
++        <a href="https://github.com/dani-garcia/vaultwarden">contact us</a>.
+       </p>
+     </div>
+-    <div class="container footer text-muted content">© Copyright 2022 Bitwarden, Inc.</div>
++    <div class="container footer text-muted content">© Copyright 2022 Bitwarden, Inc. (Powered by Vaultwarden)</div>
+   </body>
+ </html>
+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 @@
+ <div class="container footer text-muted">
+   <div class="row">
+-    <div class="col">&copy; {{ year }} Bitwarden Inc.</div>
++    <div class="col">&copy; {{ year }} Bitwarden Inc. (Powered by Vaultwarden)</div>
+     <div class="col text-center"></div>
+     <div class="col text-right">
+       {{ "versionNumber" | i18n: version }}
+diff --git a/apps/web/src/app/layouts/frontend-layout.component.html b/apps/web/src/app/layouts/frontend-layout.component.html
+index d737bc9f0..8db146fe9 100644
+--- a/apps/web/src/app/layouts/frontend-layout.component.html
++++ b/apps/web/src/app/layouts/frontend-layout.component.html
+@@ -1,5 +1,5 @@
+ <router-outlet></router-outlet>
+ <div class="container my-5 text-muted text-center">
+-  &copy; {{ year }} Bitwarden Inc. <br />
++  &copy; {{ year }} Bitwarden Inc. (Powered by Vaultwarden)<br />
+   {{ "versionNumber" | i18n: version }}
+ </div>
+diff --git a/apps/web/src/app/layouts/navbar.component.html b/apps/web/src/app/layouts/navbar.component.html
+index edc5d34d6..f6ae1a323 100644
+--- a/apps/web/src/app/layouts/navbar.component.html
++++ b/apps/web/src/app/layouts/navbar.component.html
+@@ -69,7 +69,7 @@
+               <i class="bwi bwi-fw bwi-user" aria-hidden="true"></i>
+               {{ "accountSettings" | i18n }}
+             </a>
+-            <a bitMenuItem href="https://bitwarden.com/help/" target="_blank" rel="noopener">
++            <a bitMenuItem href="https://github.com/dani-garcia/vaultwarden/" target="_blank" rel="noopener">
+               <i class="bwi bwi-fw bwi-question-circle" aria-hidden="true"></i>
+               {{ "getHelp" | i18n }}
+             </a>
+diff --git a/apps/web/src/app/modules/vault/modules/individual-vault/individual-vault.component.ts b/apps/web/src/app/modules/vault/modules/individual-vault/individual-vault.component.ts
+index 47a0f433c..5c4de87bf 100644
+--- a/apps/web/src/app/modules/vault/modules/individual-vault/individual-vault.component.ts
++++ b/apps/web/src/app/modules/vault/modules/individual-vault/individual-vault.component.ts
+@@ -94,11 +94,7 @@ export class IndividualVaultComponent implements OnInit, OnDestroy {
+   async ngOnInit() {
+     this.showVerifyEmail = !(await this.tokenService.getEmailVerified());
+     this.showBrowserOutdated = window.navigator.userAgent.indexOf("MSIE") !== -1;
+-    this.trashCleanupWarning = this.i18nService.t(
+-      this.platformUtilsService.isSelfHost()
+-        ? "trashCleanupWarningSelfHosted"
+-        : "trashCleanupWarning"
+-    );
++    this.trashCleanupWarning = this.i18nService.t("trashCleanupWarningSelfHosted");
+ 
+     this.route.queryParams.pipe(first()).subscribe(async (params) => {
+       await this.syncService.fullSync(false);
+diff --git a/apps/web/src/app/modules/vault/modules/organization-vault/organization-vault.component.ts b/apps/web/src/app/modules/vault/modules/organization-vault/organization-vault.component.ts
+index 451e9ca50..0ce25610e 100644
+--- a/apps/web/src/app/modules/vault/modules/organization-vault/organization-vault.component.ts
++++ b/apps/web/src/app/modules/vault/modules/organization-vault/organization-vault.component.ts
+@@ -81,11 +81,7 @@ export class OrganizationVaultComponent implements OnInit, OnDestroy {
+   ) {}
+ 
+   ngOnInit() {
+-    this.trashCleanupWarning = this.i18nService.t(
+-      this.platformUtilsService.isSelfHost()
+-        ? "trashCleanupWarningSelfHosted"
+-        : "trashCleanupWarning"
+-    );
++    this.trashCleanupWarning = this.i18nService.t("trashCleanupWarningSelfHosted");
+     this.route.parent.params.subscribe(async (params: any) => {
+       this.organization = await this.organizationService.get(params.organizationId);
+       this.vaultFilterComponent.organization = this.organization;
+diff --git a/apps/web/src/app/send/access.component.html b/apps/web/src/app/send/access.component.html
+index b58186102..bfcbc352b 100644
+--- a/apps/web/src/app/send/access.component.html
++++ b/apps/web/src/app/send/access.component.html
+@@ -137,15 +137,6 @@
+     <div class="col-12 text-center mt-5 text-muted">
+       <p class="mb-0">
+         {{ "sendAccessTaglineProductDesc" | i18n }}<br />
+-        {{ "sendAccessTaglineLearnMore" | i18n }}
+-        <a href="https://www.bitwarden.com/products/send?source=web-vault" target="_blank"
+-          >Bitwarden Send</a
+-        >
+-        {{ "sendAccessTaglineOr" | i18n }}
+-        <a href="https://vault.bitwarden.com/#/register" target="_blank">{{
+-          "sendAccessTaglineSignUp" | i18n
+-        }}</a>
+-        {{ "sendAccessTaglineTryToday" | i18n }}
+       </p>
+     </div>
+   </div>
+diff --git a/apps/web/src/app/services/init.service.ts b/apps/web/src/app/services/init.service.ts
+index eacfea977..c2f810338 100644
+--- a/apps/web/src/app/services/init.service.ts
++++ b/apps/web/src/app/services/init.service.ts
+@@ -36,11 +36,23 @@ export class InitService {
+   ) {}
+ 
+   init() {
++    function getBaseUrl() {
++        // If the base URL is `https://vaultwarden.example.com/base/path/`,
++        // `window.location.href` should have one of the following forms:
++        //
++        // - `https://vaultwarden.example.com/base/path/`
++        // - `https://vaultwarden.example.com/base/path/#/some/route[?queryParam=...]`
++        //
++        // We want to get to just `https://vaultwarden.example.com/base/path`.
++        let baseUrl = window.location.href;
++        baseUrl = baseUrl.replace(/#.*/, '');  // Strip off `#` and everything after.
++        baseUrl = baseUrl.replace(/\/+$/, ''); // Trim any trailing `/` chars.
++        return baseUrl;
++    }
+     return async () => {
+       await this.stateService.init();
+ 
+-      const urls = process.env.URLS as Urls;
+-      urls.base ??= this.win.location.origin;
++      const urls = {base: getBaseUrl()};
+       this.environmentService.setUrls(urls);
+ 
+       setTimeout(() => this.notificationsService.init(), 3000);
+diff --git a/apps/web/src/app/settings/settings.component.ts b/apps/web/src/app/settings/settings.component.ts
+index f0559b8dc..b728e3601 100644
+--- a/apps/web/src/app/settings/settings.component.ts
++++ b/apps/web/src/app/settings/settings.component.ts
+@@ -55,10 +55,6 @@ export class SettingsComponent implements OnInit, OnDestroy {
+     this.hasFamilySponsorshipAvailable = await this.organizationService.canManageSponsorships();
+     const hasPremiumFromOrg = await this.stateService.getHasPremiumFromOrganization();
+     let billing = null;
+-    if (!this.selfHosted) {
+-      billing = await this.apiService.getUserBillingHistory();
+-    }
+-    this.hideSubscription =
+-      !this.premium && hasPremiumFromOrg && (this.selfHosted || billing?.hasNoHistory);
++    this.hideSubscription = true;
+   }
+ }
+diff --git a/apps/web/src/app/settings/user-billing-history.component.ts b/apps/web/src/app/settings/user-billing-history.component.ts
+index ae26862d0..69ff16a07 100644
+--- a/apps/web/src/app/settings/user-billing-history.component.ts
++++ b/apps/web/src/app/settings/user-billing-history.component.ts
+@@ -39,7 +39,7 @@ export class UserBillingHistoryComponent implements OnInit {
+       return;
+     }
+     this.loading = true;
+-    this.billing = await this.apiService.getUserBillingHistory();
++    this.billing = null;
+     this.loading = false;
+   }
+ 
+diff --git a/apps/web/src/app/vault/add-edit.component.html b/apps/web/src/app/vault/add-edit.component.html
+index 37410ea59..8c9e1a6f4 100644
+--- a/apps/web/src/app/vault/add-edit.component.html
++++ b/apps/web/src/app/vault/add-edit.component.html
+@@ -182,7 +182,7 @@
+             <div class="col-6 form-group totp d-flex align-items-end" [ngClass]="{ low: totpLow }">
+               <div *ngIf="!cipher.login.totp || !totpCode">
+                 <img
+-                  src="../../images/totp-countdown.png"
++                  src="images/totp-countdown.png"
+                   id="totpImage"
+                   title="{{ 'verificationCodeTotp' | i18n }}"
+                   class="ml-2"
+diff --git a/apps/web/src/scss/styles.scss b/apps/web/src/scss/styles.scss
+index 9b5c9e906..fcef55848 100644
+--- a/apps/web/src/scss/styles.scss
++++ b/apps/web/src/scss/styles.scss
+@@ -61,3 +61,54 @@ $card-icons-base: "../../../../libs/angular/src/images/cards/";
+ @import "./tables";
+ @import "./toasts";
+ @import "./vault-filters";
++
++/**** START Vaultwarden CHANGES ****/
++/* This combines all selectors extending it into one */
++%vw-hide { display: none !important; }
++
++/* This allows searching for the combined style in the browsers dev-tools (look into the head tag) */
++#vw-hide, head { @extend %vw-hide; }
++
++/* Hide any link pointing to billing */
++a[href$="/settings/billing"] { @extend %vw-hide; }
++
++/* Hide any link pointing to subscriptions */
++a[href$="/settings/subscription"] { @extend %vw-hide; }
++
++/* Hide any link pointing to Sponsored Families */
++a[href$="/settings/sponsored-families"] { @extend %vw-hide; }
++
++/* Hide the `Enterprise Single Sign-On` button on the login page */
++a[href$="/sso"] { @extend %vw-hide; }
++
++/* Hide the info box that advertises Bitwarden Send */
++app-send-info.d-block { @extend %vw-hide; }
++
++/* Hide Two-Factor menu in Organization settings */
++app-org-settings a[href$="/settings/two-factor"] { @extend %vw-hide; }
++
++/* Hide organization plans */
++app-organization-plans > form > div.form-check { @extend %vw-hide; }
++app-organization-plans > form > h2.mt-5 { @extend %vw-hide; }
++
++/* Hide the `This account is owned by a business` checkbox and label */
++#ownedBusiness, label[for^=ownedBusiness] { @extend %vw-hide; }
++
++/* Hide External Id field for Collections */
++app-collection-add-edit form div.form-group:nth-child(2) { @extend %vw-hide; }
++
++/* Hide the radio button and label for the `Custom` org user type */
++#userTypeCustom, label[for^=userTypeCustom] { @extend %vw-hide; }
++
++/* Hide the warning that policy config is moving to Business Portal */
++app-org-policies > app-callout { @extend %vw-hide; }
++
++/* Hide Business Name and Identifier */
++app-org-account form div.form-group:nth-child(3) { display: none; }
++app-org-account form div.form-group:nth-child(4) { display: none; }
++
++/* Hide Tax Info and Form in Organization settings */
++app-org-account > div.secondary-header:nth-child(3) { @extend %vw-hide; }
++app-org-account > div.secondary-header:nth-child(3) + p { @extend %vw-hide; }
++app-org-account > div.secondary-header:nth-child(3) + p + form { @extend %vw-hide; }
++/**** END Vaultwarden CHANGES ****/
+diff --git a/apps/web/src/services/webPlatformUtils.service.ts b/apps/web/src/services/webPlatformUtils.service.ts
+index 755600a15..25f4561e1 100644
+--- a/apps/web/src/services/webPlatformUtils.service.ts
++++ b/apps/web/src/services/webPlatformUtils.service.ts
+@@ -240,11 +240,11 @@ export class WebPlatformUtilsService implements PlatformUtilsService {
+   }
+ 
+   isDev(): boolean {
+-    return process.env.NODE_ENV === "development";
++    return false;
+   }
+ 
+   isSelfHost(): boolean {
+-    return process.env.ENV.toString() === "selfhosted";
++    return false;
+   }
+ 
+   copyToClipboard(text: string, options?: any): void | boolean {
+diff --git a/libs/angular/src/components/register.component.ts b/libs/angular/src/components/register.component.ts
+index d4b99e17a..c16262007 100644
+--- a/libs/angular/src/components/register.component.ts
++++ b/libs/angular/src/components/register.component.ts
+@@ -28,7 +28,7 @@ export class RegisterComponent extends CaptchaProtectedComponent implements OnIn
+   formPromise: Promise<any>;
+   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/srcpkgs/vaultwarden-web/template b/srcpkgs/vaultwarden-web/template
new file mode 100644
index 000000000000..d3012d8ec418
--- /dev/null
+++ b/srcpkgs/vaultwarden-web/template
@@ -0,0 +1,30 @@
+# Template file for 'vaultwarden-web'
+pkgname=vaultwarden-web
+version=2022.6.2
+revision=1
+wrksrc="clients-web-v${version}"
+hostmakedepends="git nodejs"
+short_desc="Web vault builds for vaultwarden"
+maintainer="Joel Beckmeyer <joel@beckmeyer.us>"
+license="GPL-3.0-or-later"
+# patches need to be pulled from
+# https://github.com/dani-garcia/bw_web_builds/tree/master/patches into the
+# patches directory
+homepage="https://github.com/dani-garcia/bw_web_builds"
+distfiles="https://github.com/bitwarden/clients/archive/web-v${version}.tar.gz"
+checksum=0b1e78787b1336abe4e4cb932927e1c6e7967dde566eee9586bedc7638636358
+
+do_configure() {
+	npm ci --ignore-scripts
+}
+
+do_build() {
+	cd apps/web
+	npm run dist:oss:selfhost
+}
+
+do_install() {
+	cd apps/web
+	vmkdir usr/share/webapps/vaultwarden-web
+	vcopy build/* usr/share/webapps/vaultwarden-web
+}
diff --git a/srcpkgs/vaultwarden-web/update b/srcpkgs/vaultwarden-web/update
new file mode 100644
index 000000000000..7d10386dd670
--- /dev/null
+++ b/srcpkgs/vaultwarden-web/update
@@ -0,0 +1,2 @@
+pkgname=bw_web
+site="https://github.com/dani-garcia/bw_web_builds/releases"

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PR PATCH] [Updated] New packages: vaultwarden-web-2022.6.2, vaultwarden-1.25.1
  2022-05-23 17:23 [PR PATCH] New packages: vaultwarden-web-2.28.1, vaultwarden-1.25.0 TinfoilSubmarine
                   ` (16 preceding siblings ...)
  2022-07-19 15:53 ` [PR PATCH] [Updated] New packages: vaultwarden-web-2022.6.0, vaultwarden-1.25.0 TinfoilSubmarine
@ 2022-07-28 19:40 ` TinfoilSubmarine
  2022-09-04 22:49 ` TinfoilSubmarine
                   ` (5 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: TinfoilSubmarine @ 2022-07-28 19:40 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1279 bytes --]

There is an updated pull request by TinfoilSubmarine against master on the void-packages repository

https://github.com/TinfoilSubmarine/void-packages maint/vaultwarden
https://github.com/void-linux/void-packages/pull/37258

New packages: vaultwarden-web-2022.6.2, vaultwarden-1.25.1
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **YES**

#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/37258.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-maint/vaultwarden-37258.patch --]
[-- Type: text/x-diff, Size: 20654 bytes --]

From 6fb8c77302499c50e2ab0493370701c405caeee4 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Sat, 26 Mar 2022 20:55:52 -0400
Subject: [PATCH 1/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 @@
+         </a>
+       </p>
+       <p>
+-        You can <a href="/">return to the web vault</a>, check our
+-        <a href="https://status.bitwarden.com/">status page</a> or
+-        <a href="https://bitwarden.com/contact/">contact us</a>.
++        You can <a href="/">return to the web vault</a>, or
++        <a href="https://github.com/dani-garcia/vaultwarden">contact us</a>.
+       </p>
+     </div>
+-    <div class="container footer text-muted content">© Copyright 2022 Bitwarden, Inc.</div>
++    <div class="container footer text-muted content">© Copyright 2022 Bitwarden, Inc. (Powered by Vaultwarden)</div>
+   </body>
+ </html>
+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 @@
+ <div class="container footer text-muted">
+   <div class="row">
+-    <div class="col">&copy; {{ year }} Bitwarden Inc.</div>
++    <div class="col">&copy; {{ year }} Bitwarden Inc. (Powered by Vaultwarden)</div>
+     <div class="col text-center"></div>
+     <div class="col text-right">
+       {{ "versionNumber" | i18n: version }}
+diff --git a/apps/web/src/app/layouts/frontend-layout.component.html b/apps/web/src/app/layouts/frontend-layout.component.html
+index d737bc9f0..8db146fe9 100644
+--- a/apps/web/src/app/layouts/frontend-layout.component.html
++++ b/apps/web/src/app/layouts/frontend-layout.component.html
+@@ -1,5 +1,5 @@
+ <router-outlet></router-outlet>
+ <div class="container my-5 text-muted text-center">
+-  &copy; {{ year }} Bitwarden Inc. <br />
++  &copy; {{ year }} Bitwarden Inc. (Powered by Vaultwarden)<br />
+   {{ "versionNumber" | i18n: version }}
+ </div>
+diff --git a/apps/web/src/app/layouts/navbar.component.html b/apps/web/src/app/layouts/navbar.component.html
+index edc5d34d6..f6ae1a323 100644
+--- a/apps/web/src/app/layouts/navbar.component.html
++++ b/apps/web/src/app/layouts/navbar.component.html
+@@ -69,7 +69,7 @@
+               <i class="bwi bwi-fw bwi-user" aria-hidden="true"></i>
+               {{ "accountSettings" | i18n }}
+             </a>
+-            <a bitMenuItem href="https://bitwarden.com/help/" target="_blank" rel="noopener">
++            <a bitMenuItem href="https://github.com/dani-garcia/vaultwarden/" target="_blank" rel="noopener">
+               <i class="bwi bwi-fw bwi-question-circle" aria-hidden="true"></i>
+               {{ "getHelp" | i18n }}
+             </a>
+diff --git a/apps/web/src/app/modules/vault/modules/individual-vault/individual-vault.component.ts b/apps/web/src/app/modules/vault/modules/individual-vault/individual-vault.component.ts
+index 47a0f433c..5c4de87bf 100644
+--- a/apps/web/src/app/modules/vault/modules/individual-vault/individual-vault.component.ts
++++ b/apps/web/src/app/modules/vault/modules/individual-vault/individual-vault.component.ts
+@@ -94,11 +94,7 @@ export class IndividualVaultComponent implements OnInit, OnDestroy {
+   async ngOnInit() {
+     this.showVerifyEmail = !(await this.tokenService.getEmailVerified());
+     this.showBrowserOutdated = window.navigator.userAgent.indexOf("MSIE") !== -1;
+-    this.trashCleanupWarning = this.i18nService.t(
+-      this.platformUtilsService.isSelfHost()
+-        ? "trashCleanupWarningSelfHosted"
+-        : "trashCleanupWarning"
+-    );
++    this.trashCleanupWarning = this.i18nService.t("trashCleanupWarningSelfHosted");
+ 
+     this.route.queryParams.pipe(first()).subscribe(async (params) => {
+       await this.syncService.fullSync(false);
+diff --git a/apps/web/src/app/modules/vault/modules/organization-vault/organization-vault.component.ts b/apps/web/src/app/modules/vault/modules/organization-vault/organization-vault.component.ts
+index 451e9ca50..0ce25610e 100644
+--- a/apps/web/src/app/modules/vault/modules/organization-vault/organization-vault.component.ts
++++ b/apps/web/src/app/modules/vault/modules/organization-vault/organization-vault.component.ts
+@@ -81,11 +81,7 @@ export class OrganizationVaultComponent implements OnInit, OnDestroy {
+   ) {}
+ 
+   ngOnInit() {
+-    this.trashCleanupWarning = this.i18nService.t(
+-      this.platformUtilsService.isSelfHost()
+-        ? "trashCleanupWarningSelfHosted"
+-        : "trashCleanupWarning"
+-    );
++    this.trashCleanupWarning = this.i18nService.t("trashCleanupWarningSelfHosted");
+     this.route.parent.params.subscribe(async (params: any) => {
+       this.organization = await this.organizationService.get(params.organizationId);
+       this.vaultFilterComponent.organization = this.organization;
+diff --git a/apps/web/src/app/send/access.component.html b/apps/web/src/app/send/access.component.html
+index b58186102..bfcbc352b 100644
+--- a/apps/web/src/app/send/access.component.html
++++ b/apps/web/src/app/send/access.component.html
+@@ -137,15 +137,6 @@
+     <div class="col-12 text-center mt-5 text-muted">
+       <p class="mb-0">
+         {{ "sendAccessTaglineProductDesc" | i18n }}<br />
+-        {{ "sendAccessTaglineLearnMore" | i18n }}
+-        <a href="https://www.bitwarden.com/products/send?source=web-vault" target="_blank"
+-          >Bitwarden Send</a
+-        >
+-        {{ "sendAccessTaglineOr" | i18n }}
+-        <a href="https://vault.bitwarden.com/#/register" target="_blank">{{
+-          "sendAccessTaglineSignUp" | i18n
+-        }}</a>
+-        {{ "sendAccessTaglineTryToday" | i18n }}
+       </p>
+     </div>
+   </div>
+diff --git a/apps/web/src/app/services/init.service.ts b/apps/web/src/app/services/init.service.ts
+index eacfea977..c2f810338 100644
+--- a/apps/web/src/app/services/init.service.ts
++++ b/apps/web/src/app/services/init.service.ts
+@@ -36,11 +36,23 @@ export class InitService {
+   ) {}
+ 
+   init() {
++    function getBaseUrl() {
++        // If the base URL is `https://vaultwarden.example.com/base/path/`,
++        // `window.location.href` should have one of the following forms:
++        //
++        // - `https://vaultwarden.example.com/base/path/`
++        // - `https://vaultwarden.example.com/base/path/#/some/route[?queryParam=...]`
++        //
++        // We want to get to just `https://vaultwarden.example.com/base/path`.
++        let baseUrl = window.location.href;
++        baseUrl = baseUrl.replace(/#.*/, '');  // Strip off `#` and everything after.
++        baseUrl = baseUrl.replace(/\/+$/, ''); // Trim any trailing `/` chars.
++        return baseUrl;
++    }
+     return async () => {
+       await this.stateService.init();
+ 
+-      const urls = process.env.URLS as Urls;
+-      urls.base ??= this.win.location.origin;
++      const urls = {base: getBaseUrl()};
+       this.environmentService.setUrls(urls);
+ 
+       setTimeout(() => this.notificationsService.init(), 3000);
+diff --git a/apps/web/src/app/settings/settings.component.ts b/apps/web/src/app/settings/settings.component.ts
+index f0559b8dc..b728e3601 100644
+--- a/apps/web/src/app/settings/settings.component.ts
++++ b/apps/web/src/app/settings/settings.component.ts
+@@ -55,10 +55,6 @@ export class SettingsComponent implements OnInit, OnDestroy {
+     this.hasFamilySponsorshipAvailable = await this.organizationService.canManageSponsorships();
+     const hasPremiumFromOrg = await this.stateService.getHasPremiumFromOrganization();
+     let billing = null;
+-    if (!this.selfHosted) {
+-      billing = await this.apiService.getUserBillingHistory();
+-    }
+-    this.hideSubscription =
+-      !this.premium && hasPremiumFromOrg && (this.selfHosted || billing?.hasNoHistory);
++    this.hideSubscription = true;
+   }
+ }
+diff --git a/apps/web/src/app/settings/user-billing-history.component.ts b/apps/web/src/app/settings/user-billing-history.component.ts
+index ae26862d0..69ff16a07 100644
+--- a/apps/web/src/app/settings/user-billing-history.component.ts
++++ b/apps/web/src/app/settings/user-billing-history.component.ts
+@@ -39,7 +39,7 @@ export class UserBillingHistoryComponent implements OnInit {
+       return;
+     }
+     this.loading = true;
+-    this.billing = await this.apiService.getUserBillingHistory();
++    this.billing = null;
+     this.loading = false;
+   }
+ 
+diff --git a/apps/web/src/app/vault/add-edit.component.html b/apps/web/src/app/vault/add-edit.component.html
+index 37410ea59..8c9e1a6f4 100644
+--- a/apps/web/src/app/vault/add-edit.component.html
++++ b/apps/web/src/app/vault/add-edit.component.html
+@@ -182,7 +182,7 @@
+             <div class="col-6 form-group totp d-flex align-items-end" [ngClass]="{ low: totpLow }">
+               <div *ngIf="!cipher.login.totp || !totpCode">
+                 <img
+-                  src="../../images/totp-countdown.png"
++                  src="images/totp-countdown.png"
+                   id="totpImage"
+                   title="{{ 'verificationCodeTotp' | i18n }}"
+                   class="ml-2"
+diff --git a/apps/web/src/scss/styles.scss b/apps/web/src/scss/styles.scss
+index 9b5c9e906..fcef55848 100644
+--- a/apps/web/src/scss/styles.scss
++++ b/apps/web/src/scss/styles.scss
+@@ -61,3 +61,54 @@ $card-icons-base: "../../../../libs/angular/src/images/cards/";
+ @import "./tables";
+ @import "./toasts";
+ @import "./vault-filters";
++
++/**** START Vaultwarden CHANGES ****/
++/* This combines all selectors extending it into one */
++%vw-hide { display: none !important; }
++
++/* This allows searching for the combined style in the browsers dev-tools (look into the head tag) */
++#vw-hide, head { @extend %vw-hide; }
++
++/* Hide any link pointing to billing */
++a[href$="/settings/billing"] { @extend %vw-hide; }
++
++/* Hide any link pointing to subscriptions */
++a[href$="/settings/subscription"] { @extend %vw-hide; }
++
++/* Hide any link pointing to Sponsored Families */
++a[href$="/settings/sponsored-families"] { @extend %vw-hide; }
++
++/* Hide the `Enterprise Single Sign-On` button on the login page */
++a[href$="/sso"] { @extend %vw-hide; }
++
++/* Hide the info box that advertises Bitwarden Send */
++app-send-info.d-block { @extend %vw-hide; }
++
++/* Hide Two-Factor menu in Organization settings */
++app-org-settings a[href$="/settings/two-factor"] { @extend %vw-hide; }
++
++/* Hide organization plans */
++app-organization-plans > form > div.form-check { @extend %vw-hide; }
++app-organization-plans > form > h2.mt-5 { @extend %vw-hide; }
++
++/* Hide the `This account is owned by a business` checkbox and label */
++#ownedBusiness, label[for^=ownedBusiness] { @extend %vw-hide; }
++
++/* Hide External Id field for Collections */
++app-collection-add-edit form div.form-group:nth-child(2) { @extend %vw-hide; }
++
++/* Hide the radio button and label for the `Custom` org user type */
++#userTypeCustom, label[for^=userTypeCustom] { @extend %vw-hide; }
++
++/* Hide the warning that policy config is moving to Business Portal */
++app-org-policies > app-callout { @extend %vw-hide; }
++
++/* Hide Business Name and Identifier */
++app-org-account form div.form-group:nth-child(3) { display: none; }
++app-org-account form div.form-group:nth-child(4) { display: none; }
++
++/* Hide Tax Info and Form in Organization settings */
++app-org-account > div.secondary-header:nth-child(3) { @extend %vw-hide; }
++app-org-account > div.secondary-header:nth-child(3) + p { @extend %vw-hide; }
++app-org-account > div.secondary-header:nth-child(3) + p + form { @extend %vw-hide; }
++/**** END Vaultwarden CHANGES ****/
+diff --git a/apps/web/src/services/webPlatformUtils.service.ts b/apps/web/src/services/webPlatformUtils.service.ts
+index 755600a15..25f4561e1 100644
+--- a/apps/web/src/services/webPlatformUtils.service.ts
++++ b/apps/web/src/services/webPlatformUtils.service.ts
+@@ -240,11 +240,11 @@ export class WebPlatformUtilsService implements PlatformUtilsService {
+   }
+ 
+   isDev(): boolean {
+-    return process.env.NODE_ENV === "development";
++    return false;
+   }
+ 
+   isSelfHost(): boolean {
+-    return process.env.ENV.toString() === "selfhosted";
++    return false;
+   }
+ 
+   copyToClipboard(text: string, options?: any): void | boolean {
+diff --git a/libs/angular/src/components/register.component.ts b/libs/angular/src/components/register.component.ts
+index d4b99e17a..c16262007 100644
+--- a/libs/angular/src/components/register.component.ts
++++ b/libs/angular/src/components/register.component.ts
+@@ -28,7 +28,7 @@ export class RegisterComponent extends CaptchaProtectedComponent implements OnIn
+   formPromise: Promise<any>;
+   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/srcpkgs/vaultwarden-web/template b/srcpkgs/vaultwarden-web/template
new file mode 100644
index 000000000000..d3012d8ec418
--- /dev/null
+++ b/srcpkgs/vaultwarden-web/template
@@ -0,0 +1,30 @@
+# Template file for 'vaultwarden-web'
+pkgname=vaultwarden-web
+version=2022.6.2
+revision=1
+wrksrc="clients-web-v${version}"
+hostmakedepends="git nodejs"
+short_desc="Web vault builds for vaultwarden"
+maintainer="Joel Beckmeyer <joel@beckmeyer.us>"
+license="GPL-3.0-or-later"
+# patches need to be pulled from
+# https://github.com/dani-garcia/bw_web_builds/tree/master/patches into the
+# patches directory
+homepage="https://github.com/dani-garcia/bw_web_builds"
+distfiles="https://github.com/bitwarden/clients/archive/web-v${version}.tar.gz"
+checksum=0b1e78787b1336abe4e4cb932927e1c6e7967dde566eee9586bedc7638636358
+
+do_configure() {
+	npm ci --ignore-scripts
+}
+
+do_build() {
+	cd apps/web
+	npm run dist:oss:selfhost
+}
+
+do_install() {
+	cd apps/web
+	vmkdir usr/share/webapps/vaultwarden-web
+	vcopy build/* usr/share/webapps/vaultwarden-web
+}
diff --git a/srcpkgs/vaultwarden-web/update b/srcpkgs/vaultwarden-web/update
new file mode 100644
index 000000000000..7d10386dd670
--- /dev/null
+++ b/srcpkgs/vaultwarden-web/update
@@ -0,0 +1,2 @@
+pkgname=bw_web
+site="https://github.com/dani-garcia/bw_web_builds/releases"

From 3d5f6277e045663f07ecc6d79e2d053e5b8ea78d Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Thu, 17 Feb 2022 13:25:21 -0500
Subject: [PATCH 2/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 <joel@beckmeyer.us>"
+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
+}

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PR PATCH] [Updated] New packages: vaultwarden-web-2022.6.2, vaultwarden-1.25.1
  2022-05-23 17:23 [PR PATCH] New packages: vaultwarden-web-2.28.1, vaultwarden-1.25.0 TinfoilSubmarine
                   ` (17 preceding siblings ...)
  2022-07-28 19:40 ` [PR PATCH] [Updated] New packages: vaultwarden-web-2022.6.2, vaultwarden-1.25.1 TinfoilSubmarine
@ 2022-09-04 22:49 ` TinfoilSubmarine
  2022-09-06  5:27 ` New packages: vaultwarden-web-2022.8.1, vaultwarden-1.25.1 classabbyamp
                   ` (4 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: TinfoilSubmarine @ 2022-09-04 22:49 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1279 bytes --]

There is an updated pull request by TinfoilSubmarine against master on the void-packages repository

https://github.com/TinfoilSubmarine/void-packages maint/vaultwarden
https://github.com/void-linux/void-packages/pull/37258

New packages: vaultwarden-web-2022.6.2, vaultwarden-1.25.1
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **YES**

#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/37258.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-maint/vaultwarden-37258.patch --]
[-- Type: text/x-diff, Size: 20797 bytes --]

From 96c629edd745ca5ba8a6868f242b136ce0e650ac Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
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 <joel@beckmeyer.us>"
+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 <joel@beckmeyer.us>
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 @@
+         </a>
+       </p>
+       <p>
+-        You can <a href="/">return to the web vault</a>, check our
+-        <a href="https://status.bitwarden.com/">status page</a> or
+-        <a href="https://bitwarden.com/contact/">contact us</a>.
++        You can <a href="/">return to the web vault</a>, or
++        <a href="https://github.com/dani-garcia/vaultwarden">contact us</a>.
+       </p>
+     </div>
+-    <div class="container footer text-muted content">© Copyright 2022 Bitwarden, Inc.</div>
++    <div class="container footer text-muted content">© Copyright 2022 Bitwarden, Inc. (Powered by Vaultwarden)</div>
+   </body>
+ </html>
+diff --git a/apps/web/src/app/app.component.ts b/apps/web/src/app/app.component.ts
+index fc9f44dcf..bcfa17b85 100644
+--- a/apps/web/src/app/app.component.ts
++++ b/apps/web/src/app/app.component.ts
+@@ -171,6 +171,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 @@
+ <div class="container footer text-muted">
+   <div class="row">
+-    <div class="col">&copy; {{ year }} Bitwarden Inc.</div>
++    <div class="col">&copy; {{ year }} Bitwarden Inc. (Powered by Vaultwarden)</div>
+     <div class="col text-center"></div>
+     <div class="col text-right">
+       {{ "versionNumber" | i18n: version }}
+diff --git a/apps/web/src/app/layouts/frontend-layout.component.html b/apps/web/src/app/layouts/frontend-layout.component.html
+index d737bc9f0..8db146fe9 100644
+--- a/apps/web/src/app/layouts/frontend-layout.component.html
++++ b/apps/web/src/app/layouts/frontend-layout.component.html
+@@ -1,5 +1,5 @@
+ <router-outlet></router-outlet>
+ <div class="container my-5 text-muted text-center">
+-  &copy; {{ year }} Bitwarden Inc. <br />
++  &copy; {{ year }} Bitwarden Inc. (Powered by Vaultwarden)<br />
+   {{ "versionNumber" | i18n: version }}
+ </div>
+diff --git a/apps/web/src/app/layouts/navbar.component.html b/apps/web/src/app/layouts/navbar.component.html
+index edc5d34d6..f6ae1a323 100644
+--- a/apps/web/src/app/layouts/navbar.component.html
++++ b/apps/web/src/app/layouts/navbar.component.html
+@@ -69,7 +69,7 @@
+               <i class="bwi bwi-fw bwi-user" aria-hidden="true"></i>
+               {{ "accountSettings" | i18n }}
+             </a>
+-            <a bitMenuItem href="https://bitwarden.com/help/" target="_blank" rel="noopener">
++            <a bitMenuItem href="https://github.com/dani-garcia/vaultwarden/" target="_blank" rel="noopener">
+               <i class="bwi bwi-fw bwi-question-circle" aria-hidden="true"></i>
+               {{ "getHelp" | i18n }}
+             </a>
+diff --git a/apps/web/src/app/modules/vault/modules/individual-vault/individual-vault.component.ts b/apps/web/src/app/modules/vault/modules/individual-vault/individual-vault.component.ts
+index 567e390c0..9bb81a760 100644
+--- a/apps/web/src/app/modules/vault/modules/individual-vault/individual-vault.component.ts
++++ b/apps/web/src/app/modules/vault/modules/individual-vault/individual-vault.component.ts
+@@ -90,11 +90,7 @@ export class IndividualVaultComponent implements OnInit, OnDestroy {
+   async ngOnInit() {
+     this.showVerifyEmail = !(await this.tokenService.getEmailVerified());
+     this.showBrowserOutdated = window.navigator.userAgent.indexOf("MSIE") !== -1;
+-    this.trashCleanupWarning = this.i18nService.t(
+-      this.platformUtilsService.isSelfHost()
+-        ? "trashCleanupWarningSelfHosted"
+-        : "trashCleanupWarning"
+-    );
++    this.trashCleanupWarning = this.i18nService.t("trashCleanupWarningSelfHosted");
+ 
+     this.route.queryParams.pipe(first()).subscribe(async (params) => {
+       await this.syncService.fullSync(false);
+diff --git a/apps/web/src/app/modules/vault/modules/organization-vault/organization-vault.component.ts b/apps/web/src/app/modules/vault/modules/organization-vault/organization-vault.component.ts
+index 1aee9a0a0..654bb3288 100644
+--- a/apps/web/src/app/modules/vault/modules/organization-vault/organization-vault.component.ts
++++ b/apps/web/src/app/modules/vault/modules/organization-vault/organization-vault.component.ts
+@@ -80,11 +80,7 @@ export class OrganizationVaultComponent implements OnInit, OnDestroy {
+   ) {}
+ 
+   ngOnInit() {
+-    this.trashCleanupWarning = this.i18nService.t(
+-      this.platformUtilsService.isSelfHost()
+-        ? "trashCleanupWarningSelfHosted"
+-        : "trashCleanupWarning"
+-    );
++    this.trashCleanupWarning = this.i18nService.t("trashCleanupWarningSelfHosted");
+     this.route.parent.params.subscribe(async (params: any) => {
+       this.organization = await this.organizationService.get(params.organizationId);
+       this.vaultFilterComponent.organization = this.organization;
+diff --git a/apps/web/src/app/send/access.component.html b/apps/web/src/app/send/access.component.html
+index b58186102..bfcbc352b 100644
+--- a/apps/web/src/app/send/access.component.html
++++ b/apps/web/src/app/send/access.component.html
+@@ -137,15 +137,6 @@
+     <div class="col-12 text-center mt-5 text-muted">
+       <p class="mb-0">
+         {{ "sendAccessTaglineProductDesc" | i18n }}<br />
+-        {{ "sendAccessTaglineLearnMore" | i18n }}
+-        <a href="https://www.bitwarden.com/products/send?source=web-vault" target="_blank"
+-          >Bitwarden Send</a
+-        >
+-        {{ "sendAccessTaglineOr" | i18n }}
+-        <a href="https://vault.bitwarden.com/#/register" target="_blank">{{
+-          "sendAccessTaglineSignUp" | i18n
+-        }}</a>
+-        {{ "sendAccessTaglineTryToday" | i18n }}
+       </p>
+     </div>
+   </div>
+diff --git a/apps/web/src/app/services/init.service.ts b/apps/web/src/app/services/init.service.ts
+index 047a28da1..e0cdde25f 100644
+--- a/apps/web/src/app/services/init.service.ts
++++ b/apps/web/src/app/services/init.service.ts
+@@ -35,11 +35,23 @@ export class InitService {
+   ) {}
+ 
+   init() {
++    function getBaseUrl() {
++        // If the base URL is `https://vaultwarden.example.com/base/path/`,
++        // `window.location.href` should have one of the following forms:
++        //
++        // - `https://vaultwarden.example.com/base/path/`
++        // - `https://vaultwarden.example.com/base/path/#/some/route[?queryParam=...]`
++        //
++        // We want to get to just `https://vaultwarden.example.com/base/path`.
++        let baseUrl = window.location.href;
++        baseUrl = baseUrl.replace(/#.*/, '');  // Strip off `#` and everything after.
++        baseUrl = baseUrl.replace(/\/+$/, ''); // Trim any trailing `/` chars.
++        return baseUrl;
++    }
+     return async () => {
+       await this.stateService.init();
+ 
+-      const urls = process.env.URLS as Urls;
+-      urls.base ??= this.win.location.origin;
++      const urls = {base: getBaseUrl()};
+       this.environmentService.setUrls(urls);
+ 
+       setTimeout(() => this.notificationsService.init(), 3000);
+diff --git a/apps/web/src/app/settings/settings.component.ts b/apps/web/src/app/settings/settings.component.ts
+index 0fae6a7dc..a9d89ca90 100644
+--- a/apps/web/src/app/settings/settings.component.ts
++++ b/apps/web/src/app/settings/settings.component.ts
+@@ -55,10 +55,6 @@ export class SettingsComponent implements OnInit, OnDestroy {
+     this.hasFamilySponsorshipAvailable = await this.organizationService.canManageSponsorships();
+     const hasPremiumFromOrg = await this.stateService.getHasPremiumFromOrganization();
+     let billing = null;
+-    if (!this.selfHosted) {
+-      billing = await this.apiService.getUserBillingHistory();
+-    }
+-    this.hideSubscription =
+-      !this.premium && hasPremiumFromOrg && (this.selfHosted || billing?.hasNoHistory);
++    this.hideSubscription = true;
+   }
+ }
+diff --git a/apps/web/src/app/settings/user-billing-history.component.ts b/apps/web/src/app/settings/user-billing-history.component.ts
+index dfc3216d2..f4693577b 100644
+--- a/apps/web/src/app/settings/user-billing-history.component.ts
++++ b/apps/web/src/app/settings/user-billing-history.component.ts
+@@ -39,7 +39,7 @@ export class UserBillingHistoryComponent implements OnInit {
+       return;
+     }
+     this.loading = true;
+-    this.billing = await this.apiService.getUserBillingHistory();
++    this.billing = null;
+     this.loading = false;
+   }
+ 
+diff --git a/apps/web/src/app/vault/add-edit.component.html b/apps/web/src/app/vault/add-edit.component.html
+index 54b707c9f..0c17406fe 100644
+--- a/apps/web/src/app/vault/add-edit.component.html
++++ b/apps/web/src/app/vault/add-edit.component.html
+@@ -182,7 +182,7 @@
+             <div class="col-6 form-group totp d-flex align-items-end" [ngClass]="{ low: totpLow }">
+               <div *ngIf="!cipher.login.totp || !totpCode">
+                 <img
+-                  src="../../images/totp-countdown.png"
++                  src="images/totp-countdown.png"
+                   id="totpImage"
+                   title="{{ 'verificationCodeTotp' | i18n }}"
+                   class="ml-2"
+diff --git a/apps/web/src/scss/styles.scss b/apps/web/src/scss/styles.scss
+index dc1c740b4..f1400831e 100644
+--- a/apps/web/src/scss/styles.scss
++++ b/apps/web/src/scss/styles.scss
+@@ -57,3 +57,57 @@
+ @import "./tables";
+ @import "./toasts";
+ @import "./vault-filters";
++
++/**** START Vaultwarden CHANGES ****/
++/* This combines all selectors extending it into one */
++%vw-hide { display: none !important; }
++
++/* This allows searching for the combined style in the browsers dev-tools (look into the head tag) */
++#vw-hide,head { @extend %vw-hide; }
++
++/* Hide any link pointing to billing */
++a[href$="/settings/billing"] { @extend %vw-hide; }
++
++/* Hide any link pointing to subscriptions */
++a[href$="/settings/subscription"] { @extend %vw-hide; }
++
++/* Hide any link pointing to Sponsored Families */
++a[href$="/settings/sponsored-families"] { @extend %vw-hide; }
++
++/* Hide the `Enterprise Single Sign-On` button on the login page */
++a[href$="/sso"] { @extend %vw-hide; }
++
++/* Hide the info box that advertises Bitwarden Send */
++app-send-info.d-block { @extend %vw-hide; }
++
++/* Hide Two-Factor menu in Organization settings */
++app-org-settings a[href$="/settings/two-factor"] { @extend %vw-hide; }
++
++/* Hide Business Owned checkbox */
++app-org-info > form:nth-child(1) > div:nth-child(3) { @extend %vw-hide; }
++
++/* Hide organization plans */
++app-organization-plans > form > div.form-check { @extend %vw-hide; }
++app-organization-plans > form > h2.mt-5 { @extend %vw-hide; }
++
++/* Hide the `This account is owned by a business` checkbox and label */
++#ownedBusiness, label[for^=ownedBusiness] { @extend %vw-hide; }
++
++/* Hide External Id field for Collections */
++app-collection-add-edit form div.form-group:nth-child(2) { @extend %vw-hide; }
++
++/* Hide the radio button and label for the `Custom` org user type */
++#userTypeCustom, label[for^=userTypeCustom] { @extend %vw-hide; }
++
++/* Hide the warning that policy config is moving to Business Portal */
++app-org-policies > app-callout { @extend %vw-hide; }
++
++/* Hide Business Name and Identifier */
++app-org-account form div.form-group:nth-child(3) { @extend %vw-hide; }
++app-org-account form div.form-group:nth-child(4) { @extend %vw-hide; }
++
++/* Hide Tax Info and Form in Organization settings */
++app-org-account > div.secondary-header:nth-child(3) { @extend %vw-hide; }
++app-org-account > div.secondary-header:nth-child(3) + p { @extend %vw-hide; }
++app-org-account > div.secondary-header:nth-child(3) + p + form { @extend %vw-hide; }
++/**** END Vaultwarden CHANGES ****/
+diff --git a/apps/web/src/services/webPlatformUtils.service.ts b/apps/web/src/services/webPlatformUtils.service.ts
+index 115d53401..e62638e35 100644
+--- a/apps/web/src/services/webPlatformUtils.service.ts
++++ b/apps/web/src/services/webPlatformUtils.service.ts
+@@ -188,11 +188,11 @@ export class WebPlatformUtilsService implements PlatformUtilsService {
+   }
+ 
+   isDev(): boolean {
+-    return process.env.NODE_ENV === "development";
++    return false;
+   }
+ 
+   isSelfHost(): boolean {
+-    return process.env.ENV.toString() === "selfhosted";
++    return false;
+   }
+ 
+   copyToClipboard(text: string, options?: any): void | boolean {
+diff --git a/libs/angular/src/components/register.component.ts b/libs/angular/src/components/register.component.ts
+index 967cb0e44..0c135beb5 100644
+--- a/libs/angular/src/components/register.component.ts
++++ b/libs/angular/src/components/register.component.ts
+@@ -32,7 +32,7 @@ export class RegisterComponent extends CaptchaProtectedComponent implements OnIn
+   formPromise: Promise<any>;
+   masterPasswordScore: number;
+   referenceData: ReferenceEventRequest;
+-  showTerms = true;
++  showTerms = false;
+   showErrorSummary = false;
+ 
+   formGroup = this.formBuilder.group(
+@@ -79,7 +79,7 @@ export class RegisterComponent extends CaptchaProtectedComponent implements OnIn
+     protected logService: LogService
+   ) {
+     super(environmentService, i18nService, platformUtilsService);
+-    this.showTerms = !platformUtilsService.isSelfHost();
++    this.showTerms = false;
+   }
+ 
+   async ngOnInit() {
+@@ -117,6 +117,15 @@ export class RegisterComponent extends CaptchaProtectedComponent implements OnIn
+   }
+ 
+   async submit(showToast = true) {
++    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;
++    }
++
+     let email = this.formGroup.get("email")?.value;
+     let name = this.formGroup.get("name")?.value;
+     const masterPassword = this.formGroup.get("masterPassword")?.value;
diff --git a/srcpkgs/vaultwarden-web/template b/srcpkgs/vaultwarden-web/template
new file mode 100644
index 000000000000..47f3f41d62dd
--- /dev/null
+++ b/srcpkgs/vaultwarden-web/template
@@ -0,0 +1,30 @@
+# Template file for 'vaultwarden-web'
+pkgname=vaultwarden-web
+version=2022.8.1
+revision=1
+wrksrc="clients-web-v${version}"
+hostmakedepends="git nodejs"
+short_desc="Web vault builds for vaultwarden"
+maintainer="Joel Beckmeyer <joel@beckmeyer.us>"
+license="GPL-3.0-or-later"
+# patches need to be pulled from
+# https://github.com/dani-garcia/bw_web_builds/tree/master/patches into the
+# patches directory
+homepage="https://github.com/dani-garcia/bw_web_builds"
+distfiles="https://github.com/bitwarden/clients/archive/web-v${version}.tar.gz"
+checksum=9dff38f13d8be047fe0fd6426bda3c409bb222b787bd6b21a3559f5d29255a92
+
+do_configure() {
+	npm ci --ignore-scripts
+}
+
+do_build() {
+	cd apps/web
+	npm run dist:oss:selfhost
+}
+
+do_install() {
+	cd apps/web
+	vmkdir usr/share/webapps/vaultwarden-web
+	vcopy build/* usr/share/webapps/vaultwarden-web
+}
diff --git a/srcpkgs/vaultwarden-web/update b/srcpkgs/vaultwarden-web/update
new file mode 100644
index 000000000000..7d10386dd670
--- /dev/null
+++ b/srcpkgs/vaultwarden-web/update
@@ -0,0 +1,2 @@
+pkgname=bw_web
+site="https://github.com/dani-garcia/bw_web_builds/releases"

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: New packages: vaultwarden-web-2022.8.1, vaultwarden-1.25.1
  2022-05-23 17:23 [PR PATCH] New packages: vaultwarden-web-2.28.1, vaultwarden-1.25.0 TinfoilSubmarine
                   ` (18 preceding siblings ...)
  2022-09-04 22:49 ` TinfoilSubmarine
@ 2022-09-06  5:27 ` classabbyamp
  2022-09-06  5:27 ` classabbyamp
                   ` (3 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: classabbyamp @ 2022-09-06  5:27 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1785 bytes --]

New comment by classabbyamp on void-packages repository

https://github.com/void-linux/void-packages/pull/37258#issuecomment-1237674008

Comment:
I know I said the opposite before, but thinking about it again, i think pulling the patch from upstream is best

this worked for me:
```patch
diff --git a/srcpkgs/vaultwarden-web/template b/srcpkgs/vaultwarden-web/template
index 47f3f41d62..557c3e1952 100644
--- a/srcpkgs/vaultwarden-web/template
+++ b/srcpkgs/vaultwarden-web/template
@@ -2,17 +2,26 @@
 pkgname=vaultwarden-web
 version=2022.8.1
 revision=1
-wrksrc="clients-web-v${version}"
+_patch_ver=2022.8.0
+create_wrksrc=yes
+build_wrksrc="clients-web-v${version}"
 hostmakedepends="git nodejs"
 short_desc="Web vault builds for vaultwarden"
 maintainer="Joel Beckmeyer <joel@beckmeyer.us>"
 license="GPL-3.0-or-later"
-# patches need to be pulled from
-# https://github.com/dani-garcia/bw_web_builds/tree/master/patches into the
-# patches directory
 homepage="https://github.com/dani-garcia/bw_web_builds"
-distfiles="https://github.com/bitwarden/clients/archive/web-v${version}.tar.gz"
-checksum=9dff38f13d8be047fe0fd6426bda3c409bb222b787bd6b21a3559f5d29255a92
+distfiles="https://github.com/bitwarden/clients/archive/web-v${version}.tar.gz
+ https://raw.githubusercontent.com/dani-garcia/bw_web_builds/master/patches/v${_patch_ver}.patch"
+checksum="9dff38f13d8be047fe0fd6426bda3c409bb222b787bd6b21a3559f5d29255a92
+ 1199bcf5edb0cad2e0fc1e839b5bdc690565d6af5b32cc1c38348f0b13c69ee9"
+
+post_extract() {
+       mv v$_patch_ver.patch ${build_wrksrc}
+}
+
+post_patch() {
+       patch -Np1 -i v$_patch_ver.patch
+}
 
 do_configure() {
        npm ci --ignore-scripts
```
I'm going to do some testing with it and we can get this merged

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: New packages: vaultwarden-web-2022.8.1, vaultwarden-1.25.1
  2022-05-23 17:23 [PR PATCH] New packages: vaultwarden-web-2.28.1, vaultwarden-1.25.0 TinfoilSubmarine
                   ` (19 preceding siblings ...)
  2022-09-06  5:27 ` New packages: vaultwarden-web-2022.8.1, vaultwarden-1.25.1 classabbyamp
@ 2022-09-06  5:27 ` classabbyamp
  2022-09-06  5:32 ` [PR REVIEW] " classabbyamp
                   ` (2 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: classabbyamp @ 2022-09-06  5:27 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1788 bytes --]

New comment by classabbyamp on void-packages repository

https://github.com/void-linux/void-packages/pull/37258#issuecomment-1237674008

Comment:
I know I said the opposite before, but thinking about it again, i think pulling the patch from upstream is best

this worked for me:
```patch
diff --git a/srcpkgs/vaultwarden-web/template b/srcpkgs/vaultwarden-web/template
index 47f3f41d62..557c3e1952 100644
--- a/srcpkgs/vaultwarden-web/template
+++ b/srcpkgs/vaultwarden-web/template
@@ -2,17 +2,26 @@
 pkgname=vaultwarden-web
 version=2022.8.1
 revision=1
-wrksrc="clients-web-v${version}"
+_patch_ver=2022.8.0
+create_wrksrc=yes
+build_wrksrc="clients-web-v${version}"
 hostmakedepends="git nodejs"
 short_desc="Web vault builds for vaultwarden"
 maintainer="Joel Beckmeyer <joel@beckmeyer.us>"
 license="GPL-3.0-or-later"
-# patches need to be pulled from
-# https://github.com/dani-garcia/bw_web_builds/tree/master/patches into the
-# patches directory
 homepage="https://github.com/dani-garcia/bw_web_builds"
-distfiles="https://github.com/bitwarden/clients/archive/web-v${version}.tar.gz"
-checksum=9dff38f13d8be047fe0fd6426bda3c409bb222b787bd6b21a3559f5d29255a92
+distfiles="https://github.com/bitwarden/clients/archive/web-v${version}.tar.gz
+ https://raw.githubusercontent.com/dani-garcia/bw_web_builds/master/patches/v${_patch_ver}.patch"
+checksum="9dff38f13d8be047fe0fd6426bda3c409bb222b787bd6b21a3559f5d29255a92
+ 1199bcf5edb0cad2e0fc1e839b5bdc690565d6af5b32cc1c38348f0b13c69ee9"
+
+post_extract() {
+       mv v$_patch_ver.patch ${build_wrksrc}
+}
+
+post_patch() {
+       patch -Np1 -i v$_patch_ver.patch
+}
 
 do_configure() {
        npm ci --ignore-scripts
```
I'm going to do some testing with it and we can get this merged :)

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PR REVIEW] New packages: vaultwarden-web-2022.8.1, vaultwarden-1.25.1
  2022-05-23 17:23 [PR PATCH] New packages: vaultwarden-web-2.28.1, vaultwarden-1.25.0 TinfoilSubmarine
                   ` (20 preceding siblings ...)
  2022-09-06  5:27 ` classabbyamp
@ 2022-09-06  5:32 ` classabbyamp
  2022-09-06 13:37 ` [PR PATCH] [Updated] " TinfoilSubmarine
  2022-09-06 16:49 ` [PR PATCH] [Merged]: " classabbyamp
  23 siblings, 0 replies; 25+ messages in thread
From: classabbyamp @ 2022-09-06  5:32 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 213 bytes --]

New review comment by classabbyamp on void-packages repository

https://github.com/void-linux/void-packages/pull/37258#discussion_r963267940

Comment:
can you add a comment with reasoning at the top of the patch?

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PR PATCH] [Updated] New packages: vaultwarden-web-2022.8.1, vaultwarden-1.25.1
  2022-05-23 17:23 [PR PATCH] New packages: vaultwarden-web-2.28.1, vaultwarden-1.25.0 TinfoilSubmarine
                   ` (21 preceding siblings ...)
  2022-09-06  5:32 ` [PR REVIEW] " classabbyamp
@ 2022-09-06 13:37 ` TinfoilSubmarine
  2022-09-06 16:49 ` [PR PATCH] [Merged]: " classabbyamp
  23 siblings, 0 replies; 25+ messages in thread
From: TinfoilSubmarine @ 2022-09-06 13:37 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1279 bytes --]

There is an updated pull request by TinfoilSubmarine against master on the void-packages repository

https://github.com/TinfoilSubmarine/void-packages maint/vaultwarden
https://github.com/void-linux/void-packages/pull/37258

New packages: vaultwarden-web-2022.8.1, vaultwarden-1.25.1
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **YES**

#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/37258.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-maint/vaultwarden-37258.patch --]
[-- Type: text/x-diff, Size: 5606 bytes --]

From dca30e4aecfb6b66f3c7aa8820c72db66df9caae Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
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      | 35 +++++++++++++++++++
 srcpkgs/vaultwarden/template                  | 25 +++++++++++++
 4 files changed, 67 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..36114bee2474
--- /dev/null
+++ b/srcpkgs/vaultwarden/patches/config.patch
@@ -0,0 +1,35 @@
+configure several paths to sane/expected locations
+
+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
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 <joel@beckmeyer.us>"
+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 ad81b8e1836a33d4d1050a8ad05209a51a24f6fc Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Sat, 26 Mar 2022 20:55:52 -0400
Subject: [PATCH 2/2] New package: vaultwarden-web-2022.8.1

---
 srcpkgs/vaultwarden-web/template | 39 ++++++++++++++++++++++++++++++++
 srcpkgs/vaultwarden-web/update   |  2 ++
 2 files changed, 41 insertions(+)
 create mode 100644 srcpkgs/vaultwarden-web/template
 create mode 100644 srcpkgs/vaultwarden-web/update

diff --git a/srcpkgs/vaultwarden-web/template b/srcpkgs/vaultwarden-web/template
new file mode 100644
index 000000000000..557c3e195256
--- /dev/null
+++ b/srcpkgs/vaultwarden-web/template
@@ -0,0 +1,39 @@
+# Template file for 'vaultwarden-web'
+pkgname=vaultwarden-web
+version=2022.8.1
+revision=1
+_patch_ver=2022.8.0
+create_wrksrc=yes
+build_wrksrc="clients-web-v${version}"
+hostmakedepends="git nodejs"
+short_desc="Web vault builds for vaultwarden"
+maintainer="Joel Beckmeyer <joel@beckmeyer.us>"
+license="GPL-3.0-or-later"
+homepage="https://github.com/dani-garcia/bw_web_builds"
+distfiles="https://github.com/bitwarden/clients/archive/web-v${version}.tar.gz
+ https://raw.githubusercontent.com/dani-garcia/bw_web_builds/master/patches/v${_patch_ver}.patch"
+checksum="9dff38f13d8be047fe0fd6426bda3c409bb222b787bd6b21a3559f5d29255a92
+ 1199bcf5edb0cad2e0fc1e839b5bdc690565d6af5b32cc1c38348f0b13c69ee9"
+
+post_extract() {
+	mv v$_patch_ver.patch ${build_wrksrc}
+}
+
+post_patch() {
+	patch -Np1 -i v$_patch_ver.patch
+}
+
+do_configure() {
+	npm ci --ignore-scripts
+}
+
+do_build() {
+	cd apps/web
+	npm run dist:oss:selfhost
+}
+
+do_install() {
+	cd apps/web
+	vmkdir usr/share/webapps/vaultwarden-web
+	vcopy build/* usr/share/webapps/vaultwarden-web
+}
diff --git a/srcpkgs/vaultwarden-web/update b/srcpkgs/vaultwarden-web/update
new file mode 100644
index 000000000000..7d10386dd670
--- /dev/null
+++ b/srcpkgs/vaultwarden-web/update
@@ -0,0 +1,2 @@
+pkgname=bw_web
+site="https://github.com/dani-garcia/bw_web_builds/releases"

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PR PATCH] [Merged]: New packages: vaultwarden-web-2022.8.1, vaultwarden-1.25.1
  2022-05-23 17:23 [PR PATCH] New packages: vaultwarden-web-2.28.1, vaultwarden-1.25.0 TinfoilSubmarine
                   ` (22 preceding siblings ...)
  2022-09-06 13:37 ` [PR PATCH] [Updated] " TinfoilSubmarine
@ 2022-09-06 16:49 ` classabbyamp
  23 siblings, 0 replies; 25+ messages in thread
From: classabbyamp @ 2022-09-06 16:49 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1095 bytes --]

There's a merged pull request on the void-packages repository

New packages: vaultwarden-web-2022.8.1, vaultwarden-1.25.1
https://github.com/void-linux/void-packages/pull/37258

Description:
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **YES**

#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


^ permalink raw reply	[flat|nested] 25+ messages in thread

end of thread, other threads:[~2022-09-06 16:49 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-23 17:23 [PR PATCH] New packages: vaultwarden-web-2.28.1, vaultwarden-1.25.0 TinfoilSubmarine
2022-05-23 17:28 ` [PR PATCH] [Updated] " TinfoilSubmarine
2022-05-23 18:07 ` [PR REVIEW] " classabbyamp
2022-05-23 18:07 ` classabbyamp
2022-05-23 18:07 ` classabbyamp
2022-05-23 19:02 ` TinfoilSubmarine
2022-05-23 19:22 ` classabbyamp
2022-05-23 19:23 ` classabbyamp
2022-05-23 20:30 ` [PR PATCH] [Updated] " TinfoilSubmarine
2022-05-23 20:32 ` TinfoilSubmarine
2022-05-24 11:58 ` TinfoilSubmarine
2022-06-06 13:10 ` TinfoilSubmarine
2022-06-07 18:13 ` [PR PATCH] [Updated] New packages: vaultwarden-web-2022.05.0, vaultwarden-1.25.0 TinfoilSubmarine
2022-06-08 12:23 ` TinfoilSubmarine
2022-06-28 13:48 ` [PR PATCH] [Updated] " TinfoilSubmarine
2022-06-28 13:49 ` TinfoilSubmarine
2022-07-11 13:00 ` [PR PATCH] [Updated] New packages: vaultwarden-web-2022.5.2, vaultwarden-1.25.0 TinfoilSubmarine
2022-07-19 15:53 ` [PR PATCH] [Updated] New packages: vaultwarden-web-2022.6.0, vaultwarden-1.25.0 TinfoilSubmarine
2022-07-28 19:40 ` [PR PATCH] [Updated] New packages: vaultwarden-web-2022.6.2, vaultwarden-1.25.1 TinfoilSubmarine
2022-09-04 22:49 ` TinfoilSubmarine
2022-09-06  5:27 ` New packages: vaultwarden-web-2022.8.1, vaultwarden-1.25.1 classabbyamp
2022-09-06  5:27 ` classabbyamp
2022-09-06  5:32 ` [PR REVIEW] " classabbyamp
2022-09-06 13:37 ` [PR PATCH] [Updated] " TinfoilSubmarine
2022-09-06 16:49 ` [PR PATCH] [Merged]: " classabbyamp

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).