# Post-Deploy Scripts Some apps require a management command after first deploy to create an admin account, register a node, or invite the first user. Package these as shell scripts in `scripts/` alongside the kustomize files. ## Registering scripts Register every script in `manifest.yaml` — the web UI shows a button with a parameter form for each one: ```yaml scripts: - name: create-superuser path: scripts/create-superuser.sh description: "Create the initial admin account." params: - name: EMAIL required: true - name: PASSWORD description: Leave blank to generate a random one ``` ## Script conventions Follow `synapse/versions/v1/scripts/create-user.sh` as the reference implementation: - Require `KUBECONFIG`, `WILD_INSTANCE`, and `WILD_API_DATA_DIR`; exit with a clear error if missing - Read `namespace` from `config.yaml` via `yq` — never hardcode it - Auto-generate passwords with `openssl rand` if `PASSWORD` is not supplied - Find the running pod by label — never hardcode a pod name - Print credentials at the end with a "save this — it won't be shown again" warning ## Common commands **Django non-interactive superuser**: ```bash kubectl exec -n -- \ env DJANGO_SUPERUSER_PASSWORD="${PASSWORD}" \ python manage.py createsuperuser --email "${EMAIL}" --noinput ``` **Rails**: ```bash kubectl exec -n -- bundle exec rake db:migrate ``` **Affected apps**: Eventyay, Synapse, Headscale.