PatchCenter - Application web de gestion du patching
Migration migrate_patching_notes_20260507.sql: - servers.skip_first_reboot boolean (TPV1: vptraatpf1/2 a true) - servers.patching_notes text (markdown — meme operateur) - server_clusters.reboot_delay_min_minutes int default 0 - Backfill patching_notes pour 22 cas particuliers du wiki SANEF: ASM Oracle (~50 hosts kernel*), TPV1, HAproxy FL, Covoiturage, SI Patrimoine (vrpatbsip1 avant vrpataels1, kibana, certs), Talend, Scoop (Debian apt-mark hold + CentOS containers Docker), DATI (pm2/tomcat post-reboot), COMMVAULT (mode maintenance), Masterparc (kmeihm pm2), Splunk (RPM special), Site institutionnel (HAproxy backend rotation, no *node*), Centreon (1 par 1 + check centengine), Sextan (10min reboot delay), OCTAN, PAIPOR (site maintenance), Gaspar, Postgres, Oracle OEM, SMTP relay - Cluster Sextan cree (10 min entre reboots) + 10 serveurs Sextan rattaches UI iexec: - Banner cumule en haut: '⚠ Particularites pour N serveur(s)' si au moins 1 note - Badges sur la cellule asset_name: ⚠ note (modal markdown au clic), ⏭ skip 1st reboot, ⏱ Xmin (cluster reboot delay) - Modal patching_notes avec rendu pre/markdown, fermeture Escape UI fiche serveur (server_detail.html): - Ligne 'Skip 1er reboot' dans bloc Patching - Bandeau orange particularites avec contenu patching_notes si renseigne Pas encore implemente cote logique d'execution (Phase 2): - skip_first_reboot logic dans le step reboot - enforcement reboot_delay_min_minutes entre membres cluster - Pour l'instant: notes affichees en mode 'memo operateur' uniquement |
||
|---|---|---|
| agents | ||
| app | ||
| deploy | ||
| docs | ||
| scripts | ||
| tools | ||
| .gitignore | ||
| cleanup_fqdn_incoherents.sql | ||
| fill_fqdn_from_domain_ltd.sql | ||
| migrate_applications.sql | ||
| migrate_correspondance.sql | ||
| migrate_drop_legacy_servers.sql | ||
| migrate_etat.sql | ||
| migrate_missing_tables_20260427.sql | ||
| migrate_patch_excludes_v2_20260507.sql | ||
| migrate_patch_excludes_v2_fix_20260507.sql | ||
| migrate_patch_excludes_wiki.sql | ||
| migrate_patching_notes_20260507.sql | ||
| migrate_pct_workflow_20260507.sql | ||
| migrate_planning_imports_v2.sql | ||
| migrate_planning_imports_v3.sql | ||
| migrate_planning_imports_v4.sql | ||
| migrate_planning_imports.sql | ||
| migrate_qualys_vuln_dashboard.sql | ||
| migrate_servers_satellite.sql | ||
| migrate_teams_pct_workflow.sql | ||
| migrate_teams_rules_20260506.sql | ||
| migrate_teams_rules_v2_20260506.sql | ||
| migrate_users.sql | ||
| populate_zones.sql | ||
| README.md | ||
| replace_etat.py | ||
| requirements.txt | ||
| resync_servers_text_fields.sql | ||
| run.sh | ||
| schema.sql | ||
| tailwind.config.js | ||
| update_zone_dmz.sql | ||
PatchCenter — SLPM (SANEF Linux Patch Manager)
App web FastAPI/PostgreSQL pour piloter le patching Linux SANEF : plan de patching, historique, users AD/LDAP, intégration iTop, API Qualys.
Source de vérité : VM CT 116 (pc.mpcz.fr, 172.28.199.185 + pct exec 116 -- ...) + repo Gitea adminmpmcz/patchcenter.
Workflow de dev (validé 2026-04-17)
- Claude modifie direct sur CT 116 via SSH →
git pushGitea - Khalid sur poste SANEF (
C:\patchcenter) →git pull→ test sur127.0.0.1:8080 - Si OK : Khalid ajoute ses modifs +
git pushGitea - Claude sur CT 116 →
git pull+systemctl restart patchcenter
Stack
- Python 3.11+ / FastAPI / Uvicorn
- PostgreSQL (patchcenter)
- Jinja2 + Tailwind (templates)
- LDAP (AD SANEF) pour auth
Structure
app/— code FastAPI (auth, models, routers, services)deploy/— scripts déploiement + migrations SQLtools/— scripts d'import/enrichissement (Qualys, iTop, Ayoub, etc.)docs/— DEPLOY.md, SANEF_PATCHING_PROCESS.mdmigrate_*.sql— migrations DB manuelles
Lancer en local (poste SANEF, pas la copie locale Claude)
python -m uvicorn app.main:app --host 0.0.0.0 --port 8080
Gitea
- Repo :
http://172.28.199.202:3000/adminmpmcz/patchcenter - Creds HTTPS :
adminmpmcz/Admin@2025
Notes
SECRET_KEYcôté VM :sanef-patchcenter-demo-key-change-me(drop-in systemd)- DB échangée via Gitea Releases (attachment
.sql), jamais dans le git tree - Après restore DB :
ALTER TABLE ... OWNER TO patchcenterpour toutes les tables+sequences