First Run — Setup CLI

VANTAGE follows the same initialization model as GLPI: the system ships with no default users and refuses to serve authenticated requests until an administrator account exists.

The setup:create-admin command is the only way to initialize a fresh installation.

How it works

When the backend starts, it checks whether any user with role: admin exists in the database:

  • Admin found → normal boot, all endpoints available.

  • No admin found → the system enters uninitialized mode:

    • /health/ready returns HTTP 503 (prevents load-balancers from routing traffic).

    • All authenticated endpoints return HTTP 503 with an instructive message.

    • Public endpoints (/health, /api/auth/login) continue responding normally.

    • The backend emits a log line with the exact command to run.

Running the setup command

Non-interactive mode (CI/CD)

docker compose exec -T backend python bin/console setup:create-admin \
  --name    "Admin"           \
  --username admin            \
  --email   admin@example.com \
  --password "$(cat /run/secrets/admin_pass)" \
  --lang    pt                \
  --no-interaction

Caution

Never pass the password as a literal string in shell history. Use $(cat /run/secrets/file) or a secrets manager.

What happens after setup

  • The admin account is created with an Argon2-hashed password.

  • The system transitions to initialized mode — /health/ready returns 200.

  • The command cannot be run again. If attempted:

    [WARNING] System already initialized. This command cannot be run again.
    

    The process exits with code 1.

Verifying initialization

curl -s http://localhost/health/ready | python -m json.tool

Before setup returns:

{"status": "not_initialized"}

After setup returns:

{"status": "ok"}