feat: add web gateway — browser-based chat UI over WebSocket
New platform adapter that serves a full-featured chat interface via HTTP. Enables access from any device on the network (phone, tablet, desktop). Features: - aiohttp server with WebSocket real-time messaging - Token-based authentication - Markdown rendering (marked.js) + code highlighting (highlight.js) - Voice recording via MediaRecorder API + STT transcription - Image, voice, and document display - Typing indicator + message editing (streaming support) - Mobile responsive dark theme - Auto-reconnect on disconnect - Media file cleanup (24h TTL) Config: WEB_UI_ENABLED=true, WEB_UI_PORT=8765, WEB_UI_TOKEN=<token> No new dependencies — uses aiohttp already in [messaging] extra.
This commit is contained in:
parent
e50323f730
commit
a3905ef289
3 changed files with 1219 additions and 0 deletions
|
|
@ -829,6 +829,13 @@ class GatewayRunner:
|
|||
return None
|
||||
return EmailAdapter(config)
|
||||
|
||||
elif platform == Platform.WEB:
|
||||
from gateway.platforms.web import WebAdapter, check_web_requirements
|
||||
if not check_web_requirements():
|
||||
logger.warning("Web: aiohttp not installed. Run: pip install aiohttp")
|
||||
return None
|
||||
return WebAdapter(config)
|
||||
|
||||
return None
|
||||
|
||||
def _is_user_authorized(self, source: SessionSource) -> bool:
|
||||
|
|
@ -848,6 +855,11 @@ class GatewayRunner:
|
|||
if source.platform == Platform.HOMEASSISTANT:
|
||||
return True
|
||||
|
||||
# Web UI users are authenticated via token at the WebSocket level.
|
||||
# No additional allowlist check needed.
|
||||
if source.platform == Platform.WEB:
|
||||
return True
|
||||
|
||||
user_id = source.user_id
|
||||
if not user_id:
|
||||
return False
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue