Add Fastify GET /v1/paperclip/recent-errors returning CRM-compatible JSON (data envelope, project_slug per row, status open for open/investigating incidents). Admin UI proxies the public path /api/error-monitoring/recent-errors to the API base; middleware bypasses the session redirect for that path only. Auth matches CRM env names: ERROR_RESOLVE_API_KEY or ERROR_REPORTING_API_KEY for ?api_key=, DEBUG_VIEW_ERRORS_KEY for ?view_errors=. Paperclip-Agent: David Santos (urlKey david-santos; id 0b1fcf92-5fe3-4ac0-9f29-df4ab72f5376) Paperclip-Issue: BIT-684 Paperclip-Run: cf7cb964-6953-4476-af09-3feb5d10da17 Made-with: Cursor
33 lines
983 B
Bash
33 lines
983 B
Bash
# Copy to .env and fill in values. Never commit .env.
|
|
|
|
# Server
|
|
NODE_ENV=development
|
|
HOST=0.0.0.0
|
|
PORT=3200
|
|
LOG_LEVEL=info
|
|
|
|
# Database
|
|
DATABASE_URL=postgresql://errors:password@localhost:5432/errors_bitreport
|
|
|
|
# JWT — generate with: openssl rand -base64 64
|
|
JWT_SECRET=change_me_in_production_64_bytes_minimum
|
|
|
|
# Cookie signing — generate with: openssl rand -base64 32
|
|
COOKIE_SECRET=change_me_in_production_32_bytes_minimum
|
|
|
|
# Recent-errors for Paperclip (optional — if unset, GET /v1/paperclip/recent-errors returns 503)
|
|
# ERROR_RESOLVE_API_KEY=same_as_CRM_or_shared_hub_secret
|
|
# DEBUG_VIEW_ERRORS_KEY=read_only_alternate_query_param_view_errors
|
|
|
|
# Rate limits (optional — defaults shown)
|
|
# RATE_INGEST_MAX=1000
|
|
# RATE_INGEST_WINDOW_MS=60000
|
|
# RATE_LOGIN_MAX=10
|
|
# RATE_LOGIN_WINDOW_MS=300000
|
|
# RATE_GLOBAL_MAX=500
|
|
# RATE_GLOBAL_WINDOW_MS=60000
|
|
|
|
# Payload limits (optional — defaults shown)
|
|
# INGEST_MAX_BODY_BYTES=524288 # 512 KB
|
|
# ADMIN_MAX_BODY_BYTES=65536 # 64 KB
|