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
|
// Accepted for parity with the enterprise implementation (used there for
|
||||||
// site-label filtering of remote exit nodes). The OSS build has no remote
|
// site-label filtering of remote exit nodes). The OSS build has no remote
|
||||||
// exit nodes, so it is unused here.
|
// 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
|
// TODO: pick which nodes to send and ping better than just all of them that are not remote
|
||||||
const allExitNodes = await db
|
const allExitNodes = await db
|
||||||
|
|||||||
@@ -153,7 +153,8 @@ export async function listExitNodes(
|
|||||||
orgId: string,
|
orgId: string,
|
||||||
filterOnline = false,
|
filterOnline = false,
|
||||||
noCloud = false,
|
noCloud = false,
|
||||||
siteId?: number
|
siteId?: number,
|
||||||
|
noRemote = false
|
||||||
) {
|
) {
|
||||||
const allExitNodes = await db
|
const allExitNodes = await db
|
||||||
.select({
|
.select({
|
||||||
@@ -242,7 +243,9 @@ export async function listExitNodes(
|
|||||||
|
|
||||||
let remoteExitNodesList = allExitNodes.filter(
|
let remoteExitNodesList = allExitNodes.filter(
|
||||||
(node) =>
|
(node) =>
|
||||||
node.type === "remoteExitNode" && (!filterOnline || node.online)
|
node.type === "remoteExitNode" &&
|
||||||
|
!noRemote &&
|
||||||
|
(!filterOnline || node.online)
|
||||||
);
|
);
|
||||||
const gerbilExitNodes = allExitNodes.filter(
|
const gerbilExitNodes = allExitNodes.filter(
|
||||||
(node) =>
|
(node) =>
|
||||||
|
|||||||
@@ -42,7 +42,8 @@ export const handleOlmExitNodesRequestMessage: MessageHandler = async (
|
|||||||
client.orgId,
|
client.orgId,
|
||||||
true,
|
true,
|
||||||
noCloud || false,
|
noCloud || false,
|
||||||
olm.clientId
|
olm.clientId,
|
||||||
|
true // don't select remote exit nodes for clients
|
||||||
); // filter for only the online ones
|
); // filter for only the online ones
|
||||||
|
|
||||||
let lastExitNodeId = null;
|
let lastExitNodeId = null;
|
||||||
|
|||||||
Reference in New Issue
Block a user