fix(wireguard): поддержать IPv6 и исключить выключенные серверы

This commit is contained in:
Denozordec committed 2026-10-11 22:08:10 +07:00
1 parent f3cbc32720
commit 4d3cb659c1
30 files changed
+2001 -82

No files matched your search

+3 -1
View File
@@ -1,4 +1,5 @@
import type { MikrotikClient } from "./mikrotik.js"
import { interfaceAddressPath } from "./entity-snapshots.js"
/** Общие PUT iface / peer / address для `/wireguard` и traffic-flow overlay. */
export function toRosBody(obj: Record<string, string | undefined>): Record<string, string> {
@@ -31,7 +32,8 @@ export async function putIpAddress(
address: string,
iface: string,
): Promise<void> {
await client.put("/ip/address", { address, interface: iface })
const path = interfaceAddressPath(address)
await client.put(path, { address, interface: iface, ...(path === "/ipv6/address" ? { advertise: "no" } : {}) })
}
export async function putWireguardPeer(