mirror of
https://github.com/cwinfo/yggdrasil-go.git
synced 2024-11-26 15:21:37 +00:00
Merge pull request #97 from neilalexander/master
Set allowed encryption keys after start
This commit is contained in:
commit
887b463306
15
yggdrasil.go
15
yggdrasil.go
@ -194,11 +194,6 @@ func main() {
|
|||||||
// Setup the Yggdrasil node itself. The node{} type includes a Core, so we
|
// Setup the Yggdrasil node itself. The node{} type includes a Core, so we
|
||||||
// don't need to create this manually.
|
// don't need to create this manually.
|
||||||
n := node{}
|
n := node{}
|
||||||
// Check to see if any allowed encryption keys were provided in the config.
|
|
||||||
// If they were then set them now.
|
|
||||||
for _, pBoxStr := range cfg.AllowedEncryptionPublicKeys {
|
|
||||||
n.core.AddAllowedEncryptionPublicKey(pBoxStr)
|
|
||||||
}
|
|
||||||
// Check to see if any multicast interface expressions were provided in the
|
// Check to see if any multicast interface expressions were provided in the
|
||||||
// config. If they were then set them now.
|
// config. If they were then set them now.
|
||||||
for _, ll := range cfg.MulticastInterfaces {
|
for _, ll := range cfg.MulticastInterfaces {
|
||||||
@ -208,14 +203,18 @@ func main() {
|
|||||||
}
|
}
|
||||||
n.core.AddMulticastInterfaceExpr(ifceExpr)
|
n.core.AddMulticastInterfaceExpr(ifceExpr)
|
||||||
}
|
}
|
||||||
// Now that we have a working configuration, and we have provided any allowed
|
// Now that we have a working configuration, we can now actually start
|
||||||
// encryption keys or multicast interface expressions, we can now actually
|
// Yggdrasil. This will start the router, switch, DHT node, TCP and UDP
|
||||||
// start Yggdrasil. This will start the router, switch, DHT node, TCP and UDP
|
|
||||||
// sockets, TUN/TAP adapter and multicast discovery port.
|
// sockets, TUN/TAP adapter and multicast discovery port.
|
||||||
if err := n.core.Start(cfg, logger); err != nil {
|
if err := n.core.Start(cfg, logger); err != nil {
|
||||||
logger.Println("An error occurred during startup")
|
logger.Println("An error occurred during startup")
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
|
// Check to see if any allowed encryption keys were provided in the config.
|
||||||
|
// If they were then set them now.
|
||||||
|
for _, pBoxStr := range cfg.AllowedEncryptionPublicKeys {
|
||||||
|
n.core.AddAllowedEncryptionPublicKey(pBoxStr)
|
||||||
|
}
|
||||||
// If any static peers were provided in the configuration above then we should
|
// If any static peers were provided in the configuration above then we should
|
||||||
// configure them. The loop ensures that disconnected peers will eventually
|
// configure them. The loop ensures that disconnected peers will eventually
|
||||||
// be reconnected with.
|
// be reconnected with.
|
||||||
|
Loading…
Reference in New Issue
Block a user