mirror of
https://github.com/kairos-io/provider-kairos.git
synced 2025-09-18 00:02:14 +00:00
🌱 Allow to disable DHT
Signed-off-by: Ettore Di Giacinto <mudler@mocaccino.org>
This commit is contained in:
@@ -10,6 +10,7 @@ type Kairos struct {
|
||||
HybridVPN bool `yaml:"hybrid_vpn,omitempty"`
|
||||
MinimumNodes int `yaml:"minimum_nodes,omitempty"`
|
||||
SkipAuto bool `yaml:"skip_auto"`
|
||||
DisableDHT bool `yaml:"disable_dht,omitempty"`
|
||||
}
|
||||
|
||||
type Config struct {
|
||||
|
@@ -53,6 +53,10 @@ func SetupAPI(apiAddress, rootDir string, start bool, c *providerConfig.Config)
|
||||
vpnOpts[k] = v
|
||||
}
|
||||
|
||||
if c.Kairos.DisableDHT {
|
||||
vpnOpts["EDGEVPNDHT"] = "false"
|
||||
}
|
||||
|
||||
os.MkdirAll("/etc/systemd/system.conf.d/", 0600) //nolint:errcheck
|
||||
// Setup edgevpn instance
|
||||
err = utils.WriteEnv(filepath.Join(rootDir, "/etc/systemd/system.conf.d/edgevpn-kairos.env"), vpnOpts)
|
||||
@@ -99,6 +103,11 @@ func SetupVPN(instance, apiAddress, rootDir string, start bool, c *providerConfi
|
||||
if token != "" {
|
||||
vpnOpts["EDGEVPNTOKEN"] = c.Kairos.NetworkToken
|
||||
}
|
||||
|
||||
if c.Kairos.DisableDHT {
|
||||
vpnOpts["EDGEVPNDHT"] = "false"
|
||||
}
|
||||
|
||||
// Override opts with user-supplied
|
||||
for k, v := range c.VPN {
|
||||
vpnOpts[k] = v
|
||||
|
Reference in New Issue
Block a user