Files
ai-news-writer/.env.example
T
David Santos 7f941e3cf7
Node tests / test (push) Has been cancelled
chore(pm2): auto DEPLOY_REVISION from git in ecosystem
When DEPLOY_REVISION/GIT_REVISION are unset, ecosystem.config.cjs runs
git rev-parse --short HEAD at pm2 start so /health deploy_revision matches
the checkout. Documented in README and .env.example.

Made-with: Cursor
2026-03-25 02:50:38 +00:00

63 lines
2.1 KiB
Bash

# AI Engine
OPENAI_API_KEY=
# Use "openai" (default), "anthropic", or "local"
AI_PROVIDER=openai
AI_MODEL=gpt-4o
OPENAI_MAX_ATTEMPTS=3
OPENAI_RETRY_BASE_MS=800
# Anthropic (optional alternative)
ANTHROPIC_API_KEY=
# WordPress target (default site — override per-site in config/sites/)
WP_URL=https://wp.newsproject.bitreport.pt
WP_USER=
WP_PASSWORD=
# Retries for WP REST GET/POST (publish, tags, wp:test users/me)
WP_HTTP_MAX_ATTEMPTS=3
WP_RETRY_BASE_MS=500
# Social / X (Twitter) listening (optional)
TWITTER_BEARER_TOKEN=
# Retries for X API v2 recent search (429 / 5xx / transient network)
X_HTTP_MAX_ATTEMPTS=3
X_RETRY_BASE_MS=1000
# Telegram listening (optional)
TELEGRAM_BOT_TOKEN=
# HTTP client tuning (RSS + article scraper)
HTTP_USER_AGENT=ai-news-writer/0.1 (+https://bitreport.pt)
RSS_TIMEOUT_MS=10000
RSS_HTTP_MAX_ATTEMPTS=3
RSS_RETRY_BASE_MS=500
RSS_FETCH_CONCURRENCY=3
SCRAPER_TIMEOUT_MS=12000
SCRAPER_HTTP_MAX_ATTEMPTS=3
SCRAPER_RETRY_BASE_MS=500
# App — HTTP status (listen/auto mode only; bind all interfaces for NPM → LXC)
HOST=0.0.0.0
PORT=3200
# Optional: set at deploy (CI webhook) — surfaced in GET /health as deploy_revision
# PM2 ecosystem.config.cjs also injects DEPLOY_REVISION from `git rev-parse --short HEAD` when unset.
# DEPLOY_REVISION=
# GIT_REVISION=
# Inbound socket timeouts (ms). headers must stay above request (enforced in code if misconfigured).
HTTP_REQUEST_TIMEOUT_MS=120000
HTTP_HEADERS_TIMEOUT_MS=125000
LOG_LEVEL=info
# Optional: required to save changes from /ui (sources, social, theme). Use a long random value in production.
ADMIN_TOKEN=
# auto | manual
MODE=manual
# Cron for auto mode, e.g. "*/30 * * * *" (every 30 min)
AUTO_CRON=*/30 * * * *
# JSONL article index under data/ — trim when file is large (stops unbounded disk growth)
ARTICLE_LOG_MAX_LINES=10000
ARTICLE_LOG_TRIM_AT_BYTES=2097152
# Optional override path (absolute or relative to repo root)
# ARTICLE_LOG_PATH=data/article-index.jsonl
# Optional IANA timezone for RSS cron (e.g. Europe/Lisbon). Invalid values are ignored with a warning.
# CRON_TIMEZONE=Europe/Lisbon