🔐PWD work #634

This commit is contained in:
jokob-sk
2024-04-20 10:14:22 +10:00
parent c1b5a2684b
commit 003fc557cd
19 changed files with 76 additions and 248 deletions

View File

@@ -1,48 +1,13 @@
## Overview
A simple script-based plugin for setting the password.
A simple setting-based plugin for setting the password.
### Usage
- Head to **Settings** > **UI password** to adjust the default values.
- Head to **Settings** > **Set Password** to adjust the default values.
### Notes
- The plugin is executed on the `RUN` type `before_config_save` so it's possible to update the `app.conf` file before the data is loaded into the app.
- The executed command is stored in the `CMD` setting: `/app/back/pialert-cli set_password {password}`
- The `{password}` parameter is replaced via the parameter and setting below:
```json
...
"params" : [
{
"name" : "password",
"type" : "setting",
"value" : "SETPWD_password"
}
],
...
{
"function": "password",
"type": "password",
"maxLength": 50,
"default_value": "123456",
"options": [],
"localized": ["name", "description"],
"name": [
{
"language_code": "en_us",
"string": "Password"
}
],
"description": [
{
"language_code": "en_us",
"string": "The default password is <code>123456</code>. To change the password run <code>/app/back/pialert-cli set_password {password}</code> in the container"
}
]
}
```
- The default password is <code>123456</code>.
- When enabled a login dialog is displayed. If facing issues, you can always disable the login by setting <code>SETPWD_enable_password=False</code> in your <code>app.conf</code> file.
- SHA256 hash is used