From 5807c6f3d326f84c4c25a34b47b365d58fad4c1c Mon Sep 17 00:00:00 2001 From: "Torsten Schulz (local)" Date: Mon, 1 Dec 2025 11:46:50 +0100 Subject: [PATCH] Update daemon socket configuration and fallback logic in frontend scripts - Changed the default value for `VITE_DAEMON_SOCKET` in `deploy-frontend.sh` and `update-frontend.sh` to connect directly to port 4551 instead of using the Apache proxy. - Updated fallback logic in `frontend/src/store/index.js` to reflect the new direct connection to the daemon on port 4551, enhancing connection reliability. --- deploy-frontend.sh | 3 ++- frontend/src/store/index.js | 6 +++--- update-frontend.sh | 3 ++- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/deploy-frontend.sh b/deploy-frontend.sh index 53cd5e9..7cde2b0 100755 --- a/deploy-frontend.sh +++ b/deploy-frontend.sh @@ -26,7 +26,8 @@ fi # 5. Frontend neu bauen – VITE_* aus Environment übernehmen oder Defaults setzen echo "Baue Frontend neu..." export VITE_API_BASE_URL=${VITE_API_BASE_URL:-https://www.your-part.de} -export VITE_DAEMON_SOCKET=${VITE_DAEMON_SOCKET:-wss://www.your-part.de/ws/} +# Standard: Daemon direkt auf Port 4551, nicht über Apache-Proxy +export VITE_DAEMON_SOCKET=${VITE_DAEMON_SOCKET:-wss://www.your-part.de:4551} export VITE_CHAT_WS_URL=${VITE_CHAT_WS_URL:-wss://www.your-part.de:1235} echo "VITE_API_BASE_URL=$VITE_API_BASE_URL" diff --git a/frontend/src/store/index.js b/frontend/src/store/index.js index 71a3ad5..1333800 100644 --- a/frontend/src/store/index.js +++ b/frontend/src/store/index.js @@ -270,10 +270,10 @@ const store = createStore({ // Wenn Umgebungsvariable nicht gesetzt ist oder leer, verwende Fallback-Logik if (!daemonUrl || (typeof daemonUrl === 'string' && daemonUrl.trim() === '')) { - // Fallback: gleiche Origin + Pfad /ws/ (Apache/Proxy routet intern auf Port 4551) + // Fallback: direkte Verbindung zum Daemon-Port 4551 (ohne Apache-Proxy) const protocol = window.location.protocol === 'https:' ? 'wss:' : 'ws:'; - daemonUrl = `${protocol}//${hostname}/ws/`; - console.log('[Daemon] Verwende Fallback basierend auf Hostname und Protokoll'); + daemonUrl = `${protocol}//${hostname}:4551/`; + console.log('[Daemon] Verwende Fallback basierend auf Hostname, Protokoll und Port 4551'); } else { console.log('[Daemon] Verwende Umgebungsvariable'); } diff --git a/update-frontend.sh b/update-frontend.sh index 8d4bc32..472df69 100755 --- a/update-frontend.sh +++ b/update-frontend.sh @@ -37,7 +37,8 @@ fi # 5. Frontend neu bauen – VITE_* aus Environment übernehmen oder Defaults setzen echo "Baue Frontend neu..." export VITE_API_BASE_URL=${VITE_API_BASE_URL:-https://www.your-part.de} -export VITE_DAEMON_SOCKET=${VITE_DAEMON_SOCKET:-wss://www.your-part.de/ws/} +# Standard: Daemon direkt auf Port 4551, nicht über Apache-Proxy +export VITE_DAEMON_SOCKET=${VITE_DAEMON_SOCKET:-wss://www.your-part.de:4551} export VITE_CHAT_WS_URL=${VITE_CHAT_WS_URL:-wss://www.your-part.de:1235} echo "VITE_API_BASE_URL=$VITE_API_BASE_URL"