# STORAGE REDIS_URL="redis://127.0.0.1:23379" DATABASE_URL="postgresql://postgres:postgres@localhost:23432/postgres?schema=public" DATABASE_URL_DIRECT="$DATABASE_URL" CLICKHOUSE_URL="http://localhost:23123/openpanel" # Symmetric key for all at-rest encryption: TOTP secrets, GSC tokens, and # object-store export credentials (S3 secret keys, GCS service-account keys). # Generate with: openssl rand -hex 32 ENCRYPTION_KEY="" # CODE MIGRATIONS # Lets the api/worker apply every pending ClickHouse code migration, in order, # once it is listening; a Redis lock makes one process do it. Self-hosted # installs set it; without it, run them all with # `bun run --filter @openpanel/db migrate:deploy`. # AUTOMATIC_MIGRATIONS="true" # Signs the session cookie; changing it signs everyone out. Falls back to # COOKIE_SECRET when unset. Generate with: openssl rand -base64 32 # AUTH_SECRET="" # OBJECT-STORE EXPORT (S3/GCS) tuning — optional, sensible defaults shown. # The flushExports cron job windows ClickHouse by inserted_at and uploads # batched files. LAG keeps a safety gap behind now() for in-flight inserts; # BATCH_SIZE is rows per file; MAX_BATCHES_PER_RUN bounds backlog drain per # tick; CONCURRENCY is parallel (project,integration) uploads. # EXPORT_LAG_SECONDS="60" # EXPORT_BATCH_SIZE="50000" # EXPORT_MAX_BATCHES_PER_RUN="20" # EXPORT_CONCURRENCY="4" # REST BATCH_SIZE="5000" BATCH_INTERVAL="10000" CONCURRENCY="10" NEXT_PUBLIC_DASHBOARD_URL="http://localhost:3000" NEXT_PUBLIC_API_URL="http://localhost:3333" WORKER_PORT=9999 API_PORT=3333 # DEV LOGIN (local only). Puts a one-click "Dev login" button on the sign-in # page that signs in as this account; the API refuses to boot with it under # NODE_ENV=production. The seed creates exactly this user. # DEV_LOGIN="admin@openpanel.local/openpanel" # SOCIAL LOGIN (optional). Docs: https://openpanel.dev/docs/self-hosting/social-login # The redirect URIs must match what you register at the provider exactly. # GOOGLE_CLIENT_ID="" # GOOGLE_CLIENT_SECRET="" # GOOGLE_REDIRECT_URI="http://localhost:3333/oauth/google/callback" # GITHUB_CLIENT_ID="" # GITHUB_CLIENT_SECRET="" # GITHUB_REDIRECT_URI="http://localhost:3333/oauth/github/callback" # GOOGLE SEARCH CONSOLE (optional). Docs: https://openpanel.dev/docs/self-hosting/google-search-console # Reuses GOOGLE_CLIENT_ID/SECRET above. Requires ENCRYPTION_KEY. # GSC_GOOGLE_REDIRECT_URI="http://localhost:3333/gsc/callback" # KAFKA / REDPANDA (optional, runs in parallel with the groupmq events queue) # Empty KAFKA_BROKERS disables both producer and consumer; everything falls # back to groupmq. Enable ENABLED_QUEUES=events_kafka on the worker(s) that # should consume from Kafka. # KAFKA_BROKERS="" # KAFKA_EVENTS_TOPIC="events" # KAFKA_CONSUMER_GROUP="openpanel-events" # KAFKA_PARTITIONS_CONCURRENT="8" # Number of partitions Redpanda/Kafka creates the `events` topic with; cloud # runs 24. FOOTGUN: the producer partitions by murmur2(key) % numPartitions, # so raising this once the topic already exists reshuffles every key and # silently breaks per-key ordering and mutual exclusion for events produced # before the change. Set it once at install; to raise it later, drain # ingestion (stop producers, let consumers fully catch up) and recreate the # topic — see self-hosting/redpanda/bootstrap.template.yaml. # KAFKA_EVENTS_TOPIC_PARTITIONS="24" # Producer throughput knobs (ADR-023; docs/KAFKA_PRODUCER_OPTIONS.md). # How many events are accumulated into one Kafka send(); 1 turns batching off. # KAFKA_PRODUCER_BATCH_SIZE="25" # How long a partly filled batch waits for company, in ms; added to the # /track response time when the batch is not already full. # KAFKA_PRODUCER_BATCH_LINGER_MS="5" # How many produce requests may be outstanding at once; raising it buys ~2-3% # and risks reordering after a broker hiccup, so leave it at 1. # KAFKA_PRODUCER_MAX_IN_FLIGHT="1" # Local dev with docker-compose: # KAFKA_BROKERS="localhost:23092" # TLS / SASL for an external broker (docs: self-hosting/environment-variables#kafka_ssl). # Unauthenticated plaintext when unset. SASL credentials imply KAFKA_SSL=true; # a partial pair, an unknown mechanism or TLS options without TLS fail boot. # KAFKA_SSL="true" # KAFKA_SSL_CA_PATH="/etc/openpanel/kafka-ca.pem" # KAFKA_SSL_REJECT_UNAUTHORIZED="true" # KAFKA_SASL_USERNAME="" # KAFKA_SASL_PASSWORD="" # KAFKA_SASL_MECHANISM="scram-sha-512" # plain | scram-sha-256 | scram-sha-512 # Local SASL/TLS broker for trying these out: `bun run dock:kafka-auth`, then # KAFKA_BROKERS="localhost:23094" with user op512 / op512-secret and # KAFKA_SSL_CA_PATH="$PWD/docker/data/op-rp-auth-certs/ca.crt". # Stop the api asking DuckDuckGo and Google for favicons (true or 1) # DISABLE_FAVICON_FETCH="true" # EMAIL - set one or both; SMTP takes priority over Resend if SMTP_HOST is set # Option A - Resend # RESEND_API_KEY="" # EMAIL_SENDER="hello@openpanel.dev" # Option B - SMTP (used first when SMTP_HOST is present, even if RESEND_API_KEY is also set) # SMTP_HOST="" # SMTP_PORT="587" # SMTP_SECURE="false" # SMTP_USER="" # SMTP_PASS="" # EMAIL_SENDER="hello@openpanel.dev" # AI assistant providers (optional; one is enough) # OPENAI_API_KEY="" # ANTHROPIC_API_KEY="" # Track this deployment's own AI calls (assistant, report drafts, insights) # into an OpenPanel project, so the AI section shows them. Use a client of # the project that should receive them; OP_API_URL defaults to the public API. # OP_CLIENT_ID="" # OP_CLIENT_SECRET="" # OP_API_URL=""