From 4f2bcf3c24b0dc83ee525acce1103e387ef43ffd Mon Sep 17 00:00:00 2001
From: BlackDex
Date: Sat, 18 Jun 2022 16:05:48 +0200
Subject: [PATCH] Updated web-vault to v2022.5.2
---
Dockerfile | 4 +-
patches/v2022.5.2.patch | 312 ++++++++++++++++++++++++++++++++++++++++
2 files changed, 314 insertions(+), 2 deletions(-)
create mode 100644 patches/v2022.5.2.patch
diff --git a/Dockerfile b/Dockerfile
index 07fdbec..4959bd6 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -23,8 +23,8 @@ USER node
# Can be a tag, release, but prefer a commit hash because it's not changeable
# https://github.com/bitwarden/web/commit/${VAULT_VERSION}
#
-# Using https://github.com/bitwarden/web/releases/tag/2022.05.0
-ARG VAULT_VERSION=ec80782d8f2ec593adf4f2d874fc8b97783c9d33
+# Using https://github.com/bitwarden/web/releases/tag/v2022.5.2
+ARG VAULT_VERSION=b7cee309ba120aa4aa454be1c7690dbdfc38491f
RUN git clone https://github.com/bitwarden/web.git /vault
WORKDIR /vault
diff --git a/patches/v2022.5.2.patch b/patches/v2022.5.2.patch
new file mode 100644
index 0000000..11f9591
--- /dev/null
+++ b/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;
+ masterPasswordScore: number;
+ referenceData: ReferenceEventRequest;
+- showTerms = true;
++ showTerms = false;
+ acceptPolicies = false;
+
+ protected successRoute = "login";
+@@ -47,7 +47,7 @@ export class RegisterComponent extends CaptchaProtectedComponent implements OnIn
+ protected logService: LogService
+ ) {
+ super(environmentService, i18nService, platformUtilsService);
+- this.showTerms = !platformUtilsService.isSelfHost();
++ this.showTerms = false;
+ }
+
+ async ngOnInit() {
+@@ -85,6 +85,15 @@ export class RegisterComponent extends CaptchaProtectedComponent implements OnIn
+ }
+
+ async submit() {
++ if (typeof crypto.subtle === 'undefined') {
++ this.platformUtilsService.showToast(
++ "error",
++ "This browser requires HTTPS to use the web vault",
++ "Check the Vaultwarden wiki for details on how to enable it"
++ );
++ return;
++ }
++
+ if (!this.acceptPolicies && this.showTerms) {
+ this.platformUtilsService.showToast(
+ "error",
+diff --git a/src/404.html b/src/404.html
+index 6cf5e363..54d11495 100644
+--- a/src/404.html
++++ b/src/404.html
+@@ -42,11 +42,10 @@
+
+
+
+- You can return to the web vault, check our
+- status page or
+- contact us.
++ You can return to the web vault, or
++ contact us.
+
+
+-
++
+