From aabcc2737f7be43f1b2ea086fd02a2252d2c4f4d Mon Sep 17 00:00:00 2001 From: BlackDex Date: Wed, 29 Jun 2022 15:49:38 +0200 Subject: [PATCH] Update web-vault to v2022.6.0 Updated the web-vault to the latest released version. This version is also using the new repo `bitwarden/clients` instead of the old `bitwarden/web`. All files have been changed where needed. --- Dockerfile | 17 +- patches/v2022.6.0.patch | 311 +++++++++++++++++++++++++++++++++ scripts/.script_env | 2 +- scripts/build_web_vault.sh | 6 +- scripts/checkout_web_vault.sh | 3 +- scripts/generate_patch_file.sh | 2 +- scripts/tar_web_vault.sh | 11 +- 7 files changed, 335 insertions(+), 17 deletions(-) create mode 100644 patches/v2022.6.0.patch diff --git a/Dockerfile b/Dockerfile index 4959bd6..2f68de4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -23,14 +23,13 @@ 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/v2022.5.2 -ARG VAULT_VERSION=b7cee309ba120aa4aa454be1c7690dbdfc38491f +# Using https://github.com/bitwarden/web/releases/tag/v2022.6.0 +ARG VAULT_VERSION=bb5f9311a776b94a33bcf0a7bff44cd87a2fcc92 -RUN git clone https://github.com/bitwarden/web.git /vault +RUN git clone https://github.com/bitwarden/clients.git /vault WORKDIR /vault -RUN git -c advice.detachedHead=false checkout "${VAULT_VERSION}" && \ - git submodule update --recursive --init --force +RUN git -c advice.detachedHead=false checkout "${VAULT_VERSION}" COPY --chown=node:node patches /patches COPY --chown=node:node scripts/apply_patches.sh /apply_patches.sh @@ -40,6 +39,10 @@ RUN bash /apply_patches.sh # Build RUN npm ci RUN npm audit fix || true + +# Switch to the web apps folder +WORKDIR /vault/apps/web + RUN npm run dist:oss:selfhost RUN printf '{"version":"%s"}' \ @@ -57,7 +60,7 @@ RUN tar -czvf "bw_web_vault.tar.gz" web-vault --owner=0 --group=0 # The result is included both uncompressed and as a tar.gz, to be able to use it in the docker images and the github releases directly FROM scratch # hadolint ignore=DL3010 -COPY --from=build /vault/bw_web_vault.tar.gz /bw_web_vault.tar.gz -COPY --from=build /vault/web-vault /web-vault +COPY --from=build /vault/apps/web/bw_web_vault.tar.gz /bw_web_vault.tar.gz +COPY --from=build /vault/apps/web/web-vault /web-vault # Added so docker create works, can't actually run a scratch image CMD [""] diff --git a/patches/v2022.6.0.patch b/patches/v2022.6.0.patch new file mode 100644 index 0000000..1466ec8 --- /dev/null +++ b/patches/v2022.6.0.patch @@ -0,0 +1,311 @@ +diff --git a/apps/web/src/404.html b/apps/web/src/404.html +index 6cf5e363d..54d11495c 100644 +--- a/apps/web/src/404.html ++++ b/apps/web/src/404.html +@@ -42,11 +42,10 @@ + +

+

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

+ +- ++ + + +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 @@ +