diff --git a/.env.example b/.env.example index bfab55f..86d5567 100644 --- a/.env.example +++ b/.env.example @@ -55,3 +55,11 @@ DATA_PATH=/srv/data/folio # Logs Apache (onglet Recherches dans /admin) # Nom du fichier de log d'accès du vhost dans /var/log/apache2/ APACHE_ACCESS_LOG=lan.acegrp.varlog-access.log + +# IA — analyse critique et réécriture d'articles dans l'éditeur +# Provider : anthropic (API) ou claude_code (CLI local) +# AI_PROVIDER=anthropic +# Clé API Anthropic (obtenir sur https://console.anthropic.com/) +ANTHROPIC_API_KEY= +# Modèle à utiliser (défaut : claude-haiku-4-5-20251001) — ignoré si provider=claude_code +# AI_MODEL=claude-haiku-4-5-20251001 diff --git a/CHANGELOG.md b/CHANGELOG.md index b3b2ad0..e81d91f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,149 @@ Format : [Keep a Changelog](https://keepachangelog.com/fr/1.0.0/) — versionnag --- +## [1.6.25] - 2026-05-16 + +### Ajouté +- Admin : onglet « IA » — statut provider/clé, sélecteur `anthropic`/`claude_code`, champ modèle, procédure d'installation CLI, sauvegarde dans `site_settings.json` (#97) +- `AiService` : support du provider Claude Code CLI via `proc_open` + lecture provider/modèle depuis `SiteSettings` (#97) +- Éditeur : bouton IA unique « Analyser et proposer » — un seul appel retourne l'analyse critique et la réécriture via séparateur `===CRITIQUE===/===REWRITE===` (#96) + +### Corrigé +- Éditeur IA : boutons placés dans `wizard/step1.php` (la vraie page d'édition) ; `ai-editor.js` adapté pour `#wz-content` et extraction du titre depuis le Markdown (#96) +- Sécurité CSP : extraction du ` @@ -976,17 +1032,13 @@ foreach (COLOR_PALETTE_16 as $_i => $_rgb): -
- Voir -
- -

Erreur :

- - -
- -
-
+ + Voir ↗ + + + ⚠ Erreur + @@ -1178,7 +1230,15 @@ foreach (COLOR_PALETTE_16 as $_i => $_rgb):
Termes recherchés
- Derniers 14 jours de logs · cache 10 min +
+ Derniers jours · cache 10 min +
+ 7 j + 14 j +
+
@@ -1199,7 +1259,7 @@ foreach (COLOR_PALETTE_16 as $_i => $_rgb): # Terme recherché - Fois + Visiteurs @@ -1230,6 +1290,57 @@ foreach (COLOR_PALETTE_16 as $_i => $_rgb): + + + + +
Flux supprimé.
+ + +
Flux RSS agrégés
+

Tous les flux enregistrés par les utilisateurs. Seul un administrateur peut les supprimer.

+ + +

Aucun flux enregistré.

+ +
+ + + + + + + + + + + + + + + + + + + + + +
UtilisateurLibelléURLAjouté le
+ + + + +
+ + +
+
+
+ + + + @@ -1305,6 +1416,8 @@ foreach (COLOR_PALETTE_16 as $_i => $_rgb):
+ -
Minuscules, chiffres, tirets. Exemple : esp8266
-
+
- + +
+
+ + +
Minuscules, chiffres, tirets — basé sur le titre.
@@ -1376,6 +1490,127 @@ foreach (COLOR_PALETTE_16 as $_i => $_rgb): + + + + + +
Configuration IA enregistrée.
+ +
Erreur lors de l'enregistrement.
+ + +
Intelligence artificielle
+ + +
+
Statut
+
+ + + + + + + + + + + + + + + + + + + +
Clé Anthropic (ANTHROPIC_API_KEY)✓ Configurée' : '✗ Absente' ?>
Claude Code CLI (/usr/local/bin/claude)✓ Trouvé' : '✗ Introuvable' ?>
Provider actif
Modèle actif
+
+
+ + +
+
Configuration
+
+
+
+ +
+
+ > + +
+
+ > + +
+
+
+
+ + +
Laisser vide pour utiliser le défaut (claude-haiku-4-5-20251001). Ignoré si le provider est Claude Code CLI.
+
+ +
+
+
+ + +
+
Clé API Anthropic
+
+
+ La clé API Anthropic ne peut pas être saisie ici.
+ Elle doit être définie dans le fichier .env du serveur : +
ANTHROPIC_API_KEY=sk-ant-...
+
Statut actuel : ✓ Configurée' : '✗ Absente' ?>
+
+
+
+ + +
+
Procédure d'installation de Claude Code CLI
+
+ +
/usr/local/bin/claude détecté.
+ +
/usr/local/bin/claude introuvable — suivez les étapes ci-dessous.
+ +

À exécuter en SSH sur le serveur (en root ou via sudo) :

+
# 1. Installer Claude Code CLI (en root)
+sudo npm install -g @anthropic-ai/claude-code
+
+# Vérifier l'installation
+/usr/local/bin/claude --version
+
+# 2. Créer le répertoire HOME de www-data pour Claude
+sudo mkdir -p /var/lib/claude-www
+sudo chown www-data:www-data /var/lib/claude-www
+
+# 3. Authentifier Claude en tant que www-data
+sudo -u www-data HOME=/var/lib/claude-www /usr/local/bin/claude auth login
+# → Suivre les instructions (OAuth navigateur ou clé API)
+
+# 4. Vérifier que ça fonctionne
+sudo -u www-data HOME=/var/lib/claude-www /usr/local/bin/claude --print "Réponds juste OK"
+
+
+ + + diff --git a/templates/author_articles.php b/templates/author_articles.php index 9f8d530..ead17ad 100644 --- a/templates/author_articles.php +++ b/templates/author_articles.php @@ -1,6 +1,4 @@
text($post['content']); - $preview = mb_strimwidth(strip_tags($html), 0, 120, '…'); + $preview = mb_strimwidth($post['plain'] ?? '', 0, 120, '…'); $category = trim((string)($post['category'] ?? '')); $gradient = coverGradient($category !== '' ? $category : $post['uuid'], $allCats ?? []); $postUrl = '/post/' . rawurlencode($post['slug']); diff --git a/templates/author_profile.php b/templates/author_profile.php index b83c931..21eafb0 100644 --- a/templates/author_profile.php +++ b/templates/author_profile.php @@ -1,6 +1,4 @@
text($post['content']); - $preview = mb_strimwidth(strip_tags($html), 0, 120, '…'); + $preview = mb_strimwidth($post['plain'] ?? '', 0, 120, '…'); $category = trim((string)($post['category'] ?? '')); $gradient = coverGradient($category !== '' ? $category : $post['uuid'], $allCats ?? []); $postUrl = '/post/' . rawurlencode($post['slug']); diff --git a/templates/comments_section.php b/templates/comments_section.php index f6af609..d723823 100644 --- a/templates/comments_section.php +++ b/templates/comments_section.php @@ -142,3 +142,4 @@ setcookie('_csrf_c', $_csrfToken, [
+ diff --git a/templates/edit_tags.php b/templates/edit_tags.php index 7621331..99007b2 100644 --- a/templates/edit_tags.php +++ b/templates/edit_tags.php @@ -97,8 +97,10 @@ $_typeLabel = $isCatField ? 'Catégorie' : ($tagTypes[$tagType] ?? ucfirst($tag + +

Aucun terme détecté dans cet article.

diff --git a/templates/flux.php b/templates/flux.php index 401e912..9d98e97 100644 --- a/templates/flux.php +++ b/templates/flux.php @@ -4,6 +4,21 @@

Flux agrégés

+ +
+ flux en erreur + +
+ +

Aucun article disponible pour l'instant.

diff --git a/templates/layout.php b/templates/layout.php index c96bf79..191a6a7 100644 --- a/templates/layout.php +++ b/templates/layout.php @@ -46,11 +46,20 @@ - + + class=""> - +