Date : 13/01/2026 13:26 Duree : ~30 min Statut : TERMINE
Identifier toutes les valeurs hardcodees dans les scripts generate.d/ du dashboard monitoring.
| Script | Taille | Hardcoding | Priorite Migration | Effort |
|---|---|---|---|---|
_common.sh |
5KB | ELEVE | P1 | S |
01-index.sh |
73KB | MOYEN | P2 | M |
02-alerts.sh |
8KB | FAIBLE | P3 | XS |
03-doc.sh |
41KB | TRES ELEVE | P1 | L |
04-secrets.sh |
13KB | TRES ELEVE | P1 | M |
05-endpoints.sh |
63KB | TRES ELEVE | P1 | L |
06-montages.sh |
7KB | FAIBLE | P3 | XS |
07-nginx.sh |
14KB | FAIBLE | P3 | XS |
08-crons.sh |
39KB | MOYEN | P2 | M |
09-architecture.sh |
20KB | OK | - | - |
12-raidz.sh |
19KB | FAIBLE | P3 | XS |
13-models.sh |
10KB | MOYEN | P2 | S |
14-syncthing.sh |
5KB | MOYEN | P2 | S |
Probleme central : IP nginx hardcodee dans deploy_page()
local nginx_host="192.168.1.104"
Footer hardcode dans gen_footer_full():
Solution : Creer un fichier config.json avec:
Hardcoding trouve :
nameMap JS avec noms de serveurs192.168.1.30:8188Deja dynamique :
current.jsonSolution : Generer sections serveurs depuis JSON comme fait pour architecture.html
Hardcoding :
nameMap JS (meme que 01-index)Note : Logique d'alertes basee sur JSON, peu de hardcoding
Hardcoding massif (~60 occurrences):
Solution :
current.json + fichier infra-config.jsonHardcoding (~30 occurrences):
Securite : Ce fichier contient des infos sensibles, migration vers JSON risquee
Solution recommandee : Garder statique, MAJ manuelle
Hardcoding massif (~80 occurrences):
Solution : Fichier services.json avec:
{
"ollama": { "host": "win11", "port": 11434, "url": null },
"redis-prod": { "host": "prod-portainer", "port": 6379, "url": null },
"grafana": { "host": "prod-portainer", "port": 3000, "url": "grafana.33800" }
}
Hardcoding faible :
pve proxmox1 docker-prod dev-portainer gitlab nginx jellyfinDeja dynamique : Montages lus depuis current.json
Hardcoding faible :
Deja dynamique : Sites nginx depuis collecte SSH
Hardcoding moyen (~15 occurrences):
Deja dynamique : Status crons depuis current.json
Hardcoding faible :
Deja dynamique : Donnees ZFS depuis current.json
Hardcoding moyen (~10 occurrences):
Solution : Lire config Ollama depuis JSON
Hardcoding moyen :
Solution : Lire depuis current.json
Creer /stock_8to/33800-stack/monitoring/config.json:
{
"hosts": {
"pve": { "ip": "192.168.1.10", "ip_storage": "10.10.10.10", "mdns": "pve.local" },
"proxmox1": { "ip": "192.168.1.155", "mdns": "proxmox.local" },
"prod-portainer": { "ip": "192.168.1.12", "mdns": "prod-portainer.local" },
"nginx": { "ip": "192.168.1.104", "mdns": "nginx.local" }
},
"services": {
"portainer_prod": { "host": "prod-portainer", "port": 9443, "https": true },
"grafana": { "host": "prod-portainer", "port": 3000, "domain": "grafana.33800" }
}
}
Modifier _common.sh pour lire nginx_host depuis config.json
Modifier gen_footer_full() pour generer liens depuis config.json
Priorite 1 : Scripts a fort impact
_common.sh - Base commune01-index.sh - Page principalePriorite 2 : Scripts a impact moyen
08-crons.sh13-models.sh14-syncthing.shPriorite 3 : Garder statique (documentation)
03-doc.sh - Documentation infra04-secrets.sh - Credentials (securite)05-endpoints.sh - Reference API| Phase | Description | Effort |
|---|---|---|
| 3A | config.json + _common.sh | 2h |
| 3B-P1 | 01-index.sh dynamique | 3h |
| 3B-P2 | crons + models + syncthing | 2h |
| 3B-P3 | (statique - pas de migration) | 0h |
| 4 | Script verification | 1h |
Total : ~8h (1 journee)
config.json : Centralise les IPs = impact sur tous les scripts./generate.sh + verification visuelle09-architecture.sh (exemple de migration reussie)/stock_8to/33800-stack/monitoring/current.json/home/gouroubleu/backlog/13-01-2026-dashboard-dynamique-suite.md