Unattended install
A server started by a pipeline or an orchestrator has nobody to read a setup code. Give it three things in its environment and it shows no setup page at all.
| What | How |
|---|---|
| The licence | JOOBQUI_ENROLLMENT_TOKEN (or _FILE) and JOOBQUI_PUBLIC_URL |
| The connections | DATABASE_URL and REDIS_URL (or REDIS_HOST) |
A volume at /data | Where the licence and the generated secrets are kept between starts |
1. Create an enrollment token
On the portal's Deployments & licensing page, an admin of the organization creates an enrollment token (jq_enroll_...). By default it works once and for 24 hours; it can be limited to one address, and allowed up to 10 uses or 7 days. Revoke an unused token on the same page.
2. Start the server with it
docker run -d --name joobqui -p 127.0.0.1:4000:4000 -v joobqui-data:/data \
-v "$PWD/secrets:/run/secrets:ro" \
-e JOOBQUI_ENROLLMENT_TOKEN_FILE=/run/secrets/enrollment_token \
-e JOOBQUI_PUBLIC_URL=https://jobs.example.com \
-e DATABASE_URL_FILE=/run/secrets/database_url \
-e REDIS_URL_FILE=/run/secrets/redis_url \
-e JOOBQUI_SETUP=off \
ghcr.io/azutoolkit/joobqui-selfhosted:vX.Y.ZBefore anything else the server connects itself with the token, saves its licence and its generated secrets in /data, and logs "Connected to JoobQ with the enrollment token". Then it applies the migrations and starts.
- The token is a secret: pass it as a file or a secret, not in a command line or a committed file. It is spent after the first start, so remove it from the deployment afterwards. A server that already has a licence ignores it.
- With
JOOBQUI_SETUP=off, a token that does not work stops the server with one line saying why. Without it, the setup page opens and shows the reason. JOOBQUI_DEPLOYMENT_NAMEis the name the server proposes to the portal.
3. Make the first admin and the SDK token
Nobody has signed in yet. Members of your organization can use Sign in with JoobQ at once. For a local admin and for workers, run the tasks of First sign-in; both can be part of the same pipeline:
docker exec -e JOOBQUI_ACCOUNT_PASSWORD="$ADMIN_PASSWORD" joobqui ./joobqui accounts:create admin@example.com adminThe SDK token can be an environment variable from the start (JOOBQUI_SDK_TOKEN_FILE, at least 32 characters).
Several instances
Instances that share one /data volume connect once: the first takes a lock on the volume and enrols, the others find its licence there. So a single-use token is enough for any number of replicas, as long as they mount the same volume. See Scale the server.
Check it worked
docker exec joobqui ./joobqui license:statusprints the licence as JSON and exits with status 0 when the deployment is eligible. If it does not, see Setup and licence.