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:
@ -4,6 +4,8 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
"net"
|
"net"
|
||||||
|
"os"
|
||||||
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/StackExchange/dnscontrol/v4/models"
|
"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"]
|
api.cfClient.AccountID = m["accountid"]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
debug, err := strconv.ParseBool(os.Getenv("CLOUDFLAREAPI_DEBUG"))
|
||||||
|
if err == nil {
|
||||||
|
api.cfClient.Debug = debug
|
||||||
|
}
|
||||||
|
|
||||||
if len(metadata) > 0 {
|
if len(metadata) > 0 {
|
||||||
parsedMeta := &struct {
|
parsedMeta := &struct {
|
||||||
IPConversions string `json:"ip_conversions"`
|
IPConversions string `json:"ip_conversions"`
|
||||||
|
Reference in New Issue
Block a user