mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
feat: allow disabling stun addresses via env (#7066)
* feat: allow disabling stun addresses via env Resolves #6791 * Specify a dummy access URL so the tunnel wouldn't start * Document --------- Co-authored-by: Kyle Carberry <kyle@carberry.com>
This commit is contained in:
co-authored by
Kyle Carberry
parent
25c1e45930
commit
c6b2861493
@@ -390,6 +390,19 @@ func (r *RootCmd) Server(newAPI func(context.Context, *coderd.Options) (*coderd.
|
||||
if !cfg.DERP.Server.Enable {
|
||||
defaultRegion = nil
|
||||
}
|
||||
|
||||
// HACK: see https://github.com/coder/coder/issues/6791.
|
||||
for _, addr := range cfg.DERP.Server.STUNAddresses {
|
||||
if addr != "disable" {
|
||||
continue
|
||||
}
|
||||
err := cfg.DERP.Server.STUNAddresses.Replace(nil)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
break
|
||||
}
|
||||
|
||||
derpMap, err := tailnet.NewDERPMap(
|
||||
ctx, defaultRegion, cfg.DERP.Server.STUNAddresses,
|
||||
cfg.DERP.Config.URL.String(), cfg.DERP.Config.Path.String(),
|
||||
|
||||
Reference in New Issue
Block a user