From 45c9585b52b333299c6427d7c33c4f11f15a5a11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Goran=20Dragani=C4=87?= Date: Thu, 17 Oct 2024 13:34:20 +0200 Subject: [PATCH] feat: derpmap field in config (#1823) --- hscontrol/derp/derp.go | 3 +++ hscontrol/types/config.go | 1 + 2 files changed, 4 insertions(+) diff --git a/hscontrol/derp/derp.go b/hscontrol/derp/derp.go index 5d4b24f2..9d358598 100644 --- a/hscontrol/derp/derp.go +++ b/hscontrol/derp/derp.go @@ -82,6 +82,9 @@ func mergeDERPMaps(derpMaps []*tailcfg.DERPMap) *tailcfg.DERPMap { func GetDERPMap(cfg types.DERPConfig) *tailcfg.DERPMap { var derpMaps []*tailcfg.DERPMap + if cfg.DERPMap != nil { + derpMaps = append(derpMaps, cfg.DERPMap) + } for _, path := range cfg.Paths { log.Debug(). diff --git a/hscontrol/types/config.go b/hscontrol/types/config.go index f02b9758..ec963793 100644 --- a/hscontrol/types/config.go +++ b/hscontrol/types/config.go @@ -176,6 +176,7 @@ type DERPConfig struct { STUNAddr string URLs []url.URL Paths []string + DERPMap *tailcfg.DERPMap AutoUpdate bool UpdateFrequency time.Duration IPv4 string