Add log_level to config, more ACL debug log

This commit is contained in:
Eugen 2021-12-01 20:02:00 +01:00
parent 7e95b3501d
commit a6e99525ac
3 changed files with 10 additions and 0 deletions

1
.gitignore vendored
View File

@ -18,6 +18,7 @@
config.json config.json
config.yaml config.yaml
derp.yaml derp.yaml
*.hujson
*.key *.key
/db.sqlite /db.sqlite
*.sqlite3 *.sqlite3

View File

@ -34,6 +34,11 @@ const (
// LoadACLPolicy loads the ACL policy from the specify path, and generates the ACL rules. // LoadACLPolicy loads the ACL policy from the specify path, and generates the ACL rules.
func (h *Headscale) LoadACLPolicy(path string) error { 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) policyFile, err := os.Open(path)
if err != nil { if err != nil {
return err return err
@ -67,6 +72,8 @@ func (h *Headscale) LoadACLPolicy(path string) error {
} }
h.aclRules = rules h.aclRules = rules
log.Trace().Interface("ACL", rules).Msg("ACL rules generated")
return nil return nil
} }

View File

@ -54,6 +54,8 @@ tls_letsencrypt_challenge_type: HTTP-01
tls_cert_path: "" tls_cert_path: ""
tls_key_path: "" tls_key_path: ""
log_level: info
# Path to a file containg ACL policies. # Path to a file containg ACL policies.
acl_policy_path: "" acl_policy_path: ""