forked from coop-cloud/authentik
Fix race condition when setting admin password with POST_DEPLOY_CMDS
This commit is contained in:
parent
7a2c45137f
commit
d6bd030880
10
abra.sh
10
abra.sh
@ -88,6 +88,16 @@ set_admin_pass() {
|
||||
password=$(cat /run/secrets/admin_pass)
|
||||
token=$(cat /run/secrets/admin_token)
|
||||
/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.set_password('$password')
|
||||
akadmin.save()
|
||||
|
Loading…
x
Reference in New Issue
Block a user