# === Encryption === # Server-side AES-256-GCM encryption key (32 bytes, base64). # Leave EMPTY to have one generated automatically on first launch and persisted # in the data volume (at .encryption_key) — zero-config start. Set it explicitly # to control and back up the key yourself. # Generate with: openssl rand -base64 32 # WARNING: Never change this after first deployment — all notes become inaccessible. SERVER_ENCRYPTION_KEY= # Or the path of a file that holds it, such as a Docker or Kubernetes secret. # Every secret in this file has a _FILE variant: API_KEY_FILE (and # API_KEY_1_FILE...), S3_ACCESS_KEY_ID_FILE, S3_SECRET_ACCESS_KEY_FILE, # METRICS_TOKEN_FILE. Setting a variable and its _FILE together stops the server. # See docs/self-hosting.md#secrets-in-files # SERVER_ENCRYPTION_KEY_FILE= # === Application === APP_NAME=Secret # Public URL where your instance is reachable. Set this to your own domain in # production (e.g. https://secret.example.com) — it is used for CORS, the # OpenAPI spec, robots.txt and sitemap.xml. APP_URL=http://localhost:3000 # The home page's description, for search engines and link previews (meta # description, og:description, twitter:description, JSON-LD), in every # language. Leave it unset for each language's own translated description. # APP_DESCRIPTION= # === Design / Branding === # Accent colour as hex (e.g. #2563eb). Leave empty for the default indigo. The # second colour of the gradients is derived from it, a lighter shade takes over # on the dark theme when the colour would vanish there, and text on accent # buttons turns white or near-black, whichever reads better. APP_PRIMARY_COLOR= APP_FOOTER_TEXT= # Social preview image (Open Graph / Twitter card) for the home page. # Leave empty to use the bundled default served at /og.png. # Set a full URL to use your own (recommended size: 1280x630, PNG/JPG). APP_OG_IMAGE_URL= # === Limits === # Sizes the body limit of a note sent in one request: MAX_FILE_SIZE x # MAX_FILES_PER_NOTE + 1 MB. Files are limited by MAX_CHUNKED_FILE_SIZE below: # a note larger than a chunk goes up in chunks. MAX_FILE_SIZE=10485760 MAX_FILES_PER_NOTE=10 # Retention ceiling in seconds. Operators can only tighten it: the protocol # maximum is 2592000 (30 days) and the minimum is 300 (5 minutes). MAX_EXPIRY=2592000 # Total storage budget in bytes for encrypted payloads (notes, files, chunks). # Writes beyond it are refused with HTTP 507 until notes expire or are deleted. # 0 (default) = unlimited. Current usage is in the metrics (METRICS_TOKEN below). # STORAGE_QUOTA_BYTES=0 # === API keys (optional) === # Grant SDK clients write access without solving a Proof-of-Work challenge. # Minimum 32 characters. Use API_KEY_1, API_KEY_2, ... for several clients. # docker-compose.yml passes API_KEY_1 to API_KEY_3 and their _FILE on to the # container: list any further one there too, or it is ignored. # API_KEY= # API_KEY_FILE= # Scales every per-IP rate limit (create 30/min, reads 60/min, chunks 200/min). # Raise it when many legitimate users share one apparent address (NAT, VPN), or # when the API sits behind a proxy whose address is not in TRUSTED_PROXIES. # RATE_LIMIT_MULTIPLIER=1 # === Server key rotation guard === # The server refuses to start if SERVER_ENCRYPTION_KEY no longer matches the key # that encrypted the existing notes. Set this only if you accept that every # stored note becomes permanently unreadable. # ALLOW_SERVER_KEY_CHANGE=false # === Server === # The port the app is published on: the site and the API, from one process. # Inside the container the app listens on 3000, unless a platform injects PORT. PORT=3000 # Seconds a stopping container gives the requests in flight before it cuts them. # Docker kills it 10 seconds after asking it to stop: to raise this, raise # stop_grace_period in the compose file as well, a couple of seconds above. # SHUTDOWN_TIMEOUT=8 # === Database === DATABASE_PATH=/app/data/secret.db # === File Storage === # Storage backend: "local" (default) or "s3" STORAGE_BACKEND=local FILES_PATH=/app/data/files # === S3 Configuration (only when STORAGE_BACKEND=s3) === # S3_BUCKET= # S3_REGION=us-east-1 # S3_ENDPOINT= # Omit for AWS S3. RustFS: http://rustfs:9000 / R2: https://xxx.r2.cloudflarestorage.com # S3_ACCESS_KEY_ID= # S3_SECRET_ACCESS_KEY= # S3_ACCESS_KEY_ID_FILE= # S3_SECRET_ACCESS_KEY_FILE= # S3_FORCE_PATH_STYLE=false # Set to true for self-hosted servers (RustFS, Garage) # Daily sweep of stored files that no note points to any more (left behind by a # deletion that failed or was interrupted). The bucket or FILES_PATH must belong # to this instance alone. See docs/self-hosting.md#storage-cleanup # STORAGE_RECONCILE=true # === Chunked Upload === # Bytes per chunk (default: 4MB). Lower it when a proxy in front limits request # bodies. The web app follows it; SDK clients must pass the same `chunkSize`. # CHUNK_SIZE=4194304 # MAX_CHUNKED_FILE_SIZE=524288000 # Max total upload size (default: 500MB) # === Proof-of-Work (Cap) === # Difficulty of the PoW challenge browsers must solve before writing a note. # Higher = more CPU work per request (stronger abuse resistance, slower UX). # Recommended: 4 (balanced). Raise to 5 under sustained abuse; >6 is rejected. # CAP_DIFFICULTY=4 # Number of sub-challenges per token. Higher = more total work. Default: 50. # CAP_CHALLENGE_COUNT=50 # === Client address behind a proxy === # Which header carries the client address, and how many proxies sit in front of # the app (1 for a single Nginx/Traefik/Caddy/Cloudflare hop). Behind a reverse # proxy, rate limits only tell clients apart once these are set: otherwise every # user shares the proxy's bucket. Set, ADDRESS_HEADER decides the address on its # own, and TRUSTED_PROXIES plays no part. # See docs/self-hosting.md#making-rate-limiting-work-behind-a-proxy # ADDRESS_HEADER=X-Forwarded-For # XFF_DEPTH=1 # Without ADDRESS_HEADER: comma-separated IPs / CIDR ranges (IPv4 or IPv6) of # the proxies allowed to set X-Forwarded-For / X-Real-IP. The rate-limiter only # honours these headers when the direct peer is in this list. Empty, the peer's # own address counts, which behind a proxy is the proxy's. TRUSTED_PROXIES= # === Cleanup === CLEANUP_INTERVAL_MS=300000 # === Monitoring === # Turns on GET /api/metrics (Prometheus text format) for requests that send # "Authorization: Bearer ". Unset, the endpoint does not exist. The # metrics reveal how the instance is used (notes created and read, volume # stored): keep the token as secret as an API key. Minimum 32 characters. # Generate with: openssl rand -base64 32 # See docs/self-hosting.md#monitoring # METRICS_TOKEN= # METRICS_TOKEN_FILE= # === Logging === # Set to 1 / true to log full error objects on 500s (stack chains, cause, # adapter context). Off by default to avoid leaking paths or credentials. # DEBUG=0