Guide for Administrators¶
This guide is for operators responsible for uptime, access control, and recovery.
Scope¶
Use this page for:
- initial environment setup
- user/role administration
- health checks and incident response
- backup and restore operations
Use Deployment Guide for local deployment flow details.
Assumptions¶
- You can run CLI commands on the service host
- You can access PostgreSQL and Redis
- You have admin credentials for ezrules
Runbook: Initial Setup¶
Action¶
uv run ezrules init-db
uv run ezrules bootstrap-org --name your-org --admin-email admin@example.com --admin-password admin
Verify¶
http://localhost:8888/pingresponds- Admin user can log in to the UI
- Security and Settings pages are visible in sidebar
- SMTP settings are configured if you plan to use invitation/password reset emails:
EZRULES_SMTP_HOST,EZRULES_SMTP_PORT,EZRULES_SMTP_USER,EZRULES_SMTP_PASSWORD,EZRULES_FROM_EMAILEZRULES_APP_BASE_URLpoints to your frontend URL
Rollback / Recovery¶
- If initialization was run with wrong DB settings, fix
EZRULES_DB_ENDPOINTand rerun setup commands - If admin login fails, rerun
bootstrap-orgfor the same organisation or create another admin withadd-user --org-name
Runbook: User and Role Management¶
UI-first workflow¶
- Open Security for user management
- Open Settings for role/permission management
- Use Invite User for standard onboarding (email + optional role)
- Apply least-privilege role assignments
API endpoints¶
GET /api/v2/usersPOST /api/v2/usersPOST /api/v2/users/invitePUT /api/v2/users/{user_id}DELETE /api/v2/users/{user_id}GET /api/v2/rolesPUT /api/v2/roles/{role_id}/permissionsPOST /api/v2/auth/accept-invitePOST /api/v2/auth/forgot-passwordPOST /api/v2/auth/reset-password
Verify¶
- Modified user/role appears in UI
- Target user can perform expected actions and is blocked from restricted actions
- Invitation emails contain links to
/accept-invite?token=... - Password reset emails contain links to
/reset-password?token=...
Runbook: Health Checks¶
Action¶
Verify¶
- API responds successfully
- OpenAPI docs load
- Required infra services are
Up(Postgres, Redis, worker if used)
If Backtests Stay PENDING¶
Likely cause: Celery worker is down.
Then re-check task status via /api/v2/backtesting/task/{task_id}.
Runbook: Audit and Change Tracking¶
Use audit endpoints during incident review or compliance checks:
GET /api/v2/auditGET /api/v2/audit/rulesGET /api/v2/audit/rules/{rule_id}GET /api/v2/audit/configGET /api/v2/audit/user-listsGET /api/v2/audit/outcomesGET /api/v2/audit/labelsGET /api/v2/audit/usersGET /api/v2/audit/rolesGET /api/v2/audit/field-typesGET /api/v2/audit/api-keysGET /api/v2/audit/strict-mode
Operational tips:
- Capture actor (
changed_by) values and timestamps when preparing incident timelines - Watch for
rolled_backrule actions when reconstructing emergency change timelines - Watch for
reorderedrule actions when investigating decision-order changes in first-match mode - Field type changes affect rule evaluation behavior; review
GET /api/v2/audit/field-typeswhen investigating unexpected rule outcomes - Review
GET /api/v2/audit/api-keyswhen tracing API key creation or revocation during an incident
If your organisation uses ordered main-rule execution, see Ordered Rule Execution in ezrules for the operator-facing model, reorder workflow, and audit implications.
Rule rollback in incident response¶
If a recently edited rule needs to be restored quickly:
- Open the rule's History timeline in the UI.
- Select the last known-good revision.
- Trigger Roll back to revision ... to create a new draft version from that historical logic.
- Re-test or shadow validate if time allows.
- Promote the rollback draft if the rule needs to be active again in production.
Rollback preserves every prior revision. It is preferable to manual copy/paste because it records the recovery action explicitly in audit history.
Runbook: Backup and Restore¶
Backup¶
Restore¶
Verify¶
- API starts cleanly after restore
- Recent rules, outcomes, and users are present
- Basic evaluate request succeeds
Safety Notes¶
- Test restores in non-production before production use
- Keep backup retention and encryption policies outside app repo
Security Checklist¶
- Set strong
EZRULES_APP_SECRET - Restrict network access to Postgres and Redis
- Use HTTPS at reverse proxy or load balancer
- Use least-privilege roles for non-admin users
- Review audit history on a fixed cadence
Next Steps¶
- Configuration Guide - environment and runtime config
- Architecture Overview - system boundaries and design decisions
- Troubleshooting - symptom-based diagnostics