fix: error on explicit missing config path; update env.example; add README config docs

- config.rs: NoxaConfig::load() now exits with an error when an explicit path
  (via --config arg or NOXA_CONFIG env var) does not exist; implicit ./config.json
  missing still silently returns default
- Updated test: test_load_missing_file_returns_default replaced with
  test_load_implicit_missing_file_returns_default (tests None path, not explicit)
- env.example: replaced fat legacy content with slim secrets-only template
  matching .env.example; deleted redundant .env.example
- README.md: replaced bare env-var table with full Configuration section
  covering config.json workflow, precedence, NOXA_CONFIG override, and bool
  flag limitation
This commit is contained in:
Jacob Magar 2026-04-11 12:35:21 -04:00
parent 10364416c1
commit 1c112459bc
4 changed files with 322 additions and 62 deletions

View file

@ -1,46 +1,17 @@
# ============================================
# Noxa Configuration
# Copy to .env and fill in your values
# ============================================
# Secrets and URLs only — everything else goes in config.json
# See config.example.json for the full list of configurable defaults.
# --- LLM Providers ---
# Cloud API key (required for --cloud / --research)
NOXA_API_KEY=
# Gemini CLI (primary provider — requires `gemini` binary on PATH)
# GEMINI_MODEL=gemini-2.5-pro # defaults to gemini-2.5-pro
# Single proxy URL (or use NOXA_PROXY_FILE for pool rotation)
NOXA_PROXY=
# Ollama (fallback; local inference)
OLLAMA_HOST=http://localhost:11434
OLLAMA_MODEL=qwen3:8b
# Webhook URL for completion notifications
NOXA_WEBHOOK_URL=
# OpenAI (optional cloud fallback)
# OPENAI_API_KEY — set your OpenAI key
# OPENAI_BASE_URL — defaults to https://api.openai.com/v1
# OPENAI_MODEL — defaults to gpt-4o-mini
# LLM base URL (Ollama or OpenAI-compatible endpoint)
NOXA_LLM_BASE_URL=
# Anthropic (optional cloud fallback)
# ANTHROPIC_API_KEY — set your Anthropic key
# ANTHROPIC_MODEL — defaults to claude-sonnet-4-20250514
# --- Proxy ---
# Single proxy
# NOXA_PROXY=http://user:pass@host:port
# Proxy file (one per line: host:port:user:pass)
# NOXA_PROXY_FILE=/path/to/proxies.txt
# --- Server (noxa-server only) ---
# NOXA_PORT=3000
# NOXA_HOST=0.0.0.0
# NOXA_AUTH_KEY=your-auth-key
# NOXA_MAX_CONCURRENCY=50
# NOXA_JOB_TTL_SECS=3600
# NOXA_MAX_JOBS=100
# --- CLI LLM overrides ---
# NOXA_LLM_PROVIDER=ollama
# NOXA_LLM_MODEL=qwen3:8b
# NOXA_LLM_BASE_URL=http://localhost:11434
# --- Logging ---
# NOXA_LOG=info
# Optional: path to a non-default config file (default: ./config.json)
# NOXA_CONFIG=/path/to/my-config.json