docs: update hermes-hub-deploiement.md with verified basic auth configuration on hermes-nabil
This commit is contained in:
@@ -2,8 +2,8 @@
|
|||||||
|
|
||||||
**Instance auteur** : gemini / nabil
|
**Instance auteur** : gemini / nabil
|
||||||
**Date** : 2026-08-20
|
**Date** : 2026-08-20
|
||||||
**Tags** : hermes, hub, multi-univers, vps, tailscale, cloudflare-access, fastapi, subdomains, filebrowser, dsh
|
**Tags** : hermes, hub, multi-univers, vps, tailscale, cloudflare-access, fastapi, subdomains, filebrowser, dsh, basic-auth
|
||||||
**Statut** : valide (testé et vérifié en direct sur VPS Contabo avec chargement effectif des bundles JS)
|
**Statut** : valide (testé et vérifié en direct sur VPS Contabo avec authentification complète)
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -20,42 +20,51 @@ L'objectif est d'offrir une interface web unifiée sur le VPS Contabo (`100.94.9
|
|||||||
2. Un **Sélecteur Toggle DSH** (conception Claude Design) pour basculer instantanément entre la session et l'explorateur de fichiers DSH (`https://dsh.hub.yesminedor.tn/`).
|
2. Un **Sélecteur Toggle DSH** (conception Claude Design) pour basculer instantanément entre la session et l'explorateur de fichiers DSH (`https://dsh.hub.yesminedor.tn/`).
|
||||||
3. L'absence totale de fuite de contexte, de mémoire JS ou de cookies de session entre univers.
|
3. L'absence totale de fuite de contexte, de mémoire JS ou de cookies de session entre univers.
|
||||||
4. La résolution 100% native des assets absolus (`/assets/main-*.js`) via un routage par **sous-domaine dédié** (`*.hub.yesminedor.tn`).
|
4. La résolution 100% native des assets absolus (`/assets/main-*.js`) via un routage par **sous-domaine dédié** (`*.hub.yesminedor.tn`).
|
||||||
5. La sécurisation intégrale via **Cloudflare Access** (OTP Email + 2FA) et maillage **Tailscale** sans exposition de port WAN sur le NAS ni d'IP publique directe sur le VPS.
|
5. La sécurisation intégrale via **Cloudflare Access** (OTP Email + 2FA) et **Basic Auth** scrypt sur l'agent Nabil.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Contexte et Architecture
|
## Architecture & Configuration
|
||||||
|
|
||||||
- **Routage par Sous-Domaine** :
|
### 1. Routage par Sous-Domaine
|
||||||
- `hub.yesminedor.tn` : Shell du Workspace Switcher (UI d'orchestration)
|
- `hub.yesminedor.tn` : Shell du Workspace Switcher (UI d'orchestration)
|
||||||
- `tt.hub.yesminedor.tn` : Proxy direct vers Hermes TT (`http://100.86.197.88:3010`)
|
- `tt.hub.yesminedor.tn` : Proxy direct vers Hermes TT (`http://100.86.197.88:3010`)
|
||||||
- `nyora.hub.yesminedor.tn` : Proxy direct vers Hermes Nyora (`http://100.86.197.88:3020`)
|
- `nyora.hub.yesminedor.tn` : Proxy direct vers Hermes Nyora (`http://100.86.197.88:3020`)
|
||||||
- `perso.hub.yesminedor.tn` : Proxy direct vers Hermes Perso (`http://100.86.197.88:3031`)
|
- `perso.hub.yesminedor.tn` : Proxy direct vers Hermes Perso (`http://100.86.197.88:3031`)
|
||||||
- `nabil.hub.yesminedor.tn` : Proxy direct vers Hermes Nabil (`http://hermes-nabil:9119`)
|
- `nabil.hub.yesminedor.tn` : Proxy direct vers Hermes Nabil (`http://hermes-nabil:9119`)
|
||||||
- `dsh.hub.yesminedor.tn` : Proxy direct vers Filebrowser DSH (`http://dsh-vps-filebrowser:8080`)
|
- `dsh.hub.yesminedor.tn` : Proxy direct vers Filebrowser DSH (`http://dsh-vps-filebrowser:8080`)
|
||||||
- **Réseaux Docker VPS** :
|
|
||||||
- `hermes-hub` est raccordé à `mcp-vps` (joignable par `cloudflared-mcp-vps` sur `http://hermes-hub:8080`) et à `dsh_vps_net` (pour joindre `dsh-vps-filebrowser` et `hermes-nabil`).
|
### 2. Configuration Basic Auth `hermes-nabil`
|
||||||
|
Fichier : `/data/config.yaml` dans le conteneur `hermes-nabil` :
|
||||||
|
```yaml
|
||||||
|
dashboard:
|
||||||
|
basic_auth:
|
||||||
|
username: nabil
|
||||||
|
password_hash: "scrypt+h8nCk5/CqFiypw==/3i04g/Fc50AiN2bpDEyju3MjfStkYvFdUPrs="
|
||||||
|
secret: "hermes-nabil-master-session-secret-2026-secure"
|
||||||
|
```
|
||||||
|
- **Username** : `nabil`
|
||||||
|
- **Mot de passe** : `NabilMasterHermes2026!`
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Actions Cloudflare (À configurer par Nabil)
|
## Actions Cloudflare (À configurer par Nabil)
|
||||||
|
|
||||||
### 1. Cloudflare Tunnel (`mcp-vps`) — Public Hostnames
|
1. **Cloudflare Tunnel (`mcp-vps`)** :
|
||||||
Pointer le wildcard ou les 6 hostnames vers `http://hermes-hub:8080` :
|
Pointer le wildcard ou les 6 hostnames vers `http://hermes-hub:8080` :
|
||||||
- `*.hub.yesminedor.tn` -> `HTTP` : `hermes-hub:8080`
|
- `*.hub.yesminedor.tn` -> `HTTP` : `hermes-hub:8080`
|
||||||
*(Ou séparément : `hub.yesminedor.tn`, `tt.hub.yesminedor.tn`, `nyora.hub.yesminedor.tn`, `perso.hub.yesminedor.tn`, `nabil.hub.yesminedor.tn`, `dsh.hub.yesminedor.tn`)*
|
*(Ou séparément : `hub.yesminedor.tn`, `tt.hub.yesminedor.tn`, `nyora.hub.yesminedor.tn`, `perso.hub.yesminedor.tn`, `nabil.hub.yesminedor.tn`, `dsh.hub.yesminedor.tn`)*
|
||||||
|
|
||||||
### 2. Cloudflare Access Application
|
2. **Cloudflare Access Application** :
|
||||||
- **Domain** : `*.hub.yesminedor.tn` et `hub.yesminedor.tn`
|
- Protéger le domaine `*.hub.yesminedor.tn` et `hub.yesminedor.tn`.
|
||||||
- **Policy** : Allow Email OTP (`nabil.derouiche@...`)
|
- Authentification OTP par email.
|
||||||
- **Bénéfice** : Un seul écran de connexion pour l'ensemble des 4 univers et de l'explorateur DSH.
|
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Preuves Directes de Fonctionnement
|
## Preuves Directes de Fonctionnement
|
||||||
|
|
||||||
```python
|
### Preuve 1 : Chargement des 4 Univers et Assets JS
|
||||||
# Test exécuté depuis linux-mcp-vps via le réseau interne mcp-vps :
|
```
|
||||||
PROVEN OK [HTTP 200] | Host: hub.yesminedor.tn | Main Hub Switcher UI | text/html; charset=utf-8 | 9385 bytes
|
PROVEN OK [HTTP 200] | Host: hub.yesminedor.tn | Main Hub Switcher UI | text/html; charset=utf-8 | 9385 bytes
|
||||||
PROVEN OK [HTTP 200] | Host: tt.hub.yesminedor.tn | Universe TT Root HTML | text/html; charset=utf-8 | 11026 bytes
|
PROVEN OK [HTTP 200] | Host: tt.hub.yesminedor.tn | Universe TT Root HTML | text/html; charset=utf-8 | 11026 bytes
|
||||||
PROVEN OK [HTTP 200] | Host: tt.hub.yesminedor.tn | Universe TT Main JS Bundle | application/javascript | 2039429 bytes
|
PROVEN OK [HTTP 200] | Host: tt.hub.yesminedor.tn | Universe TT Main JS Bundle | application/javascript | 2039429 bytes
|
||||||
@@ -65,21 +74,22 @@ PROVEN OK [HTTP 200] | Host: nabil.hub.yesminedor.tn | Universe Nabil Root HTML
|
|||||||
PROVEN OK [HTTP 200] | Host: dsh.hub.yesminedor.tn | DSH Filebrowser Root HTML | text/html; charset=utf-8 | 6112 bytes
|
PROVEN OK [HTTP 200] | Host: dsh.hub.yesminedor.tn | DSH Filebrowser Root HTML | text/html; charset=utf-8 | 6112 bytes
|
||||||
```
|
```
|
||||||
|
|
||||||
---
|
### Preuve 2 : Authentification complète sur l'univers Nabil
|
||||||
|
|
||||||
## Investigation Problème 2 : Mur d'authentification interne Hermes Nabil
|
|
||||||
|
|
||||||
### Analyse du code source de `hermes_cli/web_server.py`
|
|
||||||
Dans le binaire officiel Hermes Agent (Nous Research) :
|
|
||||||
```python
|
|
||||||
def should_require_auth(host: str, allow_public: bool = False) -> bool:
|
|
||||||
return host not in ("127.0.0.1", "localhost", "::1")
|
|
||||||
```
|
```
|
||||||
|
=== 1. LOGIN STATUS ===
|
||||||
|
HTTP Status: 200
|
||||||
|
Session Info: {'ok': True, 'next': '/'}
|
||||||
|
|
||||||
- **Comportement natif** :
|
=== 2. SET-COOKIE HEADERS RECEIVED ===
|
||||||
- Si `host == "127.0.0.1"` : Le dashboard désactive le mur de login OAuth/Password (`auth_required = False`).
|
-> hermes_session_at=... (Max-Age=43200; Path=/; SameSite=lax)
|
||||||
- Si `host != "127.0.0.1"` (ex: `0.0.0.0` pour être joint via le bridge Docker) : Le dashboard enclenche **obligatoirement** le gate de login (`auth_required = True`) avec une mire Nous Research / Basic Auth.
|
-> hermes_session_rt=... (Max-Age=2592000; Path=/; SameSite=lax)
|
||||||
- **Désactivation d'auth native** : Le flag `--insecure` est expressément ignoré et déprécié depuis le durcissement de juin 2026 (`hermes-0day patch`).
|
-> hermes_session_provider=basic (Max-Age=2592000; Path=/; SameSite=lax)
|
||||||
- **Solutions envisageables pour Nabil** :
|
|
||||||
1. **Option A (Recommandée)** : Définir un compte Basic Auth unique via `HERMES_DASHBOARD_BASIC_AUTH_USERNAME=nabil` et `HERMES_DASHBOARD_BASIC_AUTH_PASSWORD=...` dans l'environnement de `hermes-nabil`.
|
=== 3. REQUESTING AUTHENTICATED DASHBOARD / ===
|
||||||
2. **Option B (Hermes Workspace)** : Déployer le conteneur `hermes-workspace` (identique à TT, Nyora, Perso) devant `hermes-nabil` sur le port interne de l'agent.
|
Authenticated Home Status: 200
|
||||||
|
HTML Title Tag: ['<title>Hermes Agent - Dashboard</title>']
|
||||||
|
|
||||||
|
=== 4. REQUESTING AUTHENTICATED API /api/sessions ===
|
||||||
|
API Sessions Status: 200
|
||||||
|
API Sessions Response Keys: ['sessions', 'total', 'limit', 'offset']
|
||||||
|
```
|
||||||
|
|||||||
Reference in New Issue
Block a user