# ───────────────────────────────────────────────────────────────────────────── # cursed-spreadsheet — environment configuration # # Running the standalone app? You do not need this file. Everything below is on # the Settings page behind the gear icon, saved to config.json in your data # folder (~/.cursed-data-excel). This file is for embedding the server in # another app, and for CI. # # Every value here is optional; the defaults shown are what the server uses when # the variable is absent. Bun loads .env automatically. For Node, use # `node --env-file=.env`. # # Note the precedence: settings saved from the Settings page beat these, so a # value set here will not override one you have configured in the app. # # Anything set here can also be passed programmatically to createSpreadsheetServer(), # and explicit options always win over the environment. # ───────────────────────────────────────────────────────────────────────────── # ── Network ────────────────────────────────────────────────────────────────── # TCP port to listen on. 0 picks a free port (useful for tests). SPREADSHEET_PORT=3000 # Interface to bind. Keep 127.0.0.1 unless you intend to expose the server. SPREADSHEET_HOST=127.0.0.1 # Mount the whole app under a sub-path, e.g. /sheets. Must start with "/". SPREADSHEET_BASE_PATH=/ # ── Storage ────────────────────────────────────────────────────────────────── # SQLite database file. Parent directories are created automatically. # Use ":memory:" for an ephemeral database. # The standalone app defaults to data.db inside the data folder instead, so it # is the same location whichever directory you launch from — leave this unset # unless you are embedding the server and want the database somewhere specific. # A database outside the data folder is warned about on startup. # SPREADSHEET_DB_PATH=./data/spreadsheet.db # Write-Ahead Logging. Leave on unless the DB lives on a network filesystem. SPREADSHEET_DB_WAL=true # Busy timeout in milliseconds before a locked write gives up. SPREADSHEET_DB_BUSY_TIMEOUT_MS=5000 # ── Authentication ─────────────────────────────────────────────────────────── # Leave unset for an open server (correct for a local, loopback-bound app). # When set, every /api request must send: Authorization: Bearer # SPREADSHEET_AUTH_TOKEN=change-me-to-a-long-random-string # Comma-separated route prefixes that skip auth entirely (health checks etc). SPREADSHEET_AUTH_PUBLIC_PATHS=/api/v1/health # ── CORS ───────────────────────────────────────────────────────────────────── # Comma-separated allowed origins for cross-origin embedding. # Unset = same-origin only. "*" = allow any origin (never with a real token). # SPREADSHEET_CORS_ORIGIN=http://localhost:5173,https://app.example.com SPREADSHEET_CORS_CREDENTIALS=false # ── Limits ─────────────────────────────────────────────────────────────────── # Largest accepted upload, in megabytes. SPREADSHEET_MAX_UPLOAD_MB=128 # Hard ceiling on rows per file. Guards against a runaway import. SPREADSHEET_MAX_ROWS_PER_FILE=1000000 # Hard ceiling on columns per file. SPREADSHEET_MAX_COLUMNS_PER_FILE=1024 # Default and maximum page size for GET /files/:id/rows SPREADSHEET_DEFAULT_PAGE_SIZE=200 SPREADSHEET_MAX_PAGE_SIZE=5000 # ── Frontend ───────────────────────────────────────────────────────────────── # Serve the bundled single-page workbench UI from this server. SPREADSHEET_SERVE_UI=true # Override the directory the UI is served from (defaults to the bundled assets). # SPREADSHEET_STATIC_DIR=./dist/app # ── Observability ──────────────────────────────────────────────────────────── # silent | error | warn | info | debug SPREADSHEET_LOG_LEVEL=info # Log every HTTP request. Off by default at info level to keep output readable. SPREADSHEET_LOG_REQUESTS=false