Dont allow clients to connect to remote nodes quite yet

This commit is contained in:
Owen
2026-08-21 12:25:14 -04:00
parent e3e1508e8a
commit 442cefda84
3 changed files with 11 additions and 4 deletions
+4 -1
View File
@@ -22,7 +22,10 @@ export async function listExitNodes(
// Accepted for parity with the enterprise implementation (used there for
// site-label filtering of remote exit nodes). The OSS build has no remote
// exit nodes, so it is unused here.
siteId?: number
siteId?: number,
// Same as above: accepted for parity, unused since the OSS build has no
// remote exit nodes to exclude.
noRemote = false
) {
// TODO: pick which nodes to send and ping better than just all of them that are not remote
const allExitNodes = await db
+5 -2
View File
@@ -153,7 +153,8 @@ export async function listExitNodes(
orgId: string,
filterOnline = false,
noCloud = false,
siteId?: number
siteId?: number,
noRemote = false
) {
const allExitNodes = await db
.select({
@@ -242,7 +243,9 @@ export async function listExitNodes(
let remoteExitNodesList = allExitNodes.filter(
(node) =>
node.type === "remoteExitNode" && (!filterOnline || node.online)
node.type === "remoteExitNode" &&
!noRemote &&
(!filterOnline || node.online)
);
const gerbilExitNodes = allExitNodes.filter(
(node) =>
@@ -42,7 +42,8 @@ export const handleOlmExitNodesRequestMessage: MessageHandler = async (
client.orgId,
true,
noCloud || false,
olm.clientId
olm.clientId,
true // don't select remote exit nodes for clients
); // filter for only the online ones
let lastExitNodeId = null;