mirror of
https://github.com/StackExchange/dnscontrol.git
synced 2024-05-11 05:55:12 +00:00
Revert "_PROVIDER flag phase 1: generate warnings"
This reverts commit 26c632e05f
.
This commit is contained in:
@ -137,7 +137,8 @@ type FeatureMatrix struct {
|
|||||||
|
|
||||||
var tmpl = template.Must(template.New("").Funcs(template.FuncMap{
|
var tmpl = template.Must(template.New("").Funcs(template.FuncMap{
|
||||||
"safe": func(s string) template.HTML { return template.HTML(s) },
|
"safe": func(s string) template.HTML { return template.HTML(s) },
|
||||||
}).Parse(`{% comment %}
|
}).Parse(`
|
||||||
|
{% comment %}
|
||||||
Matrix generated by build/generate/featureMatrix.go. DO NOT HAND EDIT!
|
Matrix generated by build/generate/featureMatrix.go. DO NOT HAND EDIT!
|
||||||
{% endcomment %}{{$providers := .Providers}}
|
{% endcomment %}{{$providers := .Providers}}
|
||||||
<table class="table-header-rotated">
|
<table class="table-header-rotated">
|
||||||
|
@ -203,11 +203,6 @@ func InitializeProviders(credsFile string, cfg *models.DNSConfig, notifyFlag boo
|
|||||||
isNonDefault[name] = true
|
isNonDefault[name] = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Collect the names of all providers.
|
|
||||||
// Run through the providerConfigs and output a warning if any are
|
|
||||||
// invalid.
|
|
||||||
|
|
||||||
registrars := map[string]providers.Registrar{}
|
registrars := map[string]providers.Registrar{}
|
||||||
dnsProviders := map[string]providers.DNSServiceProvider{}
|
dnsProviders := map[string]providers.DNSServiceProvider{}
|
||||||
for _, d := range cfg.Domains {
|
for _, d := range cfg.Domains {
|
||||||
|
@ -1,6 +0,0 @@
|
|||||||
|
|
||||||
NOTE: The `_PROVIDER` field is ignored by the provider. It is used by
|
|
||||||
DNSControl to cross-check that this entry is used with the proper
|
|
||||||
provider code. DNSControl produces warnings if it is missing or
|
|
||||||
invalid. In the future these warnings will become hard errors.
|
|
||||||
|
|
@ -30,7 +30,6 @@ The `ActiveDirectory_PS` provider reads an `ADServer` setting from `creds.json`
|
|||||||
```js
|
```js
|
||||||
{
|
{
|
||||||
"activedir": {
|
"activedir": {
|
||||||
"_PROVIDER": "ACTIVEDIRECTORY_PS",
|
|
||||||
"ADServer": "ny-dc01"
|
"ADServer": "ny-dc01"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -42,7 +41,6 @@ If you want to modify the "fake powershell" mode details, you can set them in th
|
|||||||
```js
|
```js
|
||||||
{
|
{
|
||||||
"activedir": {
|
"activedir": {
|
||||||
"_PROVIDER": "ACTIVEDIRECTORY_PS",
|
|
||||||
"ADServer": "ny-dc01",
|
"ADServer": "ny-dc01",
|
||||||
"fakeps": "true",
|
"fakeps": "true",
|
||||||
"pslog": "powershell.log",
|
"pslog": "powershell.log",
|
||||||
@ -51,7 +49,6 @@ If you want to modify the "fake powershell" mode details, you can set them in th
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
{% include providerfield.html %}
|
|
||||||
|
|
||||||
An example DNS configuration:
|
An example DNS configuration:
|
||||||
|
|
||||||
|
@ -28,7 +28,6 @@ In the credentials file (creds.json), you must provide the following:
|
|||||||
|
|
||||||
```json
|
```json
|
||||||
"akamaiedgedns": {
|
"akamaiedgedns": {
|
||||||
"_PROVIDER": "AKAMAIEDGEDNS",
|
|
||||||
"client_secret": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
|
"client_secret": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
|
||||||
"host": "akaa-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.xxxx.akamaiapis.net",
|
"host": "akaa-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.xxxx.akamaiapis.net",
|
||||||
"access_token": "akaa-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
|
"access_token": "akaa-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
|
||||||
|
@ -14,7 +14,6 @@ In your credentials file, you must provide [username, password and a context](ht
|
|||||||
{% highlight json %}
|
{% highlight json %}
|
||||||
{
|
{
|
||||||
"autodns": {
|
"autodns": {
|
||||||
"_PROVIDER": "AUTODNS",
|
|
||||||
"username": "autodns.service-account@example.com",
|
"username": "autodns.service-account@example.com",
|
||||||
"password": "[***]",
|
"password": "[***]",
|
||||||
"context": "33004"
|
"context": "33004"
|
||||||
|
@ -42,7 +42,6 @@ For instance, your `creds.json` might looks like:
|
|||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"axfrddns": {
|
"axfrddns": {
|
||||||
"_PROVIDER": "AXFRDDNS",
|
|
||||||
"transfer-key": "hmac-sha256:transfer-key-id:Base64EncodedSecret=",
|
"transfer-key": "hmac-sha256:transfer-key-id:Base64EncodedSecret=",
|
||||||
"update-key": "hmac-sha256:update-key-id:AnotherSecret="
|
"update-key": "hmac-sha256:update-key-id:AnotherSecret="
|
||||||
}
|
}
|
||||||
|
@ -11,7 +11,6 @@ You can specify the API credentials in the credentials json file:
|
|||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"azuredns_main":{
|
"azuredns_main":{
|
||||||
"_PROVIDER": "AZURE_DNS",
|
|
||||||
"SubscriptionID": "AZURE_SUBSCRIPTION_ID",
|
"SubscriptionID": "AZURE_SUBSCRIPTION_ID",
|
||||||
"ResourceGroup": "AZURE_RESOURCE_GROUP",
|
"ResourceGroup": "AZURE_RESOURCE_GROUP",
|
||||||
"TenantID": "AZURE_TENANT_ID",
|
"TenantID": "AZURE_TENANT_ID",
|
||||||
@ -34,7 +33,6 @@ export AZURE_CLIENT_SECRET=BBBBBBBBB
|
|||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"azuredns_main":{
|
"azuredns_main":{
|
||||||
"_PROVIDER": "AZURE_DNS",
|
|
||||||
"SubscriptionID": "$AZURE_SUBSCRIPTION_ID",
|
"SubscriptionID": "$AZURE_SUBSCRIPTION_ID",
|
||||||
"ResourceGroup": "$AZURE_RESOURCE_GROUP",
|
"ResourceGroup": "$AZURE_RESOURCE_GROUP",
|
||||||
"TenantID": "$AZURE_TENANT_ID",
|
"TenantID": "$AZURE_TENANT_ID",
|
||||||
|
@ -18,7 +18,6 @@ you can specify a `directory` where the provider will look for and create zone f
|
|||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"bind": {
|
"bind": {
|
||||||
"_PROVIDER": "BIND",
|
|
||||||
"directory": "myzones",
|
"directory": "myzones",
|
||||||
"filenameformat": "%U.zone" << The default
|
"filenameformat": "%U.zone" << The default
|
||||||
}
|
}
|
||||||
|
@ -25,7 +25,6 @@ This method is enabled by setting the "apitoken" value in `creds.json`:
|
|||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"cloudflare": {
|
"cloudflare": {
|
||||||
"_PROVIDER": "CLOUDFLAREAPI",
|
|
||||||
"apitoken": "your-cloudflare-api-token",
|
"apitoken": "your-cloudflare-api-token",
|
||||||
"accountid": "your-cloudflare-account-id"
|
"accountid": "your-cloudflare-account-id"
|
||||||
}
|
}
|
||||||
|
@ -14,7 +14,6 @@ Current version of provider doesn't support `sub-auth-user`.
|
|||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"cloudns": {
|
"cloudns": {
|
||||||
"_PROVIDER": "CLOUDNS",
|
|
||||||
"auth-id": "12345",
|
"auth-id": "12345",
|
||||||
"sub-auth-id": "12345",
|
"sub-auth-id": "12345",
|
||||||
"auth-password": "your-password"
|
"auth-password": "your-password"
|
||||||
|
@ -14,7 +14,6 @@ In your `creds.json` file, you must provide your API key and user/client token.
|
|||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"cscglobal": {
|
"cscglobal": {
|
||||||
"_PROVIDER": "CSCGLOBAL",
|
|
||||||
"api-key": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
|
"api-key": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
|
||||||
"user-token": "yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy",
|
"user-token": "yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy",
|
||||||
"notification_emails": "test@exmaple.tld,hostmaster@example.tld"
|
"notification_emails": "test@exmaple.tld,hostmaster@example.tld"
|
||||||
|
@ -11,7 +11,6 @@ In your providers credentials file you must provide a deSEC account auth token:
|
|||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"desec": {
|
"desec": {
|
||||||
"_PROVIDER": "DESEC",
|
|
||||||
"auth-token": "your-deSEC-auth-token"
|
"auth-token": "your-deSEC-auth-token"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -8,22 +8,19 @@ title: creds.json file format
|
|||||||
When dnscontrol interacts with a provider, any API keys, credentials, or other
|
When dnscontrol interacts with a provider, any API keys, credentials, or other
|
||||||
configuration parameters required are stored in `creds.json`. The file contains a set of key/value pairs for each configuration. That is, since a provider can be used multiple times with different credentials, the file contains a section for each set of credentials.
|
configuration parameters required are stored in `creds.json`. The file contains a set of key/value pairs for each configuration. That is, since a provider can be used multiple times with different credentials, the file contains a section for each set of credentials.
|
||||||
|
|
||||||
Here's a sample `creds.json` file:
|
Here's a sample file:
|
||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"cloudflare_tal": {
|
"cloudflare_tal": {
|
||||||
"_PROVIDER": "CLOUDFLAREAPI",
|
|
||||||
"apikey": "REDACTED",
|
"apikey": "REDACTED",
|
||||||
"apiuser": "REDACTED"
|
"apiuser": "REDACTED"
|
||||||
},
|
},
|
||||||
"inside": {
|
"inside": {
|
||||||
"_PROVIDER": "BIND",
|
|
||||||
"directory": "inzones",
|
"directory": "inzones",
|
||||||
"filenameformat": "db_%T%?_%D"
|
"filenameformat": "db_%T%?_%D"
|
||||||
},
|
},
|
||||||
"hexonet": {
|
"hexonet": {
|
||||||
"_PROVIDER": "HEXONET",
|
|
||||||
"apilogin": "$HEXONET_APILOGIN",
|
"apilogin": "$HEXONET_APILOGIN",
|
||||||
"apipassword": "$HEXONET_APIPASSWORD",
|
"apipassword": "$HEXONET_APIPASSWORD",
|
||||||
"debugmode": "$HEXONET_DEBUGMODE",
|
"debugmode": "$HEXONET_DEBUGMODE",
|
||||||
@ -42,7 +39,6 @@ Here's a sample `creds.json` file:
|
|||||||
* ...are whatever the provider specifies.
|
* ...are whatever the provider specifies.
|
||||||
* ...can be credentials, secrets, or configuration settings. In the above examples the `inside` setting is configuration parameters for the BIND provider, not credentials.
|
* ...can be credentials, secrets, or configuration settings. In the above examples the `inside` setting is configuration parameters for the BIND provider, not credentials.
|
||||||
* A missing subkey is not an error. The value is the empty string.
|
* A missing subkey is not an error. The value is the empty string.
|
||||||
* The subkey `_PROVIDER` indicates which provider plug-in to use. In the future it will be required and dnscontrol will report an error if it is missing or invalid. Currently DNSControl reports warnings.
|
|
||||||
* Values:
|
* Values:
|
||||||
* ...may include any JSON string value including the empty string.
|
* ...may include any JSON string value including the empty string.
|
||||||
* If a subkey starts with `$`, it is taken as an env variable. In the above example, `$HEXONET_APILOGIN` would be replaced by the value of the environment variable `HEXONET_APILOGIN` or the empty string if no such environment variable exists.
|
* If a subkey starts with `$`, it is taken as an env variable. In the above example, `$HEXONET_APILOGIN` would be replaced by the value of the environment variable `HEXONET_APILOGIN` or the empty string if no such environment variable exists.
|
||||||
|
@ -57,24 +57,9 @@ func LoadProviderConfigs(fname string) (map[string]map[string]string, error) {
|
|||||||
if err = replaceEnvVars(results); err != nil {
|
if err = replaceEnvVars(results); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
ckeys := keysWithColons(results)
|
|
||||||
if len(ckeys) != 0 {
|
|
||||||
fmt.Printf("WARNING: Cred entries may not contain colons in the future. Please fix: %v\n", quotedList(ckeys))
|
|
||||||
}
|
|
||||||
|
|
||||||
pkeys := entriesWithoutProvider(results)
|
|
||||||
if len(pkeys) != 0 {
|
|
||||||
fmt.Printf("WARNING: Please add a PROVIDER field to these credential entries: %v\n", quotedList(pkeys))
|
|
||||||
}
|
|
||||||
|
|
||||||
return results, nil
|
return results, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func quotedList(l []string) string {
|
|
||||||
return `"` + strings.Join(l, `", "`) + `"`
|
|
||||||
}
|
|
||||||
|
|
||||||
func isExecutable(filename string) bool {
|
func isExecutable(filename string) bool {
|
||||||
if stat, statErr := os.Stat(filename); statErr == nil {
|
if stat, statErr := os.Stat(filename); statErr == nil {
|
||||||
if mode := stat.Mode(); mode&0111 == 0111 {
|
if mode := stat.Mode(); mode&0111 == 0111 {
|
||||||
|
Reference in New Issue
Block a user