mirror of
https://github.com/fosrl/pangolin.git
synced 2026-08-22 12:10:35 +02:00
Dont allow clients to connect to remote nodes quite yet
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user