diff --git a/client/src/pages/constellation/vpn.jsx b/client/src/pages/constellation/vpn.jsx index 289f38a..f74a4da 100644 --- a/client/src/pages/constellation/vpn.jsx +++ b/client/src/pages/constellation/vpn.jsx @@ -89,6 +89,9 @@ export const ConstellationVPN = () => { newConfig.ConstellationConfig.PrivateNode = values.PrivateNode; newConfig.ConstellationConfig.NebulaConfig.Relay.AMRelay = values.IsRelay; newConfig.ConstellationConfig.ConstellationHostname = values.ConstellationHostname; + setTimeout(() => { + refreshConfig(); + }, 1500); return API.config.set(newConfig); }} > diff --git a/package.json b/package.json index f6e5666..629e438 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cosmos-server", - "version": "0.10.0-unstable21", + "version": "0.10.0-unstable22", "description": "", "main": "test-server.js", "bugs": { diff --git a/src/constellation/nebula.go b/src/constellation/nebula.go index fa4fa7b..ac20c16 100644 --- a/src/constellation/nebula.go +++ b/src/constellation/nebula.go @@ -108,6 +108,13 @@ func ResetNebula() error { if err != nil { return err } + + config := utils.ReadConfigFromFile() + config.ConstellationConfig.Enabled = false + config.ConstellationConfig.SlaveMode = false + config.ConstellationConfig.DNSDisabled = false + + utils.SetBaseMainConfig(config) Init() @@ -194,6 +201,8 @@ func ExportConfigToYAML(overwriteConfig utils.ConstellationConfig, outputPath st finalConfig.PKI.Blocklist = append(finalConfig.PKI.Blocklist, d.Fingerprint) } + finalConfig.Lighthouse.AMLighthouse = !overwriteConfig.PrivateNode + // add other lighthouses finalConfig.Lighthouse.Hosts = []string{} for _, l := range lh { @@ -204,7 +213,7 @@ func ExportConfigToYAML(overwriteConfig utils.ConstellationConfig, outputPath st finalConfig.Relay.Relays = []string{} for _, l := range lh { - if l.IsRelay && l.IsLighthouse { + if l.IsRelay { finalConfig.Relay.Relays = append(finalConfig.Relay.Relays, cleanIp(l.IP)) } } @@ -257,8 +266,10 @@ func getYAMLClientConfig(name, configPath, capki, cert, key, APIKey string, devi } if staticHostMap, ok := configMap["static_host_map"].(map[interface{}]interface{}); ok { - staticHostMap["192.168.201.1"] = []string{ - utils.GetMainConfig().ConstellationConfig.ConstellationHostname + ":4242", + if !utils.GetMainConfig().ConstellationConfig.PrivateNode { + staticHostMap["192.168.201.1"] = []string{ + utils.GetMainConfig().ConstellationConfig.ConstellationHostname + ":4242", + } } for _, l := range lh { @@ -274,10 +285,11 @@ func getYAMLClientConfig(name, configPath, capki, cert, key, APIKey string, devi if lighthouseMap, ok := configMap["lighthouse"].(map[interface{}]interface{}); ok { lighthouseMap["am_lighthouse"] = device.IsLighthouse - lighthouseMap["hosts"] = []string{ - "192.168.201.1", + lighthouseMap["hosts"] = []string{} + if !utils.GetMainConfig().ConstellationConfig.PrivateNode { + lighthouseMap["hosts"] = append(lighthouseMap["hosts"].([]string), "192.168.201.1") } - + for _, l := range lh { if cleanIp(l.IP) != cleanIp(device.IP) { lighthouseMap["hosts"] = append(lighthouseMap["hosts"].([]string), cleanIp(l.IP))