From a6e99525aca8e32e1807f84017627e112b2e67ef Mon Sep 17 00:00:00 2001 From: Eugen Date: Wed, 1 Dec 2021 20:02:00 +0100 Subject: [PATCH] Add log_level to config, more ACL debug log --- .gitignore | 1 + acls.go | 7 +++++++ config-example.yaml | 2 ++ 3 files changed, 10 insertions(+) diff --git a/.gitignore b/.gitignore index ddec49c0..d047cbfd 100644 --- a/.gitignore +++ b/.gitignore @@ -18,6 +18,7 @@ config.json config.yaml derp.yaml +*.hujson *.key /db.sqlite *.sqlite3 diff --git a/acls.go b/acls.go index 1550c340..4017e28e 100644 --- a/acls.go +++ b/acls.go @@ -34,6 +34,11 @@ const ( // LoadACLPolicy loads the ACL policy from the specify path, and generates the ACL rules. func (h *Headscale) LoadACLPolicy(path string) error { + log.Debug(). + Str("func", "LoadACLPolicy"). + Str("path", path). + Msg("Loading ACL policy from path") + policyFile, err := os.Open(path) if err != nil { return err @@ -67,6 +72,8 @@ func (h *Headscale) LoadACLPolicy(path string) error { } h.aclRules = rules + log.Trace().Interface("ACL", rules).Msg("ACL rules generated") + return nil } diff --git a/config-example.yaml b/config-example.yaml index 692c605a..29b2f3ff 100644 --- a/config-example.yaml +++ b/config-example.yaml @@ -54,6 +54,8 @@ tls_letsencrypt_challenge_type: HTTP-01 tls_cert_path: "" tls_key_path: "" +log_level: info + # Path to a file containg ACL policies. acl_policy_path: ""