Gateway configuration
The gateway is a role of the data plane server (runtime/cmd/dataplane). Set ROBOTELOS_DATAPLANE_ROLES to the roles a process runs: gateway serves the conversation protocol, engine advances accepted work, and gateway,engine runs both. Unset means engine alone. A role name that is misspelled, repeated or empty stops the process with exit code 2.
The gateway reads its configuration from the environment at startup and validates all of it before it starts. Problems are reported together, and the process exits with code 2.
| Variable | Default | Meaning |
|---|---|---|
ROBOTELOS_GATEWAY_DATABASE_URL | required | PostgreSQL connection as robotelos_app |
ROBOTELOS_GATEWAY_WORKER_DATABASE_URL | required | PostgreSQL connection as robotelos_worker |
ROBOTELOS_GATEWAY_TOKENS_FILE | required | Path to the bearer-token file (JSON). Tokens must be at least 8 characters |
ROBOTELOS_GATEWAY_HTTP_ADDR | :8787 | SSE, WebSocket, /healthz and /readyz |
ROBOTELOS_GATEWAY_GRPC_ADDR | :8788 | gRPC listener; off disables it |
ROBOTELOS_GATEWAY_ALLOWED_ORIGINS | none | Comma separated origins whose web pages may open a WebSocket, for example app.example.com,*.partner.test. A * matches any characters except a slash, dots included. Empty allows only pages served from the gateway’s own host. A bare * is refused at startup |
ROBOTELOS_GATEWAY_MAX_CONNECTIONS_PER_PRINCIPAL | 20 | Connections one principal may hold at once. The one over the limit is answered with limit_exceeded and closed. off removes the limit |
ROBOTELOS_GATEWAY_MAX_SUBSCRIPTIONS_PER_CONNECTION | 100 | Conversations one connection may follow. Subscribing again to one already followed does not count. off removes the limit |
ROBOTELOS_GATEWAY_COMMAND_RATE | 20 | Commands per second one principal may send over all its connections. Over the limit a command is answered with rate_limited and the wait. off removes the limit |
ROBOTELOS_GATEWAY_COMMAND_BURST | twice the rate | Commands a principal may send at once before the rate applies |
ROBOTELOS_GATEWAY_WORKERS | 8 | Concurrent agent turns per replica |
ROBOTELOS_GATEWAY_TURN_LEASE | 30s | A turn not finished within this time is claimed again |
ROBOTELOS_GATEWAY_MAX_TURN_ATTEMPTS | 3 | After this many attempts the turn ends as failed |
ROBOTELOS_GATEWAY_MAX_CONNS | 20 | Connection pool size per role |
ROBOTELOS_GATEWAY_MOCK_AGENT_DELAY | 0 | Artificial reply delay of the mock agent |
ROBOTELOS_GATEWAY_ALLOW_UNSAFE_DATABASE_ROLE | false | Allows an application role that can bypass row level security. Only for local experiments |
Startup checks
- The application role cannot bypass row level security.
- The schema is at least migration
20261113121000, the newest migration the gateway needs. A database at an older version is refused with the reason.
If either check fails, the gateway exits with the reason.
Token file
{"tokens": {"a-long-random-secret": {"id": "par_alice", "account": "acct_1", "display": "Alice"}}}
Mount the file read-only and keep it out of version control.
Next steps
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.