feat: implement OmegaConf-based configuration management with uv

Configuration changes:
- Replace pydantic-settings with OmegaConf for flexible config management
- Support YAML config files via CONFIG_FILE environment variable
- Support environment variables with STEWARD__SECTION__KEY format
- Add config_schema.yaml as default configuration schema
- Create pydantic models for each configuration section for type safety
- Maintain backward compatibility via properties on Settings class
- Add CONFIGURATION.md with comprehensive setup and usage guide
- Update pyproject.toml to include config_schema.yaml in package data

Build/deployment changes:
- Replace pip with uv in Dockerfile for faster dependency installation
- Create docker-compose.dev.yml for local development (build .)
- Keep docker-compose.yml for production (uses ghcr.io/djw4/steward:latest)
- Update .env.example with new STEWARD__* variable format

This setup is designed for Kubernetes deployment:
- Non-sensitive config goes in ConfigMap (config.yaml)
- Secrets go in Secret resources (environment variables)
- Single unified configuration system for all environments
This commit is contained in:
Daniel Wagner
2026-07-26 12:34:23 +10:00
parent 669b57a317
commit d5eac108f8
9 changed files with 657 additions and 58 deletions
+32 -22
View File
@@ -2,31 +2,41 @@
# Never commit .env to version control.
# Telegram bot token from @BotFather
TELEGRAM_BOT_TOKEN=
STEWARD__TELEGRAM__BOT_TOKEN=
# Comma-separated Telegram user IDs allowed to talk to Steward.
# Leave empty to allow everyone (not recommended for production).
TELEGRAM_ALLOWED_USER_IDS=
# List of user IDs allowed to interact via DM (JSON format, empty = all users)
STEWARD__TELEGRAM__ALLOWED_USER_IDS='[1234567890]'
# OpenAI (or compatible) credentials
OPENAI_API_KEY=
OPENAI_BASE_URL=https://api.openai.com/v1
OPENAI_MODEL=gpt-4o
# List of group/channel IDs where bot operates (JSON format, empty = all groups)
STEWARD__TELEGRAM__GROUP_IDS='[-1005308306472]'
# Optional: override the default system prompt
# OPENAI_SYSTEM_PROMPT=
# OpenAI API key
STEWARD__OPENAI__API_KEY=
# Daily analysis target (optional)
# ANALYSIS_TARGET_URL=https://your-internal-api/endpoint
# ANALYSIS_TARGET_API_KEY=
# ANALYSIS_CRON_HOUR=8
# ANALYSIS_CRON_MINUTE=0
# OpenAI API base URL (can use any OpenAI-compatible provider)
STEWARD__OPENAI__BASE_URL=https://api.openai.com/v1
# Thread memory store path (JSON file for persisted thread summaries)
# THREAD_MEMORY_PATH=thread_memory.json
# Model to use
STEWARD__OPENAI__MODEL=gpt-4o
# MCP / OpenAPI tool server (open-webui/openapi-servers compatible)
# Point to any OpenAPI-spec tool server to enable LLM tool calling.
# The service fetches /openapi.json from MCP_SERVER_URL to discover tools.
# MCP_SERVER_URL=http://localhost:8000
# MCP_SERVER_API_KEY=
# Optional: Custom system prompt for the LLM
# STEWARD__OPENAI__SYSTEM_PROMPT="You are Steward..."
# Optional: Target URL for API analysis
STEWARD__ANALYSIS__TARGET_URL=
# Optional: API key for analysis target
STEWARD__ANALYSIS__TARGET_API_KEY=
# Cron schedule for automatic analysis
STEWARD__ANALYSIS__CRON_HOUR=8
STEWARD__ANALYSIS__CRON_MINUTE=0
# Path to thread memory storage (use absolute path in containers)
STEWARD__MEMORY__THREAD_MEMORY_PATH=/data/thread_memory.json
# Optional: MCP/OpenAPI tool server URL
STEWARD__TOOLS__MCP_SERVER_URL=
# Optional: API key for MCP server
STEWARD__TOOLS__MCP_SERVER_API_KEY=