diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2021-03-05 18:08:17 +0100 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2021-03-05 18:08:17 +0100 |
| commit | d5b6a4ea27f8c905e613363aab365066ad6d9cda (patch) | |
| tree | 7cbb6a3a94cb9079800023d0bf06f7bd1b1bc55c /animism-align/cli/app/settings/app_cfg.py | |
| parent | 9893a6e30f8fdbb95fc7066db851579e2a9bfe69 (diff) | |
auth stuff. generate secret and create user from the cli
Diffstat (limited to 'animism-align/cli/app/settings/app_cfg.py')
| -rw-r--r-- | animism-align/cli/app/settings/app_cfg.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/animism-align/cli/app/settings/app_cfg.py b/animism-align/cli/app/settings/app_cfg.py index dfd0154..ceb9e43 100644 --- a/animism-align/cli/app/settings/app_cfg.py +++ b/animism-align/cli/app/settings/app_cfg.py @@ -33,6 +33,7 @@ load_dotenv(dotenv_path=fp_env) CLICK_GROUPS = { 'peaks': 'commands/peaks', 'site': 'commands/site', + 'admin': 'commands/admin', 'db': '', 'flask': '', 'viewer': '', @@ -84,6 +85,19 @@ except Exception as e: pass # ----------------------------------------------------------------------------- +# Le crypto +# ----------------------------------------------------------------------------- + +TOKEN_SECRET = os.getenv("TOKEN_SECRET") or None +if TOKEN_SECRET is None: + import random + raise ValueError("Please set a token secret, e.g. " + hex(random.getrandbits(64 * 8)).replace('0x','')) + +TOKEN_SECRET_BYTES = bytearray() +TOKEN_SECRET_BYTES.extend(map(ord, TOKEN_SECRET)) + + +# ----------------------------------------------------------------------------- # Exports # ----------------------------------------------------------------------------- |
