Skip to content

Configuration

Plystra Core is configured through environment variables. In production, cmd/plystrad validates safety-critical settings before opening the database.

VariableDefaultDescription
SERVER_HOST / PLYSTRA_SERVER_HOSTemptyOptional bind host. Empty binds all interfaces.
SERVER_PORT / PLYSTRA_SERVER_PORT8080HTTP port.
SERVER_MODE / PLYSTRA_ENVdevelopmentSet to production for production guards.
SERVER_PUBLIC_URL / PLYSTRA_SERVER_PUBLIC_URLlocal development URL in .env.examplePublic URL. Required and non-localhost in production.
PLYSTRA_CORE_VERSION / CORE_VERSION1.0.0-devReported by the version endpoint.
VariableDefaultDescription
DATABASE_URLdevelopment PostgreSQL URLPrimary database URL.
PLYSTRA_DATABASE_URLnoneCompatibility alias used by tests and tools.
DOCKER_DATABASE_URLCompose PostgreSQL URLUsed by docker-compose.yml for the Core container.

Production rejects the default plystra:plystra credentials.

VariableDefaultDescription
PLYSTRA_ADMIN_TOKEN / ADMIN_TOKENdevelopment placeholderBootstrap token for non-public Core API routes. Must be at least 32 characters in production.
PLYSTRA_SESSION_SECRET / SESSION_SECRETdevelopment placeholderPreferred secret for HMAC hashing stored opaque bearer tokens.
JWT_SECRET / PLYSTRA_JWT_SECRETcompatibility placeholderCompatibility alias for the session secret. Core v1.0 does not issue JWT claims.
TRUSTED_PROXIESemptyEnables trusted forwarded IP parsing for known proxies.

Do not use the placeholder values from .env.example in production.

VariableDefaultDescription
CORS_ALLOWED_ORIGINSlocalhost list in .env.example, * Compose fallbackComma-separated allowed origins. Production rejects empty or wildcard values.
REQUEST_ID_HEADERX-Request-IDRequest ID header name.

HTTP authorization checks ignore body-provided ip, user_agent, and canonical request_id. The server derives those values from the request and middleware.

VariableDefaultDescription
AUDIT_WRITE_MODEalwaysStore write mode for authz audit decisions.
TRACE_VERSION1.0Trace version for decision snapshots.

AuditLog is append-only. Production deployments should define retention and export policies.

VariableDefaultDescription
DATA_CONSOLE_ENABLEDfalseEnables /api/v1/data/* preview routes when explicitly set.
METRICS_ENABLEDfalseEnables /metrics when explicitly set.
METRICS_TOKEN / PLYSTRA_METRICS_TOKENemptyToken for /metrics. If omitted, admin token is accepted when metrics are enabled.

Disabled feature routes return FEATURE_DISABLED.

With SERVER_MODE=production, Core refuses to start if:

  • database URL is missing or uses default development credentials.
  • session secret is missing, too short, or a placeholder.
  • admin token is missing, too short, or a placeholder.
  • CORS origins are missing or include *.
  • public URL is missing or points to localhost.