Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion api/v1/controllers/util.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import DB from '../../../lib/db.mjs'
*/
export async function generatePassword (req, res, next) {
const pwd = generator.generate({
length: 15,
length: Config.get().generated_password_length || 20,
numbers: true,
symbols: req?.query?.symbols !== 'false',
lowercase: true,
Expand Down
3 changes: 2 additions & 1 deletion config-skel.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,6 @@
"max_hours": 168
},
"readonly": false,
"enable_metrics": true
"enable_metrics": true,
"generated_password_length": 20
}
1 change: 1 addition & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,7 @@ Copy `config-skel.json` to `config.json` and adjust the options:
- `max_hours`: Max one-time secrets duration
- `readonly`: true or false; if true, no write operation is allowed both for admins and regolar users
- `enable_metrics`: true or false, enables Prometheus formatted metrics
- `generated_password_length`: length of random generated password, default is 20

## Environment variables

Expand Down
3 changes: 2 additions & 1 deletion lib/schemas/system_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@
"required": [ "max_hours" ]
},
"readonly": { "type": "boolean" },
"enable_metrics": { "type": "boolean" }
"enable_metrics": { "type": "boolean" },
"generated_password_length": { "type": "integer", "minimum": 10, "maximum": 50 }
},
"required": ["jwt_duration", "listen", "log", "https", "redis", "onetimetokens", "readonly"]
}