From 063f6b5ca9fc31db61e7204879245ddf3408a29c Mon Sep 17 00:00:00 2001 From: Owen Date: Fri, 4 Sep 2026 12:31:04 -0400 Subject: [PATCH] Basic DNS config send empty for olm --- server/routers/olm/dnsConfig.ts | 20 +++++++++++++++++++ .../routers/olm/handleOlmRegisterMessage.ts | 2 ++ 2 files changed, 22 insertions(+) create mode 100644 server/routers/olm/dnsConfig.ts diff --git a/server/routers/olm/dnsConfig.ts b/server/routers/olm/dnsConfig.ts new file mode 100644 index 000000000..441246764 --- /dev/null +++ b/server/routers/olm/dnsConfig.ts @@ -0,0 +1,20 @@ +import config from "@server/lib/config"; + +// Mirrors the optional fields on the olm client's TunnelConfig - any field +// present here overrides the value the olm client is otherwise locally +// configured with; an absent field leaves the client's own config alone. +export type OlmDnsConfig = { + upstreamDns?: string[]; + overrideDns?: boolean; + tunnelDns?: boolean; + matchDomains?: string[]; +}; + +export function buildOlmDnsConfig(): OlmDnsConfig | undefined { + return { + upstreamDns: undefined, + overrideDns: undefined, + tunnelDns: undefined, + matchDomains: undefined + }; +} diff --git a/server/routers/olm/handleOlmRegisterMessage.ts b/server/routers/olm/handleOlmRegisterMessage.ts index 35fb95ca5..693920950 100644 --- a/server/routers/olm/handleOlmRegisterMessage.ts +++ b/server/routers/olm/handleOlmRegisterMessage.ts @@ -15,6 +15,7 @@ import { encodeHexLowerCase } from "@oslojs/encoding"; import { sha256 } from "@oslojs/crypto/sha2"; import { getUserDeviceName } from "@server/db/names"; import { buildSiteConfigurationForOlmClient } from "./buildConfiguration"; +import { buildOlmDnsConfig } from "./dnsConfig"; import { OlmErrorCodes, sendOlmError } from "./error"; import { handleFingerprintInsertion } from "./fingerprintingUtils"; import { build } from "@server/build"; @@ -512,6 +513,7 @@ export const handleOlmRegisterMessage: MessageHandler = async (context) => { tunnelIP: `${clientSubnet.split("/")[0]}/${exitNode.address.split("/")[1]}` // we need to use the exit node's subnet mask here because the client will be using the exit node's subnet mask for its routing table so we can address it } : undefined, + dnsConfig: buildOlmDnsConfig(), chainId: chainId } },