mirror of
https://github.com/bitbaum/orangecat.git
synced 2026-12-04 06:35:56 +01:00
* feat(notify): OrangeCat's bots reach the owner through Loki's one gateway The owner wants Telegram to be the way any of his bots reaches him, and only with a one-tap action. Loki now owns that contract (loki src/lib/notify/policy.ts); OrangeCat hands it the owner's news over the existing signed rail instead of keeping it in-app only. - services/loki/notify-owner.ts: posts the owner's notices (only when the recipient IS the owner, OPS_NOTIFY_USER_ID) to /api/orangecat/notify. - The Cat's daily brief and fired watches go there with "Open the Cat". - Ops alerts go there with no button, so they land in Loki's list and never ring the phone. - uptime.yml: the outage message carries "Run Box doctor"; the recovery message is gone (nothing to do). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019MDtmtzUbLhg3oqt4X1NaN * chore(env): list LOKI_NOTIFY_URL in .env.example Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019MDtmtzUbLhg3oqt4X1NaN --------- Co-authored-by: Claude <noreply@anthropic.com>
240 lines
13 KiB
Bash
240 lines
13 KiB
Bash
# OrangeCat Environment Variables Template
|
|
# Copy this to .env.local and fill in your actual values
|
|
# NEVER commit .env.local to git!
|
|
|
|
# ============================================================================
|
|
# SUPABASE (Required for auth, database, storage)
|
|
# ============================================================================
|
|
# Self-hosted on bitbaum, NOT supabase.com — the managed cloud project was
|
|
# retired 2026-06 (see docs/operations/DECOMMISSION-CLOUD.md). There is no
|
|
# dashboard to fetch these from: keys live in the box .env, ask before minting.
|
|
NEXT_PUBLIC_SUPABASE_URL="https://supabase.orangecat.ch"
|
|
NEXT_PUBLIC_SUPABASE_ANON_KEY="your-anon-key"
|
|
NEXT_PUBLIC_SUPABASE_PUBLISHABLE_KEY="your-publishable-key"
|
|
|
|
# Server-side only (never expose to browser)
|
|
SUPABASE_SERVICE_ROLE_KEY="your-service-role-key"
|
|
SUPABASE_SERVICE_KEY="your-service-role-key"
|
|
SUPABASE_SECRET_KEY="your-secret-key"
|
|
SUPABASE_ACCESS_TOKEN="sbp_..."
|
|
SUPABASE_JWT_SECRET="your-jwt-secret"
|
|
|
|
# ============================================================================
|
|
# POSTGRES (Required for database connections)
|
|
# ============================================================================
|
|
# Get from: Supabase Dashboard → Settings → Database
|
|
POSTGRES_URL="postgresql://..."
|
|
POSTGRES_URL_NON_POOLING="postgresql://..."
|
|
POSTGRES_PRISMA_URL="postgresql://..."
|
|
POSTGRES_DATABASE="postgres"
|
|
POSTGRES_HOST="db.your-project.supabase.co"
|
|
POSTGRES_USER="postgres"
|
|
POSTGRES_PASSWORD="your-db-password"
|
|
|
|
# ============================================================================
|
|
# DEPLOYMENT (self-hosted on Hetzner "bitbaum", behind Caddy)
|
|
# ============================================================================
|
|
# No Vercel. Production env lives in /opt/orangecat/app/.env on the box.
|
|
# See docs/operations/deployment/DEPLOYMENT_PROCESS.md for the on-box flow.
|
|
|
|
# ============================================================================
|
|
# GITHUB (Required for repo integration, PRs, issues)
|
|
# ============================================================================
|
|
# Get from: gh auth token (after running: gh auth login)
|
|
GITHUB_TOKEN="ghp_your_personal_access_token"
|
|
|
|
# ============================================================================
|
|
# APPLICATION (Optional, used for OG metadata and CORS)
|
|
# ============================================================================
|
|
# NEXT_PUBLIC_APP_URL="https://orangecat.ch"
|
|
# NEXT_PUBLIC_SITE_URL="https://orangecat.ch"
|
|
# NEXT_PUBLIC_SITE_NAME="OrangeCat"
|
|
|
|
# ============================================================================
|
|
# BITCOIN / LIGHTNING (Required for payments)
|
|
# ============================================================================
|
|
BITCOIN_NETWORK="testnet"
|
|
# OrangeCat's OWN receiving addresses — power the founding-supporter donation on
|
|
# /support (rendered as QR + copy). Until set to real values, /support shows a
|
|
# graceful "opens shortly" state instead of a placeholder address.
|
|
NEXT_PUBLIC_BITCOIN_ADDRESS="bitcoin:bc1q...?message=OrangeCat%20Donation"
|
|
NEXT_PUBLIC_LIGHTNING_ADDRESS="your-username@getalby.com"
|
|
# NEXT_PUBLIC_LIGHTNING_NODE_URL=""
|
|
# LIGHTNING_API_KEY=""
|
|
|
|
# Payment provider: 'mock' (default) or 'btcpay' (requires BTCPay Server)
|
|
# PAYMENT_PROVIDER="mock"
|
|
|
|
# BTCPay Server integration (required if PAYMENT_PROVIDER="btcpay")
|
|
# BTCPAY_URL="https://your-btcpay-instance.example.com"
|
|
# BTCPAY_STORE_ID=""
|
|
# BTCPAY_API_KEY=""
|
|
|
|
# Platform receiving wallet for Cat Credits top-ups (NWC connection string).
|
|
# This is OrangeCat's OWN wallet, used only to RECEIVE credit purchases — it is
|
|
# unrelated to users' (non-custodial) wallets. When unset, Lightning top-up is
|
|
# disabled and the rest of Cat Credits is unaffected. NWC is an abstraction, so
|
|
# this can point at a hosted wallet now or a self-hosted LNbits/BTCPay node later.
|
|
# PLATFORM_NWC_URI="nostr+walletconnect://<pubkey>?relay=...&secret=..."
|
|
|
|
# Encryption keys (generate with: openssl rand -hex 32)
|
|
# API_KEY_ENCRYPTION_SECRET=""
|
|
# PAYMENT_ENCRYPTION_KEY=""
|
|
|
|
# ============================================================================
|
|
# OAUTH PROVIDERS (Optional, social login)
|
|
# ============================================================================
|
|
# OAuth client IDs and secrets are configured in the Supabase Dashboard:
|
|
# Supabase Dashboard > Authentication > Providers
|
|
# No env vars needed here — all OAuth config lives in the Supabase dashboard.
|
|
# Callback URL to configure for each provider: https://your-domain.com/auth/callback
|
|
# Supported providers: Google, GitHub, Apple, X/Twitter
|
|
|
|
# ============================================================================
|
|
# CLOUDFLARE TURNSTILE (Optional, bot protection)
|
|
# ============================================================================
|
|
# Get from: https://dash.cloudflare.com → Turnstile
|
|
# NEXT_PUBLIC_TURNSTILE_SITE_KEY=""
|
|
# TURNSTILE_SECRET_KEY=""
|
|
|
|
# ============================================================================
|
|
# AI / OPENROUTER (Optional for platform-level AI)
|
|
# ============================================================================
|
|
# Get from: https://openrouter.ai/keys
|
|
# If not set, AI chat will only work when users bring their own key (BYOK mode)
|
|
# If set, provides platform-level access to Llama 4 Maverick and other models
|
|
# OPENROUTER_API_KEY="sk-or-..."
|
|
# GEMINI_API_KEY=""
|
|
# GROQ_API_KEY=""
|
|
|
|
# ============================================================================
|
|
# ANALYTICS (Optional)
|
|
# ============================================================================
|
|
# Provider: 'ga' (Google Analytics), 'mixpanel', 'amplitude', or 'plausible'
|
|
# NEXT_PUBLIC_ANALYTICS_PROVIDER=""
|
|
# NEXT_PUBLIC_GA_MEASUREMENT_ID=""
|
|
# NEXT_PUBLIC_MIXPANEL_TOKEN=""
|
|
# NEXT_PUBLIC_AMPLITUDE_KEY=""
|
|
|
|
# ============================================================================
|
|
# TURBO (Optional build optimization)
|
|
# ============================================================================
|
|
TURBO_CACHE="remote:rw"
|
|
TURBO_REMOTE_ONLY="true"
|
|
TURBO_RUN_SUMMARY="true"
|
|
TURBO_DOWNLOAD_LOCAL_ENABLED="true"
|
|
NX_DAEMON="false"
|
|
|
|
# ============================================================================
|
|
# FEATURE FLAGS (Optional)
|
|
# ============================================================================
|
|
# Enable mic buttons across forms and onboarding (client-side)
|
|
NEXT_PUBLIC_FEATURE_VOICE_INPUT="true"
|
|
# Enable analytics tracking
|
|
# NEXT_PUBLIC_FEATURE_ANALYTICS="false"
|
|
# Show performance monitor overlay (development only)
|
|
# NEXT_PUBLIC_SHOW_PERFORMANCE_MONITOR="false"
|
|
# Enable Supabase debug logging
|
|
# NEXT_PUBLIC_SUPABASE_DEBUG="false"
|
|
|
|
# Write-mode gates (set to true to enable write operations in those modules)
|
|
# LOANS_WRITE_MODE="false"
|
|
# PRODUCTS_WRITE_MODE="false"
|
|
# METRICS_ENABLED="false"
|
|
|
|
# ============================================================================
|
|
# LOKI SIBLING INTEGRATION
|
|
# ============================================================================
|
|
# Same 32+ character random value on OrangeCat and Loki. Signs ten-minute,
|
|
# one-use entity → build handoffs; never expose it as NEXT_PUBLIC_*.
|
|
LOKI_BUILD_INTENT_SECRET=""
|
|
# Same webhook secret on both products for settled-payment activity signals.
|
|
ORANGECAT_WEBHOOK_SECRET=""
|
|
LOKI_EVENTS_URL="https://loki.orangecat.ch/api/orangecat/events"
|
|
NEXT_PUBLIC_LOKI_URL="https://loki.orangecat.ch"
|
|
# Canonical OrangeCat pages used by both support pages.
|
|
NEXT_PUBLIC_ORANGECAT_PROJECT_ID="cb093f00-8745-4579-98df-050ebfb37181"
|
|
NEXT_PUBLIC_LOKI_ORANGECAT_PROJECT_ID="8130c927-114a-45b7-8cc2-99efd5224025"
|
|
|
|
# ============================================================================
|
|
# EVERYTHING ELSE src/ READS (optional — a feature is off until its key is set)
|
|
# ============================================================================
|
|
# Generated contract, enforced by __tests__/unit/ci/env-example-covers-src.test.ts:
|
|
# a variable the code reads must be named here, with the file that reads it,
|
|
# so a copy of this repo never discovers a switch by grepping. Leave unset to
|
|
# keep the feature off; read the named file for what the value means.
|
|
# AI_PROBE_SECRET= # src/services/cat/liveness.ts
|
|
# BRAVE_SEARCH_API_KEY= # src/services/cat/capability-gate.ts
|
|
# CAT_COMPLEXITY_ESCALATION= # src/services/cat/provider-catalog.ts
|
|
# CAT_PROMPT_SECTION_SELECTION= # src/services/cat/system-prompt.ts
|
|
# CAT_SOLON_PRIVKEY= # src/services/cat/handlers/governance.ts
|
|
# CHAT_REVIEW_TOKEN= # src/services/cat/chat-review-export.ts
|
|
# CRON_SECRET= # src/lib/api/cronAuth.ts
|
|
# EMBEDDINGS_API_KEY= # src/services/ai/embeddings.ts
|
|
# EMBEDDINGS_BASE_URL= # src/services/ai/embeddings.ts
|
|
# EMBEDDINGS_MODEL= # src/services/ai/embeddings.ts
|
|
# GITHUB_APP_CLIENT_ID= # src/services/github/connection.ts
|
|
# GITHUB_APP_CLIENT_SECRET= # src/services/github/connection.ts
|
|
# GITHUB_APP_SLUG= # src/services/github/connection.ts
|
|
# GROQ_DEFAULT_MODEL= # src/services/ai/groq-models.ts
|
|
# LOKI_ACTOR_STATUS_URL= # src/services/loki/actor-status.ts
|
|
# LOKI_ASK_URL= # src/services/loki/ask.ts
|
|
# LOKI_ENTITLEMENT_URL= # src/services/loki/entitlement-notify.ts
|
|
# LOKI_NOTIFY_URL= # src/services/loki/notify-owner.ts (the owner bots to Loki notify gateway)
|
|
# LOKI_FEEDBACK_TOKEN= # src/app/layout.tsx
|
|
# LOKI_MAP_URL= # src/services/ai/studio-map-fetcher.ts
|
|
# LOKI_MCP_RESOURCE= # src/lib/oauth/config.ts
|
|
# LOKI_SITE_URL= # src/services/loki/site-build.ts
|
|
# LOKI_TASK_URL= # src/services/loki/task-dispatch.ts
|
|
# NEXT_PUBLIC_BITCOIN_NETWORK= # src/lib/bitcoin/mempool.ts
|
|
# NEXT_PUBLIC_CAT_CREDITS_LIVE= # src/config/features.ts
|
|
# NEXT_PUBLIC_ECOSYSTEM_BITCOIN_ADDRESS= # src/config/ecosystem.ts
|
|
# NEXT_PUBLIC_ECOSYSTEM_LIGHTNING_ADDRESS= # src/config/ecosystem.ts
|
|
# NEXT_PUBLIC_PAID_PLANS_OPEN= # src/config/features.ts
|
|
# NEXT_PUBLIC_SUPPORTER_PRODUCT_URL= # src/config/cat-plans.ts
|
|
# OAUTH_ISSUER= # src/lib/oauth/config.ts
|
|
# OAUTH_JWT_KID= # src/lib/oauth/keys.ts
|
|
# OAUTH_JWT_PREVIOUS_JWKS= # src/lib/oauth/keys.ts
|
|
# OAUTH_JWT_PRIVATE_KEY= # src/lib/oauth/keys.ts
|
|
# OC_BACKUP_DIR= # src/lib/host-metrics.ts
|
|
# OPENAI_API_KEY= # src/services/ai/embeddings.ts
|
|
# OPS_NOTIFY_USER_ID= # src/services/cat/ops-alert.ts
|
|
# ORANGECAT_OAUTH_CLIENT_ID= # src/app/(public)/docs/sign-in-with-orangecat/snippets.ts
|
|
# ORANGECAT_OAUTH_CLIENT_SECRET= # src/app/(public)/docs/sign-in-with-orangecat/snippets.ts
|
|
# PLATFORM_GROQ_FALLBACK_MODEL= # src/services/ai/groq-models.ts
|
|
# PLATFORM_GROQ_MODEL= # src/services/ai/groq-models.ts
|
|
# PLATFORM_OLLAMA_API_KEY= # src/services/ai/platform-providers.ts
|
|
# PLATFORM_OLLAMA_MODEL= # src/services/ai/platform-providers.ts
|
|
# PLATFORM_OLLAMA_URL= # src/services/ai/platform-providers.ts
|
|
# REINDEX_SECRET= # src/app/api/admin/reindex-embeddings/route.ts
|
|
# SEARXNG_URL= # src/services/cat/capability-gate.ts
|
|
# SOLON_AGENT_API_KEY= # src/services/cat/handlers/governance.ts
|
|
# SOLON_BASE_URL= # src/services/solon/decision-verify.ts
|
|
# SOLON_WEBHOOK_SECRET= # src/app/api/solon/events/route.ts
|
|
# TAVILY_API_KEY= # src/services/cat/capability-gate.ts
|
|
# TOGETHER_DEFAULT_MODEL= # src/services/cat/provider-catalog.ts
|
|
# WEBHOOK_SECRET_KEY= # src/lib/crypto/webhookSecretCipher.ts
|
|
|
|
# ============================================================================
|
|
# SETUP INSTRUCTIONS
|
|
# ============================================================================
|
|
# 1. Copy this file: cp .env.example .env.local
|
|
# 2. Fill in Supabase credentials from your project dashboard
|
|
# 3. Fill in Postgres credentials from Supabase database settings
|
|
# 4. Run: gh auth login (to authenticate GitHub CLI)
|
|
# 5. Run: gh auth token (to get GitHub personal access token)
|
|
# 6. Add GitHub token to GITHUB_TOKEN above
|
|
# 7. Optional: Add OpenRouter API key for platform-level AI
|
|
# 8. Run: npm run dev (to start development server)
|
|
|
|
# ============================================================================
|
|
# CREDENTIALS
|
|
# ============================================================================
|
|
# Local dev: fill in Supabase + Postgres values from your self-hosted
|
|
# Supabase instance (Studio on the box) into .env.local.
|
|
# Production: values live in /opt/orangecat/app/.env on the Hetzner box.
|
|
#
|
|
# Also add manually:
|
|
# - GITHUB_TOKEN (from: gh auth token)
|
|
# - OPENROUTER_API_KEY (optional, from: https://openrouter.ai/keys)
|