update rocket config file and related docs

This commit is contained in:
glyph 2022-01-18 16:59:54 +02:00
parent d0321d17d0
commit bfb53747db
2 changed files with 12 additions and 9 deletions

View File

@ -25,7 +25,7 @@ Move into the repo and compile:
Run the tests:
`ROCKET_DISABLE_AUTH=true PEACH_STANDALONE_MODE=false cargo test`
`ROCKET_DISABLE_AUTH=true ROCKET_STANDALONE_MODE=false cargo test`
Move back to the `peach-workspace` directory:
@ -37,21 +37,23 @@ Run the binary:
### Environment
**Deployment Mode**
**Deployment Profile**
The web application deployment mode is configured with the `ROCKET_ENV` environment variable:
The web application deployment profile can be configured with the `ROCKET_ENV` environment variable:
`export ROCKET_ENV=stage`
Other deployment modes are `dev` and `prod`. Read the [Rocket Environment Configurations docs](https://rocket.rs/v0.5-rc/guide/configuration/#environment-variables) for further information.
Default configuration parameters are defined in `Rocket.toml`. This file defines a set of default parameters, some of which are overwritten when running in `debug` mode (ie. `cargo run` or `cargo build`) or `release` mode (ie. `cargo run --release` or `cargo build --release`).
Read the [Rocket Environment Configurations docs](https://rocket.rs/v0.5-rc/guide/configuration/#environment-variables) for further information.
**Configuration Mode**
The web application can be run with a minimal set of routes and functionality (PeachPub - a simple sbot manager) or with the full-suite of capabilities, including network management and access to device statistics (PeachCloud). The mode is configured with the `PEACH_STANDALONE_MODE` environment variable: `true` or `false`. If the variable is unset or the value is incorrectly set, the application defaults to standalone mode.
The web application can be run with a minimal set of routes and functionality (PeachPub - a simple sbot manager) or with the full-suite of capabilities, including network management and access to device statistics (PeachCloud). The mode is enabled by default (as defined in `Rocket.toml`) but can be overwritten using the `ROCKET_STANDALONE_MODE` environment variable: `true` or `false`. If the variable is unset or the value is incorrectly set, the application defaults to standalone mode.
**Authentication**
Authentication is disabled in `development` mode and enabled by default when running the application in `production` mode. It can be disabled by setting the `ROCKET_DISABLE_AUTH` environment variable to `true`:
Authentication is disabled in `debug` mode and enabled by default when running the application in `release` mode. It can be disabled by setting the `ROCKET_DISABLE_AUTH` environment variable to `true`:
`export ROCKET_DISABLE_AUTH=true`

View File

@ -1,10 +1,11 @@
[default]
secret_key = "VYVUDivXvu8g6llxeJd9F92pMfocml5xl/Jjv5Sk4yw="
disable_auth = false
standalone_mode = true
[development]
[debug]
template_dir = "templates/"
disable_auth = true
[production]
[release]
template_dir = "templates/"
disable_auth = false