fix(boxwart): Nachrichten-Job raeumt nach dem Versand auf, Hermes-Dashboard-Link repariert
- news-melden.sh verschiebt Text- und Sprechfassung nach dem Versand nach *.gesendet.*. Hermes' write_file ueberschreibt keine vorhandene Datei; der liegengebliebene Bericht vom Vortag liess jeden Morgenlauf 4 von 5 Schreibversuchen scheitern. Ein zweiter Aufruf desselben Laufs erkennt den schon verschickten Bericht weiterhin. - hermes_ui-Proxy: Seit Hermes v0.21 leitet das Dashboard auf /login um und die Anmeldeseite schickt an /auth/password-login — beides ohne /hermes-ui-Praefix. Der Knopf „Hermes-GUI oeffnen“ landete deshalb auf MC2s „Diese Seite gibt es nicht“. Umleitungen und Anmelde-Pfade werden jetzt umgeschrieben, mehrere Set-Cookie bleiben. - Tests fuer die Pfad-Umschreibung (12 Backend-Tests gesamt). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
12dadfe6ef
commit
3d2c9549fb
@@ -0,0 +1,33 @@
|
||||
"""Tests für die Pfad-Umschreibung des Hermes-Dashboard-Proxys (Anmeldung seit Hermes v0.21)."""
|
||||
|
||||
from routers import hermes_ui
|
||||
|
||||
|
||||
def test_umleitung_auf_login_bekommt_praefix():
|
||||
assert hermes_ui.praefixiere_ort("/login?next=%2F") == "/hermes-ui/login?next=%2F"
|
||||
assert hermes_ui.praefixiere_ort("/") == "/hermes-ui/"
|
||||
|
||||
|
||||
def test_fremde_oder_schon_praefixierte_ziele_bleiben():
|
||||
assert hermes_ui.praefixiere_ort("/hermes-ui/sessions") == "/hermes-ui/sessions"
|
||||
assert hermes_ui.praefixiere_ort("https://example.org/x") == "https://example.org/x"
|
||||
assert hermes_ui.praefixiere_ort("//evil.example/x") == "//evil.example/x"
|
||||
|
||||
|
||||
def test_anmeldeseite_schickt_an_praefixierten_pfad():
|
||||
html = (b'<html><head><title>Login</title></head><body>'
|
||||
b'<form action="/auth/password-login" method="post"></form>'
|
||||
b'<script>fetch("/auth/password-login",{method:"POST"});location.href="/login?x=1"</script>'
|
||||
b'</body></html>')
|
||||
neu = hermes_ui.praefixiere_html(html)
|
||||
assert b'action="/hermes-ui/auth/password-login"' in neu
|
||||
assert b'fetch("/hermes-ui/auth/password-login"' in neu
|
||||
assert b'"/hermes-ui/login?x=1"' in neu
|
||||
assert b'window.__HERMES_BASE_PATH__="/hermes-ui"' in neu
|
||||
|
||||
|
||||
def test_andere_absolute_pfade_bleiben_unberuehrt():
|
||||
html = b'<head></head><a href="/assets/x.js">x</a><a href="/authors">y</a>'
|
||||
neu = hermes_ui.praefixiere_html(html)
|
||||
assert b'href="/assets/x.js"' in neu
|
||||
assert b'href="/authors"' in neu
|
||||
@@ -5,17 +5,17 @@ from datetime import datetime
|
||||
from services import modell_nutzung
|
||||
|
||||
ZEILEN = [
|
||||
'2026-09-23T03:12:44+02:00 box llama-swap[1]: [INFO] Request 192.168.178.28 '
|
||||
'"POST /v1/chat/completions HTTP/1.1" 200 10254 "Go-http-client/1.1" 1.2s',
|
||||
'2026-09-23T03:12:50+02:00 box llama-swap[1]: [INFO] Request 192.168.178.28 '
|
||||
'"POST /v1/chat/completions HTTP/1.1" 200 9000 "Go-http-client/1.1" 1.1s',
|
||||
'2026-09-23T07:01:00+02:00 box llama-swap[1]: [INFO] Request 127.0.0.1 '
|
||||
'"POST /v1/chat/completions HTTP/1.1" 200 800 "python-httpx/0.28.1" 3s',
|
||||
'2026-09-23T07:02:00+02:00 box llama-swap[1]: [INFO] Request 127.0.0.1 '
|
||||
'"POST /v1/embeddings HTTP/1.1" 200 800 "python-httpx/0.28.1" 20ms',
|
||||
('2026-09-23T03:12:44+02:00 box llama-swap[1]: [INFO] Request 192.168.178.28 '
|
||||
'"POST /v1/chat/completions HTTP/1.1" 200 10254 "Go-http-client/1.1" 1.2s'),
|
||||
('2026-09-23T03:12:50+02:00 box llama-swap[1]: [INFO] Request 192.168.178.28 '
|
||||
'"POST /v1/chat/completions HTTP/1.1" 200 9000 "Go-http-client/1.1" 1.1s'),
|
||||
('2026-09-23T07:01:00+02:00 box llama-swap[1]: [INFO] Request 127.0.0.1 '
|
||||
'"POST /v1/chat/completions HTTP/1.1" 200 800 "python-httpx/0.28.1" 3s'),
|
||||
('2026-09-23T07:02:00+02:00 box llama-swap[1]: [INFO] Request 127.0.0.1 '
|
||||
'"POST /v1/embeddings HTTP/1.1" 200 800 "python-httpx/0.28.1" 20ms'),
|
||||
"2026-09-17T19:59:00+02:00 box llama-swap[1]: [INFO] <Qwen3.8-27B> Health check passed on http://localhost:5805/health",
|
||||
'2026-09-10T03:00:00+02:00 box llama-swap[1]: [INFO] Request 192.168.178.28 '
|
||||
'"POST /v1/chat/completions HTTP/1.1" 200 1 "Go-http-client/1.1" 1s',
|
||||
('2026-09-10T03:00:00+02:00 box llama-swap[1]: [INFO] Request 192.168.178.28 '
|
||||
'"POST /v1/chat/completions HTTP/1.1" 200 1 "Go-http-client/1.1" 1s'),
|
||||
]
|
||||
|
||||
NAMEN = {"127.0.0.1": "Lucy und OpenChamber über MC2", "192.168.178.28": "NerdQuiz auf Arcane"}
|
||||
|
||||
@@ -10,14 +10,14 @@ PROJEKTE_SYNC_LOG = [
|
||||
]
|
||||
|
||||
ERRORS_LOG = [
|
||||
'2026-09-23 07:02:41,584 WARNING [cron_195e479e8e30_20260923_070017] agent.tool_executor: '
|
||||
'Tool write_file returned error (0.00s): {"error": "Refusing to overwrite /tmp/news-text.md: '
|
||||
'/tmp/news-text.md exists"}',
|
||||
'2026-09-23 07:02:58,516 WARNING [cron_195e479e8e30_20260923_070017] agent.tool_executor: '
|
||||
'Tool write_file returned error (0.00s): {"error": "Refusing to overwrite /tmp/news-text.md"}',
|
||||
('2026-09-23 07:02:41,584 WARNING [cron_195e479e8e30_20260923_070017] agent.tool_executor: '
|
||||
'Tool write_file returned error (0.00s): {"error": "Refusing to overwrite /tmp/news-text.md: '
|
||||
'/tmp/news-text.md exists"}'),
|
||||
('2026-09-23 07:02:58,516 WARNING [cron_195e479e8e30_20260923_070017] agent.tool_executor: '
|
||||
'Tool write_file returned error (0.00s): {"error": "Refusing to overwrite /tmp/news-text.md"}'),
|
||||
"2026-09-23 07:03:39,596 WARNING gateway.mirror: Mirror: no session found for telegram:1 thread=None",
|
||||
'2026-09-22 07:01:10,000 WARNING [cron_195e479e8e30_20260922_070017] agent.tool_executor: '
|
||||
'Tool web_extract returned error (0.10s): {"error": "timeout"}',
|
||||
('2026-09-22 07:01:10,000 WARNING [cron_195e479e8e30_20260922_070017] agent.tool_executor: '
|
||||
'Tool web_extract returned error (0.10s): {"error": "timeout"}'),
|
||||
]
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user