Loading files
This file is pinned to the selected release. Download the original to open it in your design tool.
# PostHog Analytics
NEXT_PUBLIC_POSTHOG_KEY=phc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
NEXT_PUBLIC_POSTHOG_HOST=https://us.i.posthog.com
# ── Community (self-hosted deployment only) ──────────────────────────────────
# The community runs where this flag is set (the Raspberry Pi / VPS). Leave it
# unset on Vercel — community pages then show a pointer to the community host.
COMMUNITY_ENABLED=1
# Better Auth session signing secret. Generate one:
# openssl rand -base64 32
BETTER_AUTH_SECRET=change-me
# Public URL of THIS deployment (used by Better Auth for cookies/origin).
# Dev: http://localhost:3000 · Pi: https://community.patternflow.work
BETTER_AUTH_URL=http://localhost:3000
# Where the SQLite file lives. Default: ./data/community.db (gitignored).
# On the Pi point it somewhere backed up, e.g. /home/pi/patternflow/community.db
#COMMUNITY_DB_PATH=./data/community.db
# Public URL of the community deployment. Set this wherever the community
# should be reachable — it is also the switch that shows Pattern Lab's
# "Share to Community" button, so leave it UNSET on a deployment that ships
# before the community host exists. Set it on EVERY deployment that has one:
# · Vercel — sends /community visitors here, and points Pattern Lab's
# "Share to Community" / sign-in calls at this host.
# · The community host itself — it matches its own origin, so calls stay
# relative and no CORS is involved.
# · Local development — http://localhost:3000 (matches, so stays relative).
NEXT_PUBLIC_COMMUNITY_URL=https://community.patternflow.work
# Origins allowed to call this community API from the browser, comma separated.
# Community deployment only. This is both the CORS allow-list and Better Auth's
# trustedOrigins (its Origin-header CSRF check), so the main site must be named
# here or cross-origin sign-in and publishing are rejected.
COMMUNITY_ALLOWED_ORIGINS=https://patternflow.work
# ── Firmware build service (community host with a worker) ────────────────────
# Server side: enables POST /api/community/builds. Needs arduino-cli installed
# and `npm run worker` running. Compiling submitted C++ is arbitrary code
# execution at compile time — keep this off unless the worker's unit carries
# the sandbox in docs/SERVICES.md (no network, read-only system, limits).
#BUILD_ENABLED=1
# Client side: shows the "Build firmware" buttons. Set both, or neither.
#NEXT_PUBLIC_BUILD_ENABLED=1
# Overrides for the worker (defaults are usually right in a repo checkout):
#FIRMWARE_SRC_DIR=/home/pi/Patternflow/firmware/patternflow
#BUILD_WORK_DIR=/home/pi/patternflow-data/build-worker
#BUILD_ARTIFACT_DIR=/home/pi/patternflow-data/builds
#ARDUINO_CLI_PATH=arduino-cli
#
# BUILD_FQBN — normally leave this unset. The built-in default already pins the
# board options firmware/README.md requires (PSRAM, flash size, partition
# scheme, CDC on boot), and a build is refused if an override drops any of
# them: leaving one out compiles against the board defaults and produces
# firmware that boots but is not the firmware we release.
# To inspect the available options: arduino-cli board details --fqbn esp32:esp32:esp32s3
#BUILD_FQBN=esp32:esp32:esp32s3:PSRAM=opi,FlashSize=16M,PartitionScheme=app3M_fat9M_16MB,CDCOnBoot=cdc,USBMode=hwcdc
# Moderators — comma-separated USERNAMES (not ids) who may remove other
# people's patterns, posts and comments. Unset means nobody can, which is the
# right default for any deployment that is not the official community.
#COMMUNITY_ADMIN_USERNAMES=engmung
# The .pfm module builder shells out to Python for firmware/toolchain/
# build_module.py. Set this when the runtime is `python3` or lives in a venv.
#PYTHON_PATH=python3
# Build worker (`npm run worker`): a label for its log lines and job claims —
# never point two workers at the same BUILD_WORK_DIR — and the queue poll.
#WORKER_ID=worker-1
#BUILD_POLL_MS=2000
# ── Edition images (community host) ─────────────────────────────────────────
# /api/variant-bin/<name>/<file> serves hosted edition firmware images from a
# directory OUTSIDE the checkout (they are megabytes and change every release).
# Unset = the route answers 404 and the shelf falls back to the flasher's
# committed images.
#VARIANT_BIN_DIR=/home/pi/patternflow-data/variant-bin
# ── Local development ───────────────────────────────────────────────────────
# Extra origins allowed to reach `next dev` (a tunnel host, a phone on the LAN
# by hostname), comma separated.
#NEXT_DEV_ORIGINS=my-tunnel.example.com
98b423c28This file is pinned to the selected release. Download the original to open it in your design tool.