mirror of
				https://github.com/juanfont/headscale.git
				synced 2025-10-28 10:51:44 +01:00 
			
		
		
		
	Make ACL policy part of the config struct
This commit is contained in:
		
							parent
							
								
									f9d38e5048
								
							
						
					
					
						commit
						af44dc589d
					
				
							
								
								
									
										6
									
								
								app.go
									
									
									
									
									
								
							
							
						
						
									
										6
									
								
								app.go
									
									
									
									
									
								
							@ -115,6 +115,8 @@ type Config struct {
 | 
				
			|||||||
	LogTail LogTailConfig
 | 
						LogTail LogTailConfig
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	CLI CLIConfig
 | 
						CLI CLIConfig
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						ACL ACLConfig
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
type OIDCConfig struct {
 | 
					type OIDCConfig struct {
 | 
				
			||||||
@ -151,6 +153,10 @@ type CLIConfig struct {
 | 
				
			|||||||
	Insecure bool
 | 
						Insecure bool
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					type ACLConfig struct {
 | 
				
			||||||
 | 
						PolicyPath string
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// Headscale represents the base app of the service.
 | 
					// Headscale represents the base app of the service.
 | 
				
			||||||
type Headscale struct {
 | 
					type Headscale struct {
 | 
				
			||||||
	cfg        Config
 | 
						cfg        Config
 | 
				
			||||||
 | 
				
			|||||||
@ -177,6 +177,14 @@ func GetLogTailConfig() headscale.LogTailConfig {
 | 
				
			|||||||
	}
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func GetACLConfig() headscale.ACLConfig {
 | 
				
			||||||
 | 
						policyPath := viper.GetString("acl_policy_path")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						return headscale.ACLConfig{
 | 
				
			||||||
 | 
							PolicyPath: policyPath,
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func GetDNSConfig() (*tailcfg.DNSConfig, string) {
 | 
					func GetDNSConfig() (*tailcfg.DNSConfig, string) {
 | 
				
			||||||
	if viper.IsSet("dns_config") {
 | 
						if viper.IsSet("dns_config") {
 | 
				
			||||||
		dnsConfig := &tailcfg.DNSConfig{}
 | 
							dnsConfig := &tailcfg.DNSConfig{}
 | 
				
			||||||
@ -397,6 +405,8 @@ func GetHeadscaleConfig() headscale.Config {
 | 
				
			|||||||
			Timeout:  viper.GetDuration("cli.timeout"),
 | 
								Timeout:  viper.GetDuration("cli.timeout"),
 | 
				
			||||||
			Insecure: viper.GetBool("cli.insecure"),
 | 
								Insecure: viper.GetBool("cli.insecure"),
 | 
				
			||||||
		},
 | 
							},
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							ACL: GetACLConfig(),
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user