document new env variables

This commit is contained in:
1e99 2024-11-08 16:06:59 +01:00
parent 08fbba0e0a
commit 05e787baba
2 changed files with 8 additions and 6 deletions

View file

@ -53,8 +53,10 @@ PASSED_STORE_TYPE=dir ./passed
## Configuration ## Configuration
Configuration is done with environment variables. Configuration is done with environment variables.
- `PASSED_ADDRESS`: Specifies the address that PassED should listen on, defaults to `:3000` - `PASSED_ADDRESS`: Specifies the address that PassED should listen on, defaults to `:3000`.
- `PASSED_STORE_TYPE`: Specify which store to use to save passwords, defaults to `ram`: - `PASSED_LOG_REQUESTS`: Specifies wether HTTP requests should be logged or not, defaults to `true`.
- `ram`: Stores all passwords in RAM, they are lost on restart - `PASSED_MAX_LENGTH`: Specifies the maximum password length in bytes, defaults to `12288` (12KiB).
- `dir`: Stores all passwords in a directory. Requires `PASSED_STORE_DIR_PATH` to be set to the directory, defaults to `passwords`. PassED will not create the directory. - `PASSED_STORE_TYPE`: Specify which store is used to save passwords, defaults to `ram`:
- `STORE_CLEAR_EXPIRED_INTERVAL`: Specifies the delay in seconds to wait between clearing expired passwords, defaults to `30`. - `ram`: Stores all passwords in RAM, they are lost on restart.
- `dir`: Stores all passwords in a directory. Requires `PASSED_STORE_DIR_PATH` to be set to the directory, defaults to `passwords`. PassED will **not** create the directory.
- `PASSED_STORE_CLEAR_INTERVAL`: Specifies the delay in seconds to wait between clearing expired passwords, defaults to `30`.

View file

@ -60,7 +60,7 @@ func run() error {
func newStore() (store storage.Store, err error) { func newStore() (store storage.Store, err error) {
var storeType string var storeType string
var clearInterval int var clearInterval int
config.Env("PASSED_STORE", &storeType, "ram") config.Env("PASSED_STORE_TYPE", &storeType, "ram")
config.Env("PASSED_STORE_CLEAR_INTERVAL", &clearInterval, "30") config.Env("PASSED_STORE_CLEAR_INTERVAL", &clearInterval, "30")
switch storeType { switch storeType {