|
|
To configure _suvi_, there are the parameters described here, which can be passed to the app when the program starts, can be defined as environment variables or can be queried in a configuration file.
|
|
|
|
|
|
Start parameters have the highest priority, environment variables come second and the configuration file last.
|
|
|
|
|
|
## Parameters
|
|
|
|
|
|
- `--bind`: The ip/interface where suvi listens at.
|
|
|
- `--port`: The listening port.
|
|
|
- `--enforce` / `--no-enforce`: Require a basic auth login
|
|
|
- `--admin-login`: Username for the admin user
|
|
|
- `--admin-password`: Password for the admin user
|
|
|
- `--user-login`: Username for the standard user
|
|
|
- `--user-password`: Password for the standard user
|
|
|
- `--tasks`: Where to look for task config files (`.json` files)
|
|
|
- `--cycle`: Update interval in seconds to look for new/deleted task config files
|
|
|
- `--logs`: Directory where to store suvi and task log files.
|
|
|
- `--log-rotate-when`: When to rotate log files (`H` for hours, `D` for days or `midnight`)
|
|
|
- `--log-rotate-interval`: How many instances fo `when` have to pass before rotating the log file
|
|
|
- `--log-backup-count`: How many file rollovers should be stored
|
|
|
- `--help`: Show help message and exit.
|
|
|
|
|
|
## Using environment vars
|
|
|
|
|
|
Parameters can be set via environment vars, example:
|
|
|
|
|
|
```bash
|
|
|
#/bin/bash
|
|
|
|
|
|
PW1=$(pwmake 80)
|
|
|
PW2=$(pwmake 80)
|
|
|
|
|
|
echo Setting admin password to "$PW1" and user password to "$PW2".
|
|
|
|
|
|
SUVI_ENFORCE=True \
|
|
|
SUVI_ADMIN_LOGIN=admin \
|
|
|
SUVI_ADMIN_PASSWORD="$PW1" \
|
|
|
SUVI_USER_LOGIN=user \
|
|
|
SUVI_USER_PASSWORD="$PW2" \
|
|
|
suvi
|
|
|
```
|
|
|
|
|
|
## Using `suvi.toml`
|
|
|
|
|
|
Parameters can also be set by a `suvi.toml` file:
|
|
|
|
|
|
```toml
|
|
|
bind = "0.0.0.0"
|
|
|
port = 8080
|
|
|
enforce = true
|
|
|
admin_login = "admin"
|
|
|
admin_password = "RamesesII"
|
|
|
user_login = "user"
|
|
|
user_password = "TrustNo1"
|
|
|
tasks = "./tasks"
|
|
|
cycle = 10
|
|
|
logs = "./log"
|
|
|
log_rotate_when = "midnight"
|
|
|
log_rotate_interval = 1
|
|
|
log_backup_count = 5
|
|
|
```
|
|
|
|
|
|
## Defaults
|
|
|
|
|
|
For settings that are not defined, these defaults are in place:
|
|
|
|
|
|
- `bind`: `0.0.0.0`
|
|
|
- `port`: `8080`
|
|
|
- `enforce`: `false`
|
|
|
- `admin_login`: `admin`
|
|
|
- `admin_password`: -
|
|
|
- `user_login`: `user`
|
|
|
- `user_password`: -
|
|
|
- `tasks`: `./tasks`
|
|
|
- On app start, _suvi_ will try to create this directory if it does not exist.
|
|
|
- `cycle`: `10`
|
|
|
- `logs`: `./log`
|
|
|
- On app start, _suvi_ will try to create this directory if it does not exist.
|
|
|
- `log_rotate_when`: `midnight`
|
|
|
- `log_rotate_interval`: `1`
|
|
|
- `log_backup_count`: `5` |
|
|
\ No newline at end of file |