fix: migration hostnames hub point->tiret + bouton repli sidebar

This commit is contained in:
bolbol
2026-08-20 20:00:19 +01:00
parent 3fadb884f0
commit e474071f76
4 changed files with 170 additions and 27 deletions
+24 -8
View File
@@ -13,22 +13,38 @@ from app.personas import ensure_dirs
def get_subdomain_target(host: str) -> Optional[Tuple[str, str]]:
"""
Inspects Host header and returns (target_backend_url, universe_id) if it matches a subdomain.
Examples:
tt.hub.yesminedor.tn -> (HERMES_TT_URL, 'tt')
nyora.hub.yesminedor.tn -> (HERMES_NYORA_URL, 'nyora')
perso.hub.yesminedor.tn -> (HERMES_PERSO_URL, 'perso')
nabil.hub.yesminedor.tn -> (HERMES_NABIL_URL, 'nabil')
dsh.hub.yesminedor.tn -> (DSH_FILEBROWSER_URL, 'nabil')
Inspects Host header and returns (target_backend_url, universe_id) if it matches a universe hostname.
Hostnames (Dash-based 1st level):
tt-hub.yesminedor.tn -> (HERMES_TT_URL, 'tt')
nyora-hub.yesminedor.tn -> (HERMES_NYORA_URL, 'nyora')
perso-hub.yesminedor.tn -> (HERMES_PERSO_URL, 'perso')
nabil-hub.yesminedor.tn -> (HERMES_NABIL_URL, 'nabil')
dsh-hub.yesminedor.tn -> (DSH_FILEBROWSER_URL, 'nabil')
Apex / Hub UI:
hub.yesminedor.tn -> None (Serves index.html Workspace Switcher)
"""
if not host:
return None
hostname = host.split(":")[0].lower()
# The main hub switcher UI should NOT be proxied
if hostname in ("hub.yesminedor.tn", "localhost", "127.0.0.1"):
return None
sub = None
if hostname.endswith(".hub.yesminedor.tn"):
# 1. New 1st level dash-based production hostnames (*-hub.yesminedor.tn)
if hostname.endswith("-hub.yesminedor.tn"):
sub = hostname.rsplit("-hub.yesminedor.tn", 1)[0]
# 2. Backward compatibility (*.hub.yesminedor.tn)
elif hostname.endswith(".hub.yesminedor.tn"):
sub = hostname.rsplit(".hub.yesminedor.tn", 1)[0]
# 3. Localhost dash development (*-hub.localhost)
elif hostname.endswith("-hub.localhost"):
sub = hostname.rsplit("-hub.localhost", 1)[0]
# 4. Localhost dot development (*.localhost)
elif hostname.endswith(".localhost"):
sub = hostname.rsplit(".localhost", 1)[0]
+14 -6
View File
@@ -3,11 +3,18 @@
{% block content %}
<div class="hub-shell">
<!-- Sidebar / Workspace Switcher -->
<aside class="hub-sidebar">
<aside id="hub-sidebar" class="hub-sidebar">
<div class="hub-brand">
<div class="hub-logo-icon">H</div>
<div class="hub-brand-text">Hermes Hub</div>
<div class="hub-brand-badge">v1.0</div>
<div class="hub-brand-left">
<div class="hub-logo-icon">H</div>
<div class="hub-brand-text">Hermes Hub</div>
<div class="hub-brand-badge">v1.0</div>
</div>
<button id="btn-toggle-sidebar" class="hub-collapse-btn" type="button" aria-label="Replier la barre latérale" title="Replier la barre latérale">
<svg class="hub-collapse-icon" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round">
<polyline points="15 18 9 12 15 6"></polyline>
</svg>
</button>
</div>
<div class="hub-nav-section">Univers Hermes</div>
@@ -22,6 +29,7 @@
data-scope="{{ u.scope }}"
data-tagline="{{ u.tagline }}"
data-supports-files="{{ 'true' if u.supports_files else 'false' }}"
title="{{ u.name }} — {{ u.tagline }}"
style="--item-accent: var({{ u.accent_token }});"
>
<div class="hub-universe-avatar">
@@ -39,11 +47,11 @@
<!-- Sidebar Tools Footer -->
<div class="hub-sidebar-footer">
<button id="btn-edit-persona" class="hub-tool-btn" type="button">
<button id="btn-edit-persona" class="hub-tool-btn" type="button" title="Personnalité & Ton">
<span>⚙️</span>
<span>Personnalité & Ton</span>
</button>
<button id="btn-clone-universe" class="hub-tool-btn" type="button">
<button id="btn-clone-universe" class="hub-tool-btn" type="button" title="Cloner ce profil">
<span>🧬</span>
<span>Cloner ce profil</span>
</button>