Unofficial Bitwarden compatible server written in Rust, formerly known as bitwarden_rs
Go to file
Daniel García e2f7f56a81 Removed unused test library that broke with latest nightly, and updated dependencies 2018-03-01 14:36:39 +01:00
libs/jsonwebtoken First working version 2018-02-10 01:00:55 +01:00
migrations Some initial work on organizations, nothing works yet 2018-02-17 23:04:34 +01:00
src Removed unused test library that broke with latest nightly, and updated dependencies 2018-03-01 14:36:39 +01:00
web-vault Fixed icons and updated web-vault 2018-02-17 18:48:42 +01:00
.dockerignore Fixed docker build and implemented automatic creation of JWT signing keys on platforms with OpenSSL (it needs to be on the PATH) 2018-02-17 01:13:02 +01:00
.env First working version 2018-02-10 01:00:55 +01:00
.gitignore First working version 2018-02-10 01:00:55 +01:00
Cargo.lock Removed unused test library that broke with latest nightly, and updated dependencies 2018-03-01 14:36:39 +01:00
Cargo.toml Removed unused test library that broke with latest nightly, and updated dependencies 2018-03-01 14:36:39 +01:00
Dockerfile Reduced Docker final image and updated dependencies 2018-02-18 19:14:25 +01:00
LICENSE.txt Upload and download attachments, and added License file 2018-02-15 00:40:34 +01:00
README.md Fixed icons and updated web-vault 2018-02-17 18:48:42 +01:00

README.md

Easy setup (Docker)

Install Docker to your system and then, from the project root, run:

# Build the docker image:
docker build -t dani/bitwarden_rs .

# Run the docker image with a docker volume:
docker volume create bw_data
docker run --name bitwarden_rs -t --init --rm --mount source=bw_data,target=/data -p 8000:80 dani/bitwarden_rs

Other possible Docker options

To run the container in the background, add the -d parameter.

To check the logs when in background, run docker logs bitwarden_rs

To stop the container in background, run docker stop bitwarden_rs

To make sure the container is restarted automatically, add the --restart unless-stopped parameter

To run the image with a host bind, change the --mount parameter to:

--mount type=bind,source=<absolute_path>,target=/data

Where <absolute_path> is an absolute path in the hosts file system (e.g. C:\bitwarden\data)

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, on other systems use their respective package managers.

Then run:

cargo run --bin bitwarden_rs
# or
cargo build

How to update the web-vault used

Install node.js and either yarn or npm (usually included with node)

Clone the web-vault outside the project:

git clone https://github.com/bitwarden/web.git web-vault

Modify web-vault/settings.Production.json to look like this:

{
  "appSettings": {
    "apiUri": "/api",
    "identityUri": "/identity",
    "iconsUri": "/icons",
    "stripeKey": "",
    "braintreeKey": ""
  }
}

Then, run the following from the web-vault dir:

# With yarn (recommended)
yarn
yarn gulp dist:selfHosted

# With npm
npm install
npx gulp dist:selfHosted

Finally copy the contents of the web-vault/dist folder into the bitwarden_rs/web-vault folder.

How to recreate database schemas

Install diesel-cli with cargo:

cargo install diesel_cli --no-default-features --features sqlite

Make sure that the correct path to the database is in the .env file.

If you want to modify the schemas, create a new migration with:

diesel migration generate <name>

Modify the *.sql files, making sure that any changes are reverted in the down.sql file.

Apply the migrations and save the generated schemas as follows:

diesel migration redo
diesel print-schema > src/db/schema.rs