diff --git a/server/routers/newt/handleNewtGetConfigMessage.ts b/server/routers/newt/handleNewtGetConfigMessage.ts index 169c8a0f0..dabea0353 100644 --- a/server/routers/newt/handleNewtGetConfigMessage.ts +++ b/server/routers/newt/handleNewtGetConfigMessage.ts @@ -12,7 +12,6 @@ import { supportsCertReferences } from "@server/lib/clientVersionChecks"; import { dedupeCertsForTargets } from "@server/lib/ip"; -import config from "@server/lib/config"; import { waitForSiteRebuildIdle } from "@server/lib/rebuildClientAssociations"; export const handleNewtGetConfigMessage: MessageHandler = async (context) => { @@ -61,7 +60,7 @@ export const handleNewtGetConfigMessage: MessageHandler = async (context) => { if (existingSite.lastHolePunch && now - existingSite.lastHolePunch > 12) { logger.warn( - `Site last hole punch is too old; skipping this register. The site is failing to hole punch and identify its network address with the server. Can the site reach the server on UDP port ${config.getRawConfig().gerbil.clients_start_port}?` + `Site last hole punch is too old; skipping this register. The site is failing to hole punch and identify its network address with the server. Can the site reach the server on its Relay UDP port?` ); return; } diff --git a/server/routers/olm/error.ts b/server/routers/olm/error.ts index b0fd90993..586aa4301 100644 --- a/server/routers/olm/error.ts +++ b/server/routers/olm/error.ts @@ -1,7 +1,4 @@ import { sendToClient } from "#dynamic/routers/ws"; -import config from "@server/lib/config"; - -const udpPort = config.getRawConfig().gerbil.clients_start_port; // Error codes for registration failures export const OlmErrorCodes = { @@ -93,7 +90,7 @@ export const OlmErrorCodes = { }, HOLEPUNCH_MISSING: { code: "HOLEPUNCH_MISSING", - message: `Unable to coordinate client P2P connection. Please ensure your client can reach the server on UDP port ${udpPort} and try registering again.` + message: `Unable to coordinate client P2P connection. Please ensure your client can reach the server on its relay UDP port and try registering again.` }, NO_AVAILABLE_SUBNET: { code: "NO_AVAILABLE_SUBNET", diff --git a/server/routers/olm/handleOlmRegisterMessage.ts b/server/routers/olm/handleOlmRegisterMessage.ts index f583729ef..c74b82c6b 100644 --- a/server/routers/olm/handleOlmRegisterMessage.ts +++ b/server/routers/olm/handleOlmRegisterMessage.ts @@ -20,7 +20,6 @@ import { OlmErrorCodes, sendOlmError } from "./error"; import { handleFingerprintInsertion } from "./fingerprintingUtils"; import { build } from "@server/build"; import { canCompress } from "@server/lib/clientVersionChecks"; -import config from "@server/lib/config"; import cache from "#dynamic/lib/cache"; // not using regional here because we need this in the register message handler before we know where the client is import { waitForClientRebuildIdle } from "@server/lib/rebuildClientAssociations"; import { @@ -438,7 +437,7 @@ export const handleOlmRegisterMessage: MessageHandler = async (context) => { // TODO: I still think there is a better way to do this rather than locking it out here but ??? if (now - (client.lastHolePunch || 0) > 12 && sitesCount > 0) { logger.warn( - `[handleOlmRegisterMessage] Client last hole punch is too old and we have sites to send; skipping this register. The client is failing to hole punch and identify its network address with the server. Can the client reach the server on UDP port ${config.getRawConfig().gerbil.clients_start_port}?`, + `[handleOlmRegisterMessage] Client last hole punch is too old and we have sites to send; skipping this register. The client is failing to hole punch and identify its network address with the server. Can the client reach the server on its relay UDP port?`, { orgId: client.orgId, clientId: client.clientId } );