Files
astro-site-cerveau/docs/PC6-JOURNAL-N8N-SETUP.md
Jules Neny e22dd6654a feat: PC6 journal unifie + n8n workflow agregateur (V1 MVP)
Composant Vue JournalList :
- fetch PUBLIC_JOURNAL_URL (defaut data.trans-former.fr/journal.json)
- ecoute event 'hashtag-filter-change' emis par ColJournal (PC2)
- filtre par hashtag actif, tri desc respecte (n8n cote serveur)
- fallback gracieux : loading / errored / empty / no-match

Cabling :
- ColJournal.astro importe et rend <JournalList client:visible />
- placeholder remplace par le composant Vue

Workflow n8n (docs/n8n-workflow-journal-aggregate.json) :
- Schedule trigger cron 0 3 * * *
- Fetch Gitea Atom (jules.atom) + Behold AEP + Behold julesneny (skip si feed IDs absents)
- Code Node normalisation 3 sources -> format JSON commun
- Tri desc + cap top 100
- Write Binary File vers /home/node/.n8n/journal/journal.json (volume Docker partage)

Sources V1 actives :
- Gitea Atom (#stack) - active, 200 OK confirme
- Behold @aep (#aep-politique) - conditionnel feed ID
- Behold @julesneny (#peinture) - conditionnel feed ID

Sources skipped (V1.5/V2) :
- GitHub.com : username 'julesneny' n'existe pas (HTTP 404), pivot Gitea
- Substack 'transformations' : pris par 'WoodHorse' (pas Jules), handle a confirmer
- LinkedIn, Castopod, Blog : V2

Mock journal.json en public/data/ pour dev local (fallback si data.trans-former.fr indisponible).

Setup VPS prepare (cf docs/PC6-JOURNAL-N8N-SETUP.md) :
- Caddyfile bloc data.trans-former.fr ajoute en commentaire (active apres DNS)
- Dossier /var/lib/docker/volumes/vps-kit_n8n_data/_data/journal/ cree
- journal.json initial deploye
- Caddy reload OK valide (config valide)
- Workflow JSON copie sur VPS /tmp/n8n-workflow-journal-aggregate.json (import manuel UI)

Checkpoint Jules requis :
- Ajout DNS A 'data' -> 178.104.106.195 (OVH)
- Decommenter bloc Caddy + reload
- Import workflow n8n via UI (creds basic auth deprecies, login email user)
- Run manuel + activation cron

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-09 01:13:51 +02:00

4.9 KiB

PC6 — Setup journal unifié + n8n workflow

Spec : 0 INBOX/PROMPTS/page-cerveau-build/PROMPT-PC6-journal-n8n.md Pilote : 0 INBOX/PROMPTS/page-cerveau-build/PILOTE-PC.md (delta 5, delta 15)

TL;DR

Le journal de la colonne G est alimenté par un cron n8n nocturne qui agrège plusieurs sources publiques (Gitéa Atom, Behold @aep, Behold @julesneny) et écrit un JSON statique servi par Caddy sur data.trans-former.fr/journal.json.

n8n cron (3h00 UTC)
  -> fetch Gitéa Atom + Behold @aep + Behold @julesneny
  -> normalisation Code Node
  -> tri desc + top 100
  -> écrit /home/node/.n8n/journal/journal.json (volume Docker)
  -> Caddy data.trans-former.fr file_server expose ce fichier
  -> JournalList.vue fetch côté client (no rebuild Astro requis)

Sources V1 actives

Plateforme Hashtag URL feed Statut
Gitéa #stack https://git.trans-former.fr/jules.atom ACTIF
Behold @aep #aep-politique https://feeds.behold.so/{PUBLIC_BEHOLD_AEP} conditionnel (skip si feed ID absent)
Behold @julesneny #peinture https://feeds.behold.so/{PUBLIC_BEHOLD_JULESNENY} conditionnel (skip si feed ID absent)

Sources skipped (V1 -> V1.5/V2)

Plateforme Hashtag Raison
GitHub.com #stack username julesneny n'existe pas (HTTP 404). Pivot Gitéa pour le MVP. À reconfirmer si Jules a un autre handle GitHub public.
Substack #politique transformations.substack.com est pris par "WoodHorse" (pas Jules). Handle Substack à confirmer avant V1.5.
LinkedIn #building-public V2 (RSS via service tiers ou scrape)
Castopod #podcast V2 (Castopod RSS prêt mais hors scope MVP)
Blog trans-former.fr #manifeste V2 (post-PC8 deploy)

Format JSON

{
  "generatedAt": "2026-05-09T03:00:00Z",
  "items": [
    {
      "id": "gitea-2026-05-09-pc6",
      "platform": "gitea",
      "hashtag": "#stack",
      "date": "2026-05-09T01:01:00Z",
      "titre": "PC6 journal unifié + n8n agrégateur",
      "extrait": "...",
      "url": "https://git.trans-former.fr/jules/astro-site-cerveau/commit/...",
      "thumbnail": null
    }
  ],
  "counts": { "total": N, "gitea": N, "instagram": N }
}

Composant Vue

src/components/vue/JournalList.vue :

  • fetch import.meta.env.PUBLIC_JOURNAL_URL (défaut https://data.trans-former.fr/journal.json)
  • écoute window.addEventListener('hashtag-filter-change', ...) émis par ColJournal.astro
  • filtre par hashtag (vide ou tous cochés -> tout afficher ; tous décochés -> rien)
  • tri desc déjà fait côté n8n, le composant respecte l'ordre

Cabling : src/components/astro/ColJournal.astro importe et rend <JournalList client:visible /> dans #journal-list.

Variable d'env

PUBLIC_JOURNAL_URL=https://data.trans-former.fr/journal.json (.env.example)

Override possible en local pointant vers /data/journal.json (mock fourni dans public/data/journal.json).

Setup VPS — étapes (ops, à valider Jules)

1. DNS

Dans OVH zone DNS trans-former.fr :

data    A    178.104.106.195    TTL 600

Attendre propagation (~5min).

2. Volume Docker partagé n8n -> Caddy

Le container n8n monte vps-kit_n8n_data:/home/node/.n8n. On va simplement lire un fichier dans ce volume depuis Caddy.

Path source : /var/lib/docker/volumes/vps-kit_n8n_data/_data/journal/journal.json

ssh vps-hetzner "mkdir -p /var/lib/docker/volumes/vps-kit_n8n_data/_data/journal && \
  chown 1000:1000 /var/lib/docker/volumes/vps-kit_n8n_data/_data/journal"

3. Caddyfile bloc

Ajouter dans le Caddyfile (probablement /etc/caddy/Caddyfile ou /opt/vps-kit/configs/Caddyfile) :

data.trans-former.fr {
    root * /var/lib/docker/volumes/vps-kit_n8n_data/_data/journal
    file_server {
        index journal.json
    }
    encode gzip
    header {
        Cache-Control "public, max-age=300"
        Access-Control-Allow-Origin "https://trans-former.fr"
    }
    log {
        output file /var/log/caddy/data.log
    }
}

Backup + reload :

ssh vps-hetzner "cp /etc/caddy/Caddyfile /etc/caddy/Caddyfile.bak.$(date +%Y%m%d-%H%M%S) && \
  systemctl reload caddy && \
  systemctl status caddy --no-pager | head -10"

4. Workflow n8n

Importer docs/n8n-workflow-journal-aggregate.json dans https://automate.trans-former.fr (UI -> Import from file).

Activer le toggle, vérifier le cron (0 3 * * *).

Configurer les credentials env n8n si besoin (Behold feed IDs) -> non bloquants si absents (workflow skip).

5. Smoke test

# Run manuel (UI n8n -> Execute Workflow)
ssh vps-hetzner "ls -la /var/lib/docker/volumes/vps-kit_n8n_data/_data/journal/"
curl -sf https://data.trans-former.fr/journal.json | jq '.counts'

Backlog (hors scope PC6)

  • Trigger rebuild Astro Coolify webhook (PC8)
  • Sources V2 : LinkedIn, Castopod, Blog, Substack (post handle confirmé)
  • Storage archivage long-terme (V1 = écrasement quotidien)
  • Real-time updates (V3)