mirror of
https://github.com/joohoi/acme-dns.git
synced 2024-12-22 21:23:52 +07:00
Log IP address that we're matching against allowFrom values stored in the DB (#46)
* Add logging for IP matching * Fix typo
This commit is contained in:
parent
11c852ee91
commit
9a908d7d6b
@ -5,6 +5,7 @@ import (
|
||||
"net"
|
||||
|
||||
"github.com/satori/go.uuid"
|
||||
log "github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
// ACMETxt is the default structure for the user controlled record
|
||||
@ -47,6 +48,7 @@ func (a ACMETxt) allowedFrom(ip string) bool {
|
||||
if len(a.AllowFrom.ValidEntries()) == 0 {
|
||||
return true
|
||||
}
|
||||
log.WithFields(log.Fields{"ip": remoteIP}).Debug("Checking if update is permitted from IP")
|
||||
for _, v := range a.AllowFrom.ValidEntries() {
|
||||
_, vnet, _ := net.ParseCIDR(v)
|
||||
if vnet.Contains(remoteIP) {
|
||||
|
Loading…
Reference in New Issue
Block a user