mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
fix: Allow disabling built-in DERP server (#3852)
This commit is contained in:
+6
-2
@@ -329,7 +329,7 @@ func Server(newAPI func(*coderd.Options) *coderd.API) *cobra.Command {
|
||||
validatedAutoImportTemplates[i] = v
|
||||
}
|
||||
|
||||
derpMap, err := tailnet.NewDERPMap(ctx, &tailcfg.DERPRegion{
|
||||
defaultRegion := &tailcfg.DERPRegion{
|
||||
RegionID: derpServerRegionID,
|
||||
RegionCode: derpServerRegionCode,
|
||||
RegionName: derpServerRegionName,
|
||||
@@ -341,7 +341,11 @@ func Server(newAPI func(*coderd.Options) *coderd.API) *cobra.Command {
|
||||
STUNPort: -1,
|
||||
ForceHTTP: accessURLParsed.Scheme == "http",
|
||||
}},
|
||||
}, derpServerSTUNAddrs, derpConfigURL)
|
||||
}
|
||||
if !derpServerEnabled {
|
||||
defaultRegion = nil
|
||||
}
|
||||
derpMap, err := tailnet.NewDERPMap(ctx, defaultRegion, derpServerSTUNAddrs, derpConfigURL)
|
||||
if err != nil {
|
||||
return xerrors.Errorf("create derp map: %w", err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user