From a52ce51b6fa9caf9bddbad5399d3c333dc6b2a0b Mon Sep 17 00:00:00 2001 From: ClaraCrazy Date: Mon, 5 Jan 2026 10:45:28 +0100 Subject: [PATCH] [Chore]: Update config --- .env.example | 3 ++- application/config.js | 15 +++------------ 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/.env.example b/.env.example index e36be9b..8ca3429 100644 --- a/.env.example +++ b/.env.example @@ -44,10 +44,11 @@ HTTP_DISPLAY_SORT=2 # Domain display HTTP_HIDE_OTHER=false # true = only show first domain, false = show all HTTP_STATISTICS_ENABLED=false # Enable statistics page at /stats (true/false) HTTP_SHOW_INFO_SECTION=true # Show info section on homepage (true/false) +HTTP_API_ENABLED=true # Enable API endpoints (true/false) # --- USER AUTHENTICATION & INBOX LOCKING --- USER_AUTH_ENABLED=false # Enable user registration/login system (default: false) USER_DATABASE_PATH="./db/data.db" # Path to application database (users, forwarding, locks) -USER_MAX_FORWARD_EMAILS=5 # Maximum verified forwarding emails per user +USER_MAX_FORWARD_EMAILS=3 # Maximum verified forwarding emails per user USER_MAX_LOCKED_INBOXES=5 # Maximum locked inboxes per user LOCK_RELEASE_HOURS=168 # Auto-release locked inboxes after X hours without login (default: 168 = 7 days) diff --git a/application/config.js b/application/config.js index 48dccaf..fafc4b2 100644 --- a/application/config.js +++ b/application/config.js @@ -37,8 +37,7 @@ function parseBool(v) { } const config = { - apiEnabled: parseBool(process.env.API_ENABLED) !== false, // default true - // UX Debug Mode + apiEnabled: parseBool(process.env.HTTP_API_ENABLED) || true, uxDebugMode: parseBool(process.env.UX_DEBUG_MODE) || false, email: { @@ -80,30 +79,22 @@ const config = { }, http: { - // Server settings port: Number(process.env.HTTP_PORT), baseUrl: parseValue(process.env.HTTP_BASE_URL) || 'http://localhost:3000', sessionSecret: parseValue(process.env.HTTP_SESSION_SECRET) || parseValue(process.env.USER_SESSION_SECRET) || 'change-me-in-production', - - // UI Features & Display features: { branding: parseValue(process.env.HTTP_BRANDING), displaySort: Number(process.env.HTTP_DISPLAY_SORT) || 0, hideOther: parseBool(process.env.HTTP_HIDE_OTHER), statistics: parseBool(process.env.HTTP_STATISTICS_ENABLED) || false, - infoSection: parseBool(process.env.HTTP_SHOW_INFO_SECTION) !== false // default true + infoSection: parseBool(process.env.HTTP_SHOW_INFO_SECTION) || true } }, user: { - // Authentication System authEnabled: parseBool(process.env.USER_AUTH_ENABLED) || false, - - // Database databasePath: parseValue(process.env.USER_DATABASE_PATH) || './db/data.db', - - // Feature Limits - maxForwardEmails: Number(process.env.USER_MAX_FORWARD_EMAILS) || 5, + maxForwardEmails: Number(process.env.USER_MAX_FORWARD_EMAILS) || 3, maxLockedInboxes: Number(process.env.USER_MAX_LOCKED_INBOXES) || 5, lockReleaseHours: Number(process.env.LOCK_RELEASE_HOURS) || 168 // 7 days default }