From 9a908d7d6b6f96715888d78436c28e6d440116cf Mon Sep 17 00:00:00 2001 From: Joona Hoikkala Date: Thu, 1 Mar 2018 16:53:38 +0200 Subject: [PATCH] Log IP address that we're matching against allowFrom values stored in the DB (#46) * Add logging for IP matching * Fix typo --- acmetxt.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/acmetxt.go b/acmetxt.go index 8584017..7b20c02 100644 --- a/acmetxt.go +++ b/acmetxt.go @@ -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) {