Skip to content

Commit

Permalink
Merge pull request #11 from hugomd/feat/log-warning-for-deprecated-en…
Browse files Browse the repository at this point in the history
…v-variables

Log warning for deprecated environment variables
  • Loading branch information
hugomd authored May 23, 2020
2 parents 8c159d9 + 08146af commit 0e5fa07
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions lib/providers/cloudflare/cloudflare.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ func NewProvider() (providers.Provider, error) {
log.Fatal("CLOUDFLARE_EMAIL env. variable is required")
}

// Check for use of any deprecated variables first, point to how to update
if os.Getenv("CLOUDFLARE_APIKEY") != "" || os.Getenv("CLOUDFLARE_EMAIL") != "" || os.Getenv("CLOUDFLARE_ZONE") != "" {
log.Print("WARNING: CLOUDFLARE_APIKEY, CLOUDFLARE_EMAIL and CLOUDFLARE_ZONE are deprecated environment variables and are unsupported. Please see https://github.com/hugomd/cloudflare-ddns#deprecated-environment-variables for more information")
}

api, err := NewCloudflareClient(APIKEY, EMAIL, ZONE, HOST)
if err != nil {
return nil, err
Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package main

import (
"bytes"
"flag"
"flag"
"github.com/hugomd/cloudflare-ddns/lib/providers"
_ "github.com/hugomd/cloudflare-ddns/lib/providers/_all"
"io/ioutil"
Expand Down

0 comments on commit 0e5fa07

Please sign in to comment.