# Stock Intel configuration. Copy to .env and fill in. .env is gitignored and never leaves the host. # Every service and script reads this one file. Setup walkthrough: docs/SETUP-APIS.md. # # cp .env.example .env # python scripts/bootstrap.py --generate-secrets # fills every blank password below # # --------------------------------------------------------------------------- # Passwords and keys generated for you (leave blank, bootstrap writes them) # --------------------------------------------------------------------------- # Postgres superuser, used by the migration runner and the container itself. POSTGRES_USER=postgres POSTGRES_PASSWORD= # Service roles. stocks_n8n writes the pipeline, stocks_app serves the UI, # stocks_analyst is read-only with a 5s statement timeout. STOCKS_PG_PASSWORD= STOCKS_APP_PG_PASSWORD= STOCKS_ANALYST_PG_PASSWORD= # Intraday recorder roles (only used with the intraday profile). STOCKS_INTRADAY_SVC_PASSWORD= STOCKS_INTRADAY_RO_PASSWORD= # n8n's own database and the key it encrypts credentials with. Losing the key means # re-importing every credential, so back .env up. N8N_DB_NAME=n8n N8N_DB_USER=n8n N8N_DB_PASSWORD= N8N_ENCRYPTION_KEY= # Bearer token for every /api route on the app. Paste it into the UI once. STOCK_INTEL_APP_TOKEN= # Shared header secret between the app and the n8n webhooks, both directions. STOCK_INTEL_N8N_WEBHOOK_SECRET= # --------------------------------------------------------------------------- # Network # --------------------------------------------------------------------------- # Host interface the published ports bind to. 127.0.0.1 keeps the stack on this machine. # Use 0.0.0.0 only behind a reverse proxy that does authentication. HOST_BIND_IP=127.0.0.1 PORT=8095 # Change these two if something already listens on the default ports. N8N_HOST_PORT=5678 TZ=America/New_York # n8n as the app reaches it, and the URL n8n builds webhook links from. N8N_BASE_URL=http://n8n:5678 N8N_WEBHOOK_URL=http://localhost:5678/ # Created once in the n8n UI (Settings -> n8n API). Only the developer scripts need it. N8N_API_KEY= # --------------------------------------------------------------------------- # Postgres. These are host-side values: the scripts in scripts/ connect over the # loopback port Compose publishes. The app, n8n and the recorder always use the # container name instead, which Compose sets for them. # --------------------------------------------------------------------------- STOCKS_PG_HOST=localhost # Host-side port. The containers always reach Postgres on 5432 inside the network. STOCKS_PG_PORT=5432 STOCKS_PG_DB=stocks STOCKS_PG_USER=stocks_app STOCKS_ANALYST_PG_USER=stocks_analyst # --------------------------------------------------------------------------- # Market data. All three have free tiers; see docs/SETUP-APIS.md for sign-up links, # rate limits and what breaks without each one. # --------------------------------------------------------------------------- # Alpaca (free Basic plan): daily bars, market clock, intraday bars and quotes. ALPACA_API_KEY_ID= ALPACA_API_SECRET_KEY= # Free tier is the IEX tape. "sip" is the consolidated feed and needs a paid plan. STOCK_INTEL_QUOTE_FEED=iex STOCK_INTEL_QUOTE_CACHE_SECONDS=20 # Finnhub (free, 60 req/min): news, earnings, fundamentals, insiders, analyst ratings, # and ticker validation when you add a symbol. FINNHUB_API_KEY= # Alpha Vantage (free, 25 req/day): topic sentiment. The pipeline budgets 22 calls a day. ALPHA_VANTAGE_API_KEY= # SEC EDGAR requires a contact string on every request. Use your own name and email. SEC_USER_AGENT=your-name your-email@example.com # --------------------------------------------------------------------------- # Analyst LLM. Pick one provider; the others can stay blank. # anthropic | openai | ollama | openrouter # --------------------------------------------------------------------------- LLM_PROVIDER=anthropic ANTHROPIC_API_KEY= OPENAI_API_KEY= # Optional: any OpenAI-compatible endpoint (LM Studio, vLLM, a proxy). OPENAI_BASE_URL= # Local models. Free, slower, no key. Point at your Ollama host. OLLAMA_BASE_URL=http://host.docker.internal:11434 OPENROUTER_API_KEY= # Hard daily ceiling on analyst spend, in USD. Ollama always costs 0. ANALYST_DAILY_CAP_USD=5 # --------------------------------------------------------------------------- # Telegram brief (optional). Create a bot with @BotFather, then message it once and # read your chat id from https://api.telegram.org/bot/getUpdates. # --------------------------------------------------------------------------- TELEGRAM_BOT_TOKEN= TELEGRAM_CHAT_ID= # --------------------------------------------------------------------------- # Intraday recorder (only with: docker compose --profile intraday up -d) # --------------------------------------------------------------------------- SI_INTRADAY_FEED=iex SI_INTRADAY_SYMBOLS=SPY,QQQ SI_INTRADAY_POLL_SECONDS=60 SI_INTRADAY_LEASE_SECONDS=120 # --------------------------------------------------------------------------- # Optional: LangSmith tracing for the analyst graph. # --------------------------------------------------------------------------- LANGSMITH_TRACING=false LANGSMITH_API_KEY= LANGSMITH_PROJECT=stock-intel-analyst # --------------------------------------------------------------------------- # Optional: OpenTelemetry GenAI spans, one per model call (model, tokens, cost, calling # n8n workflow). OTLP/HTTP JSON to any receiver; off while the endpoint is empty. # --------------------------------------------------------------------------- OTEL_EXPORTER_OTLP_TRACES_ENDPOINT= # Comma-separated key=value, e.g. Authorization=Bearer%20 OTEL_EXPORTER_OTLP_HEADERS= OTEL_SERVICE_NAME=stock-intel # e.g. deployment.environment=prod,host.name= OTEL_RESOURCE_ATTRIBUTES=