mirror of
				https://github.com/yggdrasil-network/yggdrasil-go.git
				synced 2025-11-04 03:05:07 +03:00 
			
		
		
		
	Small tweaks/clean up
This commit is contained in:
		
							parent
							
								
									45b106168e
								
							
						
					
					
						commit
						8ea3070a02
					
				
					 2 changed files with 6 additions and 7 deletions
				
			
		| 
						 | 
					@ -5,7 +5,7 @@ type NodeConfig struct {
 | 
				
			||||||
	Listen         string    `comment:"Listen address for peer connections (default is to listen for all\nconnections over IPv4 and IPv6)"`
 | 
						Listen         string    `comment:"Listen address for peer connections (default is to listen for all\nconnections over IPv4 and IPv6)"`
 | 
				
			||||||
	AdminListen    string    `comment:"Listen address for admin connections (default is to listen only\nfor local connections)"`
 | 
						AdminListen    string    `comment:"Listen address for admin connections (default is to listen only\nfor local connections)"`
 | 
				
			||||||
	Peers          []string  `comment:"List of connection strings for static peers (i.e. tcp://a.b.c.d:e)"`
 | 
						Peers          []string  `comment:"List of connection strings for static peers (i.e. tcp://a.b.c.d:e)"`
 | 
				
			||||||
	AllowedBoxPubs []string  `comment:"List of peer BoxPubs to allow UDP incoming TCP connections from"`
 | 
						AllowedBoxPubs []string  `comment:"List of peer BoxPubs to allow UDP incoming TCP connections from\n(if left empty/undefined then connections will be allowed by default)"`
 | 
				
			||||||
	BoxPub         string    `comment:"Your public encryption key (your peers may ask you for this to put\ninto their AllowedBoxPubs configuration)"`
 | 
						BoxPub         string    `comment:"Your public encryption key (your peers may ask you for this to put\ninto their AllowedBoxPubs configuration)"`
 | 
				
			||||||
	BoxPriv        string    `comment:"Your private encryption key (do not share this with anyone!)"`
 | 
						BoxPriv        string    `comment:"Your private encryption key (do not share this with anyone!)"`
 | 
				
			||||||
	SigPub         string    `comment:"Your public signing key"`
 | 
						SigPub         string    `comment:"Your public signing key"`
 | 
				
			||||||
| 
						 | 
					@ -15,11 +15,11 @@ type NodeConfig struct {
 | 
				
			||||||
	IfName         string    `comment:"Local network interface name for TUN/TAP adapter, or \"auto\", or \"none\""`
 | 
						IfName         string    `comment:"Local network interface name for TUN/TAP adapter, or \"auto\", or \"none\""`
 | 
				
			||||||
	IfTAPMode      bool      `comment:"Set local network interface to TAP mode rather than TUN mode (if supported\nby your platform, option will be ignored if not)"`
 | 
						IfTAPMode      bool      `comment:"Set local network interface to TAP mode rather than TUN mode (if supported\nby your platform, option will be ignored if not)"`
 | 
				
			||||||
	IfMTU          int       `comment:"Maximux Transmission Unit (MTU) size for your local network interface"`
 | 
						IfMTU          int       `comment:"Maximux Transmission Unit (MTU) size for your local network interface"`
 | 
				
			||||||
	Net            NetConfig `comment:"Incomplete options for configuring peerings over Tor/I2P"`
 | 
						Net            NetConfig `comment:"Extended options for interoperability with other networks"`
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// NetConfig defines network/proxy related configuration values
 | 
					// NetConfig defines network/proxy related configuration values
 | 
				
			||||||
type NetConfig struct {
 | 
					type NetConfig struct {
 | 
				
			||||||
	Tor TorConfig
 | 
						Tor TorConfig `comment:"Experimental options for configuring peerings over Tor"`
 | 
				
			||||||
	I2P I2PConfig
 | 
						I2P I2PConfig `comment:"Experimental options for configuring peerings over I2P"`
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -112,7 +112,6 @@ func generateConfig(isAutoconf bool) *nodeConfig {
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func doGenconf() string {
 | 
					func doGenconf() string {
 | 
				
			||||||
 | 
					 | 
				
			||||||
	cfg := generateConfig(false)
 | 
						cfg := generateConfig(false)
 | 
				
			||||||
	bs, err := hjson.Marshal(cfg)
 | 
						bs, err := hjson.Marshal(cfg)
 | 
				
			||||||
	if err != nil {
 | 
						if err != nil {
 | 
				
			||||||
| 
						 | 
					@ -239,8 +238,8 @@ func main() {
 | 
				
			||||||
		cfg = generateConfig(false)
 | 
							cfg = generateConfig(false)
 | 
				
			||||||
		var dat map[string]interface{}
 | 
							var dat map[string]interface{}
 | 
				
			||||||
		if err := hjson.Unmarshal(config, &dat); err != nil {
 | 
							if err := hjson.Unmarshal(config, &dat); err != nil {
 | 
				
			||||||
      panic(err)
 | 
								panic(err)
 | 
				
			||||||
    }
 | 
							}
 | 
				
			||||||
		if err = mapstructure.Decode(dat, &cfg); err != nil {
 | 
							if err = mapstructure.Decode(dat, &cfg); err != nil {
 | 
				
			||||||
			panic(err)
 | 
								panic(err)
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue