chore: docker console not loading in docker
This commit is contained in:
@@ -22,6 +22,7 @@ interface SSHSession {
|
|||||||
const activeSessions = new Map<string, SSHSession>();
|
const activeSessions = new Map<string, SSHSession>();
|
||||||
|
|
||||||
const wss = new WebSocketServer({
|
const wss = new WebSocketServer({
|
||||||
|
host: "0.0.0.0",
|
||||||
port: 30008,
|
port: 30008,
|
||||||
verifyClient: async (info) => {
|
verifyClient: async (info) => {
|
||||||
try {
|
try {
|
||||||
@@ -29,9 +30,6 @@ const wss = new WebSocketServer({
|
|||||||
const token = url.query.token as string;
|
const token = url.query.token as string;
|
||||||
|
|
||||||
if (!token) {
|
if (!token) {
|
||||||
dockerConsoleLogger.warn("WebSocket connection rejected: No token", {
|
|
||||||
operation: "ws_verify",
|
|
||||||
});
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -39,20 +37,11 @@ const wss = new WebSocketServer({
|
|||||||
const decoded = await authManager.verifyJWTToken(token);
|
const decoded = await authManager.verifyJWTToken(token);
|
||||||
|
|
||||||
if (!decoded || !decoded.userId) {
|
if (!decoded || !decoded.userId) {
|
||||||
dockerConsoleLogger.warn(
|
|
||||||
"WebSocket connection rejected: Invalid token",
|
|
||||||
{
|
|
||||||
operation: "ws_verify",
|
|
||||||
},
|
|
||||||
);
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
dockerConsoleLogger.error("WebSocket verification error", error, {
|
|
||||||
operation: "ws_verify",
|
|
||||||
});
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -345,10 +345,6 @@ app.use(
|
|||||||
return callback(null, true);
|
return callback(null, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
dockerLogger.warn("CORS rejected origin", {
|
|
||||||
operation: "cors_check",
|
|
||||||
origin,
|
|
||||||
});
|
|
||||||
return callback(new Error("Not allowed by CORS"));
|
return callback(new Error("Not allowed by CORS"));
|
||||||
},
|
},
|
||||||
credentials: true,
|
credentials: true,
|
||||||
|
|||||||
Reference in New Issue
Block a user