Update dependencies and bundle SQLite with the program, so we have one less dependency to install separately

This commit is contained in:
Daniel García
2018-05-07 21:33:54 +02:00
parent 7e7c3681da
commit 8298795087
4 changed files with 167 additions and 161 deletions

290
Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -5,9 +5,9 @@ authors = ["Daniel García <dani-garcia@users.noreply.github.com>"]
[dependencies]
# Web framework for nightly with a focus on ease-of-use, expressibility, and speed.
rocket = { version = "0.3.8", features = ["tls"] }
rocket_codegen = "0.3.8"
rocket_contrib = "0.3.8"
rocket = { version = "0.3.10", features = ["tls"] }
rocket_codegen = "0.3.10"
rocket_contrib = "0.3.10"
# HTTP client
reqwest = "0.8.5"
@ -16,14 +16,17 @@ reqwest = "0.8.5"
multipart = "0.14.2"
# A generic serialization/deserialization framework
serde = "1.0.43"
serde_derive = "1.0.43"
serde_json = "1.0.16"
serde = "1.0.48"
serde_derive = "1.0.48"
serde_json = "1.0.17"
# A safe, extensible ORM and Query builder
diesel = { version = "1.2.2", features = ["sqlite", "chrono", "r2d2"] }
diesel_migrations = { version = "1.2.0", features = ["sqlite"] }
# Bundled SQLite
libsqlite3-sys = { version = "0.9.1", features = ["bundled"] }
# Crypto library
ring = { version = "= 0.11.0", features = ["rsa_signing"] }

View File

@ -33,11 +33,11 @@ RUN git config --global url."https://github.com/".insteadOf ssh://git@github.com
# we need the Rust compiler and Cargo tooling
FROM rustlang/rust:nightly as build
# Install the database libraries, in this case just sqlite3
RUN apt-get update && apt-get install -y\
sqlite3\
--no-install-recommends\
&& rm -rf /var/lib/apt/lists/*
# Using bundled SQLite, no need to install it
# RUN apt-get update && apt-get install -y\
# sqlite3\
# --no-install-recommends\
# && rm -rf /var/lib/apt/lists/*
# Creates a dummy project used to grab dependencies
RUN USER=root cargo new --bin app
@ -68,7 +68,6 @@ FROM debian:stretch-slim
# Install needed libraries
RUN apt-get update && apt-get install -y\
sqlite3\
openssl\
--no-install-recommends\
&& rm -rf /var/lib/apt/lists/*

View File

@ -1,6 +1,6 @@
## Easy setup (Docker)
Install Docker to your system and then, from the project root, run:
```
```sh
# Build the docker image:
docker build -t dani/bitwarden_rs .
@ -29,11 +29,11 @@ Where <absolute_path> is an absolute path in the hosts file system (e.g. C:\bitw
## How to compile bitwarden_rs
Install `rust nightly`, in Windows the recommended way is through `rustup`.
Install the `sqlite3`, and `openssl` libraries, in Windows the best option is Microsoft's `vcpkg`,
Install the `openssl` library, in Windows the best option is Microsoft's `vcpkg`,
on other systems use their respective package managers.
Then run:
```
```sh
cargo run
# or
cargo build
@ -63,7 +63,7 @@ Modify `web-vault/settings.Production.json` to look like this:
```
Then, run the following from the `web-vault` dir:
```
```sh
# With yarn (recommended)
yarn
yarn gulp dist:selfHosted
@ -77,8 +77,8 @@ Finally copy the contents of the `web-vault/dist` folder into the `bitwarden_rs/
## How to recreate database schemas
Install diesel-cli with cargo:
```
cargo install diesel_cli --no-default-features --features sqlite
```sh
cargo install diesel_cli --no-default-features --features sqlite-bundled # Or use only sqlite to use the system version
```
Make sure that the correct path to the database is in the `.env` file.