🧱(helm) disable createsuperuser job by setting

This provides the way to disable the admin user creation at each
deployment. In production we don't want to persist a generic admin user:
it should be created once, at first deployment then replaced by
nominative accounts.
This commit is contained in:
Quentin BEY
2025-04-03 10:24:12 +02:00
parent e23d236614
commit 7c569a3ca3
5 changed files with 10 additions and 1 deletions

View File

@@ -10,6 +10,7 @@ and this project adheres to
### Added
- 🧱(helm) disable createsuperuser job by setting #863
- 🔒️(passwords) add validators for production #850
- ✨(domains) allow to re-run check on domain if status is failed
- ✨(organization) add `is_active` field

View File

@@ -1,4 +1,4 @@
apiVersion: v2
type: application
name: desk
version: 0.0.5
version: 0.0.6

View File

@@ -82,6 +82,8 @@
| `backend.extraVolumeMounts` | Additional volumes to mount on the backend. | `[]` |
| `backend.extraVolumes` | Additional volumes to mount on the backend. | `[]` |
| `backend.createsuperuser.command` | The command to create the django super user | `python manage.py createsuperuser --username admin@example.com --password admin` |
| `backend.createsuperuser.enabled` | Whether to create the superuser job | `true` |
| `backend.createsuperuser.restartPolicy` | The restart policy for the job | `Never` |
### frontend

View File

@@ -1,3 +1,4 @@
{{- if .Values.backend.createsuperuser.enabled -}}
{{- $envVars := include "desk.common.env" (list . .Values.backend) -}}
{{- $fullName := include "desk.backend.fullname" . -}}
{{- $component := "backend" -}}
@@ -120,3 +121,4 @@ spec:
emptyDir: {}
{{- end }}
{{- end }}
{{- end -}}

View File

@@ -178,8 +178,12 @@ backend:
extraVolumes: []
## @param backend.createsuperuser.command The command to create the django super user
## @param backend.createsuperuser.enabled Whether to create the superuser job
## @param backend.createsuperuser.restartPolicy The restart policy for the job
createsuperuser:
enabled: true
command: python manage.py createsuperuser --username admin@example.com --password admin
restartPolicy: Never
## @section frontend
frontend: