@@ -30,6 +30,9 @@ SECRET_KEY=replace_me_with_a_random_string
3030# Auth type: LOCAL (email/password) or GOOGLE (OAuth)
3131AUTH_TYPE = LOCAL
3232
33+ # Deployment mode: self-hosted enables local filesystem connectors; cloud hides them.
34+ DEPLOYMENT_MODE = self-hosted
35+
3336# Allow new user registrations (TRUE or FALSE)
3437# REGISTRATION_ENABLED=TRUE
3538
@@ -43,51 +46,47 @@ ETL_SERVICE=DOCLING
4346EMBEDDING_MODEL = sentence-transformers/all-MiniLM-L6-v2
4447
4548# ------------------------------------------------------------------------------
46- # Ports (change to avoid conflicts with other services on your machine)
49+ # How You Access SurfSense
4750# ------------------------------------------------------------------------------
51+ # One public URL. Browser traffic stays same-origin and Caddy routes internally.
52+ SURFSENSE_PUBLIC_URL = http://localhost:3929
4853
49- # BACKEND_PORT=8929
50- # FRONTEND_PORT=3929
51- # ZERO_CACHE_PORT=5929
52- # SEARXNG_PORT=8888
53- # FLOWER_PORT=5555
54-
55- # ==============================================================================
56- # DEV COMPOSE ONLY (docker-compose.dev.yml)
57- # You only need them only if you are running `docker-compose.dev.yml`.
58- # ==============================================================================
59-
60- # -- pgAdmin (database GUI) --
61- # PGADMIN_PORT=5050
62- # PGADMIN_DEFAULT_EMAIL=admin@surfsense.com
63- # PGADMIN_DEFAULT_PASSWORD=surfsense
64-
65- # -- Redis exposed port (dev only; Redis is internal-only in prod) --
66- # REDIS_PORT=6379
67-
68- # -- WhatsApp bridge exposed port (dev/hybrid only; prod keeps it Docker-internal) --
69- # WHATSAPP_BRIDGE_PORT=9929
54+ # ------------------------------------------------------------------------------
55+ # Public Ports
56+ # ------------------------------------------------------------------------------
57+ # Production Docker exposes only Caddy to your machine. Caddy then routes
58+ # frontend, backend, and zero-cache traffic internally.
59+ #
60+ # Local default: LISTEN_HTTP_PORT=3929
61+ # Domain default: LISTEN_HTTP_PORT=80 and LISTEN_HTTPS_PORT=443
62+ LISTEN_HTTP_PORT = 3929
63+ LISTEN_HTTPS_PORT = 443
7064
71- # -- Frontend Build Args --
72- # In dev, the frontend is built from source and these are passed as build args.
73- # In prod, they are automatically derived from AUTH_TYPE, ETL_SERVICE, and the port settings above.
74- # NEXT_PUBLIC_FASTAPI_BACKEND_AUTH_TYPE=LOCAL
75- # NEXT_PUBLIC_ETL_SERVICE=DOCLING
76- # NEXT_PUBLIC_DEPLOYMENT_MODE=self-hosted
65+ # ------------------------------------------------------------------------------
66+ # Custom Domain / HTTPS
67+ # ------------------------------------------------------------------------------
68+ # Leave SURFSENSE_SITE_ADDRESS as :80 for local HTTP.
69+ # Set it to your domain to enable automatic HTTPS:
70+ # SURFSENSE_SITE_ADDRESS=surf.example.com
71+ # CERT_EMAIL=you@example.com
72+ SURFSENSE_SITE_ADDRESS = :80
73+ CERT_EMAIL =
7774
7875# ------------------------------------------------------------------------------
79- # Custom Domain / Reverse Proxy
76+ # Advanced Reverse Proxy Settings
8077# ------------------------------------------------------------------------------
81- # ONLY set these if you are serving SurfSense on a real domain via a reverse
82- # proxy (e.g. Caddy, Nginx, Cloudflare Tunnel).
83- # For standard localhost deployments, leave all of these commented out.
84- # they are automatically derived from the port settings above.
78+ # Usually do not change these. They are for custom certificate setup, CDNs/load
79+ # balancers, trusted proxy IPs, or changing upload limits.
80+ #
81+ # CERT_ACME_CA=https://acme-v02.api.letsencrypt.org/directory
82+ # CERT_ACME_DNS=
83+ # If a CDN/load balancer sits in front of Caddy, narrow this to that proxy's CIDRs.
84+ # TRUSTED_PROXIES=0.0.0.0/0
85+ # SURFSENSE_MAX_BODY_SIZE=5GB
8586#
86- # NEXT_FRONTEND_URL=https://app.yourdomain.com
87- # BACKEND_URL=https://api.yourdomain.com
88- # NEXT_PUBLIC_FASTAPI_BACKEND_URL=https://api.yourdomain.com
89- # NEXT_PUBLIC_ZERO_CACHE_URL=https://zero.yourdomain.com
90- # FASTAPI_BACKEND_INTERNAL_URL=http://backend:8000
87+ # Browser API and Zero URLs are same-origin relative behind bundled Caddy.
88+ # Next.js server-side calls use Docker DNS through SURFSENSE_BACKEND_INTERNAL_URL
89+ # set internally by docker-compose.yml. Usually do not override it.
9190
9291# ------------------------------------------------------------------------------
9392# Zero-cache (real-time sync)
@@ -108,10 +107,9 @@ EMBEDDING_MODEL=sentence-transformers/all-MiniLM-L6-v2
108107
109108# Sync worker tuning. zero-cache defaults ZERO_NUM_SYNC_WORKERS to the number
110109# of CPU cores, which can exceed the connection pool limits on high-core machines.
111- # Each sync worker needs at least 1 connection from both the UPSTREAM and CVR
112- # pools, so these constraints must hold:
113- # ZERO_UPSTREAM_MAX_CONNS >= ZERO_NUM_SYNC_WORKERS
114- # ZERO_CVR_MAX_CONNS >= ZERO_NUM_SYNC_WORKERS
110+ # Each sync worker needs at least 1 connection from both the UPSTREAM and CVR pools.
111+ # Keep ZERO_UPSTREAM_MAX_CONNS and ZERO_CVR_MAX_CONNS greater than or equal to
112+ # ZERO_NUM_SYNC_WORKERS.
115113# Default of 4 workers is sufficient for self-hosted / personal use.
116114# ZERO_NUM_SYNC_WORKERS=4
117115# ZERO_UPSTREAM_MAX_CONNS=20
@@ -125,16 +123,16 @@ EMBEDDING_MODEL=sentence-transformers/all-MiniLM-L6-v2
125123
126124# ZERO_QUERY_URL: where zero-cache forwards query requests for resolution.
127125# ZERO_MUTATE_URL: required by zero-cache when auth tokens are used, even though
128- # SurfSense does not use Zero mutators. Setting both URLs tells zero-cache to
129- # skip its own JWT verification and let the app endpoints handle auth instead.
130- # The mutate endpoint is a no-op that returns an empty response.
126+ # SurfSense does not use Zero mutators. Setting both URLs tells zero-cache to
127+ # skip its own JWT verification and let the app endpoints handle auth instead.
128+ # The mutate endpoint is a no-op that returns an empty response.
131129# Default: Docker service networking (http://frontend:3000/api/zero/...).
132130# Override when running the frontend outside Docker:
133- # ZERO_QUERY_URL=http://host.docker.internal:3000/api/zero/query
134- # ZERO_MUTATE_URL=http://host.docker.internal:3000/api/zero/mutate
135- # Override for custom domain:
136- # ZERO_QUERY_URL=https://app.yourdomain .com/api/zero/query
137- # ZERO_MUTATE_URL=https://app.yourdomain .com/api/zero/mutate
131+ # ZERO_QUERY_URL=http://host.docker.internal:3000/api/zero/query
132+ # ZERO_MUTATE_URL=http://host.docker.internal:3000/api/zero/mutate
133+ # Override for custom domain only when zero-cache is not in the bundled Docker network :
134+ # ZERO_QUERY_URL=https://surf.example .com/api/zero/query
135+ # ZERO_MUTATE_URL=https://surf.example .com/api/zero/mutate
138136# ZERO_QUERY_URL=http://frontend:3000/api/zero/query
139137# ZERO_MUTATE_URL=http://frontend:3000/api/zero/mutate
140138
@@ -222,73 +220,74 @@ STT_SERVICE=local/base
222220# ------------------------------------------------------------------------------
223221
224222# -- Google Connectors --
225- # GOOGLE_CALENDAR_REDIRECT_URI=http://localhost:8000 /api/v1/auth/google/calendar/connector/callback
226- # GOOGLE_GMAIL_REDIRECT_URI=http://localhost:8000 /api/v1/auth/google/gmail/connector/callback
227- # GOOGLE_DRIVE_REDIRECT_URI=http://localhost:8000 /api/v1/auth/google/drive/connector/callback
223+ # GOOGLE_CALENDAR_REDIRECT_URI=http://localhost:3929 /api/v1/auth/google/calendar/connector/callback
224+ # GOOGLE_GMAIL_REDIRECT_URI=http://localhost:3929 /api/v1/auth/google/gmail/connector/callback
225+ # GOOGLE_DRIVE_REDIRECT_URI=http://localhost:3929 /api/v1/auth/google/drive/connector/callback
228226
229227# -- Notion --
230228# NOTION_CLIENT_ID=
231229# NOTION_CLIENT_SECRET=
232- # NOTION_REDIRECT_URI=http://localhost:8000 /api/v1/auth/notion/connector/callback
230+ # NOTION_REDIRECT_URI=http://localhost:3929 /api/v1/auth/notion/connector/callback
233231
234232# -- Slack --
235233# SLACK_CLIENT_ID=
236234# SLACK_CLIENT_SECRET=
237- # SLACK_REDIRECT_URI=http://localhost:8000 /api/v1/auth/slack/connector/callback
235+ # SLACK_REDIRECT_URI=http://localhost:3929 /api/v1/auth/slack/connector/callback
238236
239237# -- Discord --
240238# DISCORD_CLIENT_ID=
241239# DISCORD_CLIENT_SECRET=
242- # DISCORD_REDIRECT_URI=http://localhost:8000 /api/v1/auth/discord/connector/callback
240+ # DISCORD_REDIRECT_URI=http://localhost:3929 /api/v1/auth/discord/connector/callback
243241# DISCORD_BOT_TOKEN=
244242
245243# -- Atlassian (Jira & Confluence) --
246244# ATLASSIAN_CLIENT_ID=
247245# ATLASSIAN_CLIENT_SECRET=
248- # JIRA_REDIRECT_URI=http://localhost:8000 /api/v1/auth/jira/connector/callback
249- # CONFLUENCE_REDIRECT_URI=http://localhost:8000 /api/v1/auth/confluence/connector/callback
246+ # JIRA_REDIRECT_URI=http://localhost:3929 /api/v1/auth/jira/connector/callback
247+ # CONFLUENCE_REDIRECT_URI=http://localhost:3929 /api/v1/auth/confluence/connector/callback
250248
251249# -- Linear --
252250# LINEAR_CLIENT_ID=
253251# LINEAR_CLIENT_SECRET=
254- # LINEAR_REDIRECT_URI=http://localhost:8000 /api/v1/auth/linear/connector/callback
252+ # LINEAR_REDIRECT_URI=http://localhost:3929 /api/v1/auth/linear/connector/callback
255253
256254# -- ClickUp --
257255# CLICKUP_CLIENT_ID=
258256# CLICKUP_CLIENT_SECRET=
259- # CLICKUP_REDIRECT_URI=http://localhost:8000 /api/v1/auth/clickup/connector/callback
257+ # CLICKUP_REDIRECT_URI=http://localhost:3929 /api/v1/auth/clickup/connector/callback
260258
261259# -- Airtable --
262260# AIRTABLE_CLIENT_ID=
263261# AIRTABLE_CLIENT_SECRET=
264- # AIRTABLE_REDIRECT_URI=http://localhost:8000 /api/v1/auth/airtable/connector/callback
262+ # AIRTABLE_REDIRECT_URI=http://localhost:3929 /api/v1/auth/airtable/connector/callback
265263
266264# -- Microsoft OAuth (Teams & OneDrive) --
267265# MICROSOFT_CLIENT_ID=
268266# MICROSOFT_CLIENT_SECRET=
269- # TEAMS_REDIRECT_URI=http://localhost:8000 /api/v1/auth/teams/connector/callback
270- # ONEDRIVE_REDIRECT_URI=http://localhost:8000 /api/v1/auth/onedrive/connector/callback
267+ # TEAMS_REDIRECT_URI=http://localhost:3929 /api/v1/auth/teams/connector/callback
268+ # ONEDRIVE_REDIRECT_URI=http://localhost:3929 /api/v1/auth/onedrive/connector/callback
271269
272270# -- Dropbox --
273271# DROPBOX_APP_KEY=
274272# DROPBOX_APP_SECRET=
275- # DROPBOX_REDIRECT_URI=http://localhost:8000 /api/v1/auth/dropbox/connector/callback
273+ # DROPBOX_REDIRECT_URI=http://localhost:3929 /api/v1/auth/dropbox/connector/callback
276274
277275# -- Composio --
278276# COMPOSIO_API_KEY=
279277# COMPOSIO_ENABLED=TRUE
280- # COMPOSIO_REDIRECT_URI=http://localhost:8000 /api/v1/auth/composio/connector/callback
278+ # COMPOSIO_REDIRECT_URI=http://localhost:3929 /api/v1/auth/composio/connector/callback
281279
282280# ------------------------------------------------------------------------------
283281# Messaging Channels (optional)
284282# ------------------------------------------------------------------------------
285283# Configure only the external chat channels you want to use.
284+ # GATEWAY_ENABLED=TRUE
286285
287286# -- Telegram --
288287# TELEGRAM_SHARED_BOT_TOKEN=
289288# TELEGRAM_SHARED_BOT_USERNAME=
290289# TELEGRAM_WEBHOOK_SECRET=
291- # GATEWAY_BASE_URL=http://localhost:8929
290+ # GATEWAY_BASE_URL=http://localhost:3929
292291# GATEWAY_TELEGRAM_INTAKE_MODE=webhook
293292
294293# -- WhatsApp --
@@ -307,20 +306,20 @@ STT_SERVICE=local/base
307306#
308307# GATEWAY_SLACK_ENABLED=FALSE
309308# GATEWAY_SLACK_SIGNING_SECRET=
310- # GATEWAY_SLACK_REDIRECT_URI=http://localhost:8929 /api/v1/gateway/slack/callback
309+ # GATEWAY_SLACK_REDIRECT_URI=http://localhost:3929 /api/v1/gateway/slack/callback
311310
312311# -- Discord --
313312# Uses DISCORD_CLIENT_ID, DISCORD_CLIENT_SECRET, and DISCORD_BOT_TOKEN from the
314313# Discord connector section.
315314#
316315# GATEWAY_DISCORD_ENABLED=FALSE
317- # GATEWAY_DISCORD_REDIRECT_URI=http://localhost:8929 /api/v1/gateway/discord/callback
316+ # GATEWAY_DISCORD_REDIRECT_URI=http://localhost:3929 /api/v1/gateway/discord/callback
318317
319318# ------------------------------------------------------------------------------
320319# SearXNG (bundled web search, works out of the box with no config needed)
321320# ------------------------------------------------------------------------------
322321# SearXNG provides web search to all search spaces automatically.
323- # To access the SearXNG UI directly: http://localhost:8888
322+ # To access the SearXNG UI directly in dev/deps-only compose : http://localhost:8888
324323# To disable the service entirely: docker compose up --scale searxng=0
325324# To point at your own SearXNG instance instead of the bundled one:
326325# SEARXNG_DEFAULT_HOST=http://your-searxng:8080
@@ -457,3 +456,36 @@ NOLOGIN_MODE_ENABLED=FALSE
457456# RESIDENTIAL_PROXY_HOSTNAME=
458457# RESIDENTIAL_PROXY_LOCATION=
459458# RESIDENTIAL_PROXY_TYPE=1
459+
460+ # ==============================================================================
461+ # DEV / DEPS-ONLY COMPOSE OVERRIDES
462+ # These are only needed for docker-compose.dev.yml or docker-compose.deps-only.yml.
463+ # Production Docker exposes Caddy only; raw app ports below do not affect
464+ # docker-compose.yml.
465+ # ==============================================================================
466+
467+ # -- pgAdmin (database GUI, dev/deps-only only) --
468+ # PGADMIN_PORT=5050
469+ # PGADMIN_DEFAULT_EMAIL=admin@surfsense.com
470+ # PGADMIN_DEFAULT_PASSWORD=surfsense
471+
472+ # -- Redis exposed port (dev/deps-only only; Redis is internal-only in prod) --
473+ # REDIS_PORT=6379
474+
475+ # -- SearXNG exposed port (dev/deps-only only; internal-only in prod) --
476+ # SEARXNG_PORT=8888
477+
478+ # -- WhatsApp bridge exposed port (dev/hybrid only; prod keeps it Docker-internal) --
479+ # WHATSAPP_BRIDGE_PORT=9929
480+
481+ # -- Raw app ports (dev/deps-only only; prod exposes Caddy instead) --
482+ # BACKEND_PORT=8000
483+ # FRONTEND_PORT=3000
484+ # ZERO_CACHE_PORT=4848
485+
486+ # -- Frontend runtime flags (prod and dev compose) --
487+ # The frontend reads these at request time in Docker; no NEXT_PUBLIC_* rebuild
488+ # or startup substitution is required.
489+ # AUTH_TYPE=LOCAL
490+ # ETL_SERVICE=DOCLING
491+ # DEPLOYMENT_MODE=self-hosted
0 commit comments