diff --git a/docker/Dockerfile b/docker/Dockerfile index 30106d6b..c90afc49 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -64,6 +64,7 @@ RUN apk add --no-cache nginx gettext su-exec openssl && \ chown -R node:node /app/data COPY docker/nginx.conf /etc/nginx/nginx.conf +COPY docker/nginx-https.conf /etc/nginx/nginx-https.conf COPY --from=frontend-builder /app/dist /usr/share/nginx/html COPY --from=frontend-builder /app/src/locales /usr/share/nginx/html/locales RUN chown -R nginx:nginx /usr/share/nginx/html diff --git a/src/ui/Desktop/Apps/Terminal/Terminal.tsx b/src/ui/Desktop/Apps/Terminal/Terminal.tsx index 6cbadc16..65b65542 100644 --- a/src/ui/Desktop/Apps/Terminal/Terminal.tsx +++ b/src/ui/Desktop/Apps/Terminal/Terminal.tsx @@ -313,9 +313,9 @@ export const Terminal = forwardRef(function SSHTerminal( ? "wss://" : "ws://"; const wsHost = baseUrl.replace(/^https?:\/\//, ""); - return `${wsProtocol}${wsHost.replace(':30001', ':30002')}/`; + return `${wsProtocol}${wsHost}/ssh/websocket/`; })() - : `${window.location.protocol === "https:" ? "wss" : "ws"}://${window.location.hostname}:30002/`; + : `${window.location.protocol === "https:" ? "wss" : "ws"}://${window.location.host}/ssh/websocket/`; // Clean up existing connection to prevent duplicates - Linus principle: eliminate complexity if (webSocketRef.current && webSocketRef.current.readyState !== WebSocket.CLOSED) { diff --git a/src/ui/Mobile/Apps/Terminal/Terminal.tsx b/src/ui/Mobile/Apps/Terminal/Terminal.tsx index 285bd8a7..2c1a59a3 100644 --- a/src/ui/Mobile/Apps/Terminal/Terminal.tsx +++ b/src/ui/Mobile/Apps/Terminal/Terminal.tsx @@ -321,7 +321,7 @@ export const Terminal = forwardRef(function SSHTerminal( ? "wss://" : "ws://"; const wsHost = baseUrl.replace(/^https?:\/\//, ""); - return `${wsProtocol}${wsHost.replace(':30001', ':30002')}/ssh/websocket/`; + return `${wsProtocol}${wsHost}/ssh/websocket/`; })() : `${window.location.protocol === "https:" ? "wss" : "ws"}://${window.location.host}/ssh/websocket/`;