7 Apr
2023
7 Apr
'23
12:18 a.m.
On 2023-04-06 14:38:41 -0700 (-0700), Mark Sapiro wrote: [...]
I can't answer that question, but you can set an admin user and password with the django admin createsuperuser command.
And for reference, here's how it's run at setup for the containers:
https://github.com/maxking/docker-mailman/blob/b581310/web/docker-entrypoint...
python3 manage.py createsuperuser --noinput --username \
"$MAILMAN_ADMIN_USER" --email "$MAILMAN_ADMIN_EMAIL"
For a maybe more automate-able example, here's how we call it from outside the container via docker exec on our deployments:
https://opendev.org/opendev/system-config/src/commit/ab0e6e1/playbooks/roles...
docker exec mailman-web bash -c \
"DJANGO_SUPERUSER_PASSWORD={{ mailman3_admin_password }} \
python3 manage.py createsuperuser --no-input --username \
{{ mailman3_admin_user }} --email \
'{{ mailman3_admin_email }}'"
The things in {{}} are Jinja2 templated values we supply through Ansible, you could just replace them with whatever values are appropriate for your deployment.
Jeremy Stanley