From cb4d984afc26a8d17c74ea2a1f61905304850465 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 5d4b24f2e89..9d358598287 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 3f70ca7bb81..65d7244422a 100644 --- a/hscontrol/types/config.go +++ b/hscontrol/types/config.go @@ -178,6 +178,7 @@ type DERPConfig struct { STUNAddr string URLs []url.URL Paths []string + DERPMap *tailcfg.DERPMap AutoUpdate bool UpdateFrequency time.Duration IPv4 string