Skip to content

Configuration ​

v1 preview

The complete repository and supported production Compose release are not public during beta. This reference describes the intended v1 configuration surface and may change before release. It is not a current deployment guide.

The planned self-hosted release uses environment variables for application, database, cache, search, AI, mail, and administration settings. Final required values, defaults, secret handling, and service versions will be published with v1.

Compose File ​

The planned compose.prod.yml file defines the service topology and reads its configuration from environment variables or a Docker secrets workflow. The public v1 release will identify which values are required and provide the supported startup procedure.

Environment Variables ​

Application ​

VariableDescriptionRequiredDefault
APP_URLPublic URL of the applicationYes—
WS_URLPublic WebSocket URL. Set this when the WebSocket server runs on a different host or port than the appNoSame as APP_URL
PORTApplication portNo3000
SESSION_SECRETExpress session secretYes—
JWT_SECRETJWT signing secretYes—
NODE_ENVEnvironment modeNoproduction
SERVER_MODERun mode: omit for full app, ws for WebSocket-only, scheduler for background jobsNo—
SOCKET_IO_ADAPTERSocket.IO cluster transport: mongodb or memoryNomongodb
SOCKET_IO_MONGO_URLOptional MongoDB connection override for the MongoDB adapterNoMONGO_URI

The MongoDB Socket.IO adapter stores events in the socketio collection and uses change streams, so it requires a MongoDB replica set or sharded cluster.

Database ​

VariableDescriptionRequiredDefault
MONGO_URIMongoDB connection stringNomongodb://mongo:27017/managani

Managani requires a MongoDB replica set. Connections use the driver-default read preference with majority read and write concerns. Each model sets its read preference with the Mongoose schema read option, and most models use secondaryPreferred. Transactions read from the primary.

Cache ​

VariableDescriptionRequiredDefault
MEMCACHED_SERVERSComma-separated Memcached endpointsNomemcached:11211 in Docker Compose

Search (Typesense) ​

VariableDescriptionRequiredDefault
TYPESENSE_HOSTTypesense server hostNotypesense
TYPESENSE_PORTTypesense server portNo8108
TYPESENSE_PROTOCOLProtocol (http or https)Nohttp
TYPESENSE_API_KEYTypesense API keyYes—
TYPESENSE_NODESMulti-node cluster config as JSON. Example: [{"host":"ts1","port":8108,"protocol":"http"},{"host":"ts2","port":8108,"protocol":"http"}]No—
TYPESENSE_COLLECTION_PREFIXPrefix added to all collection names (mg_urls_<id>), so multiple products can share one Typesense cluster. Set to an empty string to keep unprefixed names on a dedicated cluster.Nomg

When TYPESENSE_NODES is set, the individual host/port/protocol variables are ignored and the cluster config is used instead.

AI / LLM ​

Managani uses plan-aware model tiers for AI tasks:

VariableDescriptionRequiredDefault
LLM_BASIC_MODELLower-cost model for basic plans, parsing, classification, and internal analysisNogpt-6-luna
LLM_BASIC_MODEL_PROVIDERProvider for the basic model: google or openaiNoopenai
LLM_TOP_MODELTop model for Pro/customer-facing replies and generated contentNogpt-6-sol
LLM_TOP_MODEL_PROVIDERProvider for the top model: google or openaiNoopenai
CHAT_AI_MODELLegacy alias for LLM_TOP_MODEL when LLM_TOP_MODEL is unsetNogpt-6-sol
CHAT_AI_MODEL_PROVIDERLegacy alias for LLM_TOP_MODEL_PROVIDER when LLM_TOP_MODEL_PROVIDER is unsetNoopenai
SOCIAL_REPLY_LLM_MODELModel used for review-only Reddit and Quora reply draftsNogpt-6-sol
SOCIAL_REPLY_LLM_PROVIDERProvider used for review-only Reddit and Quora reply draftsNoopenai
NL_SEARCH_MODELOptional override for intent classificationNogpt-6-luna
NL_SEARCH_MODEL_PROVIDEROptional provider override for intent classificationNoopenai
TS_CONVERSATION_MODELOptional override for Typesense conversation searchNogpt-6-luna
TS_CONVERSATION_MODEL_PROVIDEROptional provider override for Typesense conversation searchNoopenai
GOOGLE_API_KEYGoogle AI API key (required when using Google models)Conditional—
OPENAI_API_KEYOpenAI API key (required when using OpenAI models)Conditional—
WIDGET_CHAT_EMAIL_FALLBACK_ENABLEDGlobal emergency switch for unread chat fallback emailNotrue
WIDGET_CHAT_EMAIL_FALLBACK_CRONScheduler cadence for due fallback emailNo* * * * *
WIDGET_CHAT_EMAIL_FALLBACK_DELAY_MINUTESUnread delay reset after each team or AI replyNo3
WIDGET_CHAT_EMAIL_FALLBACK_MAX_PER_RUNMaximum fallback deliveries claimed per scheduler runNo50

At least one API key is required for AI chat to function. Hosted Free and Starter tenants are downgraded to the basic model for top-tier requests; hosted Pro tenants use the top model.

Inbound Email Webhooks ​

Set EMAIL_FORWARD_DOMAIN to the domain used for incoming replies.

/import/email accepts forwarded replies without a webhook signing key. It checks the conversation and sender before storing a reply. Valid handled deliveries return HTTP 200, including duplicate and unmatched messages. Responses contain acknowledgment fields, without stored email or chat content. Replies cannot write to accounts being deleted. Message creation and conversation updates commit together, so a failed database write can be retried without leaving a partial reply. The same email can reach separate conversations; repeated delivery to the same conversation is stored once.

Email (SMTP) ​

VariableDescriptionRequiredDefault
SMTP_HOSTSMTP server hostYes—
SMTP_PORTSMTP server portNo587
SMTP_USERSMTP usernameYes—
SMTP_PASSSMTP passwordYes—
SMTP_FROMSender email addressYes—

Admin ​

VariableDescriptionRequiredDefault
SYSADMIN_EMAILSystem admin email. If set, a sysadmin account is provisioned on startupNo—
SYSADMIN_PASSWORDSystem admin passwordNo—

Analytics (OpenPanel) ​

VariableDescriptionRequiredDefault
ENABLE_OPENPANELEnable OpenPanel analyticsNofalse
OPENPANEL_CLIENT_IDOpenPanel client IDNo—
OPENPANEL_CLIENT_SECRETOpenPanel client secretNo—
OPENPANEL_API_URLOpenPanel API URLNo—

Reverse Proxy ​

The planned production deployment will sit behind a reverse proxy such as nginx or Caddy. The final v1 guide will require operators to:

  1. Set APP_URL to your public domain
  2. Proxy WebSocket connections to port 3001
  3. Proxy MCP connections to port 3002
  4. Set X-Forwarded-For and X-Forwarded-Proto headers

The app and MCP server share config.trustedProxies. Express uses this list to accept the forwarded protocol from a trusted socket peer and to find the first untrusted client address from the right of X-Forwarded-For. A browser session mutation must still send an Origin that matches the request's protocol and host. An untrusted socket cannot select HTTPS by sending X-Forwarded-Proto.

The hosted Swarm configuration uses the external hmnet16 network without defining its subnet. The trust list therefore includes only the production peers 30.0.9.70/32 and 30.0.9.71/32 observed in ClickStack on October 27, 2026, alongside the existing local and Cloudflare ranges. IPv4-mapped IPv6 forms of these peers are also covered. Reverify these addresses after proxy rescheduling; a new peer can cause same-origin HTTPS mutations to return 403 untrusted_origin. Do not expand trust to all of 30.0.0.0/8 without verified network boundaries.

Example nginx configuration:

nginx
server {
    listen 443 ssl;
    server_name your-instance.com;

    location / {
        proxy_pass http://localhost:3000;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
    }

    location /ws {
        proxy_pass http://localhost:3001;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
    }

    location /mcp {
        proxy_pass http://localhost:3002;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
    }
}