Add ws_token to auto-generated config

This commit is contained in:
Matthias 2022-09-09 07:13:05 +02:00
parent 46cd0ce994
commit e256ebd727
4 changed files with 4 additions and 3 deletions

View File

@ -211,6 +211,7 @@ def ask_user_config() -> Dict[str, Any]:
) )
# Force JWT token to be a random string # Force JWT token to be a random string
answers['api_server_jwt_key'] = secrets.token_hex() answers['api_server_jwt_key'] = secrets.token_hex()
answers['api_server_ws_token'] = secrets.token_urlsafe(25)
return answers return answers

View File

@ -1,7 +1,6 @@
from enum import Enum from enum import Enum
# We need to inherit from str so we can use as a str
class RPCMessageType(str, Enum): class RPCMessageType(str, Enum):
STATUS = 'status' STATUS = 'status'
WARNING = 'warning' WARNING = 'warning'

View File

@ -67,6 +67,7 @@
"verbosity": "error", "verbosity": "error",
"enable_openapi": false, "enable_openapi": false,
"jwt_secret_key": "{{ api_server_jwt_key }}", "jwt_secret_key": "{{ api_server_jwt_key }}",
"ws_token": "{{ api_server_ws_token }}",
"CORS_origins": [], "CORS_origins": [],
"username": "{{ api_server_username }}", "username": "{{ api_server_username }}",
"password": "{{ api_server_password }}" "password": "{{ api_server_password }}"