From 7d46dfe0126e49ecd5529b225b3405c692e34225 Mon Sep 17 00:00:00 2001 From: Juan Font Alonso Date: Sun, 11 Jul 2021 15:10:11 +0200 Subject: [PATCH] Only load ACLs if a path is present --- cmd/headscale/cli/utils.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/cmd/headscale/cli/utils.go b/cmd/headscale/cli/utils.go index a872ec51..662196e7 100644 --- a/cmd/headscale/cli/utils.go +++ b/cmd/headscale/cli/utils.go @@ -121,9 +121,12 @@ func getHeadscaleApp() (*headscale.Headscale, error) { } // We are doing this here, as in the future could be cool to have it also hot-reload - err = h.LoadACLPolicy(absPath(viper.GetString("acl_policy_path"))) - if err != nil { - log.Printf("Could not load the ACL policy: %s", err) + + if viper.GetString("acl_policy_path") != "" { + err = h.LoadACLPolicy(absPath(viper.GetString("acl_policy_path"))) + if err != nil { + log.Printf("Could not load the ACL policy: %s", err) + } } return h, nil