core: add command to output full config

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer 2021-11-07 21:39:25 +01:00
parent c6cc1b1728
commit 61b5b36192
5 changed files with 26 additions and 1 deletions

View file

View file

@ -0,0 +1,15 @@
"""Output full config"""
from json import dumps
from django.core.management.base import BaseCommand, no_translations
from authentik.lib.config import CONFIG
class Command(BaseCommand): # pragma: no cover
"""Output full config"""
@no_translations
def handle(self, *args, **options):
"""Check permissions for all apps"""
print(dumps(CONFIG.raw, indent=4))

View file

@ -152,3 +152,13 @@ Configure how authentik should show avatars for users. Following values can be s
- `%(username)s`: The user's username - `%(username)s`: The user's username
- `%(mail_hash)s`: The email address, md5 hashed - `%(mail_hash)s`: The email address, md5 hashed
- `%(upn)s`: The user's UPN, if set (otherwise an empty string) - `%(upn)s`: The user's UPN, if set (otherwise an empty string)
## Debugging
To check if your config has been applied correctly, you can run the following command to output the full config:
```
docker-compose run --rm worker dump_config
# Or for kubernetes
kubectl exec -it deployment/authentik-worker -c authentik -- ak dump_config
```

View file

@ -17,7 +17,7 @@ docker-compose run --rm server create_recovery_key 10 akadmin
or, for Kubernetes, run or, for Kubernetes, run
``` ```
kubectl exec -it deployment/authentik-web -c authentik -- ak create_recovery_key 10 akadmin kubectl exec -it deployment/authentik-worker -c authentik -- ak create_recovery_key 10 akadmin
``` ```
This will output a link, that can be used to instantly gain access to authentik as the user specified above. The link is valid for amount of years specified above, in this case, 10 years. This will output a link, that can be used to instantly gain access to authentik as the user specified above. The link is valid for amount of years specified above, in this case, 10 years.