2026-04-20 21:35:15 +08:00
|
|
|
# Server
|
2026-03-23 16:38:27 +08:00
|
|
|
PORT=1349
|
2026-03-22 02:41:44 +08:00
|
|
|
AUTH_ENABLED=true
|
|
|
|
|
DEFAULT_USERNAME=admin
|
|
|
|
|
DEFAULT_PASSWORD=admin
|
|
|
|
|
STORAGE_MODE=local
|
2026-04-20 21:35:15 +08:00
|
|
|
|
|
|
|
|
# Cleanup
|
|
|
|
|
FILE_MAX_AGE_HOURS=72
|
|
|
|
|
CLEANUP_INTERVAL_MINUTES=60
|
|
|
|
|
|
|
|
|
|
# Upload & Batch (0 = unlimited)
|
|
|
|
|
MAX_UPLOAD_SIZE_MB=0
|
|
|
|
|
MAX_BATCH_SIZE=0
|
|
|
|
|
CONCURRENT_JOBS=0
|
|
|
|
|
MAX_MEGAPIXELS=0
|
2026-07-23 00:18:16 +08:00
|
|
|
# Max single-file AI jobs one user may have in flight (AI pool is concurrency 1; 0 = unlimited)
|
|
|
|
|
MAX_AI_JOBS_PER_USER=5
|
|
|
|
|
# Optional per-process memory cap (MB) for the native media/doc engines (0 = disabled; container limit is the primary backstop)
|
|
|
|
|
SUBPROCESS_MEMORY_LIMIT_MB=0
|
2026-07-11 19:53:00 +08:00
|
|
|
# Max frames processed by animated background removal (0 = unlimited)
|
|
|
|
|
GIF_BG_MAX_FRAMES=150
|
2026-04-20 21:35:15 +08:00
|
|
|
|
|
|
|
|
# Rate limiting (0 = disabled)
|
|
|
|
|
RATE_LIMIT_PER_MIN=0
|
|
|
|
|
|
|
|
|
|
# Users (0 = unlimited)
|
|
|
|
|
MAX_USERS=0
|
|
|
|
|
|
|
|
|
|
# Processing (0 = auto/unlimited)
|
|
|
|
|
MAX_WORKER_THREADS=0
|
|
|
|
|
PROCESSING_TIMEOUT_S=0
|
|
|
|
|
MAX_PIPELINE_STEPS=0
|
|
|
|
|
MAX_CANVAS_PIXELS=0
|
2026-07-23 00:18:16 +08:00
|
|
|
# SVG has no "auto" sizing: 0 here disables the pre-parse size cap entirely.
|
|
|
|
|
# Ship the code default (50 MB) so copying this file does not remove the guard.
|
|
|
|
|
MAX_SVG_SIZE_MB=50
|
2026-04-20 21:35:15 +08:00
|
|
|
MAX_LOGO_SIZE_KB=2048
|
|
|
|
|
MAX_SPLIT_GRID=100
|
|
|
|
|
MAX_PDF_PAGES=0
|
2026-06-13 10:18:39 +08:00
|
|
|
MAX_VIDEO_DURATION_S=0
|
|
|
|
|
MAX_AUDIO_DURATION_S=0
|
|
|
|
|
MAX_VIDEO_BITRATE_KBPS=0
|
|
|
|
|
LIBREOFFICE_TIMEOUT_S=120
|
|
|
|
|
# Engine binary overrides (default: $PATH lookup)
|
|
|
|
|
# FFMPEG_PATH=
|
|
|
|
|
# FFPROBE_PATH=
|
|
|
|
|
# QPDF_PATH=
|
|
|
|
|
# SOFFICE_PATH=
|
2026-06-13 10:18:55 +08:00
|
|
|
# PDFCPU_PATH=
|
2026-06-13 10:18:39 +08:00
|
|
|
# SNAPOTTER_HW_ACCEL= # nvenc|vaapi: hardware encoder family (default software)
|
2026-07-04 13:46:52 +08:00
|
|
|
|
|
|
|
|
# AI tools fetch missing model files automatically (public model weights only,
|
|
|
|
|
# never user data). Set 0 for airgapped deployments to guarantee zero outbound
|
|
|
|
|
# fetches; missing models then produce actionable errors instead of downloads.
|
|
|
|
|
SNAPOTTER_ALLOW_MODEL_DOWNLOAD=1
|
|
|
|
|
|
2026-04-20 21:35:15 +08:00
|
|
|
SESSION_DURATION_HOURS=168
|
|
|
|
|
LOGIN_ATTEMPT_LIMIT=10
|
|
|
|
|
|
2026-07-27 15:37:30 +08:00
|
|
|
# Which peers may set the client IP via X-Forwarded-For. request.ip is the key
|
|
|
|
|
# for the rate limiter, the login brute-force limiter and the enterprise IP
|
|
|
|
|
# allowlist, so this decides whether those controls key on something a client
|
|
|
|
|
# can choose. The default believes only peers on a private network, which
|
|
|
|
|
# covers a reverse proxy on a Docker network or a LAN while ignoring a forged
|
|
|
|
|
# header from a public client. Use `true` only when a proxy you control sits in
|
|
|
|
|
# front on a public address, `false` when nothing proxies this instance, or a
|
|
|
|
|
# comma-separated CIDR list to name the proxies exactly.
|
|
|
|
|
TRUST_PROXY=loopback,linklocal,uniquelocal
|
|
|
|
|
|
2026-03-28 11:19:09 +08:00
|
|
|
# Set to true in CI/dev to skip the forced password-change on the default admin
|
|
|
|
|
# SKIP_MUST_CHANGE_PASSWORD=false
|
2026-06-13 10:15:23 +08:00
|
|
|
# DB_PATH removed in 2.0 -- see DATABASE_URL below
|
2026-03-22 02:41:44 +08:00
|
|
|
WORKSPACE_PATH=./tmp/workspace
|
2026-03-26 01:10:13 +08:00
|
|
|
FILES_STORAGE_PATH=./data/files
|
2026-03-22 02:41:44 +08:00
|
|
|
DEFAULT_THEME=light
|
|
|
|
|
DEFAULT_LOCALE=en
|
2026-04-24 18:02:21 +08:00
|
|
|
APP_NAME=snapotter
|
2026-06-13 10:15:23 +08:00
|
|
|
|
|
|
|
|
# --- 2.0 foundation ---
|
|
|
|
|
# Postgres connection (required; this default matches docker-compose.dev.yml)
|
|
|
|
|
# Start the dev stack first: docker compose -f docker-compose.dev.yml up -d
|
|
|
|
|
DATABASE_URL=postgres://snapotter:snapotter@localhost:5432/snapotter
|
2026-06-13 10:17:13 +08:00
|
|
|
# Redis connection (required; this default matches docker-compose.dev.yml)
|
|
|
|
|
REDIS_URL=redis://localhost:6379
|
2026-07-16 22:50:11 +08:00
|
|
|
# Startup grace: wait this long (ms) for Postgres/Redis to accept connections
|
|
|
|
|
# before failing. Lets a dependency that is still booting recover instead of
|
|
|
|
|
# crash-looping. 0 = try once, fail fast.
|
|
|
|
|
DB_STARTUP_TIMEOUT_MS=30000
|
2026-06-13 10:17:13 +08:00
|
|
|
|
|
|
|
|
# Job spine tuning
|
|
|
|
|
SYNC_WAIT_MS=8000 # sync-response window (ms) before returning 202
|
|
|
|
|
JOBS_RETENTION_DAYS=30 # completed-job metadata TTL (days)
|
|
|
|
|
AUDIT_RETENTION_DAYS=0 # audit-log TTL (0 = keep forever)
|
|
|
|
|
LOG_DIR=./data/logs # rotating log ring for support bundles
|
2026-06-16 18:04:52 +08:00
|
|
|
# JOB_TIMEOUT_FAST_S=120 # timeout for fast pools (image, docs), seconds
|
2026-06-13 10:17:13 +08:00
|
|
|
# JOB_TIMEOUT_LONG_S=7200 # timeout for long pools (ai, media), seconds
|
|
|
|
|
# SCRATCH_PATH= # worker scratch dir (default: OS tmpdir/snapotter-scratch)
|
|
|
|
|
|
|
|
|
|
# Prometheus metrics: GET /api/v1/metrics requires an authenticated admin
|
|
|
|
|
# (scrapers need a session cookie or API key with system:health permission).
|
|
|
|
|
|
2026-06-24 11:05:39 +08:00
|
|
|
# --- Analytics ---
|
2026-06-24 11:22:34 +08:00
|
|
|
# Basic analytics are included by default. SnapOtter works normally without them.
|
|
|
|
|
# To disable: docker compose build --build-arg SNAPOTTER_ANALYTICS=off
|
2026-07-10 21:41:49 +08:00
|
|
|
# Runtime kill switch: set to 0 to disable ALL telemetry (Sentry + PostHog)
|
|
|
|
|
# for this instance without rebuilding. The in-app admin toggle does the same
|
|
|
|
|
# from Settings; this env var also covers boot-time crashes and CI fleets.
|
2026-07-13 14:23:16 +08:00
|
|
|
# ANALYTICS_ENABLED=false is honored as an alias (0/off also work).
|
2026-07-10 21:41:49 +08:00
|
|
|
# SNAPOTTER_TELEMETRY=1
|
|
|
|
|
# Label this instance's error reports (shows as the Sentry environment).
|
|
|
|
|
# SNAPOTTER_ENV=production
|
2026-06-24 11:05:39 +08:00
|
|
|
|
2026-06-13 10:15:23 +08:00
|
|
|
# One-time SQLite import on first boot (1.x upgrade path). Leave unset normally.
|
|
|
|
|
# SQLITE_MIGRATE_PATH=/data/snapotter.db
|
2026-06-15 12:53:06 +08:00
|
|
|
|
|
|
|
|
# --- OpenTelemetry Distributed Tracing (enterprise only) ---
|
|
|
|
|
# Requires a valid enterprise license with distributed_tracing feature.
|
|
|
|
|
# Set OTEL_EXPORTER_OTLP_ENDPOINT to enable. All other vars are optional.
|
|
|
|
|
# Docs: https://opentelemetry.io/docs/specs/otel/configuration/sdk-environment-variables/
|
|
|
|
|
# OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4318
|
|
|
|
|
# OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf
|
|
|
|
|
# OTEL_EXPORTER_OTLP_HEADERS=
|
|
|
|
|
# OTEL_SERVICE_NAME=snapotter-api
|
|
|
|
|
# OTEL_TRACES_SAMPLER=parentbased_always_on
|
|
|
|
|
# OTEL_TRACES_EXPORTER=otlp
|