mirror of
https://github.com/StackExchange/dnscontrol.git
synced 2024-05-11 05:55:12 +00:00
Merge branch 'master' into tlim_newtxt
This commit is contained in:
@ -109,7 +109,7 @@ indent_style = space
|
||||
|
||||
# Shell
|
||||
# https://google.github.io/styleguide/shell.xml#Indentation
|
||||
[*.{bash,sh,zsh}]
|
||||
[*.{bash,sh,zsh,*sh.gotmpl}]
|
||||
indent_size = 2
|
||||
indent_style = space
|
||||
|
||||
|
@ -88,6 +88,24 @@ func Run(v string) int {
|
||||
sort.Sort(cli.CommandsByName(commands))
|
||||
app.Commands = commands
|
||||
app.EnableBashCompletion = true
|
||||
app.BashComplete = func(cCtx *cli.Context) {
|
||||
// ripped from cli.DefaultCompleteWithFlags
|
||||
var lastArg string
|
||||
|
||||
if len(os.Args) > 2 {
|
||||
lastArg = os.Args[len(os.Args)-2]
|
||||
}
|
||||
|
||||
if lastArg != "" {
|
||||
if strings.HasPrefix(lastArg, "-") {
|
||||
if !islastFlagComplete(lastArg, app.Flags) {
|
||||
dnscontrolPrintFlagSuggestions(lastArg, app.Flags, cCtx.App.Writer)
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
dnscontrolPrintCommandSuggestions(app.Commands, cCtx.App.Writer)
|
||||
}
|
||||
if err := app.Run(os.Args); err != nil {
|
||||
return 1
|
||||
}
|
||||
|
34
commands/completion-scripts/completion.bash.gotmpl
Normal file
34
commands/completion-scripts/completion.bash.gotmpl
Normal file
@ -0,0 +1,34 @@
|
||||
#!/bin/bash
|
||||
|
||||
: "{{.App.Name}}"
|
||||
|
||||
# Macs have bash3 for which the bash-completion package doesn't include
|
||||
# _init_completion. This is a minimal version of that function.
|
||||
_dnscontrol_init_completion() {
|
||||
COMPREPLY=()
|
||||
_get_comp_words_by_ref "$@" cur prev words cword
|
||||
}
|
||||
|
||||
_dnscontrol() {
|
||||
if [[ "${COMP_WORDS[0]}" != "source" ]]; then
|
||||
local cur opts base words
|
||||
COMPREPLY=()
|
||||
cur="${COMP_WORDS[COMP_CWORD]}"
|
||||
if declare -F _init_completion >/dev/null 2>&1; then
|
||||
_init_completion -n "=:" || return
|
||||
else
|
||||
_dnscontrol_init_completion -n "=:" || return
|
||||
fi
|
||||
words=("${words[@]:0:$cword}")
|
||||
if [[ "$cur" == "-"* ]]; then
|
||||
requestComp="${words[*]} ${cur} --generate-bash-completion"
|
||||
else
|
||||
requestComp="${words[*]} --generate-bash-completion"
|
||||
fi
|
||||
opts=$(eval "${requestComp}" 2>/dev/null)
|
||||
COMPREPLY=($(compgen -W "${opts}" -- ${cur}))
|
||||
return 0
|
||||
fi
|
||||
}
|
||||
|
||||
complete -o bashdefault -o default -o nospace -F "_dnscontrol" "{{.App.Name}}"
|
20
commands/completion-scripts/completion.zsh.gotmpl
Normal file
20
commands/completion-scripts/completion.zsh.gotmpl
Normal file
@ -0,0 +1,20 @@
|
||||
#compdef "{{.App.Name}}"
|
||||
|
||||
_dnscontrol() {
|
||||
local -a opts
|
||||
local cur
|
||||
cur=${words[-1]}
|
||||
if [[ "$cur" == "-"* ]]; then
|
||||
opts=("${(@f)$(${words[@]:0:#words[@]-1} ${cur} --generate-bash-completion)}")
|
||||
else
|
||||
opts=("${(@f)$(${words[@]:0:#words[@]-1} --generate-bash-completion)}")
|
||||
fi
|
||||
|
||||
if [[ "${opts[1]}" != "" ]]; then
|
||||
_describe 'values' opts
|
||||
else
|
||||
_files
|
||||
fi
|
||||
}
|
||||
|
||||
compdef "_dnscontrol" "{{.App.Name}}"
|
170
commands/completion.go
Normal file
170
commands/completion.go
Normal file
@ -0,0 +1,170 @@
|
||||
package commands
|
||||
|
||||
import (
|
||||
"embed"
|
||||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
"os"
|
||||
"path"
|
||||
"strings"
|
||||
"text/template"
|
||||
"unicode/utf8"
|
||||
|
||||
"github.com/urfave/cli/v2"
|
||||
)
|
||||
|
||||
//go:embed completion-scripts/completion.*.gotmpl
|
||||
var completionScripts embed.FS
|
||||
|
||||
func shellCompletionCommand() *cli.Command {
|
||||
supportedShells, templates, err := getCompletionSupportedShells()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return &cli.Command{
|
||||
Name: "shell-completion",
|
||||
Usage: "generate shell completion scripts",
|
||||
Hidden: true,
|
||||
ArgsUsage: fmt.Sprintf("[ %s ]", strings.Join(supportedShells, " | ")),
|
||||
Description: fmt.Sprintf("Generate shell completion script for [ %s ]", strings.Join(supportedShells, " | ")),
|
||||
BashComplete: func(ctx *cli.Context) {
|
||||
for _, shell := range supportedShells {
|
||||
if strings.HasPrefix(shell, ctx.Args().First()) {
|
||||
ctx.App.Writer.Write([]byte(shell + "\n"))
|
||||
}
|
||||
}
|
||||
},
|
||||
Action: func(ctx *cli.Context) error {
|
||||
var inputShell string
|
||||
if inputShell = ctx.Args().First(); inputShell == "" {
|
||||
if inputShell = os.Getenv("SHELL"); inputShell == "" {
|
||||
return cli.Exit(errors.New("shell not specified"), 1)
|
||||
}
|
||||
}
|
||||
shellName := path.Base(inputShell) // necessary if using $SHELL, noop otherwise
|
||||
|
||||
template := templates[shellName]
|
||||
if template == nil {
|
||||
return cli.Exit(fmt.Errorf("unknown shell: %s", inputShell), 1)
|
||||
}
|
||||
|
||||
err = template.Execute(ctx.App.Writer, struct {
|
||||
App *cli.App
|
||||
}{ctx.App})
|
||||
if err != nil {
|
||||
return cli.Exit(fmt.Errorf("failed to print completion script: %w", err), 1)
|
||||
}
|
||||
return nil
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
var _ = cmd(catUtils, shellCompletionCommand())
|
||||
|
||||
// getCompletionSupportedShells returns a list of shells with available completions.
|
||||
// The list is generated from the embedded completion scripts.
|
||||
func getCompletionSupportedShells() (shells []string, shellCompletionScripts map[string]*template.Template, err error) {
|
||||
scripts, err := completionScripts.ReadDir("completion-scripts")
|
||||
if err != nil {
|
||||
return nil, nil, fmt.Errorf("failed to read completion scripts: %w", err)
|
||||
}
|
||||
|
||||
shellCompletionScripts = make(map[string]*template.Template)
|
||||
|
||||
for _, f := range scripts {
|
||||
fNameWithoutExtension := strings.TrimSuffix(f.Name(), ".gotmpl")
|
||||
shellName := strings.TrimPrefix(path.Ext(fNameWithoutExtension), ".")
|
||||
|
||||
content, err := completionScripts.ReadFile(path.Join("completion-scripts", f.Name()))
|
||||
if err != nil {
|
||||
return nil, nil, fmt.Errorf("failed to read completion script %s", f.Name())
|
||||
}
|
||||
|
||||
t := template.New(shellName)
|
||||
t, err = t.Parse(string(content))
|
||||
if err != nil {
|
||||
return nil, nil, fmt.Errorf("failed to parse template %s", f.Name())
|
||||
}
|
||||
|
||||
shells = append(shells, shellName)
|
||||
shellCompletionScripts[shellName] = t
|
||||
}
|
||||
return shells, shellCompletionScripts, nil
|
||||
}
|
||||
|
||||
func dnscontrolPrintCommandSuggestions(commands []*cli.Command, writer io.Writer) {
|
||||
for _, command := range commands {
|
||||
if command.Hidden {
|
||||
continue
|
||||
}
|
||||
if strings.HasSuffix(os.Getenv("SHELL"), "zsh") {
|
||||
for _, name := range command.Names() {
|
||||
_, _ = fmt.Fprintf(writer, "%s:%s\n", name, command.Usage)
|
||||
}
|
||||
} else {
|
||||
for _, name := range command.Names() {
|
||||
_, _ = fmt.Fprintf(writer, "%s\n", name)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func dnscontrolCliArgContains(flagName string) bool {
|
||||
for _, name := range strings.Split(flagName, ",") {
|
||||
name = strings.TrimSpace(name)
|
||||
count := utf8.RuneCountInString(name)
|
||||
if count > 2 {
|
||||
count = 2
|
||||
}
|
||||
flag := fmt.Sprintf("%s%s", strings.Repeat("-", count), name)
|
||||
for _, a := range os.Args {
|
||||
if a == flag {
|
||||
return true
|
||||
}
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func dnscontrolPrintFlagSuggestions(lastArg string, flags []cli.Flag, writer io.Writer) {
|
||||
cur := strings.TrimPrefix(lastArg, "-")
|
||||
cur = strings.TrimPrefix(cur, "-")
|
||||
for _, flag := range flags {
|
||||
if bflag, ok := flag.(*cli.BoolFlag); ok && bflag.Hidden {
|
||||
continue
|
||||
}
|
||||
for _, name := range flag.Names() {
|
||||
name = strings.TrimSpace(name)
|
||||
// this will get total count utf8 letters in flag name
|
||||
count := utf8.RuneCountInString(name)
|
||||
if count > 2 {
|
||||
count = 2 // reuse this count to generate single - or -- in flag completion
|
||||
}
|
||||
// if flag name has more than one utf8 letter and last argument in cli has -- prefix then
|
||||
// skip flag completion for short flags example -v or -x
|
||||
if strings.HasPrefix(lastArg, "--") && count == 1 {
|
||||
continue
|
||||
}
|
||||
// match if last argument matches this flag and it is not repeated
|
||||
if strings.HasPrefix(name, cur) && cur != name && !dnscontrolCliArgContains(name) {
|
||||
flagCompletion := fmt.Sprintf("%s%s", strings.Repeat("-", count), name)
|
||||
_, _ = fmt.Fprintln(writer, flagCompletion)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func islastFlagComplete(lastArg string, flags []cli.Flag) bool {
|
||||
cur := strings.TrimPrefix(lastArg, "-")
|
||||
cur = strings.TrimPrefix(cur, "-")
|
||||
for _, flag := range flags {
|
||||
for _, name := range flag.Names() {
|
||||
name = strings.TrimSpace(name)
|
||||
if strings.HasPrefix(name, cur) && cur != name && !dnscontrolCliArgContains(name) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
}
|
||||
return true
|
||||
}
|
249
commands/completion_test.go
Normal file
249
commands/completion_test.go
Normal file
@ -0,0 +1,249 @@
|
||||
package commands
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
"github.com/google/go-cmp/cmp"
|
||||
"strings"
|
||||
"testing"
|
||||
"text/template"
|
||||
|
||||
"github.com/urfave/cli/v2"
|
||||
"golang.org/x/exp/slices"
|
||||
)
|
||||
|
||||
type shellTestDataItem struct {
|
||||
shellName string
|
||||
shellPath string
|
||||
completionScriptTemplate *template.Template
|
||||
}
|
||||
|
||||
// setupTestShellCompletionCommand resets the buffers used to capture output and errors from the app.
|
||||
func setupTestShellCompletionCommand(t *testing.T, app *cli.App) func(t *testing.T) {
|
||||
return func(t *testing.T) {
|
||||
app.Writer.(*bytes.Buffer).Reset()
|
||||
cli.ErrWriter.(*bytes.Buffer).Reset()
|
||||
}
|
||||
}
|
||||
|
||||
func TestShellCompletionCommand(t *testing.T) {
|
||||
app := cli.NewApp()
|
||||
app.Name = "testing"
|
||||
|
||||
var appWriterBuffer bytes.Buffer
|
||||
app.Writer = &appWriterBuffer // capture output from app
|
||||
|
||||
var appErrWriterBuffer bytes.Buffer
|
||||
cli.ErrWriter = &appErrWriterBuffer // capture errors from app (apparently, HandleExitCoder doesn't use app.ErrWriter!?)
|
||||
|
||||
cli.OsExiter = func(int) {} // disable os.Exit call
|
||||
|
||||
app.Commands = []*cli.Command{
|
||||
shellCompletionCommand(),
|
||||
}
|
||||
|
||||
shellsAndCompletionScripts, err := testHelperGetShellsAndCompletionScripts()
|
||||
if err != nil {
|
||||
t.Fatalf("unexpected error: %v", err)
|
||||
}
|
||||
if len(shellsAndCompletionScripts) == 0 {
|
||||
t.Fatal("no shells found")
|
||||
}
|
||||
|
||||
invalidShellTestDataItem := shellTestDataItem{
|
||||
shellName: "invalid",
|
||||
shellPath: "/bin/invalid",
|
||||
}
|
||||
for _, tt := range shellsAndCompletionScripts {
|
||||
if tt.shellName == invalidShellTestDataItem.shellName {
|
||||
t.Fatalf("invalidShellTestDataItem.shellName (%s) is actually a valid shell name", invalidShellTestDataItem.shellName)
|
||||
}
|
||||
}
|
||||
|
||||
// Test shell argument
|
||||
t.Run("shellArg", func(t *testing.T) {
|
||||
for _, tt := range shellsAndCompletionScripts {
|
||||
t.Run(tt.shellName, func(t *testing.T) {
|
||||
tearDownTest := setupTestShellCompletionCommand(t, app)
|
||||
defer tearDownTest(t)
|
||||
|
||||
err := app.Run([]string{app.Name, "shell-completion", tt.shellName})
|
||||
if err != nil {
|
||||
t.Fatalf("unexpected error: %v", err)
|
||||
}
|
||||
|
||||
got := appWriterBuffer.String()
|
||||
want, err := testHelperRenderTemplateFromApp(app, tt.completionScriptTemplate)
|
||||
if err != nil {
|
||||
t.Fatalf("unexpected error: %v", err)
|
||||
}
|
||||
if diff := cmp.Diff(got, want); diff != "" {
|
||||
t.Errorf("mismatch (-want +got):\n%s", diff)
|
||||
}
|
||||
|
||||
stderr := appErrWriterBuffer.String()
|
||||
if stderr != "" {
|
||||
t.Errorf("want no stderr, got %q", stderr)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
t.Run(invalidShellTestDataItem.shellName, func(t *testing.T) {
|
||||
tearDownTest := setupTestShellCompletionCommand(t, app)
|
||||
defer tearDownTest(t)
|
||||
|
||||
err := app.Run([]string{app.Name, "shell-completion", "invalid"})
|
||||
|
||||
if err == nil {
|
||||
t.Fatal("expected error, but didn't get one")
|
||||
}
|
||||
|
||||
want := fmt.Sprintf("unknown shell: %s", invalidShellTestDataItem.shellName)
|
||||
got := strings.TrimSpace(appErrWriterBuffer.String())
|
||||
if diff := cmp.Diff(got, want); diff != "" {
|
||||
t.Errorf("mismatch (-want +got):\n%s", diff)
|
||||
}
|
||||
|
||||
stdout := appWriterBuffer.String()
|
||||
if stdout != "" {
|
||||
t.Errorf("want no stdout, got %q", stdout)
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
// Test $SHELL envar
|
||||
t.Run("$SHELL", func(t *testing.T) {
|
||||
for _, tt := range shellsAndCompletionScripts {
|
||||
t.Run(tt.shellName, func(t *testing.T) {
|
||||
tearDownTest := setupTestShellCompletionCommand(t, app)
|
||||
defer tearDownTest(t)
|
||||
|
||||
t.Setenv("SHELL", tt.shellPath)
|
||||
|
||||
err := app.Run([]string{app.Name, "shell-completion"})
|
||||
if err != nil {
|
||||
t.Fatalf("unexpected error: %v", err)
|
||||
}
|
||||
|
||||
got := appWriterBuffer.String()
|
||||
want, err := testHelperRenderTemplateFromApp(app, tt.completionScriptTemplate)
|
||||
if err != nil {
|
||||
t.Fatalf("unexpected error: %v", err)
|
||||
}
|
||||
if diff := cmp.Diff(got, want); diff != "" {
|
||||
t.Errorf("mismatch (-want +got):\n%s", diff)
|
||||
}
|
||||
|
||||
stderr := appErrWriterBuffer.String()
|
||||
if stderr != "" {
|
||||
t.Errorf("want no stderr, got %q", stderr)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
t.Run(invalidShellTestDataItem.shellName, func(t *testing.T) {
|
||||
tearDownTest := setupTestShellCompletionCommand(t, app)
|
||||
defer tearDownTest(t)
|
||||
|
||||
t.Setenv("SHELL", invalidShellTestDataItem.shellPath)
|
||||
|
||||
err := app.Run([]string{app.Name, "shell-completion"})
|
||||
if err == nil {
|
||||
t.Fatal("expected error, but didn't get one")
|
||||
}
|
||||
|
||||
want := fmt.Sprintf("unknown shell: %s", invalidShellTestDataItem.shellPath)
|
||||
got := strings.TrimSpace(appErrWriterBuffer.String())
|
||||
if diff := cmp.Diff(got, want); diff != "" {
|
||||
t.Errorf("mismatch (-want +got):\n%s", diff)
|
||||
}
|
||||
|
||||
stdout := appWriterBuffer.String()
|
||||
if stdout != "" {
|
||||
t.Errorf("want no stdout, got %q", stdout)
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
// Test shell argument completion (meta)
|
||||
t.Run("shell-name-completion", func(t *testing.T) {
|
||||
type testCase struct {
|
||||
shellArg string
|
||||
expected []string
|
||||
}
|
||||
testCases := []testCase{
|
||||
{shellArg: ""}, // empty 'shell' argument, returns all known shells (expected is filled later)
|
||||
{shellArg: "invalid", expected: []string{""}}, // invalid shell, returns none
|
||||
}
|
||||
|
||||
for _, tt := range shellsAndCompletionScripts {
|
||||
testCases[0].expected = append(testCases[0].expected, tt.shellName)
|
||||
for i, _ := range tt.shellName {
|
||||
testCases = append(testCases, testCase{
|
||||
shellArg: tt.shellName[:i+1],
|
||||
expected: []string{tt.shellName},
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
for _, tC := range testCases {
|
||||
t.Run(tC.shellArg, func(t *testing.T) {
|
||||
tearDownTest := setupTestShellCompletionCommand(t, app)
|
||||
defer tearDownTest(t)
|
||||
app.EnableBashCompletion = true
|
||||
defer func() {
|
||||
app.EnableBashCompletion = false
|
||||
}()
|
||||
|
||||
err := app.Run([]string{app.Name, "shell-completion", tC.shellArg, "--generate-bash-completion"})
|
||||
if err != nil {
|
||||
t.Fatalf("unexpected error: %v", err)
|
||||
}
|
||||
|
||||
for _, line := range strings.Split(strings.TrimSpace(appWriterBuffer.String()), "\n") {
|
||||
if !slices.Contains(tC.expected, line) {
|
||||
t.Errorf("%q found, but not expected", line)
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// testHelperGetShellsAndCompletionScripts collects all supported shells and their completion scripts and returns them
|
||||
// as a slice of shellTestDataItem.
|
||||
// The completion scripts are sourced with getCompletionSupportedShells
|
||||
func testHelperGetShellsAndCompletionScripts() ([]shellTestDataItem, error) {
|
||||
shells, templates, err := getCompletionSupportedShells()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
var shellsAndValues []shellTestDataItem
|
||||
for shellName, t := range templates {
|
||||
if !slices.Contains(shells, shellName) {
|
||||
return nil, fmt.Errorf(
|
||||
`"%s" is not present in slice of shells from getCompletionSupportedShells`, shellName)
|
||||
}
|
||||
shellsAndValues = append(
|
||||
shellsAndValues,
|
||||
shellTestDataItem{
|
||||
shellName: shellName,
|
||||
shellPath: fmt.Sprintf("/bin/%s", shellName),
|
||||
completionScriptTemplate: t,
|
||||
},
|
||||
)
|
||||
}
|
||||
return shellsAndValues, nil
|
||||
}
|
||||
|
||||
// testHelperRenderTemplateFromApp renders a given template with a given app.
|
||||
// This is used to test the output of the CLI command against a 'known good' value.
|
||||
func testHelperRenderTemplateFromApp(app *cli.App, scriptTemplate *template.Template) (string, error) {
|
||||
var scriptBytes bytes.Buffer
|
||||
err := scriptTemplate.Execute(&scriptBytes, struct {
|
||||
App *cli.App
|
||||
}{app})
|
||||
|
||||
return scriptBytes.String(), err
|
||||
}
|
2
commands/types/dnscontrol.d.ts
vendored
2
commands/types/dnscontrol.d.ts
vendored
@ -822,7 +822,7 @@ declare function DOMAIN_ELSEWHERE(name: string, registrar: string, nameserver_na
|
||||
*
|
||||
* @see https://docs.dnscontrol.org/language-reference/top-level-functions/domain_elsewhere_auto
|
||||
*/
|
||||
declare function DOMAIN_ELSEWHERE_AUTO(name: string, domain: string, registrar: string, dnsProvider: string): void;
|
||||
declare function DOMAIN_ELSEWHERE_AUTO(name: string, registrar: string, dnsProvider: string): void;
|
||||
|
||||
/**
|
||||
* DS adds a DS record to the domain.
|
||||
|
@ -106,7 +106,7 @@
|
||||
* [CSC Global](providers/cscglobal.md)
|
||||
* [deSEC](providers/desec.md)
|
||||
* [DigitalOcean](providers/digitalocean.md)
|
||||
* [DNS Made Simple](providers/dnsmadeeasy.md)
|
||||
* [DNS Made Easy](providers/dnsmadeeasy.md)
|
||||
* [DNSimple](providers/dnsimple.md)
|
||||
* [DNS-over-HTTPS](providers/dnsoverhttps.md)
|
||||
* [DOMAINNAMESHOP](providers/domainnameshop.md)
|
||||
|
@ -54,6 +54,23 @@ git clone https://github.com/StackExchange/dnscontrol
|
||||
|
||||
If these don't work, more info is in [#805](https://github.com/StackExchange/dnscontrol/issues/805).
|
||||
|
||||
## 1.1. Shell Completion
|
||||
|
||||
Shell completion is available for `zsh` and `bash`.
|
||||
|
||||
### zsh
|
||||
|
||||
Add `eval "$(dnscontrol shell-completion zsh)"` to your `~/.zshrc` file.
|
||||
|
||||
This requires completion to be enabled in zsh. A good tutorial for this is available at
|
||||
[The Valuable Dev](https://thevaluable.dev/zsh-completion-guide-examples/) <sup>[[archived](https://web.archive.org/web/20231015083946/https://thevaluable.dev/zsh-completion-guide-examples/)]</sup>.
|
||||
|
||||
### bash
|
||||
|
||||
Add `eval "$(dnscontrol shell-completion bash)"` to your `~/.bashrc` file.
|
||||
|
||||
This requires the `bash-completion` package to be installed. See [scop/bash-completion](https://github.com/scop/bash-completion/) for instructions.
|
||||
|
||||
## 2. Create a place for the config files
|
||||
|
||||
Create a directory where you'll store your configuration files.
|
||||
|
@ -109,9 +109,3 @@ D("example.com", REG_INWX, DnsProvider(DSP_CF),
|
||||
);
|
||||
```
|
||||
{% endcode %}
|
||||
|
||||
{% hint style="info" %}
|
||||
**NOTE**: The INWX provider implementation currently only supports up to 2,147,483,647 domains. If you exceed
|
||||
this limit, it is expected that DNSControl will fail to recognize some domains. Should you exceed this
|
||||
limit, please [open an issue on GitHub](https://github.com/StackExchange/dnscontrol/issues/new/choose).
|
||||
{% endhint %}
|
||||
|
47
go.mod
47
go.mod
@ -13,16 +13,16 @@ require (
|
||||
github.com/TomOnTime/utfutil v0.0.0-20230223141146-125e65197b36
|
||||
github.com/akamai/AkamaiOPEN-edgegrid-golang v1.2.2
|
||||
github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883
|
||||
github.com/aws/aws-sdk-go-v2 v1.21.2
|
||||
github.com/aws/aws-sdk-go-v2/config v1.19.0
|
||||
github.com/aws/aws-sdk-go-v2/credentials v1.13.43
|
||||
github.com/aws/aws-sdk-go-v2/service/route53 v1.30.2
|
||||
github.com/aws/aws-sdk-go-v2/service/route53domains v1.17.5
|
||||
github.com/aws/aws-sdk-go-v2 v1.22.0
|
||||
github.com/aws/aws-sdk-go-v2/config v1.20.0
|
||||
github.com/aws/aws-sdk-go-v2/credentials v1.14.0
|
||||
github.com/aws/aws-sdk-go-v2/service/route53 v1.32.0
|
||||
github.com/aws/aws-sdk-go-v2/service/route53domains v1.18.0
|
||||
github.com/babolivier/go-doh-client v0.0.0-20201028162107-a76cff4cb8b6
|
||||
github.com/bhendo/go-powershell v0.0.0-20190719160123-219e7fb4e41e
|
||||
github.com/billputer/go-namecheap v0.0.0-20210108011502-994a912fb7f9
|
||||
github.com/centralnicgroup-opensource/rtldev-middleware-go-sdk/v3 v3.5.5
|
||||
github.com/cloudflare/cloudflare-go v0.79.0
|
||||
github.com/cloudflare/cloudflare-go v0.80.0
|
||||
github.com/digitalocean/godo v1.105.0
|
||||
github.com/ditashi/jsbeautifier-go v0.0.0-20141206144643-2520a8026a9c
|
||||
github.com/dnsimple/dnsimple-go v1.2.0
|
||||
@ -38,7 +38,7 @@ require (
|
||||
github.com/miekg/dns v1.1.56
|
||||
github.com/mittwald/go-powerdns v0.6.2
|
||||
github.com/namedotcom/go v0.0.0-20180403034216-08470befbe04
|
||||
github.com/nrdcg/goinwx v0.9.0
|
||||
github.com/nrdcg/goinwx v0.10.0
|
||||
github.com/oracle/oci-go-sdk/v32 v32.0.0
|
||||
github.com/ovh/go-ovh v1.1.0
|
||||
github.com/philhug/opensrs-go v0.0.0-20171126225031-9dfa7433020d
|
||||
@ -48,12 +48,12 @@ require (
|
||||
github.com/robertkrimen/otto v0.2.1
|
||||
github.com/softlayer/softlayer-go v1.1.2
|
||||
github.com/stretchr/testify v1.8.4
|
||||
github.com/transip/gotransip/v6 v6.22.0
|
||||
github.com/transip/gotransip/v6 v6.22.1
|
||||
github.com/urfave/cli/v2 v2.25.7
|
||||
github.com/xddxdd/ottoext v0.0.0-20221109171055-210517fa4419
|
||||
golang.org/x/net v0.17.0
|
||||
golang.org/x/oauth2 v0.13.0
|
||||
google.golang.org/api v0.148.0
|
||||
google.golang.org/api v0.149.0
|
||||
gopkg.in/ns1/ns1-go.v2 v2.7.13
|
||||
)
|
||||
|
||||
@ -62,6 +62,7 @@ require (
|
||||
github.com/G-Core/gcore-dns-sdk-go v0.2.6
|
||||
github.com/fatih/color v1.15.0
|
||||
github.com/fbiville/markdown-table-formatter v0.3.0
|
||||
github.com/google/go-cmp v0.6.0
|
||||
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510
|
||||
github.com/kylelemons/godebug v1.1.0
|
||||
github.com/mattn/go-isatty v0.0.20
|
||||
@ -72,21 +73,21 @@ require (
|
||||
)
|
||||
|
||||
require (
|
||||
cloud.google.com/go/compute v1.23.0 // indirect
|
||||
cloud.google.com/go/compute v1.23.1 // indirect
|
||||
cloud.google.com/go/compute/metadata v0.2.3 // indirect
|
||||
github.com/Azure/azure-sdk-for-go/sdk/internal v1.3.0 // indirect
|
||||
github.com/Azure/go-autorest v14.2.0+incompatible // indirect
|
||||
github.com/AzureAD/microsoft-authentication-library-for-go v1.1.1 // indirect
|
||||
github.com/andybalholm/cascadia v1.3.1 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.13.13 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.43 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.37 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/internal/ini v1.3.45 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.37 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/sso v1.15.2 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.17.3 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/sts v1.23.2 // indirect
|
||||
github.com/aws/smithy-go v1.15.0 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.14.0 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/internal/configsources v1.2.0 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.5.0 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/internal/ini v1.4.0 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.10.0 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/sso v1.16.0 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.18.0 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/sts v1.24.0 // indirect
|
||||
github.com/aws/smithy-go v1.16.0 // indirect
|
||||
github.com/boombuler/barcode v1.0.1 // indirect
|
||||
github.com/cenkalti/backoff v2.2.1+incompatible // indirect
|
||||
github.com/cenkalti/backoff/v3 v3.0.0 // indirect
|
||||
@ -104,8 +105,8 @@ require (
|
||||
github.com/golang/protobuf v1.5.3 // indirect
|
||||
github.com/google/go-querystring v1.1.0 // indirect
|
||||
github.com/google/s2a-go v0.1.7 // indirect
|
||||
github.com/google/uuid v1.3.1 // indirect
|
||||
github.com/googleapis/enterprise-certificate-proxy v0.3.1 // indirect
|
||||
github.com/google/uuid v1.4.0 // indirect
|
||||
github.com/googleapis/enterprise-certificate-proxy v0.3.2 // indirect
|
||||
github.com/googleapis/gax-go/v2 v2.12.0 // indirect
|
||||
github.com/gopherjs/gopherjs v1.17.2 // indirect
|
||||
github.com/hashicorp/errwrap v1.1.0 // indirect
|
||||
@ -143,8 +144,8 @@ require (
|
||||
golang.org/x/time v0.3.0 // indirect
|
||||
golang.org/x/tools v0.14.0 // indirect
|
||||
google.golang.org/appengine v1.6.7 // indirect
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20231012201019-e917dd12ba7a // indirect
|
||||
google.golang.org/grpc v1.58.3 // indirect
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20231016165738-49dd2c1f3d0b // indirect
|
||||
google.golang.org/grpc v1.59.0 // indirect
|
||||
google.golang.org/protobuf v1.31.0 // indirect
|
||||
gopkg.in/ini.v1 v1.66.6 // indirect
|
||||
gopkg.in/sourcemap.v1 v1.0.5 // indirect
|
||||
|
101
go.sum
101
go.sum
@ -1,6 +1,6 @@
|
||||
cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
|
||||
cloud.google.com/go/compute v1.23.0 h1:tP41Zoavr8ptEqaW6j+LQOnyBBhO7OkOMAGrgLopTwY=
|
||||
cloud.google.com/go/compute v1.23.0/go.mod h1:4tCnrn48xsqlwSAiLf1HXMQk8CONslYbdiEZc9FEIbM=
|
||||
cloud.google.com/go/compute v1.23.1 h1:V97tBoDaZHb6leicZ1G6DLK2BAaZLJ/7+9BB/En3hR0=
|
||||
cloud.google.com/go/compute v1.23.1/go.mod h1:CqB3xpmPKKt3OJpW2ndFIXnA9A4xAy/F3Xp1ixncW78=
|
||||
cloud.google.com/go/compute/metadata v0.2.3 h1:mg4jlk7mCAj6xXp9UJ4fjI9VUI5rubuGBW5aJ7UnBMY=
|
||||
cloud.google.com/go/compute/metadata v0.2.3/go.mod h1:VAV5nSsACxMJvgaAuX6Pk2AawlZn8kiOGuCv6gTkwuA=
|
||||
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.8.0 h1:9kDVnTz3vbfweTqAUmk/a/pH5pWFCHtvRpHYC0G/dcA=
|
||||
@ -33,34 +33,34 @@ github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo
|
||||
github.com/andybalholm/cascadia v1.3.1 h1:nhxRkql1kdYCc8Snf7D5/D3spOX+dBgjA6u8x004T2c=
|
||||
github.com/andybalholm/cascadia v1.3.1/go.mod h1:R4bJ1UQfqADjvDa4P6HZHLh/3OxWWEqc0Sk8XGwHqvA=
|
||||
github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8=
|
||||
github.com/aws/aws-sdk-go-v2 v1.21.2 h1:+LXZ0sgo8quN9UOKXXzAWRT3FWd4NxeXWOZom9pE7GA=
|
||||
github.com/aws/aws-sdk-go-v2 v1.21.2/go.mod h1:ErQhvNuEMhJjweavOYhxVkn2RUx7kQXVATHrjKtxIpM=
|
||||
github.com/aws/aws-sdk-go-v2/config v1.19.0 h1:AdzDvwH6dWuVARCl3RTLGRc4Ogy+N7yLFxVxXe1ClQ0=
|
||||
github.com/aws/aws-sdk-go-v2/config v1.19.0/go.mod h1:ZwDUgFnQgsazQTnWfeLWk5GjeqTQTL8lMkoE1UXzxdE=
|
||||
github.com/aws/aws-sdk-go-v2/credentials v1.13.43 h1:LU8vo40zBlo3R7bAvBVy/ku4nxGEyZe9N8MqAeFTzF8=
|
||||
github.com/aws/aws-sdk-go-v2/credentials v1.13.43/go.mod h1:zWJBz1Yf1ZtX5NGax9ZdNjhhI4rgjfgsyk6vTY1yfVg=
|
||||
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.13.13 h1:PIktER+hwIG286DqXyvVENjgLTAwGgoeriLDD5C+YlQ=
|
||||
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.13.13/go.mod h1:f/Ib/qYjhV2/qdsf79H3QP/eRE4AkVyEf6sk7XfZ1tg=
|
||||
github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.43 h1:nFBQlGtkbPzp/NjZLuFxRqmT91rLJkgvsEQs68h962Y=
|
||||
github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.43/go.mod h1:auo+PiyLl0n1l8A0e8RIeR8tOzYPfZZH/JNlrJ8igTQ=
|
||||
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.37 h1:JRVhO25+r3ar2mKGP7E0LDl8K9/G36gjlqca5iQbaqc=
|
||||
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.37/go.mod h1:Qe+2KtKml+FEsQF/DHmDV+xjtche/hwoF75EG4UlHW8=
|
||||
github.com/aws/aws-sdk-go-v2/internal/ini v1.3.45 h1:hze8YsjSh8Wl1rYa1CJpRmXP21BvOBuc76YhW0HsuQ4=
|
||||
github.com/aws/aws-sdk-go-v2/internal/ini v1.3.45/go.mod h1:lD5M20o09/LCuQ2mE62Mb/iSdSlCNuj6H5ci7tW7OsE=
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.37 h1:WWZA/I2K4ptBS1kg0kV1JbBtG/umed0vwHRrmcr9z7k=
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.37/go.mod h1:vBmDnwWXWxNPFRMmG2m/3MKOe+xEcMDo1tanpaWCcck=
|
||||
github.com/aws/aws-sdk-go-v2/service/route53 v1.30.2 h1:/RPQNjh1sDIezpXaFIkZb7MlXnSyAqjVdAwcJuGYTqg=
|
||||
github.com/aws/aws-sdk-go-v2/service/route53 v1.30.2/go.mod h1:TQZBt/WaQy+zTHoW++rnl8JBrmZ0VO6EUbVua1+foCA=
|
||||
github.com/aws/aws-sdk-go-v2/service/route53domains v1.17.5 h1:18p6+HD6xj5oOtDNi1XvW0PkZw/xticjOvSbIWFyw6I=
|
||||
github.com/aws/aws-sdk-go-v2/service/route53domains v1.17.5/go.mod h1:BhMj1pZPuQfzuS96s4ScniYr9qhPwDMA19N4eWPM1Lg=
|
||||
github.com/aws/aws-sdk-go-v2/service/sso v1.15.2 h1:JuPGc7IkOP4AaqcZSIcyqLpFSqBWK32rM9+a1g6u73k=
|
||||
github.com/aws/aws-sdk-go-v2/service/sso v1.15.2/go.mod h1:gsL4keucRCgW+xA85ALBpRFfdSLH4kHOVSnLMSuBECo=
|
||||
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.17.3 h1:HFiiRkf1SdaAmV3/BHOFZ9DjFynPHj8G/UIO1lQS+fk=
|
||||
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.17.3/go.mod h1:a7bHA82fyUXOm+ZSWKU6PIoBxrjSprdLoM8xPYvzYVg=
|
||||
github.com/aws/aws-sdk-go-v2/service/sts v1.23.2 h1:0BkLfgeDjfZnZ+MhB3ONb01u9pwFYTCZVhlsSSBvlbU=
|
||||
github.com/aws/aws-sdk-go-v2/service/sts v1.23.2/go.mod h1:Eows6e1uQEsc4ZaHANmsPRzAKcVDrcmjjWiih2+HUUQ=
|
||||
github.com/aws/smithy-go v1.15.0 h1:PS/durmlzvAFpQHDs4wi4sNNP9ExsqZh6IlfdHXgKK8=
|
||||
github.com/aws/smithy-go v1.15.0/go.mod h1:Tg+OJXh4MB2R/uN61Ko2f6hTZwB/ZYGOtib8J3gBHzA=
|
||||
github.com/aws/aws-sdk-go-v2 v1.22.0 h1:CpTS3XO3MWNel8ohoazkLZC6scvkYL2k+m0yzFJ17Hg=
|
||||
github.com/aws/aws-sdk-go-v2 v1.22.0/go.mod h1:Kd0OJtkW3Q0M0lUWGszapWjEvrXDzRW+D21JNsroB+c=
|
||||
github.com/aws/aws-sdk-go-v2/config v1.20.0 h1:q2+/mqFhY0J9m3Tb5RGFE3R4sdaUkIe4k2EuDfE3c08=
|
||||
github.com/aws/aws-sdk-go-v2/config v1.20.0/go.mod h1:7+1riCZXyT+sAGvneR5j+Zl1GyfbBUNQurpQTE6FP6k=
|
||||
github.com/aws/aws-sdk-go-v2/credentials v1.14.0 h1:LQquqPE7cL55RQmA/UBoBKehDlEtMnQKm3B0Q672ePE=
|
||||
github.com/aws/aws-sdk-go-v2/credentials v1.14.0/go.mod h1:q/3oaTPlamrQWHPwJe56Mjq9g1TYDgddvgTgWJtHTmE=
|
||||
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.14.0 h1:lF/cVllNAPKgjDwN2RsQUX9g/f6hXer9f10ubLFSoug=
|
||||
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.14.0/go.mod h1:c28nJNzMVVb9TQpZ5q4tzZvwEJwf/7So7Ie2s90l1Fw=
|
||||
github.com/aws/aws-sdk-go-v2/internal/configsources v1.2.0 h1:tN6dNNE4SzMuyMnVtQJXGVKX177/d5Zy4MuA1HA4KUc=
|
||||
github.com/aws/aws-sdk-go-v2/internal/configsources v1.2.0/go.mod h1:F6MXWETIeetAHwFHyoHEqrcB3NpijFv9nLP5h9CXtT0=
|
||||
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.5.0 h1:bfdsbTARDjaC/dSYGMO+E0psxFU4hTvCLnqYAfZ3D38=
|
||||
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.5.0/go.mod h1:Jg8XVv5M2V2wiAMvBFx+O59jg6Yr8vhP0bgNF/IuquM=
|
||||
github.com/aws/aws-sdk-go-v2/internal/ini v1.4.0 h1:21tlTXq3ev10yLMAjXZzpkZbrl49h3ElSjmxD57tD/E=
|
||||
github.com/aws/aws-sdk-go-v2/internal/ini v1.4.0/go.mod h1:d9YrBHJhyzDCv5UsEVRizHlFV6Q0sLemFq6uxuqWfUw=
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.10.0 h1:dJnwy5Awv+uvfk73aRENVbv1cSQQ60ydCkPaun097KM=
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.10.0/go.mod h1:RsPWWy7u/hwmFX57sQ7MLvrvJeYyNkiMm5BaavpoU18=
|
||||
github.com/aws/aws-sdk-go-v2/service/route53 v1.32.0 h1:TC7uLTp9vemCykin+hJnURU3BPitLh3JMOIZsF/4Mus=
|
||||
github.com/aws/aws-sdk-go-v2/service/route53 v1.32.0/go.mod h1:NIbTGg7AEJXUJz9ghYwsPWystZomU+GjQ7bx4Zx4UyM=
|
||||
github.com/aws/aws-sdk-go-v2/service/route53domains v1.18.0 h1:1C2plijzIYGfNNaosOsCkizOdN2lkG3z9XSkgHSP8GI=
|
||||
github.com/aws/aws-sdk-go-v2/service/route53domains v1.18.0/go.mod h1:phiukOXz4eEcmoQlPHxV2iE7lz8daPaNILhJuOtcEQo=
|
||||
github.com/aws/aws-sdk-go-v2/service/sso v1.16.0 h1:ZIlR6Wr/EgYwBdEz1NWBqdUsTh0mV7A68pId3YZl6H0=
|
||||
github.com/aws/aws-sdk-go-v2/service/sso v1.16.0/go.mod h1:O7B5cpuhhJKefAKkM7onb0McmpHyKnsH4RrHJhOyq7M=
|
||||
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.18.0 h1:3BZyJei4k1SHdSAFhg9Qg15NnG3v5zosZyFWPm7df/A=
|
||||
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.18.0/go.mod h1:Td8EvzggonY02wLaqSpwybI3GbmA0PWoprKGil2uwJg=
|
||||
github.com/aws/aws-sdk-go-v2/service/sts v1.24.0 h1:f/V5Y9OaHuNRrA9MntNQNAtMFXqhKj8HTEPnH81eXMI=
|
||||
github.com/aws/aws-sdk-go-v2/service/sts v1.24.0/go.mod h1:HnCUMNz2XqwnEEk5X6oeDYB2HgOLFpJ/LyfilN8WErs=
|
||||
github.com/aws/smithy-go v1.16.0 h1:gJZEH/Fqh+RsvlJ1Zt4tVAtV6bKkp3cC+R6FCZMNzik=
|
||||
github.com/aws/smithy-go v1.16.0/go.mod h1:NukqUGpCZIILqqiV0NIjeFh24kd/FAa4beRb6nbIUPE=
|
||||
github.com/babolivier/go-doh-client v0.0.0-20201028162107-a76cff4cb8b6 h1:4NNbNM2Iq/k57qEu7WfL67UrbPq1uFWxW4qODCohi+0=
|
||||
github.com/babolivier/go-doh-client v0.0.0-20201028162107-a76cff4cb8b6/go.mod h1:J29hk+f9lJrblVIfiJOtTFk+OblBawmib4uz/VdKzlg=
|
||||
github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs=
|
||||
@ -81,8 +81,8 @@ github.com/centralnicgroup-opensource/rtldev-middleware-go-sdk/v3 v3.5.5/go.mod
|
||||
github.com/chzyer/logex v1.2.1/go.mod h1:JLbx6lG2kDbNRFnfkgvh4eRJRPX1QCoOIWomwysCBrQ=
|
||||
github.com/chzyer/test v1.0.0/go.mod h1:2JlltgoNkt4TW/z9V/IzDdFaMTM2JPIi26O1pF38GC8=
|
||||
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
|
||||
github.com/cloudflare/cloudflare-go v0.79.0 h1:ErwCYDjFCYppDJlDJ/5WhsSmzegAUe2+K9qgFyQDg3M=
|
||||
github.com/cloudflare/cloudflare-go v0.79.0/go.mod h1:gkHQf9xEubaQPEuerBuoinR9P8bf8a05Lq0X6WKy1Oc=
|
||||
github.com/cloudflare/cloudflare-go v0.80.0 h1:BfCFK9gy+2H/R3yjZWzFvWsVXwr2zICCfmAW3brbHpE=
|
||||
github.com/cloudflare/cloudflare-go v0.80.0/go.mod h1:gkHQf9xEubaQPEuerBuoinR9P8bf8a05Lq0X6WKy1Oc=
|
||||
github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc=
|
||||
github.com/cpuguy83/go-md2man/v2 v2.0.2 h1:p1EgwI/C7NhT0JmVkwCD2ZBK8j4aeHQX2pMHHBfMQ6w=
|
||||
github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
|
||||
@ -180,7 +180,6 @@ github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/
|
||||
github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||
github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||
github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
|
||||
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
|
||||
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
|
||||
github.com/google/go-github/v35 v35.3.0 h1:fU+WBzuukn0VssbayTT+Zo3/ESKX9JYWjbZTLOTEyho=
|
||||
@ -195,10 +194,10 @@ github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 h1:El6M4kTTCOh6aBiKaU
|
||||
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510/go.mod h1:pupxD2MaaD3pAXIBCelhxNneeOaAeabZDe5s4K6zSpQ=
|
||||
github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||
github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||
github.com/google/uuid v1.3.1 h1:KjJaJ9iWZ3jOFZIf1Lqf4laDRCasjl0BCmnEGxkdLb4=
|
||||
github.com/google/uuid v1.3.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||
github.com/googleapis/enterprise-certificate-proxy v0.3.1 h1:SBWmZhjUDRorQxrN0nwzf+AHBxnbFjViHQS4P0yVpmQ=
|
||||
github.com/googleapis/enterprise-certificate-proxy v0.3.1/go.mod h1:VLSiSSBs/ksPL8kq3OBOQ6WRI2QnaFynd1DCjZ62+V0=
|
||||
github.com/google/uuid v1.4.0 h1:MtMxsa51/r9yyhkyLsVeVt0B+BGQZzpQiTQ4eHZ8bc4=
|
||||
github.com/google/uuid v1.4.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||
github.com/googleapis/enterprise-certificate-proxy v0.3.2 h1:Vie5ybvEvT75RniqhfFxPRy3Bf7vr3h0cechB90XaQs=
|
||||
github.com/googleapis/enterprise-certificate-proxy v0.3.2/go.mod h1:VLSiSSBs/ksPL8kq3OBOQ6WRI2QnaFynd1DCjZ62+V0=
|
||||
github.com/googleapis/gax-go/v2 v2.12.0 h1:A+gCJKdRfqXkr+BIRGtZLibNXf0m1f9E4HG56etFpas=
|
||||
github.com/googleapis/gax-go/v2 v2.12.0/go.mod h1:y+aIqrI5eb1YGMVJfuV3185Ts/D7qKpsEkdD5+I6QGU=
|
||||
github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY=
|
||||
@ -338,8 +337,8 @@ github.com/namedotcom/go v0.0.0-20180403034216-08470befbe04 h1:o6uBwrhM5C8Ll3MAA
|
||||
github.com/namedotcom/go v0.0.0-20180403034216-08470befbe04/go.mod h1:5sN+Lt1CaY4wsPvgQH/jsuJi4XO2ssZbdsIizr4CVC8=
|
||||
github.com/nbio/st v0.0.0-20140626010706-e9e8d9816f32/go.mod h1:9wM+0iRr9ahx58uYLpLIr5fm8diHn0JbqRycJi6w0Ms=
|
||||
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno=
|
||||
github.com/nrdcg/goinwx v0.9.0 h1:oh+yPdRDwc1IWsAU2nfsNorI/fkR+Gxm4O7yS+0NnjM=
|
||||
github.com/nrdcg/goinwx v0.9.0/go.mod h1:mnMSTi7CXBu2io4DzdOBoGFA1XclD0sEPWJaDhNgkA4=
|
||||
github.com/nrdcg/goinwx v0.10.0 h1:6W630bjDxQD6OuXKqrFRYVpTt0G/9GXXm3CeOrN0zJM=
|
||||
github.com/nrdcg/goinwx v0.10.0/go.mod h1:mnMSTi7CXBu2io4DzdOBoGFA1XclD0sEPWJaDhNgkA4=
|
||||
github.com/nu7hatch/gouuid v0.0.0-20131221200532-179d4d0c4d8d/go.mod h1:YUTz3bUH2ZwIWBy3CJBeOBEugqcmXREj14T+iG/4k4U=
|
||||
github.com/oracle/oci-go-sdk/v32 v32.0.0 h1:SSbzrQO3WRcPJEZ8+b3SFPYsPtkFM96clqrp03lrwbU=
|
||||
github.com/oracle/oci-go-sdk/v32 v32.0.0/go.mod h1:aZc4jC59IuNP3cr5y1nj555QvwojMX2nMJaBiozuuEs=
|
||||
@ -406,8 +405,8 @@ github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO
|
||||
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
|
||||
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
|
||||
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
|
||||
github.com/transip/gotransip/v6 v6.22.0 h1:22nRVa0wQwCakRB4zlCVBgexEACBnvLjYuvDRm31q3w=
|
||||
github.com/transip/gotransip/v6 v6.22.0/go.mod h1:nzv9eN2tdsUrm5nG5ZX6AugYIU4qgsMwIn2c0EZLk8c=
|
||||
github.com/transip/gotransip/v6 v6.22.1 h1:xM/UV++Em9CBRXsi+WQo7bBCIEylyE72XVB5ktmCvlM=
|
||||
github.com/transip/gotransip/v6 v6.22.1/go.mod h1:nzv9eN2tdsUrm5nG5ZX6AugYIU4qgsMwIn2c0EZLk8c=
|
||||
github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw=
|
||||
github.com/ugorji/go v1.2.6/go.mod h1:anCg0y61KIhDlPZmnH+so+RQbysYVyDko0IMgJv0Nn0=
|
||||
github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY=
|
||||
@ -540,8 +539,8 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T
|
||||
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
google.golang.org/api v0.148.0 h1:HBq4TZlN4/1pNcu0geJZ/Q50vIwIXT532UIMYoo0vOs=
|
||||
google.golang.org/api v0.148.0/go.mod h1:8/TBgwaKjfqTdacOJrOv2+2Q6fBDU1uHKK06oGSkxzU=
|
||||
google.golang.org/api v0.149.0 h1:b2CqT6kG+zqJIVKRQ3ELJVLN1PwHZ6DJ3dW8yl82rgY=
|
||||
google.golang.org/api v0.149.0/go.mod h1:Mwn1B7JTXrzXtnvmzQE2BD6bYZQ8DShKZDZbeN9I7qI=
|
||||
google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
|
||||
google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
|
||||
google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c=
|
||||
@ -549,19 +548,19 @@ google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCID
|
||||
google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
|
||||
google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
|
||||
google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo=
|
||||
google.golang.org/genproto v0.0.0-20231002182017-d307bd883b97 h1:SeZZZx0cP0fqUyA+oRzP9k7cSwJlvDFiROO72uwD6i0=
|
||||
google.golang.org/genproto v0.0.0-20231002182017-d307bd883b97/go.mod h1:t1VqOqqvce95G3hIDCT5FeO3YUc6Q4Oe24L/+rNMxRk=
|
||||
google.golang.org/genproto/googleapis/api v0.0.0-20231002182017-d307bd883b97 h1:W18sezcAYs+3tDZX4F80yctqa12jcP1PUS2gQu1zTPU=
|
||||
google.golang.org/genproto/googleapis/api v0.0.0-20231002182017-d307bd883b97/go.mod h1:iargEX0SFPm3xcfMI0d1domjg0ZF4Aa0p2awqyxhvF0=
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20231012201019-e917dd12ba7a h1:a2MQQVoTo96JC9PMGtGBymLp7+/RzpFc2yX/9WfFg1c=
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20231012201019-e917dd12ba7a/go.mod h1:4cYg8o5yUbm77w8ZX00LhMVNl/YVBFJRYWDc0uYWMs0=
|
||||
google.golang.org/genproto v0.0.0-20231016165738-49dd2c1f3d0b h1:+YaDE2r2OG8t/z5qmsh7Y+XXwCbvadxxZ0YY6mTdrVA=
|
||||
google.golang.org/genproto v0.0.0-20231016165738-49dd2c1f3d0b/go.mod h1:CgAqfJo+Xmu0GwA0411Ht3OU3OntXwsGmrmjI8ioGXI=
|
||||
google.golang.org/genproto/googleapis/api v0.0.0-20231016165738-49dd2c1f3d0b h1:CIC2YMXmIhYw6evmhPxBKJ4fmLbOFtXQN/GV3XOZR8k=
|
||||
google.golang.org/genproto/googleapis/api v0.0.0-20231016165738-49dd2c1f3d0b/go.mod h1:IBQ646DjkDkvUIsVq/cc03FUFQ9wbZu7yE396YcL870=
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20231016165738-49dd2c1f3d0b h1:ZlWIi1wSK56/8hn4QcBp/j9M7Gt3U/3hZw3mC7vDICo=
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20231016165738-49dd2c1f3d0b/go.mod h1:swOH3j0KzcDDgGUWr+SNpyTen5YrXjS3eyPzFYKc6lc=
|
||||
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
|
||||
google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
|
||||
google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY=
|
||||
google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
|
||||
google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc=
|
||||
google.golang.org/grpc v1.58.3 h1:BjnpXut1btbtgN/6sp+brB2Kbm2LjNXnidYujAVbSoQ=
|
||||
google.golang.org/grpc v1.58.3/go.mod h1:tgX3ZQDlNJGU96V6yHh1T/JeoBQ2TXdr43YbYSsCJk0=
|
||||
google.golang.org/grpc v1.59.0 h1:Z5Iec2pjwb+LEOqzpB2MR12/eKFhDPhuqW91O+4bwUk=
|
||||
google.golang.org/grpc v1.59.0/go.mod h1:aUPDwccQo6OTjy7Hct4AfBPD1GptF4fyUjIkQ9YtF98=
|
||||
google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
|
||||
google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
|
||||
google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=
|
||||
|
@ -207,7 +207,7 @@ func (restApi *dnsMadeEasyRestAPI) createRequest(request *apiRequest) (*http.Req
|
||||
return req, nil
|
||||
}
|
||||
|
||||
// DNS Made Simple only allows 150 request / 5 minutes
|
||||
// DNS Made Easy only allows 150 request / 5 minutes
|
||||
// backoff is the amount of time to sleep if a "Rate limit exceeded" error is received
|
||||
// It is increased up to maxBackoff after each use
|
||||
// It is reset after successful request
|
||||
|
@ -390,18 +390,24 @@ func (api *inwxAPI) GetRegistrarCorrections(dc *models.DomainConfig) ([]*models.
|
||||
|
||||
// fetchNameserverDomains returns the domains configured in INWX nameservers
|
||||
func (api *inwxAPI) fetchNameserverDomains() error {
|
||||
zones := map[string]int{}
|
||||
request := &goinwx.NameserverListRequest{}
|
||||
request.PageLimit = 2147483647 // int32 max value, highest number API accepts
|
||||
info, err := api.client.Nameservers.ListWithParams(request)
|
||||
if err != nil {
|
||||
return err
|
||||
page := 1
|
||||
for {
|
||||
request.Page = page
|
||||
info, err := api.client.Nameservers.ListWithParams(request)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
for _, domain := range info.Domains {
|
||||
zones[domain.Domain] = domain.RoID
|
||||
}
|
||||
if len(zones) >= info.Count {
|
||||
break
|
||||
}
|
||||
page++
|
||||
}
|
||||
|
||||
api.domainIndex = map[string]int{}
|
||||
for _, domain := range info.Domains {
|
||||
api.domainIndex[domain.Domain] = domain.RoID
|
||||
}
|
||||
|
||||
api.domainIndex = zones
|
||||
return nil
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user