Harden production workflows and agent admission
This commit is contained in:
@@ -30,18 +30,21 @@ UV_PROJECT_ENVIRONMENT=.venv UV_CACHE_DIR=../.cache/uv uv run fastapi dev monlet
|
||||
|
||||
| Var | Default | Purpose |
|
||||
|---|---|---|
|
||||
| `MONLET_AUTH_TOKEN` | required | Shared Bearer token (ADR-0007); `changeme` is rejected |
|
||||
| `MONLET_AUTH_TOKEN` | required | UI/operator Bearer token. Space/comma-separated list; any accepted. `changeme` is rejected. |
|
||||
| `MONLET_DATABASE_URL` | `postgresql+asyncpg://monlet:monlet@127.0.0.1:5432/monlet` | Async DSN |
|
||||
| `MONLET_LOG_LEVEL` | `INFO` | Log level |
|
||||
| `MONLET_BODY_LIMIT_BYTES` | `1048576` | Request body limit (ADR-0005) |
|
||||
| `MONLET_OUTPUT_MAX_BYTES` | `8192` | Per-event output limit |
|
||||
| `MONLET_STALE_AFTER_SEC` | `90` | Stale threshold |
|
||||
| `MONLET_DEAD_AFTER_SEC` | `300` | Dead threshold |
|
||||
| `MONLET_DETECTOR_TICK_SEC` | `15` | Detector tick |
|
||||
| `MONLET_STALE_AFTER_SEC` | `20` | Stale threshold |
|
||||
| `MONLET_DEAD_AFTER_SEC` | `30` | Dead threshold |
|
||||
| `MONLET_DETECTOR_TICK_SEC` | `5` | Detector tick |
|
||||
| `MONLET_ENABLE_DETECTOR` | `true` | Toggle detector task |
|
||||
| `MONLET_EVENTS_RETENTION_MONTHS` | `36` | Months of `events` partitions to keep; `0` disables drop |
|
||||
| `MONLET_EVENTS_FUTURE_PARTITIONS` | `3` | Future month partitions to pre-create |
|
||||
| `MONLET_EVENT_DEDUP_RETENTION_DAYS` | `30` | Idempotency window for `event_id` |
|
||||
| `MONLET_MAX_PENDING_AGENTS` | `10000` | Maximum pending agent keys before heartbeat rejects with 429 |
|
||||
| `MONLET_PENDING_AGENT_TTL_DAYS` | `7` | Pending key cleanup TTL; `0` disables pruning |
|
||||
| `MONLET_PENDING_AGENT_PRUNE_BATCH_SIZE` | `1000` | Pending cleanup rows per detector tick |
|
||||
| `MONLET_PARTITION_MAINTENANCE_INTERVAL_SEC` | `3600` | Partition create/drop worker interval |
|
||||
| `MONLET_OUTBOX_RETENTION_MAX_ROWS` | `50000` | Maximum retained terminal outbox rows; `0` disables pruning |
|
||||
| `MONLET_ENABLE_NOTIFIER_WORKER` | `true` | Toggle outbox worker |
|
||||
@@ -79,4 +82,7 @@ docker build -t monlet-server .
|
||||
|
||||
## Endpoints
|
||||
|
||||
All routes under `/api/v1` (per `api/openapi.yaml`). `/metrics` and `/api/v1/health`, `/api/v1/ready` are open; everything else requires `Authorization: Bearer <token>`.
|
||||
All routes under `/api/v1` (per `api/openapi.yaml`). `/metrics` and `/api/v1/health`, `/api/v1/ready` are open.
|
||||
|
||||
- UI/operator endpoints require `Authorization: Bearer <MONLET_AUTH_TOKEN>`.
|
||||
- Agent ingestion endpoints accept the per-agent key generated and stored by the agent. A new key creates a pending agent; events are ignored until an operator accepts it.
|
||||
|
||||
Reference in New Issue
Block a user