Skip to content

Commit

Permalink
Add log_level to config, more ACL debug log
Browse files Browse the repository at this point in the history
  • Loading branch information
negbie committed Dec 1, 2021
1 parent 7e95b35 commit a6e9952
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
config.json
config.yaml
derp.yaml
*.hujson
*.key
/db.sqlite
*.sqlite3
Expand Down
7 changes: 7 additions & 0 deletions acls.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
}

Expand Down
2 changes: 2 additions & 0 deletions config-example.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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: ""

Expand Down

0 comments on commit a6e9952

Please sign in to comment.