# Copy this file to .env and fill in your values. PORT=3000 # --- AI (optional) ------------------------------------------------------- # Exercise generation and OCR work with OpenAI's free usage tier by default: # create a key at platform.openai.com and set it here (or paste it in # Settings > AI, which is stored server-side and takes precedence). See # docs/ai.md. OPENAI_API_KEY= # Anthropic key - alternative provider for generation and OCR. ANTHROPIC_API_KEY= ANTHROPIC_MODEL=claude-opus-4-8 # Max upload size (MB). MAX_UPLOAD_MB=200 # Where the content store lives (uploaded files, render PDFs, sync payloads). # Empty = apps/api/uploads. Point it at a bigger disk if you need to. UPLOADS_DIR= # --- Database ----------------------------------------------------------- # Which DBMS to use: 'sqlite' (default, zero-config, file-based) or 'postgres'. DB_DIALECT=sqlite # SQLite database path (DB_DIALECT=sqlite). Empty = apps/api/data/synapse.db. DB_PATH= # Postgres connection string (required when DB_DIALECT=postgres), e.g. # postgres://user:password@localhost:5432/synapse DATABASE_URL= # Conversion binaries (optional; looked up on PATH otherwise). # pandoc static binary - markup formats (md/html/epub/tex/...). PANDOC_PATH= # LibreOffice binary/AppImage - office formats + faithful pptx renders. SOFFICE_PATH= # --- Auth --------------------------------------------------------------- # Secret used to sign the session cookie. required in production; must be # long and random. Generate one with: # node -e "console.log(require('crypto').randomBytes(32).toString('hex'))" SESSION_SECRET= # Session lifetime in days (default 30). AUTH_SESSION_TTL_DAYS=30 # Escape hatch: set to 'true' to disable the auth gate entirely (single-user, # localhost-only). never enable on a networked host. AUTH_DISABLED=false # Forgotten-password recovery: set to "username:new-password" and restart - # the account's password is reset (min. 8 chars) and its sessions revoked. # remove the variable right after signing back in. AUTH_RESET_PASSWORD= # Set 'true' to show a "Create an account" option on the login screen (open # self-registration, role 'user'). Off by default: accounts are normally # created by an admin in Settings → Users. Only enable on instances where # anyone who can reach the server is welcome to join. AUTH_ALLOW_SIGNUP=false # Network interface to bind. Defaults to 127.0.0.1 (loopback only) since the # app is single-tenant; set 0.0.0.0 to accept LAN/remote connections - only do # that behind auth (enabled by default) and ideally a TLS reverse proxy. HOST=127.0.0.1 # Rate limiting is on by default (300 requests per minute per client, with a # tighter limit on login and register). Set to 'false' to turn it off; the # test suites do that so they are not throttled. THROTTLE_ENABLED=true # Comma-separated origins allowed to call the API cross-origin (with # credentials). Empty = CORS off, same-origin only. Needed for native app # shells, e.g. CORS_ORIGINS=tauri://localhost CORS_ORIGINS=