forked from 0xWheatyz/SPARC
2e6b8c7445
Send HTTP POST notifications to configured webhook URLs when batch jobs complete or when scheduled analysis detects significant changes. - Add SPARC/webhooks.py with retry logic (3 attempts, exponential backoff) - Support generic HTTP POST and Slack-compatible text payloads - Integrate into batch job completion handler in api.py - Configure via WEBHOOK_URLS env var (comma-separated) - Payload includes event type, job ID, status, and summary Closes leeworks-agents/SPARC#23 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
49 lines
1.5 KiB
Bash
49 lines
1.5 KiB
Bash
# SPARC Configuration
|
|
|
|
# ---- Application Environment ----
|
|
# Set to "production" or "staging" in deployed environments.
|
|
# The API will refuse to start with the default JWT secret unless APP_ENV=development.
|
|
APP_ENV=development
|
|
|
|
# ---- API Keys ----
|
|
|
|
# SerpAPI key for patent search
|
|
API_KEY=your_serpapi_key_here
|
|
|
|
# OpenRouter API key for LLM analysis
|
|
OPENROUTER_API_KEY=your_openrouter_key_here
|
|
|
|
# ---- Database ----
|
|
|
|
# PostgreSQL credentials (used by docker-compose)
|
|
POSTGRES_USER=postgres
|
|
POSTGRES_PASSWORD=change-me-to-a-secure-password
|
|
POSTGRES_DB=sparc
|
|
|
|
# Full database URL (must match the credentials above)
|
|
DATABASE_URL=postgresql://postgres:change-me-to-a-secure-password@localhost:5432/sparc
|
|
|
|
# ---- Authentication ----
|
|
|
|
# JWT Secret for signing tokens
|
|
# IMPORTANT: Change this to a secure random string in production
|
|
JWT_SECRET=your-secure-jwt-secret-change-in-production
|
|
|
|
# ---- CORS ----
|
|
|
|
# Comma-separated list of allowed origins for CORS
|
|
# Defaults to http://localhost:3000,http://localhost:5173 when unset
|
|
# CORS_ORIGINS=https://sparc.example.com,https://app.example.com
|
|
|
|
# ---- Cache ----
|
|
|
|
# When USE_CACHE=true: check database for cached responses before making API calls
|
|
# When USE_CACHE=false: always make fresh API calls (still stores results in database)
|
|
USE_CACHE=true
|
|
|
|
# ---- Webhooks ----
|
|
|
|
# Comma-separated list of webhook URLs for job completion and alert notifications
|
|
# Supports generic HTTP POST and Slack/Discord incoming webhooks
|
|
# WEBHOOK_URLS=https://hooks.slack.com/services/XXX,https://example.com/webhook
|