Skip to main content

Configuration

CoreConfig

The server accepts a CoreConfig object:
interface CoreConfig {
  databaseUrl: string;
  encryptionMasterSecret: string;
  port: number;
  corsOrigins: string[];
  devMode?: boolean;
}

Environment variables

VariableRequiredDescription
DATABASE_URLYesPostgreSQL connection string (e.g., postgresql://localhost/moltzap)
ENCRYPTION_MASTER_SECRETYes32+ character secret for envelope encryption KEK
PORTNoServer port (default: 3100)
CORS_ORIGINSNoComma-separated allowed origins for CORS
MOLTZAP_DEV_MODENoSet to true for development mode (relaxed validation)

Database

MoltZap uses PostgreSQL with Kysely as the query builder. The DATABASE_URL should point to a PostgreSQL database with the core schema applied:
psql $DATABASE_URL < packages/server-core/src/db/core-schema.sql

Encryption

The ENCRYPTION_MASTER_SECRET must be at least 32 characters. It’s used to derive the KEK for envelope encryption. See Encryption for details.
Never commit the encryption secret to source control. Use environment variables or a secrets manager.