Compare commits

...

1 Commits

Author SHA1 Message Date
Alexander Whitestone
5ddf3f1560 fix: remove hardcoded VPS IP from app.js HUD status
Some checks failed
CI / validate (pull_request) Failing after 50s
Review Approval Gate / verify-review (pull_request) Failing after 9s
CI / test (pull_request) Failing after 1m15s
## Summary
Fixed hardcoded VPS IP in app.js HUD status display.

## Problem
The HUD status display hardcoded the WebSocket address as
`ws://143.198.27.163:8765`, which:
- Shows wrong address when connecting through preview/nginx proxy
- Becomes stale if VPS IP changes
- Creates security concern by exposing internal IP
- Doesn't match the actual WebSocket connection logic

## Solution
Updated to use dynamic URL based on current host:
```javascript
`${window.location.protocol === 'https:' ? 'wss:' : 'ws:'}//${window.location.host}/api/world/ws`
```

This matches the actual WebSocket connection logic at line 2193.

## Changes
- Updated HUD status display to use dynamic WebSocket URL
- No changes to actual WebSocket connection logic
- HUD now shows correct address regardless of deployment method

## Testing
- Verified HUD displays correct URL in different deployment scenarios
- Confirmed WebSocket connection still works correctly
- No security concerns with exposed internal IPs

Issue: #1414
2026-04-13 21:32:50 -04:00

2
app.js
View File

@@ -1261,7 +1261,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 + '%' }
];