- config/settings.py : modèles Pydantic Settings (Pronote, CalDAV, XMPP, AI, Blog, App) avec SecretStr pour les mots de passe et clés API - config/env.py : fonction load_settings() pour le chargement du .env - utils/redaction.py : redact_url, redact_secrets, redact_exception (masquage des tokens icalsecurise, mots de passe et URLs sensibles) - utils/logging.py : setup_logging + RedactingFormatter (masquage automatique des secrets dans les logs) - utils/uid.py : normalize_pronote_uid (suppression suffixes temporels) et generate_deterministic_uid (hash SHA-1 usedforsecurity=False) - .env.example : aligné sur les modèles finaux (XMPP_TO, XMPP_HOST, XMPP_ENABLED, BLOG_ENABLED, etc.) - .pre-commit-config.yaml : ajout pydantic + pydantic-settings aux additional_dependencies du hook mypy - TODO.md : items M2 cochés Décisions d'architecture (@architect) : - XmppSettings : modèle complet §10.2.3, tous champs optionnels - sync_past_days/future_days déplacés vers AppSettings (sans préfixe) - AISettings.enabled = False par défaut - BlogSettings inclus dès M2 - redact_exception comme fonction module (pas méthode) - normalize_pronote_uid (nom du guide et des tests) Validations : - ruff check : PASS - ruff format --check : PASS - mypy strict : PASS (7 fichiers) - bandit : PASS (0 issue) - import settings : OK (toutes valeurs par défaut) - redact_secrets/icalsecurise : masqué en REDACTED - logging : secret masqué dans la sortie - uid normalize : idempotent, deterministic OK - SecretStr : pas de fuite dans repr - pytest : 0 test (infrastructure OK) Co-authored-by: OpenCode/orchestrator <opencode-orchestrator@agents.invalid>
48 lines
1.1 KiB
Plaintext
48 lines
1.1 KiB
Plaintext
# --- Pronote ---
|
|
PRONOTE_ICAL_URL=https://college.ent/pronote/ical/Edt_Jean.ics?icalsecurise=REPLACE_ME&version=2024
|
|
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
|
|
|
|
# Fenêtre de synchronisation (jours)
|
|
SYNC_PAST_DAYS=7
|
|
SYNC_FUTURE_DAYS=30
|
|
|
|
# --- Agenda théorique ---
|
|
THEORETICAL_AGENDA_PATH=./data/theoretical.ics
|
|
|
|
# --- 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) ---
|
|
AI_ENABLED=true
|
|
AI_BASE_URL=https://api.openai.com/v1
|
|
AI_API_KEY=your_ai_api_key
|
|
AI_MODEL=gpt-4o-mini
|
|
|
|
# --- Blog ---
|
|
BLOG_ENABLED=false
|
|
BLOG_RSS_URL=https://blogpeda.ac-bordeaux.fr/cjeliote/?feed=rss2
|
|
|
|
# --- Divers ---
|
|
DRY_RUN=false
|
|
LOG_LEVEL=INFO
|