forked from coop-cloud/authentik
Merge pull request 'Fix race condition when setting admin password with POST_DEPLOY_CMDS' (#13) from virtualboys/authentik:main into main
Reviewed-on: coop-cloud/authentik#13 Reviewed-by: decentral1se <decentral1se@noreply.git.coopcloud.tech> Reviewed-by: ammaratef45 <ammaratef45@proton.me>
This commit is contained in:
commit
ac7192e6ab
10
abra.sh
10
abra.sh
@ -88,6 +88,16 @@ set_admin_pass() {
|
|||||||
password=$(cat /run/secrets/admin_pass)
|
password=$(cat /run/secrets/admin_pass)
|
||||||
token=$(cat /run/secrets/admin_token)
|
token=$(cat /run/secrets/admin_token)
|
||||||
/manage.py shell -c """
|
/manage.py shell -c """
|
||||||
|
import time
|
||||||
|
i = 0
|
||||||
|
while (not User.objects.filter(username='akadmin')):
|
||||||
|
print('Waiting for akadmin to be created...')
|
||||||
|
time.sleep(10)
|
||||||
|
i += 1
|
||||||
|
if i > 6:
|
||||||
|
print('Failed to find admin user!')
|
||||||
|
exit()
|
||||||
|
|
||||||
akadmin = User.objects.get(username='akadmin')
|
akadmin = User.objects.get(username='akadmin')
|
||||||
akadmin.set_password('$password')
|
akadmin.set_password('$password')
|
||||||
akadmin.save()
|
akadmin.save()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user