Updated dependencies and Docker image to new web-vault

This commit is contained in:
Daniel García
2018-07-21 17:27:00 +02:00
parent 48e69cebab
commit a291dea16f
8 changed files with 155 additions and 183 deletions

266
Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -5,20 +5,20 @@ authors = ["Daniel García <dani-garcia@users.noreply.github.com>"]
[dependencies] [dependencies]
# Web framework for nightly with a focus on ease-of-use, expressibility, and speed. # Web framework for nightly with a focus on ease-of-use, expressibility, and speed.
rocket = { version = "0.3.14", features = ["tls"] } rocket = { version = "0.3.15", features = ["tls"] }
rocket_codegen = "0.3.14" rocket_codegen = "0.3.15"
rocket_contrib = "0.3.14" rocket_contrib = "0.3.15"
# HTTP client # HTTP client
reqwest = "0.8.6" reqwest = "0.8.6"
# multipart/form-data support # multipart/form-data support
multipart = "0.14.2" multipart = "0.15.0"
# A generic serialization/deserialization framework # A generic serialization/deserialization framework
serde = "1.0.70" serde = "1.0.70"
serde_derive = "1.0.70" serde_derive = "1.0.70"
serde_json = "1.0.22" serde_json = "1.0.24"
# A safe, extensible ORM and Query builder # A safe, extensible ORM and Query builder
diesel = { version = "1.3.2", features = ["sqlite", "chrono", "r2d2"] } diesel = { version = "1.3.2", features = ["sqlite", "chrono", "r2d2"] }
@ -52,7 +52,7 @@ u2f = "0.1.2"
dotenv = { version = "0.13.0", default-features = false } dotenv = { version = "0.13.0", default-features = false }
# Lazy static macro # Lazy static macro
lazy_static = "1.0.1" lazy_static = "1.0.2"
# Numerical libraries # Numerical libraries
num-traits = "0.2.5" num-traits = "0.2.5"
@ -63,4 +63,4 @@ num-derive = "0.2.2"
jsonwebtoken = { path = "libs/jsonwebtoken" } jsonwebtoken = { path = "libs/jsonwebtoken" }
# Version 0.1.2 from crates.io lacks a commit that fixes a certificate error # Version 0.1.2 from crates.io lacks a commit that fixes a certificate error
u2f = { git = 'https://github.com/wisespace-io/u2f-rs', rev = '193de35093a44' } u2f = { git = 'https://github.com/wisespace-io/u2f-rs', rev = '193de35093a44' }

View File

@ -2,31 +2,27 @@
# https://docs.docker.com/develop/develop-images/multistage-build/ # https://docs.docker.com/develop/develop-images/multistage-build/
# https://whitfin.io/speeding-up-rust-docker-builds/ # https://whitfin.io/speeding-up-rust-docker-builds/
####################### VAULT BUILD IMAGE ####################### ####################### VAULT BUILD IMAGE #######################
FROM node:9-alpine as vault FROM node:8-alpine as vault
ENV VAULT_VERSION "1.27.0" #ENV VAULT_VERSION "v1.27.0"
ENV URL "https://github.com/bitwarden/web/archive/v${VAULT_VERSION}.tar.gz" ENV VAULT_VERSION "master"
ENV URL "https://github.com/bitwarden/web.git"
RUN apk add --update-cache --upgrade \ RUN apk add --update-cache --upgrade \
curl \ curl \
git \ git \
tar \ tar
&& npm install -g \
gulp-cli \
gulp
RUN mkdir /web-build \
&& cd /web-build \
&& curl -L "${URL}" | tar -xvz --strip-components=1
RUN git clone -b $VAULT_VERSION --depth 1 $URL web-build
WORKDIR /web-build WORKDIR /web-build
COPY /docker/settings.Production.json /web-build/ COPY docker/set-vault-baseurl.patch /web-build/
RUN git apply set-vault-baseurl.patch
RUN git config --global url."https://github.com/".insteadOf ssh://git@github.com/ \ RUN npm run sub:init && npm install
&& npm install \
&& gulp dist:selfHosted \ RUN npm run dist \
&& mv dist /web-vault && mv build /web-vault
########################## BUILD IMAGE ########################## ########################## BUILD IMAGE ##########################
# We need to use the Rust build image, because # We need to use the Rust build image, because

View File

@ -0,0 +1,16 @@
--- a/src/app/services/services.module.ts
+++ b/src/app/services/services.module.ts
@@ -114,10 +114,9 @@ containerService.attachToWindow(window);
export function initFactory(): Function {
return async () => {
- const isDev = platformUtilsService.isDev();
- if (!isDev && platformUtilsService.isSelfHost()) {
- environmentService.baseUrl = window.location.origin;
- }
+ const isDev = false;
+ environmentService.baseUrl = window.location.origin;
+
await apiService.setUrls({
base: isDev ? null : window.location.origin,
api: isDev ? 'http://localhost:4000' : null,

View File

@ -1,9 +0,0 @@
{
"appSettings": {
"apiUri": "/api",
"identityUri": "/identity",
"iconsUri": "/icons",
"stripeKey": "",
"braintreeKey": ""
}
}

View File

@ -1 +1 @@
nightly-2018-06-26 nightly-2018-07-18

View File

@ -17,7 +17,7 @@ struct OrgData {
Key: String, Key: String,
Name: String, Name: String,
#[serde(rename = "PlanType")] #[serde(rename = "PlanType")]
_PlanType: String, // Ignored, always use the same plan _PlanType: NumberOrString, // Ignored, always use the same plan
} }
#[derive(Deserialize, Debug)] #[derive(Deserialize, Debug)]

View File

@ -1,5 +1,6 @@
#![feature(plugin, custom_derive)] #![feature(plugin, custom_derive)]
#![plugin(rocket_codegen)] #![plugin(rocket_codegen)]
#![allow(proc_macro_derive_resolution_fallback)] // TODO: Remove this when diesel update fixes warnings
extern crate rocket; extern crate rocket;
extern crate rocket_contrib; extern crate rocket_contrib;
extern crate reqwest; extern crate reqwest;