Skip to main content

Configuration Reference

Environment Variables

VariableTypeDefaultRequiredDescription
PORTnumber4100NoHTTP server listen port
HOSTstring127.0.0.1NoHTTP server bind address (self-hosted only)
APP_ORIGINstringNoAdmin dashboard CORS origin(s), comma-separated
API_BASE_URLstringNoCanonical public URL of the Kyqu API for email action links
DATABASE_URLstring""YesPostgreSQL connection string
DATABASE_MAX_CONNECTIONSnumber10NoPostgreSQL pool size
SESSION_TTL_DAYSnumber30NoAdmin session TTL
NODE_ENVstring"development"Nodevelopment or production
SECURE_COOKIESbooleanfalse (dev) / true (prod)NoMark cookies Secure
RATE_LIMIT_WINDOW_MSnumber60000NoRate-limit window (ms)
RATE_LIMIT_MAXnumber120NoMax requests per window
RATE_LIMIT_STOREstring"memory" (dev) / "postgres" (prod)Nomemory or postgres
TRUSTED_PROXYbooleanfalse (dev) / true (prod)NoTrust X-Forwarded-For / X-Forwarded-Proto for client IP and email link base URL
ADMIN_REGISTRATION_OPENbooleantrue (dev) / false (prod)NoAllow new admin signups
EMAIL_DELIVERY_MODEstring"outbox" (dev) / "smtp" (prod)Nosmtp or outbox
EMAIL_FROMstring"Kyqu <noreply@example.com>"NoSender address
SMTP_HOSTstring""If SMTPSMTP server hostname
SMTP_PORTnumber587NoSMTP server port
SMTP_SECUREbooleanfalseNoUse TLS for SMTP
SMTP_USERstring""If SMTP authSMTP username
SMTP_PASSstring""If SMTP authSMTP password
MONITORING_WEBHOOK_URLstring""NoExternal alert webhook URL
ENCRYPTION_KEYstring""Yes64-char hex key for AES-256-GCM at-rest encryption. Generate: openssl rand -hex 32
AUTH_RATE_LIMIT_WINDOW_MSnumber900000 (15 min)NoStricter rate-limit window for credential endpoints
AUTH_RATE_LIMIT_MAXnumber10NoMax requests per auth window

Project Auth Settings

These settings are configurable per project via the admin dashboard or API:

SettingTypeDefaultDescription
authEnabledbooleantrueMaster auth toggle
emailPasswordEnabledbooleantrueEmail/password auth
emailVerificationRequiredbooleanfalseRequire email verification
passwordResetEnabledbooleantruePassword reset flow
magicLinkEnabledbooleanfalseMagic link auth
twoFactorEnabledbooleanfalseTOTP 2FA
allowedOriginsstring[][]CORS origins (empty = unrestricted)
blocklistedDomainsstring[][]Rejected email domains
whitelistedDomainsstring[][]Exclusively allowed email domains
blocklistedUsernamesstring[][]Rejected usernames/emails
sessionTtlDaysnumber30Project user session TTL
passwordMinLengthnumber10Minimum password length
lockoutEnabledbooleantrueAccount lockout on failed attempts
lockoutMaxAttemptsnumber5Failed attempts before lock
lockoutWindowMinutesnumber15Lockout window duration
loginUrlstring""Post-magic-link redirect URL (receives ?session_code=… on browser confirm)
emailVerifiedUrlstring""Post-verification redirect URL
passwordResetUrlstring""Password reset form URL

Rate Limit Route Families

Route FamilyPath PatternRate Limit Bucket
admin-login/api/admin/loginSeparate from other routes
admin-signup/api/admin/signupSeparate from other routes
project-login/api/projects/*/auth/loginSeparate from other routes
project-signup/api/projects/*/auth/signupSeparate from other routes
password-reset/api/projects/*/auth/password-reset/*Separate from other routes
magic-link/api/projects/*/auth/magic-link/*Separate from other routes
apiEverything elseCatch-all bucket

HTTP Response Headers

HeaderValueApplied
Access-Control-Allow-OriginEchoed request origin (never * with credentials)All requests
Access-Control-Allow-CredentialstrueAll requests
Access-Control-Allow-HeadersContent-Type, Authorization, x-kyqu-public-key, x-kyqu-csrf-tokenAll requests
Access-Control-Allow-MethodsGET, POST, PATCH, DELETE, OPTIONSAll requests
X-Content-Type-OptionsnosniffAll requests
Referrer-Policyno-referrerAll requests
X-Frame-OptionsDENYAll requests
Permissions-Policycamera=(), microphone=(), geolocation=()All requests
Cache-Controlno-storeAll requests
Strict-Transport-Securitymax-age=31536000; includeSubDomainsProduction only
RateLimit-LimitMax requests per windowAll requests
RateLimit-RemainingRemaining requestsAll requests
RateLimit-ResetSeconds until resetAll requests
X-Request-IdUUIDAll requests