feat(gateway): improve wide-area discovery

This commit is contained in:
Peter Steinberger
2026-01-09 13:45:25 +01:00
parent 7b81d97ec2
commit 1716c01bdf
7 changed files with 392 additions and 1 deletions

View File

@@ -70,12 +70,15 @@ function computeContentHash(body: string): string {
export type WideAreaBridgeZoneOpts = {
bridgePort: number;
gatewayPort?: number;
displayName: string;
tailnetIPv4: string;
tailnetIPv6?: string;
instanceLabel?: string;
hostLabel?: string;
tailnetDns?: string;
sshPort?: number;
cliPath?: string;
};
function renderZone(opts: WideAreaBridgeZoneOpts & { serial: number }): string {
@@ -91,9 +94,18 @@ function renderZone(opts: WideAreaBridgeZoneOpts & { serial: number }): string {
`transport=bridge`,
`bridgePort=${opts.bridgePort}`,
];
if (typeof opts.gatewayPort === "number" && opts.gatewayPort > 0) {
txt.push(`gatewayPort=${opts.gatewayPort}`);
}
if (opts.tailnetDns?.trim()) {
txt.push(`tailnetDns=${opts.tailnetDns.trim()}`);
}
if (typeof opts.sshPort === "number" && opts.sshPort > 0) {
txt.push(`sshPort=${opts.sshPort}`);
}
if (opts.cliPath?.trim()) {
txt.push(`cliPath=${opts.cliPath.trim()}`);
}
const records: string[] = [];