lib: load json strings in config env variables

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer 2021-11-14 12:28:46 +01:00
parent 97b814ab33
commit cab564152d
3 changed files with 21 additions and 2 deletions

View file

@ -3,7 +3,8 @@ import os
from collections.abc import Mapping
from contextlib import contextmanager
from glob import glob
from json import dumps
from json import dumps, loads
from json.decoder import JSONDecodeError
from time import time
from typing import Any
from urllib.parse import urlparse
@ -123,6 +124,11 @@ class ConfigLoader:
if dot_part not in current_obj:
current_obj[dot_part] = {}
current_obj = current_obj[dot_part]
# Check if the value is json, and try to load it
try:
value = loads(value)
except JSONDecodeError:
pass
current_obj[dot_parts[-1]] = value
idx += 1
if idx > 0:

View file

@ -72,7 +72,6 @@ disable_startup_analytics: false
avatars: env://AUTHENTIK_AUTHENTIK__AVATARS?gravatar
geoip: "./GeoLite2-City.mmdb"
# Can't currently be configured via environment variables, only yaml
footer_links:
- name: Documentation
href: https://goauthentik.io/docs/?utm_source=authentik

View file

@ -165,6 +165,20 @@ Requires authentik 2021.10.5
Enable the ability for users to change their Usernames, defaults to `true`.
### AUTHENTIK_FOOTER_LINKS
:::info
Requires authentik 2021.10.5
:::
This option configures the footer links on the flow executor pages.
The setting can be used as follows:
```
AUTHENTIK_FOOTER_LINKS='[{"name": "Link Name","href":"https://goauthentik.io"}]'
```
## Debugging
To check if your config has been applied correctly, you can run the following command to output the full config: