Add AI_PROVIDER=openai-compatible mode that reuses OpenAISynthesisProvider with a validated custom base_url, allowing any OpenAI-compatible API (OpenRouter, Ollama, LiteLLM proxy, etc.) without new code. Configuration: - AISettings.provider now accepts openai-compatible - New AISettings.allow_insecure_http: bool = False (HTTP opt-in) - .env.example: commented examples for OpenRouter (HTTPS) and Ollama (HTTP) Factory validation (_validate_openai_compatible_config): - base_url and model required, api_key required (MVP) - HTTPS enforced unless allow_insecure_http=true - Credentials in URL rejected, sensitive query params rejected (including valueless params via keep_blank_values=True) - Malformed URLs and missing hostname rejected (ValueError caught) - No /v1 manipulation; degraded to None + warning on invalid config - redact_url() used for all URL warnings Tests: 13 new factory tests in test_synthesis.py covering routing, URL validation, HTTP policy, credentials, sentinel non-leak, no-network. Coverage: 91.57% (synthesis module). Docs: GUIDE_DEV_PYTHON.md §9.5 updated with 3-provider table, validation rules, and synchronized code example. mypy override for openai.* (follow_imports=skip) to work around mypy 2.3.1 internal error in pre-commit's isolated environment. Co-authored-by: opencode/coder anthropic.claude-sonnet-4-5 <anthropic.claude-sonnet-4-5@agents.invalid> Co-authored-by: opencode/test-engineer anthropic.claude-sonnet-4-5 <anthropic.claude-sonnet-4-5@agents.invalid> Co-authored-by: opencode/tech-writer anthropic.claude-sonnet-4-5 <anthropic.claude-sonnet-4-5@agents.invalid>
73 lines
2.1 KiB
Plaintext
73 lines
2.1 KiB
Plaintext
# --- Pronote ---
|
|
PRONOTE_ICAL_URL=https://college.ent/pronote/ical/Edt_Jean.ics?icalsecurise=REPLACE_ME&version=2024
|
|
PRONOTE_URL=https://college.ent/pronote/eleve.html
|
|
PRONOTE_ACCOUNT_TYPE=parent
|
|
PRONOTE_USERNAME=parent.dupont
|
|
PRONOTE_PASSWORD=your_secure_password
|
|
PRONOTE_ENT=monbureaunumerique
|
|
|
|
# Sources (auto = essayer iCal d'abord, puis pronotepy)
|
|
PRONOTE_AGENDA_SOURCE=auto
|
|
PRONOTE_HOMEWORK_SOURCE=auto
|
|
PRONOTE_MESSAGES_SOURCE=pronotepy
|
|
|
|
# --- CalDAV ---
|
|
CALDAV_URL=https://caldav.example.com/calendars/user/pronote/
|
|
CALDAV_USERNAME=user@example.com
|
|
CALDAV_PASSWORD=your_caldav_password
|
|
CALDAV_CALENDAR_PATH=/pronote-sync/
|
|
# Autoriser HTTP (non-HTTPS) pour un serveur CalDAV local (localhost uniquement)
|
|
CALDAV_ALLOW_INSECURE_HTTP=false
|
|
|
|
# Fenêtre de synchronisation (jours)
|
|
SYNC_PAST_DAYS=7
|
|
SYNC_FUTURE_DAYS=30
|
|
|
|
# --- Agenda théorique ---
|
|
THEORETICAL_AGENDA_PATH=./data/theoretical.json
|
|
SCHOOL_HOLIDAYS_PATH=./data/school_holidays.json
|
|
THEORETICAL_WEEK_ANCHOR_DATE=2026-09-01
|
|
THEORETICAL_WEEK_ANCHOR_TYPE=even
|
|
|
|
# --- XMPP ---
|
|
XMPP_ENABLED=false
|
|
XMPP_JID=user@example.com
|
|
XMPP_PASSWORD=your_xmpp_password
|
|
XMPP_HOST=example.com
|
|
XMPP_PORT=5222
|
|
XMPP_TO=parent@example.com
|
|
XMPP_RESOURCE=pronote-sync
|
|
XMPP_USE_TLS=true
|
|
XMPP_TIMEOUT=30
|
|
|
|
# --- IA (optionnelle) ---
|
|
# L'IA est désactivée par défaut ; l'activer volontairement (AI_ENABLED=true)
|
|
# et renseigner une clé API valide avant tout envoi.
|
|
AI_ENABLED=false
|
|
AI_PROVIDER=openai
|
|
AI_BASE_URL=https://api.openai.com/v1
|
|
# AI_API_KEY=
|
|
# AI_MODEL=gpt-4o-mini # exemple recommandé, non activé par défaut
|
|
|
|
# Exemple : OpenRouter (HTTPS)
|
|
# AI_PROVIDER=openai-compatible
|
|
# AI_BASE_URL=https://openrouter.ai/api/v1
|
|
# AI_MODEL=fournisseur/modele
|
|
# AI_API_KEY=your-openrouter-key
|
|
# AI_ALLOW_INSECURE_HTTP=false
|
|
|
|
# Exemple : Ollama local (HTTP, sans authentification réelle)
|
|
# AI_PROVIDER=openai-compatible
|
|
# AI_BASE_URL=http://127.0.0.1:11434/v1
|
|
# AI_MODEL=modele-local
|
|
# AI_API_KEY=local-not-required
|
|
# AI_ALLOW_INSECURE_HTTP=true
|
|
|
|
# --- Blog ---
|
|
BLOG_ENABLED=false
|
|
BLOG_RSS_URL=https://blogpeda.ac-bordeaux.fr/cjeliote/?feed=rss2
|
|
|
|
# --- Divers ---
|
|
DRY_RUN=false
|
|
LOG_LEVEL=INFO
|