Only load ACLs if a path is present

This commit is contained in:
Juan Font Alonso 2021-07-11 15:10:11 +02:00
parent eabb1ce881
commit 7d46dfe012

View file

@ -121,10 +121,13 @@ func getHeadscaleApp() (*headscale.Headscale, error) {
} }
// We are doing this here, as in the future could be cool to have it also hot-reload // We are doing this here, as in the future could be cool to have it also hot-reload
if viper.GetString("acl_policy_path") != "" {
err = h.LoadACLPolicy(absPath(viper.GetString("acl_policy_path"))) err = h.LoadACLPolicy(absPath(viper.GetString("acl_policy_path")))
if err != nil { if err != nil {
log.Printf("Could not load the ACL policy: %s", err) log.Printf("Could not load the ACL policy: %s", err)
} }
}
return h, nil return h, nil
} }