Install `rust nightly`, in Windows the recommended way is through `rustup`.
### Dependencies
- `Rust nightly` (strongly recommended to use [rustup](https://rustup.rs/))
- `OpenSSL` (should be available in path, install through your system's package manager or use the [prebuilt binaries](https://wiki.openssl.org/index.php/Binaries))
- `NodeJS` (required to build the web-vault, (install through your system's package manager or use the [prebuilt binaries](https://nodejs.org/en/download/))
Install the `openssl` library, in Windows the best option is Microsoft's `vcpkg`,
on other systems use their respective package managers.
Then run:
## Run/Compile
```sh
```sh
# Compile and run
cargo run
cargo run
# or
# or just compile (binary located in target/release/bitwarden_rs)
cargo build
cargo build --release
```
```
## How to install the web-vault locally
When run, the server is accessible in [http://localhost:80](http://localhost:80).
If you're using docker image, you can just update `VAULT_VERSION` variable in Dockerfile and rebuild the image.
Install `node.js` and either `yarn` or `npm` (usually included with node)
### Install the web-vault
Download the latest official release from the [releases page](https://github.com/bitwarden/web/releases) and extract it.
Modify `web-vault/settings.Production.json` to look like this:
Modify `web-vault/settings.Production.json` to look like this:
```json
```json
@ -34,23 +31,23 @@ Modify `web-vault/settings.Production.json` to look like this:
}
}
```
```
Then, run the following from the `web-vault` dir:
Then, run the following from the `web-vault` directory:
```sh
```sh
# With yarn (recommended)
yarn
yarn gulp dist:selfHosted
# With npm
npm install
npm install
npx gulp dist:selfHosted
npx gulp dist:selfHosted
```
```
Finally copy the contents of the `web-vault/dist` folder into the `bitwarden_rs/web-vault` folder.
Finally copy the contents of the `web-vault/dist` folder into the `bitwarden_rs/web-vault` folder.
## How to recreate database schemas
# Configuration
The available configuration options are documented in the default `.env` file, and they can be modified by uncommenting the desired options in that file or by setting their respective environment variables. Look at the README file for the main configuration options available.
Note: the environment variables override the values set in the `.env` file.
## How to recreate database schemas (for developers)
Install diesel-cli with cargo:
Install diesel-cli with cargo:
```sh
```sh
cargo install diesel_cli --no-default-features --features sqlite-bundled # Or use only sqlite to use the system version