This commit is contained in:
Owen
2025-10-04 18:36:44 -07:00
parent 3123f858bb
commit c2c907852d
320 changed files with 35785 additions and 2984 deletions

View File

@@ -105,7 +105,7 @@ export async function updateHolePunch(
destinations: destinations
});
} catch (error) {
logger.error(error);
// logger.error(error); // FIX THIS
return next(
createHttpError(
HttpCode.INTERNAL_SERVER_ERROR,
@@ -122,7 +122,8 @@ export async function updateAndGenerateEndpointDestinations(
port: number,
timestamp: number,
token: string,
exitNode: ExitNode
exitNode: ExitNode,
checkOrg = false
) {
let currentSiteId: number | undefined;
const destinations: PeerDestination[] = [];
@@ -158,7 +159,7 @@ export async function updateAndGenerateEndpointDestinations(
.where(eq(clients.clientId, olm.clientId))
.returning();
if (await checkExitNodeOrg(exitNode.exitNodeId, client.orgId)) {
if (await checkExitNodeOrg(exitNode.exitNodeId, client.orgId) && checkOrg) {
// not allowed
logger.warn(
`Exit node ${exitNode.exitNodeId} is not allowed for org ${client.orgId}`
@@ -253,7 +254,7 @@ export async function updateAndGenerateEndpointDestinations(
.where(eq(sites.siteId, newt.siteId))
.limit(1);
if (await checkExitNodeOrg(exitNode.exitNodeId, site.orgId)) {
if (await checkExitNodeOrg(exitNode.exitNodeId, site.orgId) && checkOrg) {
// not allowed
logger.warn(
`Exit node ${exitNode.exitNodeId} is not allowed for org ${site.orgId}`