From 014c2a2929683cee4fbd06d310d2ecff99372982 Mon Sep 17 00:00:00 2001 From: "Helmut K. C. Tessarek" Date: Tue, 8 Nov 2022 11:54:04 -0500 Subject: [PATCH] use a separate patch file --- patches/v2022.10.0.patch | 26 --- patches/v2022.10.2a.patch | 330 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 330 insertions(+), 26 deletions(-) create mode 100644 patches/v2022.10.2a.patch diff --git a/patches/v2022.10.0.patch b/patches/v2022.10.0.patch index 9058fe6..0c0c8be 100644 --- a/patches/v2022.10.0.patch +++ b/patches/v2022.10.0.patch @@ -116,32 +116,6 @@ index ee428cb5e..4294ebd16 100644 {{ "getHelp" | i18n }} -diff --git a/apps/web/src/app/organizations/create/organization-information.component.html b/apps/web/src/app/organizations/create/organization-information.component.html -index 6029cfd83..04324b7d1 100644 ---- a/apps/web/src/app/organizations/create/organization-information.component.html -+++ b/apps/web/src/app/organizations/create/organization-information.component.html -@@ -12,7 +12,7 @@ - - - -- {{ "billingEmail" | i18n }} -+ {{ "email" | i18n }} - - - -diff --git a/apps/web/src/app/organizations/settings/account.component.html b/apps/web/src/app/organizations/settings/account.component.html -index 1f2e145ae..dbc4b593d 100644 ---- a/apps/web/src/app/organizations/settings/account.component.html -+++ b/apps/web/src/app/organizations/settings/account.component.html -@@ -30,7 +30,7 @@ - /> - -
-- -+ - +

+

+- You can return to the web vault, check our +- status page or +- contact us. ++ You can return to the web vault, or ++ contact us. +

+
+- ++ + + +diff --git a/apps/web/src/app/app.component.ts b/apps/web/src/app/app.component.ts +index b1700a855..9f4145f26 100644 +--- a/apps/web/src/app/app.component.ts ++++ b/apps/web/src/app/app.component.ts +@@ -170,6 +170,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/core/init.service.ts b/apps/web/src/app/core/init.service.ts +index 0f61efb67..da38c03f4 100644 +--- a/apps/web/src/app/core/init.service.ts ++++ b/apps/web/src/app/core/init.service.ts +@@ -37,11 +37,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/core/web-platform-utils.service.ts b/apps/web/src/app/core/web-platform-utils.service.ts +index 115d53401..e62638e35 100644 +--- a/apps/web/src/app/core/web-platform-utils.service.ts ++++ b/apps/web/src/app/core/web-platform-utils.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/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 @@ +