1
0
mirror of https://github.com/bitwarden/web synced 2025-12-06 00:03:28 +00:00

Compare commits

..

2 Commits

Author SHA1 Message Date
Joseph Flinn
f244f4ffde More work on the decoupling. It is not currently in a working state 2022-01-28 22:41:45 +00:00
Joseph Flinn
9d393224da switching to an nginx image instead of a bitwarden/server one 2022-01-28 12:01:47 -08:00
69 changed files with 564 additions and 852 deletions

View File

@@ -1,3 +1,4 @@
*
!docker/*
!build/*
!entrypoint.sh

View File

@@ -1,4 +1,4 @@
FROM bitwarden/server:dev
FROM nginx:stable
LABEL com.bitwarden.product="bitwarden"
@@ -8,13 +8,29 @@ RUN apt-get update \
curl \
&& rm -rf /var/lib/apt/lists/*
ENV ASPNETCORE_URLS http://+:5000
COPY docker/nginx.conf /etc/nginx
COPY docker/nginx-web.conf /etc/nginx
COPY docker/mime.types /etc/nginx
COPY docker/security-headers.conf /etc/nginx
WORKDIR /app
EXPOSE 5000
COPY ./build .
COPY entrypoint.sh /
COPY docker/entrypoint.sh /
RUN chmod +x /entrypoint.sh
HEALTHCHECK CMD curl -f http://localhost:5000 || exit 1
RUN bash /entrypoint.sh
RUN chown -R bitwarden:bitwarden /app && chmod -R 755 /app && \
chown -R bitwarden:bitwarden /var/cache/nginx && \
chown -R bitwarden:bitwarden /var/log/nginx && \
chown -R bitwarden:bitwarden /etc/nginx/conf.d
RUN touch /var/run/nginx.pid && \
chown -R bitwarden:bitwarden /var/run/nginx.pid
ENTRYPOINT ["/entrypoint.sh"]
USER bitwarden
EXPOSE 8080
HEALTHCHECK CMD curl -f http://localhost:8080 || exit 1
#ENTRYPOINT ["/entrypoint.sh"]
#CMD ["tail", "-f", "/dev/null"]
CMD nginx -g 'daemon off;'

View File

@@ -71,7 +71,7 @@
target="_blank"
rel="noopener"
appA11yTitle="{{ 'learnMore' | i18n }}"
href="https://bitwarden.com/help/about-key-connector/"
href="https://bitwarden.com/help/article/about-key-connector/"
>
<i class="bwi bwi-question-circle" aria-hidden="true"></i>
</a>
@@ -443,8 +443,7 @@
<option *ngFor="let o of samlSigningAlgorithms" [ngValue]="o">{{ o }}</option>
</select>
</div>
<div class="form-group" [hidden]="true">
<!--TODO: Unhide once Unsolicited IdP Response is supported-->
<div class="form-group">
<div class="form-check">
<input
class="form-check-input"

View File

@@ -52,7 +52,7 @@
target="_blank"
rel="noopener"
appA11yTitle="{{ 'learnMore' | i18n }}"
href="https://bitwarden.com/help/provider-users/"
href="https://bitwarden.com/help/article/user-types-access-control/#user-types"
>
<i class="bwi bwi-question-circle" aria-hidden="true"></i>
</a>

View File

@@ -1,46 +0,0 @@
@import "../common/styles.scss";
.justify-content-md-center {
justify-content: center !important;
}
.row {
display: flex;
flex-wrap: wrap;
margin-right: -10px;
margin-left: -10px;
}
.mt-5,
.my-5 {
margin-top: 3rem !important;
}
.mb-2,
.my-2 {
margin-bottom: 0.5rem !important;
}
.ml-4,
.mx-4 {
margin-left: 1.5rem !important;
}
.mb-4,
.my-4 {
margin-bottom: 1.5rem !important;
}
.mr-4,
.mx-4 {
margin-right: 1.5rem !important;
}
.lead {
font-size: 1.25rem;
font-weight: normal;
}
.text-center {
text-align: center !important;
}

View File

@@ -1,22 +0,0 @@
@import "~bootstrap/scss/_functions";
@import "~bootstrap/scss/_variables";
@import "~bootstrap/scss/_mixins";
@import "~bootstrap/scss/_root";
@import "~bootstrap/scss/_reboot";
html {
font-size: 14px;
}
html.theme_light body.layout_frontend {
background-color: #ecf0f5;
color: #333;
}
img.logo {
display: block;
height: 43px;
margin: 0 auto;
margin-bottom: 0px;
width: 284px;
}

View File

@@ -1,47 +0,0 @@
<!DOCTYPE html>
<html class="theme_light">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=1010" />
<meta name="theme-color" content="#175DDC" />
<title>Bitwarden</title>
<link
rel="apple-touch-icon"
sizes="180x180"
href="../../src/images/icons/apple-touch-icon.png"
/>
<link
rel="icon"
type="image/png"
sizes="32x32"
href="../../src/images/icons/favicon-32x32.png"
/>
<link
rel="icon"
type="image/png"
sizes="16x16"
href="../../src/images/icons/favicon-16x16.png"
/>
<link rel="mask-icon" href="../../src/images/icons/safari-pinned-tab.svg" color="#175DDC" />
<link rel="manifest" href="../../src/manifest.json" />
</head>
<body class="layout_frontend">
<div class="mt-5 d-flex justify-content-center">
<div>
<img src="../../src/images/logo-dark@2x.png" class="mb-4 logo" alt="Bitwarden" />
<div id="content">
<p class="text-center">
<i
class="bwi bwi-spinner bwi-spin bwi-2x text-muted"
title="Loading"
aria-hidden="true"
></i>
</p>
</div>
</div>
</div>
</body>
</html>

View File

@@ -1,82 +0,0 @@
@import "../common/styles.scss";
.mt-5,
.my-5 {
margin-top: 3rem !important;
}
.d-flex {
display: -ms-flexbox !important;
display: flex !important;
}
.justify-content-center {
-ms-flex-pack: center !important;
justify-content: center !important;
}
.mb-4,
.my-4 {
margin-bottom: 1.5rem !important;
}
.text-center {
text-align: center !important;
}
$icomoon-font-family: "bwi-font" !default;
$icomoon-font-path: "~@bitwarden/jslib-angular/src/scss/bwicons/fonts/" !default;
@font-face {
font-family: "#{$icomoon-font-family}";
src: url($icomoon-font-path + "bwi-font.svg") format("svg"),
url($icomoon-font-path + "bwi-font.ttf") format("truetype"),
url($icomoon-font-path + "bwi-font.woff") format("woff"),
url($icomoon-font-path + "bwi-font.woff2") format("woff2");
font-weight: normal;
font-style: normal;
font-display: block;
}
// Base Class
.bwi {
/* use !important to prevent issues with browser extensions that change fonts */
font-family: "#{$icomoon-font-family}" !important;
speak: never;
font-style: normal;
font-weight: normal;
font-variant: normal;
text-transform: none;
line-height: 1;
display: inline-block;
/* Better Font Rendering */
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.bwi-2x {
font-size: 2em;
}
// Spin Animations
.bwi-spin {
animation: bwi-spin 2s infinite linear;
}
@keyframes bwi-spin {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(359deg);
}
}
// Rotation
.bwi-rotate-270 {
transform: rotate(270deg);
}
.bwi-spinner:before {
content: "\e937";
}

View File

@@ -1,197 +0,0 @@
@import "../common/styles.scss";
body {
min-width: 0px !important;
}
.mb-3,
.my-3 {
margin-bottom: 1rem !important;
}
.rounded {
border-radius: 0.25rem !important;
}
.img-fluid {
max-width: 100%;
height: auto;
}
.text-center {
text-align: center !important;
}
.btn {
display: inline-block;
font-weight: 600;
color: #333;
text-align: center;
vertical-align: middle;
user-select: none;
background-color: transparent;
border: 1px solid transparent;
border-top-color: transparent;
border-right-color: transparent;
border-bottom-color: transparent;
border-left-color: transparent;
padding: 0.375rem 0.75rem;
font-size: 1rem;
line-height: 1.5;
border-radius: 0.25rem;
transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out,
border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}
.btn-primary {
color: #fff;
background-color: #175ddc;
border-color: #175ddc;
}
.btn:not(:disabled):not(.disabled) {
cursor: pointer;
}
.btn:hover,
.swal2-popup .swal2-actions button:hover {
color: #333;
text-decoration: none;
}
.btn-primary:hover {
color: #fff;
background-color: #134eb9;
border-color: #1249ae;
}
/** Mobile **/
.mt-5,
.my-5 {
margin-top: 3rem !important;
}
.justify-content-center,
.justify-content-md-center {
justify-content: center !important;
}
.row {
display: flex;
flex-wrap: wrap;
margin-right: -10px;
margin-left: -10px;
}
.mb-2,
.my-2 {
margin-bottom: 0.5rem !important;
}
.ml-4,
.mx-4 {
margin-left: 1.5rem !important;
}
.mb-4,
.my-4 {
margin-bottom: 1.5rem !important;
}
.mr-4,
.mx-4 {
margin-right: 1.5rem !important;
}
.lead {
font-size: 1.25rem;
font-weight: normal;
}
/** Fallback **/
.container {
margin: 0 auto;
max-width: 980px;
}
.col-5 {
position: relative;
width: 100%;
padding-right: 10px;
padding-left: 10px;
flex: 0 0 41.6666666667%;
max-width: 41.6666666667%;
}
.card {
position: relative;
display: flex;
flex-direction: column;
min-width: 0;
word-wrap: break-word;
background-color: #fff;
background-clip: border-box;
border: 1px solid rgba(0, 0, 0, 0.125);
border-radius: 0.25rem;
}
.d-block {
display: block !important;
}
.card-body {
flex: 1 1 auto;
min-height: 1px;
padding: 1.25rem;
}
.alert {
position: relative;
padding: 0.75rem 1.25rem;
margin-bottom: 1rem;
border: 1px solid transparent;
border-top-color: transparent;
border-right-color: transparent;
border-bottom-color: transparent;
border-left-color: transparent;
border-radius: 0.25rem;
}
.alert-danger {
color: #73271e;
background-color: #f8dbd7;
border-color: #f5cdc8;
}
.form-check {
position: relative;
display: block;
padding-left: 1.25rem;
}
.form-check-input {
position: absolute;
margin-top: 0.3rem;
margin-left: -1.25rem;
}
input[type="radio"],
input[type="checkbox"] {
cursor: pointer;
}
.form-check-label {
margin-bottom: 0;
}
hr {
margin-top: 1rem;
margin-bottom: 1rem;
border: 0;
border-top-color: currentcolor;
border-top-style: none;
border-top-width: 0px;
border-top: 1px solid rgba(0, 0, 0, 0.1);
}

View File

@@ -1,150 +0,0 @@
const path = require("path");
const webpack = require("webpack");
const HtmlWebpackPlugin = require("html-webpack-plugin");
const HtmlWebpackInjector = require("html-webpack-injector");
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
const NODE_ENV = process.env.NODE_ENV == null ? "development" : process.env.NODE_ENV;
const moduleRules = [
{
test: /\.ts$/,
enforce: "pre",
loader: "tslint-loader",
},
{
test: /\.tsx?$/,
use: [
{
loader: "ts-loader",
options: {
transpileOnly: true,
},
},
],
},
{
test: /\.(html)$/,
loader: "html-loader",
},
{
test: /.(ttf|otf|eot|svg|woff(2)?)(\?[a-z0-9]+)?$/,
exclude: /loading(|-white).svg/,
generator: {
filename: "fonts/[name].[contenthash][ext]",
},
type: "asset/resource",
},
{
test: /\.(jpe?g|png|gif|svg|webp|avif)$/i,
exclude: /.*(fontawesome-webfont)\.svg/,
generator: {
filename: "images/[name].[contenthash][ext]",
},
type: "asset/resource",
},
{
test: /\.scss$/,
use: [
{
loader: MiniCssExtractPlugin.loader,
},
"css-loader",
"sass-loader",
],
},
];
const plugins = [
new HtmlWebpackInjector(),
new HtmlWebpackPlugin({
template: "./src/duo.html",
filename: "duo.html",
chunks: ["duo"],
}),
new HtmlWebpackPlugin({
template: "./src/webauthn.html",
filename: "webauthn.html",
chunks: ["webauthn"],
}),
new HtmlWebpackPlugin({
template: "./src/webauthn-mobile.html",
filename: "webauthn-mobile.html",
chunks: ["webauthn"],
}),
new HtmlWebpackPlugin({
template: "./src/webauthn-fallback.html",
filename: "webauthn-fallback.html",
chunks: ["webauthn-fallback"],
}),
new HtmlWebpackPlugin({
template: "./src/sso.html",
filename: "sso.html",
chunks: ["sso"],
}),
new HtmlWebpackPlugin({
template: "./src/captcha.html",
filename: "captcha.html",
chunks: ["captcha"],
}),
new HtmlWebpackPlugin({
template: "./src/captcha-mobile.html",
filename: "captcha-mobile.html",
chunks: ["captcha"],
}),
new MiniCssExtractPlugin({
filename: "assets/[name].[contenthash].css",
chunkFilename: "assets/[id].[contenthash].css",
}),
new webpack.EnvironmentPlugin({
CACHE_TAG: Math.random().toString(36).substring(7),
}),
new webpack.ProvidePlugin({
process: "process/browser",
}),
];
const webpackConfig = {
mode: NODE_ENV,
devtool: "source-map",
entry: {
webauthn: "./src/webauthn/webauthn.ts",
"webauthn-fallback": "./src/webauthn/webauthn-fallback.ts",
duo: "./src/duo/duo.ts",
sso: "./src/sso/sso.ts",
captcha: "./src/captcha/captcha.ts",
},
optimization: {
splitChunks: {
cacheGroups: {
commons: {
test: /[\\/]node_modules[\\/]/,
name: "app/vendor",
chunks: (chunk) => {
return chunk.name === "app/main";
},
},
},
},
},
resolve: {
extensions: [".ts", ".js"],
symlinks: false,
modules: [path.resolve("../", "node_modules")],
fallback: {
buffer: false,
util: require.resolve("util/"),
assert: false,
},
},
output: {
filename: "assets/[name].[contenthash].js",
path: path.resolve(__dirname, "build"),
publicPath: "/connectors/",
clean: true,
},
module: { rules: moduleRules },
plugins: plugins,
};
module.exports = webpackConfig;

View File

@@ -32,7 +32,6 @@ mkhomedir_helper $USERNAME
chown -R $USERNAME:$GROUPNAME /etc/bitwarden
cp /etc/bitwarden/web/app-id.json /app/app-id.json
chown -R $USERNAME:$GROUPNAME /app
chown -R $USERNAME:$GROUPNAME /bitwarden_server
#chown -R $USERNAME:$GROUPNAME /bitwarden_server
exec gosu $USERNAME:$GROUPNAME dotnet /bitwarden_server/Server.dll \
/contentRoot=/app /webRoot=. /serveUnknown=false /webVault=true
#exec nginx -g 'daemon off;'

138
docker/mime.types Normal file
View File

@@ -0,0 +1,138 @@
types {
# Data interchange
application/atom+xml atom;
application/json json map topojson;
application/ld+json jsonld;
application/rss+xml rss;
application/vnd.geo+json geojson;
application/xml rdf xml;
# JavaScript
# Normalize to standard type.
# https://tools.ietf.org/html/rfc4329#section-7.2
application/javascript js;
# Manifest files
application/manifest+json webmanifest;
application/x-web-app-manifest+json webapp;
text/cache-manifest appcache;
# Media files
audio/midi mid midi kar;
audio/mp4 aac f4a f4b m4a;
audio/mpeg mp3;
audio/ogg oga ogg opus;
audio/x-realaudio ra;
audio/x-wav wav;
image/bmp bmp;
image/gif gif;
image/jpeg jpeg jpg;
image/jxr jxr hdp wdp;
image/png png;
image/svg+xml svg svgz;
image/tiff tif tiff;
image/vnd.wap.wbmp wbmp;
image/webp webp;
image/x-jng jng;
video/3gpp 3gp 3gpp;
video/mp4 f4p f4v m4v mp4;
video/mpeg mpeg mpg;
video/ogg ogv;
video/quicktime mov;
video/webm webm;
video/x-flv flv;
video/x-mng mng;
video/x-ms-asf asf asx;
video/x-ms-wmv wmv;
video/x-msvideo avi;
# Serving `.ico` image files with a different media type
# prevents Internet Explorer from displaying then as images:
# https://github.com/h5bp/html5-boilerplate/commit/37b5fec090d00f38de64b591bcddcb205aadf8ee
image/x-icon cur ico;
# Microsoft Office
application/msword doc;
application/vnd.ms-excel xls;
application/vnd.ms-powerpoint ppt;
application/vnd.openxmlformats-officedocument.wordprocessingml.document docx;
application/vnd.openxmlformats-officedocument.spreadsheetml.sheet xlsx;
application/vnd.openxmlformats-officedocument.presentationml.presentation pptx;
# Web fonts
application/font-woff woff;
application/font-woff2 woff2;
application/vnd.ms-fontobject eot;
# Browsers usually ignore the font media types and simply sniff
# the bytes to figure out the font type.
# https://mimesniff.spec.whatwg.org/#matching-a-font-type-pattern
#
# However, Blink and WebKit based browsers will show a warning
# in the console if the following font types are served with any
# other media types.
application/x-font-ttf ttc ttf;
font/opentype otf;
# Other
application/java-archive ear jar war;
application/mac-binhex40 hqx;
application/octet-stream bin deb dll dmg exe img iso msi msm msp safariextz;
application/pdf pdf;
application/postscript ai eps ps;
application/rtf rtf;
application/vnd.google-earth.kml+xml kml;
application/vnd.google-earth.kmz kmz;
application/vnd.wap.wmlc wmlc;
application/x-7z-compressed 7z;
application/x-bb-appworld bbaw;
application/x-bittorrent torrent;
application/x-chrome-extension crx;
application/x-cocoa cco;
application/x-java-archive-diff jardiff;
application/x-java-jnlp-file jnlp;
application/x-makeself run;
application/x-opera-extension oex;
application/x-perl pl pm;
application/x-pilot pdb prc;
application/x-rar-compressed rar;
application/x-redhat-package-manager rpm;
application/x-sea sea;
application/x-shockwave-flash swf;
application/x-stuffit sit;
application/x-tcl tcl tk;
application/x-x509-ca-cert crt der pem;
application/x-xpinstall xpi;
application/xhtml+xml xhtml;
application/xslt+xml xsl;
application/zip zip;
text/css css;
text/csv csv;
text/html htm html shtml;
text/markdown md;
text/mathml mml;
text/plain txt;
text/vcard vcard vcf;
text/vnd.rim.location.xloc xloc;
text/vnd.sun.j2me.app-descriptor jad;
text/vnd.wap.wml wml;
text/vtt vtt;
text/x-component htc;
}

25
docker/nginx-web.conf Normal file
View File

@@ -0,0 +1,25 @@
#######################################################################
# WARNING: This file is generated. Do not make changes to this file. #
# They will be overwritten on update. You can manage various settings #
# used in this file from the ./bwdata/config.yml file for your #
# installation. #
#######################################################################
server {
listen 8080 default_server;
listen [::]:8080 default_server;
include /etc/nginx/security-headers.conf;
location / {
root /app;
index index.html index.htm;
include /etc/nginx/security-headers.conf;
add_header X-Frame-Options SAMEORIGIN;
add_header X-Robots-Tag "noindex, nofollow";
}
location /alive {
return 200 'alive';
add_header Content-Type text/plain;
}
}

147
docker/nginx.conf Normal file
View File

@@ -0,0 +1,147 @@
# nginx Configuration File
# http://wiki.nginx.org/Configuration
# Run as a less privileged user for security reasons.
# user www www;
# How many worker threads to run;
# "auto" sets it to the number of CPU cores available in the system, and
# offers the best performance. Don't set it higher than the number of CPU
# cores if changing this parameter.
# The maximum number of connections for Nginx is calculated by:
# max_clients = worker_processes * worker_connections
worker_processes auto;
# Maximum open file descriptors per process;
# should be > worker_connections.
worker_rlimit_nofile 8192;
events {
# When you need > 8000 * cpu_cores connections, you start optimizing your OS,
# and this is probably the point at which you hire people who are smarter than
# you, as this is *a lot* of requests.
worker_connections 8000;
}
# Default error log file
# (this is only used when you don't override error_log on a server{} level)
error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;
http {
# Hide nginx version information.
server_tokens off;
# Define the MIME types for files.
include mime.types;
default_type application/octet-stream;
# Update charset_types to match updated mime.types.
# text/html is always included by charset module.
# Default: text/html text/xml text/plain text/vnd.wap.wml application/javascript application/rss+xml
charset_types
text/css
text/plain
text/vnd.wap.wml
application/javascript
application/json
application/rss+xml
application/xml;
# Format to use in log files
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
# Default log file
# (this is only used when you don't override access_log on a server{} level)
access_log /var/log/nginx/access.log main;
# How long to allow each connection to stay idle; longer values are better
# for each individual client, particularly for SSL, but means that worker
# connections are tied up longer. (Default: 65)
keepalive_timeout 20;
# Speed up file transfers by using sendfile() to copy directly
# between descriptors rather than using read()/write().
# For performance reasons, on FreeBSD systems w/ ZFS
# this option should be disabled as ZFS's ARC caches
# frequently used files in RAM by default.
sendfile on;
# Tell Nginx not to send out partial frames; this increases throughput
# since TCP frames are filled up before being sent out. (adds TCP_CORK)
tcp_nopush on;
# Compression
# Enable Gzip compressed.
gzip on;
# Compression level (1-9).
# 5 is a perfect compromise between size and cpu usage, offering about
# 75% reduction for most ascii files (almost identical to level 9).
gzip_comp_level 5;
# Don't compress anything that's already small and unlikely to shrink much
# if at all (the default is 20 bytes, which is bad as that usually leads to
# larger files after gzipping).
gzip_min_length 256;
# Compress data even for clients that are connecting to us via proxies,
# identified by the "Via" header (required for CloudFront).
gzip_proxied any;
# Tell proxies to cache both the gzipped and regular version of a resource
# whenever the client's Accept-Encoding capabilities header varies;
# Avoids the issue where a non-gzip capable client (which is extremely rare
# today) would display gibberish if their proxy gave them the gzipped version.
gzip_vary on;
# Compress all output labeled with one of the following MIME-types.
gzip_types
application/atom+xml
application/javascript
application/json
application/ld+json
application/manifest+json
application/rss+xml
application/vnd.geo+json
application/vnd.ms-fontobject
application/x-font-ttf
application/x-web-app-manifest+json
application/xhtml+xml
application/xml
font/opentype
image/bmp
image/svg+xml
image/x-icon
text/cache-manifest
text/css
text/plain
text/vcard
text/vnd.rim.location.xloc
text/vtt
text/x-component
text/x-cross-domain-policy;
# text/html is always compressed by HttpGzipModule
# This should be turned on if you are going to have pre-compressed copies (.gz) of
# static files available. If not it should be left off as it will cause extra I/O
# for the check. It is best if you enable this in a location{} block for
# a specific directory, or on an individual server{} level.
# gzip_static on;
# Content type for FIDO U2F facets
map $uri $fido_content_type {
default "application/fido.trusted-apps+json";
}
# Include files in the sites-enabled folder. server{} configuration files should be
# placed in the sites-available folder, and then the configuration should be enabled
# by creating a symlink to it in the sites-enabled folder.
# See doc/sites-enabled.md for more info.
include conf.d/*.conf;
}

View File

@@ -0,0 +1,3 @@
add_header Referrer-Policy same-origin;
add_header X-Content-Type-Options nosniff;
add_header X-XSS-Protection "1; mode=block";

2
jslib

Submodule jslib updated: 92a65b7b36...e372bf242b

View File

@@ -7,7 +7,7 @@
<p>
{{ "recoverAccountTwoStepDesc" | i18n }}
<a
href="https://bitwarden.com/help/lost-two-step-device/"
href="https://help.bitwarden.com/article/lost-two-step-device/"
target="_blank"
rel="noopener"
>{{ "learnMore" | i18n }}</a

View File

@@ -1,100 +1,44 @@
<div class="layout" [ngClass]="['layout', layout]">
<!-- TEAMS 1 Header -->
<header
class="header"
*ngIf="
layout === 'default' ||
layout === 'teams' ||
layout === 'teams1' ||
layout === 'teams2' ||
layout === 'enterprise' ||
layout === 'enterprise1' ||
layout === 'enterprise2' ||
layout === 'cnetcmpgnent' ||
layout === 'cnetcmpgnteams' ||
layout === 'cnetcmpgnind'
"
>
<header class="header" *ngIf="layout === 'enterprise2'">
<div class="container">
<div class="row">
<div class="col-7">
<img
alt="Bitwarden"
class="logo mb-2"
src="../../images/register-layout/logo-horizontal-white.svg"
src="../../images/register-layout/logo-horizontal-white.png"
/>
</div>
</div>
</div>
</header>
<form #form (ngSubmit)="submit()" [appApiAction]="formPromise" class="container" ngNativeValidate>
<div class="row">
<div class="col-7" *ngIf="layout">
<div class="mt-5">
<!-- Default Body -->
<div
*ngIf="
layout === 'teams' ||
layout === 'enterprise' ||
layout === 'enterprise1' ||
layout === 'default'
"
>
<h1>The Bitwarden Password Manager</h1>
<h2>
Trusted by millions of individuals, teams, and organizations worldwide for secure
password storage and sharing.
</h2>
<p>Store logins, secure notes, and more</p>
<div *ngIf="layout === 'enterprise2'">
<h2>Companies globally trust Bitwarden for password management.</h2>
<p>Start your 7-day free trial!</p>
<p class="highlight">Quickly deploy your <b>organization</b></p>
<p>Use Bitwarden across all platforms</p>
<p>Collaborate and share securely</p>
<p>Access anywhere on any device</p>
<p>Create your account to get started</p>
<figure>
<figcaption>
<cite>
<img src="../../images/register-layout/wired-logo.png" alt="Wired" />
</cite>
</figcaption>
<blockquote>
"Bitwarden has become a popular choice among open-source software advocates. After
using it for a few months, I can see why." - February 2020
</blockquote>
</figure>
</div>
<!-- Teams & Enterprise Body -->
<div *ngIf="layout === 'teams1' || layout === 'teams2' || layout === 'enterprise2'">
<h1>
Start Your <span *ngIf="layout === 'teams1' || layout === 'teams1'">Teams<br /></span
><span *ngIf="layout === 'enterprise2'">Enterprise</span> Free Trial Now
</h1>
<h2>
Millions of individuals, teams, and organizations worldwide trust Bitwarden for secure
password storage and sharing.
</h2>
<p>Collaborate and share securely</p>
<p>Deploy and manage quickly and easily</p>
<p>Access anywhere on any device</p>
<p>Create your account to get started</p>
<div *ngIf="layout === 'enterprise3'">
<p>Enterprise 3 layout</p>
</div>
<!-- CNET Campaign Teams & Enterprise Body -->
<div *ngIf="layout === 'cnetcmpgnteams' || layout === 'cnetcmpgnent'">
<h1>
Start Your <span *ngIf="layout === 'cnetcmpgnteams'">Teams<br /></span
><span *ngIf="layout === 'cnetcmpgnent'">Enterprise</span> Free Trial Now
</h1>
<h2>
Millions of individuals, teams, and organizations worldwide trust Bitwarden for secure
password storage and sharing.
</h2>
<p>Collaborate and share securely</p>
<p>Deploy and manage quickly and easily</p>
<p>Access anywhere on any device</p>
<p>Create your account to get started</p>
</div>
<!-- CNET Campaign Premium Body -->
<div *ngIf="layout === 'cnetcmpgnind'">
<h1>Start Your Premium Account Now</h1>
<h2>
Millions of individuals, teams, and organizations worldwide trust Bitwarden for secure
password storage and sharing.
</h2>
<p>Store logins, secure notes, and more</p>
<p>Secure your account with advanced two-step login</p>
<p>Access anywhere on any device</p>
<p>Create your account to get started</p>
<div *ngIf="layout === 'enterprise4'">
<p>Enterprise 4 layout</p>
</div>
</div>
</div>
@@ -268,88 +212,5 @@
</div>
</div>
</div>
<div class="row">
<div class="col-7 d-flex align-items-center">
<div
*ngIf="
layout === 'cnetcmpgnent' || layout === 'cnetcmpgnteams' || layout === 'cnetcmpgnind'
"
>
<figure>
<figcaption>
<cite>
<img
src="../../images/register-layout/cnet-logo.svg"
class="w-25 d-block mx-auto"
alt="cnet logo"
/>
</cite>
</figcaption>
<blockquote class="mx-auto text-center px-4">
"No more excuses; start using Bitwarden today. The identity you save could be your
own. The money definitely will be."
</blockquote>
</figure>
</div>
<div
*ngIf="
layout === 'teams' ||
layout === 'teams1' ||
layout === 'teams2' ||
layout === 'enterprise' ||
layout === 'enterprise1' ||
layout === 'enterprise2' ||
layout === 'default'
"
>
<figure>
<figcaption>
<cite>
<img
src="../../images/register-layout/forbes-logo.svg"
class="w-25 d-block mx-auto"
alt="Forbes Logo"
/>
</cite>
</figcaption>
<blockquote class="mx-auto text-center px-4">
“Bitwarden boasts the backing of some of the world's best security experts and an
attractive, easy-to-use interface”
</blockquote>
</figure>
</div>
</div>
<div
*ngIf="
layout === 'cnetcmpgnent' || layout === 'cnetcmpgnteams' || layout === 'cnetcmpgnind'
"
class="col-5 d-flex align-items-center justify-content-center"
>
<img
src="../../images/register-layout/usnews-360-badge.svg"
class="w-50 d-block"
alt="US News 360 Reviews Best Password Manager"
/>
</div>
<div
*ngIf="
layout === 'teams' ||
layout === 'teams1' ||
layout === 'teams2' ||
layout === 'enterprise' ||
layout === 'enterprise1' ||
layout === 'enterprise2' ||
layout === 'default'
"
class="col-5 d-flex align-items-center justify-content-center"
>
<img
src="../../images/register-layout/usnews-360-badge.svg"
class="w-50 d-block"
alt="US News 360 Reviews Best Password Manager"
/>
</div>
</div>
</form>
</div>

View File

@@ -153,7 +153,7 @@ export class AppComponent implements OnDestroy, OnInit {
);
if (emailVerificationConfirmed) {
this.platformUtilsService.launchUri(
"https://bitwarden.com/help/create-bitwarden-account/"
"https://bitwarden.com/help/article/create-bitwarden-account/"
);
}
break;

View File

@@ -28,7 +28,11 @@
<ng-container *ngIf="!loading && !done">
<p>
{{ "fingerprintEnsureIntegrityVerify" | i18n }}
<a href="https://bitwarden.com/help/fingerprint-phrase/" target="_blank" rel="noopener">
<a
href="https://help.bitwarden.com/article/fingerprint-phrase/"
target="_blank"
rel="noopener"
>
{{ "learnMore" | i18n }}</a
>
</p>

View File

@@ -56,7 +56,7 @@
target="_blank"
rel="noopener"
appA11yTitle="{{ 'learnMore' | i18n }}"
href="https://bitwarden.com/help/user-types-access-control/#access-control"
href="https://bitwarden.com/help/article/user-types-access-control/#access-control"
>
<i class="bwi bwi-question-circle" aria-hidden="true"></i>
</a>

View File

@@ -52,7 +52,7 @@
target="_blank"
rel="noopener"
appA11yTitle="{{ 'learnMore' | i18n }}"
href="https://bitwarden.com/help/provider-users/"
href="https://bitwarden.com/help/article/user-types-access-control/#user-types"
>
<i class="bwi bwi-question-circle" aria-hidden="true"></i>
</a>
@@ -277,7 +277,7 @@
target="_blank"
rel="noopener"
appA11yTitle="{{ 'learnMore' | i18n }}"
href="https://bitwarden.com/help/user-types-access-control/#access-control"
href="https://bitwarden.com/help/article/user-types-access-control/#access-control"
>
<i class="bwi bwi-question-circle" aria-hidden="true"></i>
</a>

View File

@@ -18,7 +18,11 @@
<div class="modal-body">
<p>
{{ "fingerprintEnsureIntegrityVerify" | i18n }}
<a href="https://bitwarden.com/help/fingerprint-phrase/" target="_blank" rel="noopener">
<a
href="https://help.bitwarden.com/article/fingerprint-phrase/"
target="_blank"
rel="noopener"
>
{{ "learnMore" | i18n }}</a
>
</p>

View File

@@ -13,7 +13,7 @@
target="_blank"
rel="noopener"
appA11yTitle="{{ 'learnMore' | i18n }}"
href="https://bitwarden.com/help/licensing-on-premise/#organization-account-sharing"
href="https://help.bitwarden.com/article/licensing-on-premise/#organization-account-sharing"
>
<i class="bwi bwi-question-circle" aria-hidden="true"></i>
</a>

View File

@@ -9,7 +9,7 @@
<div class="col-8" *ngIf="hideEmail">
<app-callout type="warning" title="{{ 'warning' | i18n }}">
{{ "viewSendHiddenEmailWarning" | i18n }}
<a href="https://bitwarden.com/help/receive-send/" target="_blank">{{
<a href="https://bitwarden.com/help/article/receive-send/" target="_blank">{{
"learnMore" | i18n
}}</a
>.

View File

@@ -24,7 +24,6 @@ import { ContainerService } from "jslib-common/services/container.service";
import { CryptoService } from "jslib-common/services/crypto.service";
import { EventService as EventLoggingService } from "jslib-common/services/event.service";
import { ImportService } from "jslib-common/services/import.service";
import { StateMigrationService } from "jslib-common/services/stateMigration.service";
import { VaultTimeoutService } from "jslib-common/services/vaultTimeout.service";
import { ApiService as ApiServiceAbstraction } from "jslib-common/abstractions/api.service";
@@ -53,14 +52,13 @@ import { VaultTimeoutService as VaultTimeoutServiceAbstraction } from "jslib-com
import { ThemeType } from "jslib-common/enums/themeType";
import { Account } from "../../models/account";
import { GlobalState } from "../../models/globalState";
import { AccountFactory } from "jslib-common/models/domain/account";
import { GlobalStateFactory } from "jslib-common/factories/globalStateFactory";
import { StateFactory } from "jslib-common/factories/stateFactory";
import { Account } from "../../models/account";
export function initFactory(
window: Window,
storageService: StorageServiceAbstraction,
environmentService: EnvironmentServiceAbstraction,
notificationsService: NotificationsServiceAbstraction,
vaultTimeoutService: VaultTimeoutService,
@@ -72,6 +70,7 @@ export function initFactory(
cryptoService: CryptoServiceAbstraction
): Function {
return async () => {
await (storageService as HtmlStorageService).init();
await stateService.init();
const urls = process.env.URLS as Urls;
@@ -111,6 +110,7 @@ export function initFactory(
useFactory: initFactory,
deps: [
"WINDOW",
StorageServiceAbstraction,
EnvironmentServiceAbstraction,
NotificationsServiceAbstraction,
VaultTimeoutServiceAbstraction,
@@ -180,19 +180,6 @@ export function initFactory(
StateServiceAbstraction,
],
},
{
provide: StateMigrationServiceAbstraction,
useFactory: (
storageService: StorageServiceAbstraction,
secureStorageService: StorageServiceAbstraction
) =>
new StateMigrationService(
storageService,
secureStorageService,
new GlobalStateFactory(GlobalState)
),
deps: [StorageServiceAbstraction, "SECURE_STORAGE"],
},
{
provide: StateServiceAbstraction,
useFactory: (
@@ -206,7 +193,7 @@ export function initFactory(
secureStorageService,
logService,
stateMigrationService,
new StateFactory(GlobalState, Account)
new AccountFactory(Account)
),
deps: [
StorageServiceAbstraction,

View File

@@ -39,7 +39,7 @@
<label for="kdfIterations">{{ "kdfIterations" | i18n }}</label>
<a
class="ml-auto"
href="https://bitwarden.com/help/what-encryption-is-used/#pbkdf2"
href="https://bitwarden.com/help/article/what-encryption-is-used/#pbkdf2"
target="_blank"
rel="noopener"
appA11yTitle="{{ 'learnMore' | i18n }}"

View File

@@ -74,7 +74,7 @@
{{ "rotateAccountEncKey" | i18n }}
</label>
<a
href="https://bitwarden.com/help/account-encryption-key/#rotate-your-encryption-key"
href="https://bitwarden.com/help/article/account-encryption-key/#rotate-your-encryption-key"
target="_blank"
rel="noopener"
appA11yTitle="{{ 'learnMore' | i18n }}"

View File

@@ -87,7 +87,7 @@ export class ChangePasswordComponent extends BaseChangePasswordComponent {
);
if (learnMore) {
this.platformUtilsService.launchUri(
"https://bitwarden.com/help/attachments/#add-storage-space"
"https://help.bitwarden.com/article/attachments/#fixing-old-attachments"
);
}
this.rotateEncKey = false;

View File

@@ -51,7 +51,7 @@
target="_blank"
rel="noopener"
appA11yTitle="{{ 'learnMore' | i18n }}"
href="https://bitwarden.com/help/emergency-access/#user-access"
href="https://bitwarden.com/help/article/emergency-access/#user-access"
>
<i class="bwi bwi-question-circle" aria-hidden="true"></i>
</a>

View File

@@ -18,7 +18,11 @@
<div class="modal-body">
<p>
{{ "fingerprintEnsureIntegrityVerify" | i18n }}
<a href="https://bitwarden.com/help/fingerprint-phrase/" target="_blank" rel="noopener">
<a
href="https://help.bitwarden.com/article/fingerprint-phrase/"
target="_blank"
rel="noopener"
>
{{ "learnMore" | i18n }}</a
>
</p>

View File

@@ -3,7 +3,7 @@
</div>
<p>
{{ "emergencyAccessDesc" | i18n }}
<a href="https://bitwarden.com/help/emergency-access/" target="_blank" rel="noopener">
<a href="https://bitwarden.com/help/article/emergency-access/" target="_blank" rel="noopener">
{{ "learnMore" | i18n }}.
</a>
</p>

View File

@@ -52,7 +52,7 @@
<label for="locale">{{ "language" | i18n }}</label>
<a
class="ml-auto"
href="https://bitwarden.com/help/localization/"
href="https://help.bitwarden.com/article/localization/"
target="_blank"
rel="noopener"
appA11yTitle="{{ 'learnMore' | i18n }}"
@@ -80,7 +80,7 @@
{{ "disableIcons" | i18n }}
</label>
<a
href="https://bitwarden.com/help/website-icons/"
href="https://help.bitwarden.com/article/website-icons/"
target="_blank"
rel="noopener"
appA11yTitle="{{ 'learnMore' | i18n }}"

View File

@@ -74,12 +74,8 @@ export class OptionsComponent implements OnInit {
this.disableIcons = await this.stateService.getDisableFavicon();
this.enableGravatars = await this.stateService.getEnableGravitars();
this.enableFullWidth = await this.stateService.getEnableFullWidth();
this.locale = await this.stateService.getLocale();
this.startingLocale = this.locale;
this.theme = await this.stateService.getTheme();
this.startingTheme = this.theme;
this.locale = (await this.stateService.getLocale()) ?? this.startingLocale;
this.theme = (await this.stateService.getTheme()) ?? this.startingTheme;
}
async submit() {
@@ -108,7 +104,10 @@ export class OptionsComponent implements OnInit {
if (this.locale !== this.startingLocale) {
window.location.reload();
} else {
this.platformUtilsService.showToast("success", null, this.i18nService.t("optionsUpdated"));
this.platformUtilsService.showToast("success", null, [
this.i18nService.t("optionsUpdated"),
this.i18nService.t("optionsUpdated"),
]);
}
}

View File

@@ -56,7 +56,7 @@
<p *ngIf="fingerprint">
{{ "yourAccountsFingerprint" | i18n }}:
<a
href="https://bitwarden.com/help/fingerprint-phrase/"
href="https://help.bitwarden.com/article/fingerprint-phrase/"
target="_blank"
rel="noopener"
appA11yTitle="{{ 'learnMore' | i18n }}"

View File

@@ -22,7 +22,7 @@
<p>
{{ "updateEncryptionKeyShortDesc" | i18n }} {{ "updateEncryptionKeyDesc" | i18n }}
<a
href="https://bitwarden.com/help/account-encryption-key/#rotate-your-encryption-key"
href="https://help.bitwarden.com/article/update-encryption-key/"
target="_blank"
rel="noopener"
>{{ "learnMore" | i18n }}</a

View File

@@ -29,14 +29,18 @@
<app-callout type="info" title="{{ getFormatInstructionTitle() }}" *ngIf="format">
<ng-container *ngIf="format === 'bitwardencsv' || format === 'bitwardenjson'">
See detailed instructions on our help site at
<a target="_blank" rel="noopener" href="https://bitwarden.com/help/export-your-data/">
https://bitwarden.com/help/export-your-data/</a
<a target="_blank" rel="noopener" href="https://help.bitwarden.com/article/export-your-data/">
https://help.bitwarden.com/article/export-your-data/</a
>
</ng-container>
<ng-container *ngIf="format === 'lastpasscsv'">
See detailed instructions on our help site at
<a target="_blank" rel="noopener" href="https://bitwarden.com/help/import-from-lastpass/">
https://bitwarden.com/help/import-from-lastpass/</a
<a
target="_blank"
rel="noopener"
href="https://help.bitwarden.com/article/import-from-lastpass/"
>
https://help.bitwarden.com/article/import-from-lastpass/</a
>
</ng-container>
<ng-container *ngIf="format === 'keepassxcsv'">
@@ -92,20 +96,32 @@
The process is exactly the same as importing from Google Chrome.
</span>
See detailed instructions on our help site at
<a target="_blank" rel="noopener" href="https://bitwarden.com/help/import-from-chrome/">
https://bitwarden.com/help/import-from-chrome/</a
<a
target="_blank"
rel="noopener"
href="https://help.bitwarden.com/article/import-from-chrome/"
>
https://help.bitwarden.com/article/import-from-chrome/</a
>
</ng-container>
<ng-container *ngIf="format === 'firefoxcsv'">
See detailed instructions on our help site at
<a target="_blank" rel="noopener" href="https://bitwarden.com/help/import-from-firefox/">
https://bitwarden.com/help/import-from-firefox/</a
<a
target="_blank"
rel="noopener"
href="https://bitwarden.com/help/article/import-from-firefox/"
>
https://bitwarden.com/help/article/import-from-firefox/</a
>.
</ng-container>
<ng-container *ngIf="format === 'safaricsv'">
See detailed instructions on our help site at
<a target="_blank" rel="noopener" href="https://bitwarden.com/help/import-from-safari/">
https://bitwarden.com/help/import-from-safari/</a
<a
target="_blank"
rel="noopener"
href="https://bitwarden.com/help/article/import-from-safari/"
>
https://bitwarden.com/help/article/import-from-safari/</a
>.
</ng-container>
<ng-container
@@ -114,8 +130,12 @@
"
>
See detailed instructions on our help site at
<a target="_blank" rel="noopener" href="https://bitwarden.com/help/import-from-1password/">
https://bitwarden.com/help/import-from-1password/</a
<a
target="_blank"
rel="noopener"
href="https://help.bitwarden.com/article/import-from-1password/"
>
https://help.bitwarden.com/article/import-from-1password/</a
>.
</ng-container>
<ng-container *ngIf="format === 'passworddragonxml'">

View File

@@ -11,7 +11,7 @@
<label for="fieldName{{ i }}">{{ "name" | i18n }}</label>
<a
class="ml-auto"
href="https://bitwarden.com/help/custom-fields/"
href="https://help.bitwarden.com/article/custom-fields/"
target="_blank"
rel="noopener"
appA11yTitle="{{ 'learnMore' | i18n }}"

View File

@@ -288,7 +288,7 @@
</label>
<a
class="ml-auto"
href="https://bitwarden.com/help/uri-match-detection/"
href="https://help.bitwarden.com/article/uri-match-detection/"
target="_blank"
rel="noopener"
appA11yTitle="{{ 'learnMore' | i18n }}"
@@ -793,7 +793,7 @@
target="_blank"
rel="noopener"
appA11yTitle="{{ 'learnMore' | i18n }}"
href="https://bitwarden.com/help/managing-items/#protect-individual-items"
href="https://bitwarden.com/help/article/managing-items/#protect-individual-items"
>
<i class="bwi bwi-question-circle" aria-hidden="true"></i>
</a>

View File

@@ -38,7 +38,7 @@
<a href="#" appStopClick (click)="download(a)">{{ a.fileName }}</a>
<div *ngIf="showFixOldAttachments(a)" class="ml-2">
<a
href="https://bitwarden.com/help/attachments/#fixing-old-attachments"
href="https://help.bitwarden.com/article/attachments/#fixing-old-attachments"
target="_blank"
rel="noopener"
>

View File

@@ -3,7 +3,7 @@
{{ "filters" | i18n }}
<a
class="ml-auto"
href="https://bitwarden.com/help/searching-vault/"
href="https://help.bitwarden.com/article/searching-vault/"
target="_blank"
rel="noopener"
appA11yTitle="{{ 'learnMore' | i18n }}"

View File

@@ -102,7 +102,7 @@
{{ "organizations" | i18n }}
<a
class="ml-auto"
href="https://bitwarden.com/help/about-organizations/"
href="https://help.bitwarden.com/article/what-is-an-organization/"
target="_blank"
rel="noopener"
appA11yTitle="{{ 'learnMore' | i18n }}"
@@ -119,7 +119,7 @@
{{ "providers" | i18n }}
<a
class="ml-auto"
href="https://bitwarden.com/help/providers/"
href="https://bitwarden.com/help/article/about-providers/"
target="_blank"
rel="noopener"
appA11yTitle="{{ 'learnMore' | i18n }}"

View File

@@ -14,7 +14,7 @@
<body class="layout_frontend">
<div class="row justify-content-md-center mt-5">
<div>
<img src="../../src/images/logo-dark@2x.png" class="logo mb-2" alt="Bitwarden" />
<img src="..//images/logo-dark@2x.png" class="logo mb-2" alt="Bitwarden" />
<p id="captchaRequired" class="lead text-center mx-4 mb-4">Captcha Required</p>
<div id="captcha"></div>
</div>

View File

@@ -0,0 +1 @@
@import "../scss/styles.scss";

View File

@@ -1,4 +1,4 @@
import { b64Decode, getQsParam } from "../common";
import { b64Decode, getQsParam } from "./common";
declare var hcaptcha: any;

View File

@@ -5,7 +5,7 @@ body {
}
body {
background: #efeff4 url("../../../src/images/loading.svg") 0 0 no-repeat;
background: #efeff4 url("../images/loading.svg") 0 0 no-repeat;
}
iframe {

View File

@@ -1,5 +1,5 @@
import * as DuoWebSDK from "duo_web_sdk";
import { getQsParam } from "../common";
import { getQsParam } from "./common";
// tslint:disable-next-line
require("./duo.scss");

33
src/connectors/sso.html Normal file
View File

@@ -0,0 +1,33 @@
<!DOCTYPE html>
<html class="theme_light">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=1010" />
<meta name="theme-color" content="#175DDC" />
<title>Bitwarden</title>
<link rel="apple-touch-icon" sizes="180x180" href="../images/icons/apple-touch-icon.png" />
<link rel="icon" type="image/png" sizes="32x32" href="../images/icons/favicon-32x32.png" />
<link rel="icon" type="image/png" sizes="16x16" href="../images/icons/favicon-16x16.png" />
<link rel="mask-icon" href="../images/icons/safari-pinned-tab.svg" color="#175DDC" />
<link rel="manifest" href="../manifest.json" />
</head>
<body class="layout_frontend">
<div class="mt-5 d-flex justify-content-center">
<div>
<img src="../images/logo-dark@2x.png" class="mb-4 logo" alt="Bitwarden" />
<div id="content">
<p class="text-center">
<i
class="bwi bwi-spinner bwi-spin bwi-2x text-muted"
title="Loading"
aria-hidden="true"
></i>
</p>
</div>
</div>
</div>
</body>
</html>

1
src/connectors/sso.scss Normal file
View File

@@ -0,0 +1 @@
@import "../scss/styles.scss";

View File

@@ -1,4 +1,4 @@
import { getQsParam } from "../common";
import { getQsParam } from "./common";
// tslint:disable-next-line
require("./sso.scss");

View File

@@ -9,7 +9,7 @@
<div class="container">
<div class="row justify-content-center mt-5">
<div class="col-5">
<img src="../../src/images/logo-dark@2x.png" class="mb-4 logo" alt="Bitwarden" />
<img src="../images/logo-dark@2x.png" class="mb-4 logo" alt="Bitwarden" />
<div id="spinner">
<p class="text-center">
<i

View File

@@ -1,4 +1,4 @@
import { b64Decode, getQsParam } from "../common";
import { b64Decode, getQsParam } from "./common";
import { buildDataString, parseWebauthnJson } from "./common-webauthn";
// tslint:disable-next-line
@@ -85,7 +85,7 @@ document.addEventListener("DOMContentLoaded", async () => {
});
async function loadLocales(newLocale: string) {
const filePath = `/locales/${newLocale}/messages.json?cache=${process.env.CACHE_TAG}`;
const filePath = `locales/${newLocale}/messages.json?cache=${process.env.CACHE_TAG}`;
const localesResult = await fetch(filePath);
return await localesResult.json();
}

View File

@@ -1,5 +1,5 @@
<!DOCTYPE html>
<html class="theme_light">
<html>
<head>
<meta charset="utf-8" />
<meta
@@ -14,12 +14,12 @@
<body style="background: transparent">
<div class="row justify-content-md-center mt-5">
<div>
<img src="../../src/images/logo-dark@2x.png" class="logo mb-2" alt="Bitwarden" />
<img src="../images/logo-dark@2x.png" class="logo mb-2" alt="Bitwarden" />
<p id="webauthn-header" class="lead text-center mx-4 mb-4"></p>
<picture>
<source srcset="../../src/images/u2fkey-mobile.avif" type="image/avif" />
<source srcset="../../src/images/u2fkey-mobile.webp" type="image/webp" />
<img src="../../src/images/u2fkey-mobile.jpg" class="rounded img-fluid" />
<source srcset="../images/u2fkey-mobile.avif" type="image/avif" />
<source srcset="../images/u2fkey-mobile.webp" type="image/webp" />
<img src="../images/u2fkey-mobile.jpg" class="rounded img-fluid" />
</picture>
<div class="text-center mt-4">
<button id="webauthn-button" class="btn btn-primary btn-lg"></button>

View File

@@ -7,9 +7,9 @@
<body style="background: transparent">
<picture>
<source srcset="../../src/images/u2fkey.avif" type="image/avif" />
<source srcset="../../src/images/u2fkey.webp" type="image/webp" />
<img src="../../src/images/u2fkey.jpg" class="rounded img-fluid mb-3" />
<source srcset="../images/u2fkey.avif" type="image/avif" />
<source srcset="../images/u2fkey.webp" type="image/webp" />
<img src="../images/u2fkey.jpg" class="rounded img-fluid mb-3" />
</picture>
<div class="text-center">
<button id="webauthn-button" class="btn btn-primary"></button>

View File

@@ -0,0 +1,5 @@
@import "../scss/styles.scss";
body {
min-width: 0px !important;
}

View File

@@ -1,4 +1,4 @@
import { b64Decode, getQsParam } from "../common";
import { b64Decode, getQsParam } from "./common";
import { buildDataString, parseWebauthnJson } from "./common-webauthn";
// tslint:disable-next-line

View File

@@ -1,3 +0,0 @@
<svg width="1236" height="906" viewBox="0 0 1236 906" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M1188.71 632.229C1204.72 632.229 1236 632.229 1236 632.229V689.173C1236 689.173 1174.89 689.173 1162.52 689.173C1138.52 689.173 1115.24 677.492 1121.79 680.413C1087.59 665.081 1074.5 627.849 1071.59 586.235V109.508H1148.7V228.508V229.238H1222.18V284.722H1148.7V285.452V592.076C1150.16 622.738 1168.34 632.229 1188.71 632.229ZM757.319 588.425V327.065C755.137 179.594 1014.12 178.864 1009.75 330.716V456.285C1009.75 464.316 1003.21 470.156 995.932 470.156H834.432V592.076C835.159 649.75 934.096 649.02 934.096 592.076V533.671H1010.48V588.425C1014.12 739.547 755.137 735.897 757.319 588.425ZM932.641 412.482V327.065C932.641 270.121 834.432 270.121 832.977 327.065V412.482H932.641ZM608.186 319.765C608.186 266.471 517.979 267.931 516.524 321.955V689.173H405.219V632.229H440.866V286.182H398.672V229.968H506.339V271.581C506.339 271.581 519.433 251.869 553.625 232.888C597.274 208.796 640.195 232.888 633.648 229.968C667.839 245.299 680.934 282.532 683.844 324.145V632.959H732.585V689.173H608.913L608.186 319.765ZM303.372 0H358.661V906H303.372V0ZM0.0137167 588.425V327.065C-2.16872 179.594 256.814 178.864 252.449 330.716V375.979H176.791L176.064 327.065C176.064 270.851 78.5814 272.311 76.399 329.255V592.076C77.1265 649.75 176.064 649.02 176.064 592.076V533.671H252.449V588.425C256.814 739.547 -2.16872 735.897 0.0137167 588.425Z" fill="black"/>
</svg>

Before

Width:  |  Height:  |  Size: 1.4 KiB

View File

@@ -1,4 +0,0 @@
<svg width="1955" height="490" viewBox="0 0 1955 490" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M1190.36 139.23C1158.92 139.23 1134.23 145.974 1109.52 159.436C1109.52 87.5714 1109.52 22.4505 1111.78 0L961.288 26.9381V40.4136L977.007 42.6573C997.201 47.1449 1003.97 58.3636 1008.42 85.3276C1012.95 139.23 1010.68 426.703 1008.42 473.874C1048.85 482.862 1091.53 489.606 1134.21 489.606C1253.25 489.606 1325.11 415.484 1325.11 298.692C1325.11 206.62 1266.72 139.23 1190.36 139.23V139.23ZM1138.7 464.886C1129.71 464.886 1118.47 464.886 1111.75 462.655C1109.49 431.217 1107.26 298.692 1109.49 181.913C1122.97 177.412 1131.94 175.169 1143.19 175.169C1192.63 175.169 1219.58 233.558 1219.58 305.41C1219.57 395.277 1185.87 464.886 1138.7 464.886V464.886ZM395.29 8.97504H0V29.1818L22.4635 31.4256C51.6453 35.9131 62.8901 53.8761 67.3646 96.5464C74.1218 177.4 71.8651 323.399 67.3646 392.995C62.8771 435.678 51.6583 455.898 22.4635 458.116L0 462.629V480.592H253.791V462.629L226.84 458.116C197.645 455.885 186.413 435.678 181.926 392.995C179.669 363.787 177.425 316.616 177.425 258.24L231.328 260.483C265.023 260.483 280.729 287.434 287.473 325.604H307.693V166.194H287.473C280.716 204.377 265.023 231.315 231.328 231.315L177.438 233.571C177.438 157.206 179.682 85.3406 181.939 42.6703H260.535C321.195 42.6703 352.633 80.8401 375.084 148.231L397.547 141.486L395.29 8.97504V8.97504Z" fill="black"/>
<path d="M523.315 134.742C635.619 134.742 691.765 211.108 691.765 312.168C691.765 408.74 628.875 489.619 516.57 489.619C404.279 489.619 348.133 413.241 348.133 312.168C348.133 215.596 411.01 134.742 523.315 134.742V134.742ZM516.57 157.206C467.156 157.206 453.68 224.584 453.68 312.168C453.68 397.508 476.144 467.13 521.071 467.13C572.69 467.13 586.192 399.752 586.192 312.168C586.192 226.827 563.754 157.206 516.57 157.206ZM1354.3 314.425C1354.3 222.34 1412.69 134.742 1527.23 134.742C1621.54 134.742 1666.48 204.377 1666.48 296.449H1457.6C1455.34 379.545 1495.77 440.192 1576.64 440.192C1612.57 440.192 1630.54 431.23 1653.01 415.497L1661.98 426.716C1639.51 458.155 1590.11 489.619 1527.23 489.619C1426.16 489.606 1354.3 417.741 1354.3 314.425V314.425ZM1457.6 271.754L1563.16 269.498C1563.16 224.584 1556.42 157.206 1518.25 157.206C1480.08 157.206 1459.83 220.083 1457.6 271.754V271.754ZM1933.78 152.718C1906.83 141.474 1870.91 134.742 1830.48 134.742C1747.39 134.742 1695.71 184.144 1695.71 242.547C1695.71 300.949 1733.85 325.643 1787.82 343.619C1843.95 363.813 1859.69 379.545 1859.69 406.496C1859.69 433.448 1839.47 458.142 1803.53 458.142C1760.87 458.142 1729.41 433.448 1704.71 366.057L1688.98 370.57L1691.24 469.387C1718.19 480.605 1767.59 489.606 1810.27 489.606C1897.87 489.606 1954.03 444.666 1954.03 375.058C1954.03 327.887 1929.31 300.949 1870.92 278.473C1808.01 253.778 1785.58 238.059 1785.58 208.851C1785.58 179.656 1805.82 159.437 1832.77 159.437C1873.17 159.437 1900.13 184.144 1920.37 244.79L1936.08 240.303L1933.78 152.718V152.718ZM983.726 143.73C945.556 121.293 878.166 132.499 842.239 213.365L844.47 134.755L694.009 163.95V177.426L709.728 179.669C729.961 181.926 738.923 193.145 741.18 222.353C745.667 276.255 743.423 370.596 741.18 417.754C738.923 444.679 729.961 458.155 709.728 460.412L694.009 462.668V480.631H902.873V462.668L875.922 460.412C853.471 458.155 846.727 444.679 844.47 417.754C839.983 375.071 839.983 289.73 842.239 235.828C853.458 220.096 902.873 206.633 947.787 235.828L983.726 143.73V143.73Z" fill="black"/>
</svg>

Before

Width:  |  Height:  |  Size: 3.4 KiB

View File

@@ -1 +0,0 @@
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 547 83"><defs><style>.cls-1{fill:#fff;fill-rule:evenodd;}</style></defs><path class="cls-1" d="M129,20.6c6.3,0,11.2,2.4,14.8,7.4s5.4,11.6,5.4,20.1c0,8.8-1.8,15.6-5.5,20.4s-8.7,7.2-15,7.2-11.1-2.2-14.7-6.8h-1l-1.9,4.7a1.85,1.85,0,0,1-1.7,1.1h-8a1.79,1.79,0,0,1-1.8-1.8V2.6A1.79,1.79,0,0,1,101.4.8h10.8A1.79,1.79,0,0,1,114,2.6V18q0,3.3-.6,10.5h.6C117.3,23.3,122.4,20.6,129,20.6Zm-4.6,11.7c-3.5,0-6.2,1.1-7.9,3.3S114,41.5,114,46.5v1.6c0,5.7.8,9.8,2.5,12.2s4.4,3.7,8.1,3.7a8.07,8.07,0,0,0,7.1-4.2c1.7-2.7,2.6-6.8,2.6-11.9s-.9-9.1-2.6-11.7A8.52,8.52,0,0,0,124.4,32.3ZM173,74.8H162.2a1.79,1.79,0,0,1-1.8-1.8V23.5a1.79,1.79,0,0,1,1.8-1.8H173a1.79,1.79,0,0,1,1.8,1.8V72.9A1.88,1.88,0,0,1,173,74.8Zm39.5-10.7a30.19,30.19,0,0,0,7.6-1.2,1.2,1.2,0,0,1,1.5,1.2v8.3a1.23,1.23,0,0,1-.7,1.1,33.36,33.36,0,0,1-12.5,2.1c-5.8,0-10-1.4-12.6-4.4s-4-7.3-4-13.1V32.6h-5.7a1.16,1.16,0,0,1-1.2-1.2V26.7c0-.1.1-.2.1-.3l7.9-4.7,3.9-10.4a1.17,1.17,0,0,1,1.1-.8h7.2a1.16,1.16,0,0,1,1.2,1.2V21.8h14.3a.65.65,0,0,1,.6.6v9a1.16,1.16,0,0,1-1.2,1.2H206.4V58a5.66,5.66,0,0,0,1.7,4.5A5.82,5.82,0,0,0,212.5,64.1Zm67.3,10.7a3.45,3.45,0,0,1-3.1-2.2L266.1,40.3c-.7-2.3-1.6-5.8-2.8-10.3H263l-1,3.6-2.1,6.8L249,72.7a3,3,0,0,1-3,2.1,3.09,3.09,0,0,1-3-2.3L229.7,26a2.33,2.33,0,0,1,2.3-2.9h.3a2.34,2.34,0,0,1,2.2,1.7l7.8,28.3c1.9,7.4,3.2,12.8,3.8,16.4h.3c1.8-7.4,3.2-12.3,4.1-14.8l10.1-29.6a3,3,0,0,1,2.9-2,2.91,2.91,0,0,1,2.8,2l9.4,29.4c2.3,7.5,3.7,12.3,4.2,14.8h.3c.3-2,1.5-7.6,3.8-16.6l7.5-27.9a2.34,2.34,0,0,1,2.2-1.7,2.28,2.28,0,0,1,2.2,2.9L283.3,72.5a3.12,3.12,0,0,1-3.1,2.3Zm59.4,0a1.83,1.83,0,0,1-1.8-1.6l-.9-6.6H336a24.69,24.69,0,0,1-8,7.1,21,21,0,0,1-9.7,2c-5.1,0-9-1.3-11.8-3.9a13,13,0,0,1-4.1-9.3,14.43,14.43,0,0,1,6-13.1c4.3-2.8,10.3-4.5,18.4-4.5l9.8-.3V41.2c0-5-1-8.6-3.1-11.1s-5.2-3.7-9.6-3.7a29.33,29.33,0,0,0-12.8,3.1,2.2,2.2,0,0,1-2.9-1.1,2.06,2.06,0,0,1,1.1-2.8,39.78,39.78,0,0,1,14.9-3.1c5.7,0,9.9,1.5,12.8,4.5s4.2,7.6,4.2,13.7V73.2A2.3,2.3,0,0,1,339.2,74.8Zm-20.7-3.4c5.6,0,9.9-1.6,13-4.7s4.8-7.6,4.8-13.1v-5l-9,.4c-7.3.3-12.4,1.5-15.6,3.4s-4.7,5-4.7,9a10.09,10.09,0,0,0,2.9,7.6A14.85,14.85,0,0,0,318.5,71.4Zm59.2-49.3a39.56,39.56,0,0,1,4.7.3,2.26,2.26,0,0,1,1.9,2.6,2.19,2.19,0,0,1-2.6,1.7,34.19,34.19,0,0,0-4.5-.4,13,13,0,0,0-10.8,5.6c-2.8,3.7-4.2,8.5-4.2,14.1V72.2a2.3,2.3,0,0,1-4.6,0v-47a2,2,0,0,1,2-2,1.92,1.92,0,0,1,2,1.9l.4,7.4h.3c2.1-3.8,4.4-6.5,6.8-8A14.77,14.77,0,0,1,377.7,22.1Zm35.2,0a22.38,22.38,0,0,1,9.7,2,18,18,0,0,1,7.3,7h.3c-.2-4.1-.3-7.9-.3-11.7V3.1a2.3,2.3,0,0,1,4.6,0V73a1.58,1.58,0,0,1-1.6,1.6,1.62,1.62,0,0,1-1.6-1.5l-1-6.5h-.4c-3.9,5.9-9.6,8.8-16.9,8.8s-12.5-2.2-16.4-6.7c-3.7-4.5-5.7-10.9-5.7-19.4,0-8.9,1.8-15.7,5.6-20.5C400.3,24.5,405.7,22.1,412.9,22.1Zm0,4.3c-5.7,0-9.9,2-12.8,6s-4.2,9.6-4.2,17.2q0,21.9,17.1,21.9c5.9,0,10.1-1.7,12.8-5.1s4.1-9,4.1-16.8v-.8c0-8-1.3-13.7-4.1-17.1C423.2,28.1,418.9,26.4,412.9,26.4Zm59.9,49.3c-7.5,0-13.3-2.3-17.6-7s-6.3-11.1-6.3-19.4,2-14.9,6.1-19.8,9.5-7.5,16.4-7.5c6,0,10.9,2.1,14.3,6.3,3.6,4.2,5.3,10,5.3,17.3v3.8H453.8c.1,7.1,1.7,12.5,5,16.3s7.9,5.5,14,5.5a45,45,0,0,0,7.8-.6,40.43,40.43,0,0,0,5.8-1.6,2,2,0,0,1,2.7,1.9,2.05,2.05,0,0,1-1.3,1.9,34.12,34.12,0,0,1-6.8,2A30.33,30.33,0,0,1,472.8,75.7Zm-1.4-49.4c-5,0-9,1.6-12,4.9s-4.7,8-5.3,14.1h32c0-5.9-1.3-10.7-3.9-14A13,13,0,0,0,471.4,26.3Zm72.4,48.5a2.26,2.26,0,0,1-2.3-2.3V41.2c0-5.2-1.1-9-3.2-11.3-2.3-2.3-5.6-3.6-10.2-3.6-6.2,0-10.7,1.5-13.5,4.7s-4.4,8.2-4.4,15.1V72.3a2.3,2.3,0,0,1-4.6,0V25.2a2.05,2.05,0,0,1,2.1-2.1,2.15,2.15,0,0,1,2.1,1.8l.6,5.2h.3c3.4-5.4,9.3-8.1,17.9-8.1,11.7,0,17.6,6.3,17.6,18.9V72.3A2.6,2.6,0,0,1,543.8,74.8ZM167.7,0a8.29,8.29,0,0,0-8.5,8.1v.8a8.51,8.51,0,0,0,17,0V8.2A8.37,8.37,0,0,0,167.7,0ZM67.4,1.8A3.25,3.25,0,0,0,65,.8H3.4A3.1,3.1,0,0,0,1,1.8,3.41,3.41,0,0,0,0,4.2v41a24.58,24.58,0,0,0,1.8,9.1,32.33,32.33,0,0,0,4.4,8,44.2,44.2,0,0,0,6.3,6.8,58.68,58.68,0,0,0,6.8,5.5c2,1.4,4.3,2.8,6.5,4.1s3.8,2.2,4.7,2.6,1.7.8,2.2,1.1a3.42,3.42,0,0,0,2.8,0,21.66,21.66,0,0,0,2.3-1.1c.9-.5,2.5-1.3,4.7-2.6S46.9,76,49,74.6a68.56,68.56,0,0,0,6.8-5.5,49.81,49.81,0,0,0,6.3-6.8,36,36,0,0,0,4.4-8,24.58,24.58,0,0,0,1.8-9.1V4.2A2.93,2.93,0,0,0,67.4,1.8ZM59.5,45.6c0,14.9-25.3,27.7-25.3,27.7V9.6H59.5Z"/></svg>

Before

Width:  |  Height:  |  Size: 4.1 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 33 KiB

View File

@@ -1,7 +0,0 @@
import { ThemeType } from "jslib-common/enums/themeType";
import { GlobalState as BaseGlobalState } from "jslib-common/models/domain/globalState";
export class GlobalState extends BaseGlobalState {
theme?: ThemeType = ThemeType.Light;
}

View File

@@ -173,28 +173,18 @@ app-sponsored-families {
/* Register Layout Page */
.layout {
&.default,
&.teams,
&.teams1,
&.teams2,
&.enterprise,
&.enterprise1,
&.enterprise2,
&.cnetcmpgnent,
&.cnetcmpgnteams,
&.cnetcmpgnind {
&.enterprise2 {
header {
background: #175ddc;
color: #ced4da;
height: 70px;
&:before {
background: #175ddc;
content: "";
height: 520px;
height: 416px;
left: 0;
position: absolute;
top: -80px;
top: -76px;
transform: skewY(-3deg);
width: 100%;
z-index: -1;
@@ -207,22 +197,15 @@ app-sponsored-families {
}
}
h1 {
color: #ffffff;
font-size: 3.5rem;
margin: 50px 0 0;
}
h2 {
color: #ffffff;
font-size: 2rem;
line-height: 1.5;
margin: 20px 0 140px;
font-size: 1.8rem;
margin: 100px 0 150px 0;
}
p {
font-size: 2rem;
margin: 10px 0 70px 0;
font-size: 1.4rem;
margin: 20px 0 40px 0;
&:before {
content: "/";
@@ -243,20 +226,10 @@ app-sponsored-families {
}
}
figure {
margin: 0;
}
blockquote {
font-size: 1.4rem;
margin: 20px 0 0;
}
}
&.cnetcmpgnind {
p {
font-size: 1.5rem;
margin: 10px 0 50px 0;
margin: 20px 0 0 0;
padding-right: 40px;
}
}
}

View File

@@ -4,6 +4,8 @@ import { StorageService } from "jslib-common/abstractions/storage.service";
import { HtmlStorageLocation } from "jslib-common/enums/htmlStorageLocation";
import { GlobalState } from "jslib-common/models/domain/globalState";
import { State } from "jslib-common/models/domain/state";
import { StorageOptions } from "jslib-common/models/domain/storageOptions";
@Injectable()
@@ -12,6 +14,16 @@ export class HtmlStorageService implements StorageService {
return { htmlStorageLocation: HtmlStorageLocation.Session };
}
async init() {
const state =
(await this.get<State>("state", { htmlStorageLocation: HtmlStorageLocation.Local })) ??
new State();
state.globals = state.globals ?? new GlobalState();
state.globals.vaultTimeout = state.globals.vaultTimeout ?? 15;
state.globals.vaultTimeoutAction = state.globals.vaultTimeoutAction ?? "lock";
await this.save("state", state, { htmlStorageLocation: HtmlStorageLocation.Local });
}
get<T>(key: string, options: StorageOptions = this.defaultOptions): Promise<T> {
let json: string = null;
switch (options.htmlStorageLocation) {

View File

@@ -72,6 +72,41 @@ const plugins = [
chunks: ["theme_head", "app/polyfills", "app/vendor", "app/main"],
}),
new HtmlWebpackInjector(),
new HtmlWebpackPlugin({
template: "./src/connectors/duo.html",
filename: "duo-connector.html",
chunks: ["connectors/duo"],
}),
new HtmlWebpackPlugin({
template: "./src/connectors/webauthn.html",
filename: "webauthn-connector.html",
chunks: ["connectors/webauthn"],
}),
new HtmlWebpackPlugin({
template: "./src/connectors/webauthn-mobile.html",
filename: "webauthn-mobile-connector.html",
chunks: ["connectors/webauthn"],
}),
new HtmlWebpackPlugin({
template: "./src/connectors/webauthn-fallback.html",
filename: "webauthn-fallback-connector.html",
chunks: ["connectors/webauthn-fallback"],
}),
new HtmlWebpackPlugin({
template: "./src/connectors/sso.html",
filename: "sso-connector.html",
chunks: ["connectors/sso"],
}),
new HtmlWebpackPlugin({
template: "./src/connectors/captcha.html",
filename: "captcha-connector.html",
chunks: ["connectors/captcha"],
}),
new HtmlWebpackPlugin({
template: "./src/connectors/captcha-mobile.html",
filename: "captcha-mobile-connector.html",
chunks: ["connectors/captcha"],
}),
new CopyWebpackPlugin({
patterns: [
{ from: "./src/.nojekyll" },
@@ -174,6 +209,11 @@ const webpackConfig = {
entry: {
"app/polyfills": "./src/app/polyfills.ts",
"app/main": "./src/app/main.ts",
"connectors/webauthn": "./src/connectors/webauthn.ts",
"connectors/webauthn-fallback": "./src/connectors/webauthn-fallback.ts",
"connectors/duo": "./src/connectors/duo.ts",
"connectors/sso": "./src/connectors/sso.ts",
"connectors/captcha": "./src/connectors/captcha.ts",
theme_head: "./src/theme.js",
},
optimization: {