Merge pull request 'Fix race condition when setting admin password with POST_DEPLOY_CMDS' (#13) from virtualboys/authentik:main into main
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #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)
|
||||
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