diff --git a/app.go b/app.go index cc4728d3..cc867a40 100644 --- a/app.go +++ b/app.go @@ -116,6 +116,8 @@ type Config struct { LogTail LogTailConfig CLI CLIConfig + + ACL ACLConfig } type OIDCConfig struct { @@ -152,6 +154,10 @@ type CLIConfig struct { Insecure bool } +type ACLConfig struct { + PolicyPath string +} + // Headscale represents the base app of the service. type Headscale struct { cfg Config diff --git a/cmd/headscale/cli/utils.go b/cmd/headscale/cli/utils.go index 797fba1a..2c0eb0a4 100644 --- a/cmd/headscale/cli/utils.go +++ b/cmd/headscale/cli/utils.go @@ -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) { if viper.IsSet("dns_config") { dnsConfig := &tailcfg.DNSConfig{} @@ -397,6 +405,8 @@ func GetHeadscaleConfig() headscale.Config { Timeout: viper.GetDuration("cli.timeout"), Insecure: viper.GetBool("cli.insecure"), }, + + ACL: GetACLConfig(), } }