mirror of
https://github.com/yggdrasil-network/yggdrasil-go
synced 2024-11-09 23:20:26 +03:00
Fix -autoconf
This commit is contained in:
parent
a233e775eb
commit
e290e744f4
@ -84,7 +84,9 @@ func GenerateConfig() *NodeConfig {
|
||||
cfg.IfName = defaults.DefaultIfName
|
||||
cfg.IfMTU = defaults.DefaultIfMTU
|
||||
cfg.NodeInfoPrivacy = false
|
||||
|
||||
if err := cfg.postprocessConfig(); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return cfg
|
||||
}
|
||||
|
||||
@ -122,6 +124,10 @@ func (cfg *NodeConfig) UnmarshalHJSON(b []byte) error {
|
||||
if err := hjson.Unmarshal(b, cfg); err != nil {
|
||||
return err
|
||||
}
|
||||
return cfg.postprocessConfig()
|
||||
}
|
||||
|
||||
func (cfg *NodeConfig) postprocessConfig() error {
|
||||
if cfg.PrivateKeyPath != "" {
|
||||
cfg.PrivateKey = nil
|
||||
f, err := os.ReadFile(cfg.PrivateKeyPath)
|
||||
|
Loading…
Reference in New Issue
Block a user