Compare commits

..

3 Commits

Author SHA1 Message Date
09eb22fb4f Merge branch 'main' into fix/1414
Some checks failed
Review Approval Gate / verify-review (pull_request) Failing after 12s
CI / test (pull_request) Failing after 1m15s
CI / validate (pull_request) Failing after 1m22s
2026-04-22 01:14:49 +00:00
98225fd2a1 Merge branch 'main' into fix/1414
Some checks failed
Review Approval Gate / verify-review (pull_request) Failing after 10s
CI / test (pull_request) Failing after 1m17s
CI / validate (pull_request) Failing after 1m20s
2026-04-22 01:07:43 +00:00
Alexander Whitestone
b5e256ab54 fix: replace hardcoded VPS IP with dynamic WebSocket URL (#1414)
Some checks failed
CI / test (pull_request) Failing after 1m9s
CI / validate (pull_request) Failing after 1m6s
Review Approval Gate / verify-review (pull_request) Failing after 7s
Replaces hardcoded ws://143.198.27.163:8765 in HUD status display
with dynamic URL matching the actual WebSocket connection.

Before: ws://143.198.27.163:8765
After:  ${protocol}//${window.location.host}/api/world/ws

Fixes:
- HUD now shows correct URL through proxy/nginx
- No exposed internal IP
- Works with any deployment configuration

Fixes #1414
2026-04-20 20:58:50 -04:00
3 changed files with 2 additions and 39 deletions

2
app.js
View File

@@ -1269,7 +1269,7 @@ async function updateSovereignHealth() {
{ name: 'LOCAL DAEMON', status: daemonReachable ? 'ONLINE' : 'OFFLINE' },
{ name: 'FORGE / GITEA', url: 'https://forge.alexanderwhitestone.com', status: 'ONLINE' },
{ name: 'NEXUS CORE', url: 'https://forge.alexanderwhitestone.com/Timmy_Foundation/the-nexus', status: 'ONLINE' },
{ name: 'HERMES WS', url: 'ws://143.198.27.163:8765', status: wsConnected ? 'ONLINE' : 'OFFLINE' },
{ name: 'HERMES WS', url: `${window.location.protocol === 'https:' ? 'wss:' : 'ws:'}//${window.location.host}/api/world/ws`, status: wsConnected ? 'ONLINE' : 'OFFLINE' },
{ name: 'SOVEREIGNTY', url: 'http://localhost:8082/metrics', status: metrics.sovereignty_score + '%' }
];

View File

@@ -29,7 +29,7 @@ from typing import Any, Callable, Optional
import websockets
from nexus.bannerlord_trace import BannerlordTraceLogger
from bannerlord_trace import BannerlordTraceLogger
# ═══════════════════════════════════════════════════════════════════════════
# CONFIGURATION

View File

@@ -304,43 +304,6 @@ async def inject_event(event_type: str, ws_url: str, **kwargs):
sys.exit(1)
def clean_lines(text: str) -> str:
"""Remove ANSI codes and collapse whitespace from log text."""
import re
text = strip_ansi(text)
text = re.sub(r'\s+', ' ', text).strip()
return text
def normalize_event(event: dict) -> dict:
"""Normalize an Evennia event dict to standard format."""
return {
"type": event.get("type", "unknown"),
"actor": event.get("actor", event.get("name", "")),
"room": event.get("room", event.get("location", "")),
"message": event.get("message", event.get("text", "")),
"timestamp": event.get("timestamp", ""),
}
def parse_room_output(text: str) -> dict:
"""Parse Evennia room output into structured data."""
import re
lines = text.strip().split("\n")
result = {"name": "", "description": "", "exits": [], "objects": []}
if lines:
result["name"] = strip_ansi(lines[0]).strip()
if len(lines) > 1:
result["description"] = strip_ansi(lines[1]).strip()
for line in lines[2:]:
line = strip_ansi(line).strip()
if line.startswith("Exits:"):
result["exits"] = [e.strip() for e in line[6:].split(",") if e.strip()]
elif line.startswith("You see:"):
result["objects"] = [o.strip() for o in line[8:].split(",") if o.strip()]
return result
def main():
parser = argparse.ArgumentParser(description="Evennia -> Nexus WebSocket Bridge")
sub = parser.add_subparsers(dest="mode")