feat: more logging info + loglevel

This commit is contained in:
phga 2021-06-02 14:59:15 +02:00
parent 0a1a496ba1
commit 1247847e9a
2 changed files with 5 additions and 0 deletions

View File

@ -18,6 +18,7 @@ type Config struct {
DdUsers map[string]map[string]string `json:"dd_users"` DdUsers map[string]map[string]string `json:"dd_users"`
DnsTTL int `json:"dns_ttl"` DnsTTL int `json:"dns_ttl"`
DnsServer string `json:"dns_server"` DnsServer string `json:"dns_server"`
Loglevel string `json:"loglevel"`
} }
var config Config var config Config

View File

@ -22,6 +22,10 @@ func handleDynamicUpdate(w http.ResponseWriter, r *http.Request) {
up := r.URL.Query() up := r.URL.Query()
ip := r.Header.Get("X-FORWARDED-FOR") ip := r.Header.Get("X-FORWARDED-FOR")
if config.Loglevel == "verbose" {
log.Println(up, ip)
}
if len(ip) < 1 { if len(ip) < 1 {
ip = strings.Split(r.RemoteAddr, ":")[0] ip = strings.Split(r.RemoteAddr, ":")[0]
} }