Load ACL policy on headscale startup

This commit is contained in:
Juan Font 2021-07-04 13:24:05 +02:00
parent 401e6aec32
commit 202d6b506f
4 changed files with 18 additions and 3 deletions

3
app.go
View file

@ -50,6 +50,7 @@ type Headscale struct {
privateKey *wgkey.Private
aclPolicy *ACLPolicy
aclRules *[]tailcfg.FilterRule
pollMu sync.Mutex
clientsPolling map[uint64]chan []byte // this is by all means a hackity hack
@ -84,7 +85,9 @@ func NewHeadscale(cfg Config) (*Headscale, error) {
dbString: dbString,
privateKey: privKey,
publicKey: &pubKey,
aclRules: &tailcfg.FilterAllowAll, // default allowall
}
err = h.initDB()
if err != nil {
return nil, err