33800 Docs

← Retour

Proposition COMPLÈTE : Architecture Unifiée Dashboard + Mémoire Claude

Date : 21/01/2026 19:45 Status : EN ATTENTE VALIDATION

Sources de Données Existantes (INVENTAIRE COMPLET)

1. current.json (32KB) - DONNÉES LIVE

Collecté toutes les heures par collect.sh

current.json
├── timestamp
├── servers/
│   ├── pve (status, zfs, vms, system, nfs, mounts)
│   ├── proxmox1 (status, zfs, vms, system)
│   ├── docker-prod (42 containers, images, volumes)
│   ├── dev-portainer (28 containers)
│   ├── gitlab (version, services up/down)
│   ├── nginx (45 sites, ssl_expiry, up/down)
│   ├── jellyfin (service, cache)
│   └── win11 (disks, gpu, services)
├── services/
│   ├── ollama (models_count, status)
│   ├── comfyui (status)
│   ├── redis_prod (memory, keys)
│   ├── redis_dev (memory, keys)
│   ├── needfinder (posts, needs, last_collection)
│   ├── notif_logger (sent, failed, last_24h)
│   ├── supabase_prod (containers_healthy)
│   ├── nextcloud (version, users)
│   ├── whisper (model)
│   └── yolo (model)
└── crons/ (à ajouter)

2. config.json (5KB) - CONFIGURATION STATIQUE

config.json
├── hosts/ (IPs, mDNS, labels)
├── services/ (ports, domains)
├── deploy/ (target, url)
└── footer/ (infra, services)

3. services-registry.json - DÉPLOIEMENTS

services-registry.json
├── services/
│   └── {name}/ (target, strategy, commit, status, domain)
└── last_updated

4. machines-registry.json - MACHINES DEPLOY

machines-registry.json
└── machines/
    └── {name}/ (ip, type, ssh_user, services_path)

5. Fichiers Secrets (NON exposés)

docker/secrets/
├── prod.env (credentials PROD)
├── dev.env (credentials DEV)
└── common.env

6. Documentation Existante

docs/
├── infrastructure.md (231 lignes)
├── o2switch-architecture.md (186 lignes)
├── smart-deploy-system.md (485 lignes)
├── ai-orchestrator-patches.md (193 lignes)
├── nginx-config-backup.md (139 lignes)
└── autofs-queuing-nfs.md (222 lignes)

Crons Existants (12 sur PVE)

Cron Schedule Description
monitoring-33800 0 * * * * Collecte current.json
rsync-stock8-to-stock36 0 * * * * Sync horaire
rsync-stock8-to-stock36 0 5 * * * Sync quotidien
o2switch-backup 0 */2 * * * Sync configs
o2switch-backup 0 */6 * * * Backup PostgreSQL
o2switch-backup 30 */6 * * * Backup GitLab
nginx-logs-archive 55 23 * * * Archive logs
zfs-alerts ? Alertes ZFS
backup-check ? Vérif backups
audit-33800 ? Audit sécurité
verify-dashboard ? Vérif dashboard
sync-logs-o2switch ? Sync logs Loki

Stacks Docker (27 sur prod-portainer)

Stack Containers Usage
notifications ntfy, apprise, notif-logger Push/Mail
monitoring loki, promtail, grafana, prometheus Logs/Metrics
supabase-prod 11 containers BDD PROD
redis-prod redis, exporter Cache PROD
ai-orchestrator 1 Queue IA
open-webui 1 Interface Ollama
pihole 1 DNS
syncthing 1 Sync files
registry 1 Docker registry
yolo-api 1 Détection objets
whisper-api 1 Speech-to-text
portainer 1 Management
+ projets ~15 APIs diverses

Architecture Cible

┌─────────────────────────────────────────────────────────────────────────────┐
│                         SOURCES DE DONNÉES                                   │
├─────────────────────────────────────────────────────────────────────────────┤
│                                                                              │
│   current.json          config.json         services-registry.json          │
│   (live, horaire)       (statique)          (déploiements)                  │
│        │                     │                     │                        │
│        └──────────┬──────────┴──────────┬──────────┘                        │
│                   │                     │                                   │
│                   ▼                     ▼                                   │
│         ┌─────────────────┐   ┌─────────────────┐                           │
│         │   DASHBOARD     │   │  MÉMOIRE CLAUDE │                           │
│         │  (pour toi)     │   │   (pour moi)    │                           │
│         └─────────────────┘   └─────────────────┘                           │
│                   │                     │                                   │
│    ┌──────────────┼──────────────┐     │                                   │
│    │              │              │     │                                   │
│    ▼              ▼              ▼     ▼                                   │
│  HTML           HTML           HTML  index/        memory/                 │
│  Statique       Live           Claude services.md  détails.md             │
│  (référence)    (JS fetch)     viewer machines.md                         │
│                                       urls.md                              │
└─────────────────────────────────────────────────────────────────────────────┘

Dashboard - Audit Complet des 23 Pages

Pages STATIQUES (OK) - 8 pages

Documentation/référence qui ne change pas souvent.

Page Sujet Source
doc.html Documentation Hardcodé
endpoints.html API endpoints Hardcodé
models.html Guide modèles Ollama Hardcodé
nginx.html Configs nginx current.json.servers.nginx
secrets.html Credentials (masqués) Hardcodé
architecture.html Vue architecture Hardcodé
montages.html Montages NFS/SMB current.json
shortlinks.html Liens raccourcis localStorage

Pages à PASSER EN LIVE - 9 pages

Données qui changent fréquemment.

Page Sujet Source Live Refresh
index.html Dashboard principal current.json 60s
services.html Services déployés services-registry.json 60s
alerts.html Alertes système current.json (errors) 30s
raidz.html Status ZFS current.json.servers.*.zfs 60s
crons.html Timeline crons current.json.crons (à ajouter) 60s
linkedin.html LinkedIn connector browser-connector/api 30s
syncthing.html Syncthing status API syncthing 60s
o2switch.html Backup status Fichier status O2switch 5min
needfinder.html Collecteur current.json.services.needfinder 60s

Pages DÉJÀ LIVE (OK) - 3 pages

Page API Refresh
ai-orchestrator.html ai-orchestrator.33800/api 30s
ai-jobs.html ai-orchestrator.33800/api/jobs 5s
schema.html Canvas dynamique -

Pages à INTÉGRER - 1 page

Page Source Action
claude.html ~/backup/configs/claude/ Intégrer claude.nowhere84.com

Pages à ÉVALUER - 2 pages

Page Status Recommandation
yolo.html Hybrid OK si utilisé
needfinder-v2.html Live Garder ou fusionner

Mémoire Claude - Structure Complète

Niveau 1 : CLAUDE.md Core (~200 lignes)

TOUJOURS chargé

# Règles Obligatoires / Interdictions (~50 lignes)
# Workflow Claude (~40 lignes)
# Symlinks et chemins (~20 lignes)
# Chargement proactif mémoire (~30 lignes)
# Liste modules disponibles (~30 lignes)
# Quick reference critique (~30 lignes)

Niveau 2 : index/ (~400 lignes total)

Généré automatiquement depuis current.json + config.json Chargé AUTO quand sujet détecté

Fichier Source Contenu
index/services.md current.json.servers.*.containers Tous containers (70 total)
index/machines.md current.json.servers 7 serveurs avec status
index/urls.md current.json.servers.nginx.sites 45 URLs actives
index/stacks.md current.json.servers.docker-prod 27 stacks
index/crons.md Crons PVE 12 crons
index/credentials-index.md Liste sans valeurs ~20 credentials

Niveau 3 : memory/ (~1500 lignes total)

Détails complets - chargé À LA DEMANDE

Fichier Lignes Contenu
memory/o2switch.md ~200 Structure, crons, scripts, credentials
memory/notifications.md ~150 Stack notif, endpoints, payloads
memory/stockage.md ~200 ZFS pools, NFS exports, rsync
memory/docker.md ~150 Stacks détaillées, conventions
memory/cicd.md ~200 GitLab, Smart-Deploy, pipelines
memory/logging.md ~150 Loki, Promtail, requêtes
memory/ai-tools.md ~250 10 outils win11, orchestrator
memory/credentials.md ~150 Valeurs complètes
memory/reseau.md ~100 Bridges, plages IP, mDNS

Scripts à Créer/Modifier

1. generate-claude-index.sh (NOUVEAU)

Génère les fichiers index/ depuis current.json

#!/bin/bash
# Génère ~/.claude/index/ depuis current.json

CURRENT="/stock_8to/33800-stack/monitoring/current.json"
INDEX_DIR="$HOME/.claude/index"

# services.md - Tous les containers
generate_services_index() {
    echo "# Services Infrastructure 33800"
    echo "Généré: $(date)"
    echo ""
    echo "## Containers PROD ($(jq '.servers["docker-prod"].containers.running' $CURRENT))"
    jq -r '.servers["docker-prod"].containers.list[] | "| \(.name) | \(.status) | \(.port) |"' $CURRENT
    echo ""
    echo "## Containers DEV ($(jq '.servers["dev-portainer"].containers.running' $CURRENT))"
    jq -r '.servers["dev-portainer"].containers.list[] | "| \(.name) | \(.status) | \(.port) |"' $CURRENT
}

# machines.md - Tous les serveurs
generate_machines_index() {
    echo "# Machines Infrastructure 33800"
    echo "Généré: $(date)"
    jq -r '.servers | to_entries[] | "| \(.key) | \(.value.ip) | \(.value.status) | CPU:\(.value.system.cpu)% RAM:\(.value.system.ram)% |"' $CURRENT
}

# urls.md - Tous les sites nginx
generate_urls_index() {
    echo "# URLs Actives"
    echo "Généré: $(date)"
    echo "Up: $(jq '.servers.nginx.sites_up_count' $CURRENT) | Down: $(jq '.servers.nginx.sites_down_count' $CURRENT)"
    jq -r '.servers.nginx.sites[] | "| \(.name) | \(.target) | \(.access) |"' $CURRENT
}

generate_services_index > $INDEX_DIR/services.md
generate_machines_index > $INDEX_DIR/machines.md
generate_urls_index > $INDEX_DIR/urls.md

2. Modifier generate.sh

Ajouter à la fin :

# Générer fichiers index Claude
echo "Generating Claude index files..."
./generate-claude-index.sh

# Générer page claude.html
./generate.d/30-claude.sh

3. generate.d/30-claude.sh (NOUVEAU)

Génère claude.html (viewer markdown intégré)

4. Modifier collect.sh

Ajouter collecte des crons dans current.json

Fichiers à Splitter (>500 lignes)

Fichier Lignes Action
01-index.sh 1392 Split en 3
05-endpoints.sh 1221 Split en 3
20-ai-jobs.sh 1086 Split en 3
18-ai-tools.sh 1051 Split en 2
03-doc.sh 934 Split en 2
08-crons.sh 815 Split en 2

Règle : Max 500 lignes par fichier

Plan d'Exécution (6 Phases)

Phase 1 : Préparer l'infrastructure (30min)

  1. Créer dossiers ~/.claude/index/ et ~/.claude/memory/
  2. Backup CLAUDE.md actuel
  3. Créer script generate-claude-index.sh

Phase 2 : Splitter les gros fichiers (2h)

  1. Split 01-index.sh → index-header.sh, index-services.sh, index-stats.sh
  2. Split 05-endpoints.sh → endpoints-prod.sh, endpoints-dev.sh, endpoints-ai.sh
  3. Split autres fichiers >500 lignes
  4. Tester generate.sh

Phase 3 : Passer pages en live (3h)

  1. index.html → fetch current.json
  2. services.html → fetch services-registry.json
  3. raidz.html → fetch current.json.servers.*.zfs
  4. alerts.html → fetch current.json (errors)
  5. crons.html → fetch current.json.crons
  6. Autres pages

Phase 4 : Intégrer claude.html (1h)

  1. Créer generate.d/30-claude.sh
  2. Générer page avec viewer MD
  3. Ajouter dans navigation
  4. Rediriger claude.nowhere84.com

Phase 5 : Générer index Claude (1h)

  1. Implémenter generate-claude-index.sh complet
  2. Intégrer dans generate.sh
  3. Tester génération
  4. Vérifier chargement proactif

Phase 6 : Réduire CLAUDE.md (2h)

  1. Créer nouveau CLAUDE.md core (~200 lignes)
  2. Créer fichiers memory/ depuis ancien CLAUDE.md
  3. Tester session complète
  4. Ajuster si nécessaire

Résumé Comparatif

Élément Avant Après
CLAUDE.md 1355 lignes ~200 lignes core
Fichiers index 0 6 fichiers auto-générés
Fichiers memory 0 9 fichiers détaillés
Pages dashboard live 3 12
Pages statiques 16 8
claude.nowhere84.com Séparé Intégré dashboard
Gros fichiers (>500) 6 0
Source données Multiple current.json unifié

Validation Requise


En attente de ta validation.