1
0
mirror of https://github.com/StackExchange/dnscontrol.git synced 2024-05-11 05:55:12 +00:00

CLOUDFLAREAPI: Allow API debugging to be enabled via env variable (#2395)

Co-authored-by: Tom Limoncelli <tlimoncelli@stackoverflow.com>
This commit is contained in:
Hamish Moffatt
2023-05-26 10:48:30 +10:00
committed by GitHub
parent c0770e6aa0
commit 3492b26d0a

View File

@ -4,6 +4,8 @@ import (
"encoding/json"
"fmt"
"net"
"os"
"strconv"
"strings"
"github.com/StackExchange/dnscontrol/v4/models"
@ -679,6 +681,11 @@ func newCloudflare(m map[string]string, metadata json.RawMessage) (providers.DNS
api.cfClient.AccountID = m["accountid"]
}
debug, err := strconv.ParseBool(os.Getenv("CLOUDFLAREAPI_DEBUG"))
if err == nil {
api.cfClient.Debug = debug
}
if len(metadata) > 0 {
parsedMeta := &struct {
IPConversions string `json:"ip_conversions"`