Commit graph

313 commits

Author SHA1 Message Date
Tom Limoncelli d6b191bae4
CLOUDFLARE: get-zones now outputs "orange cloud" status (#952)
* CLOUDFLARE: get-zones now outputs "orange cloud" status
2020-11-24 10:30:21 -05:00
Tom Limoncelli db6ad08f5e
GCLOUD: Retry on ratelimit (#946)
* Add exponential delay retry on 429, 503; and single retry on 404s.
2020-11-18 09:06:45 -05:00
Tom Limoncelli 1f471a15b9
DIGITALOCEAN: Support TXTMulti with caveats (#949)
* DIGITALOCEAN: Support TXTMulti with caveats
* go get github.com/digitalocean/godo
* DIGITALOCEAN: Enable CI tests
2020-11-18 08:22:31 -05:00
Jakob Ackermann 550fa436ed
HETZNER: better rate limit handling (#936)
* HETZNER: better rate limit handling

- Hetzner is using a Proxy service 'kong' which broadcasts it limits
- honor 'Retry-After' of 429 responses
- delay requests per-se: see the amended docs for details

Signed-off-by: Jakob Ackermann <das7pad@outlook.com>

* HETZNER: apply review feedback: store quotaName as lower case

Co-authored-by: Tom Limoncelli <tlimoncelli@stackoverflow.com>
Signed-off-by: Jakob Ackermann <das7pad@outlook.com>

Co-authored-by: Tom Limoncelli <tlimoncelli@stackoverflow.com>
2020-11-16 12:26:52 -05:00
Tom Limoncelli 7db3741bc7
MAINTENANCE: Unknown rtypes should return errors, not a panic (#945)
* Eliminate panics related to unknown rtypes
2020-11-13 16:32:40 -05:00
Tom Limoncelli 654bb9cfeb
GCLOUD: Don't panic() on unknown domain name (#944)
* GCLOUD: Dont panic on unknown domains
2020-11-13 13:12:36 -05:00
Tom Limoncelli 184131b1e3
AZURE_DNS: Remove artificial delays (#943)
* AZURE_DNS: Remove artificial delays
* CloudflareAPI is too slow for all tests
2020-11-13 12:21:13 -05:00
Tom Limoncelli ba08e718b7
DIGITALOCEAN: Abide by rate limits (#934)
* Implement exponential back-off
2020-11-12 10:53:44 -05:00
Tom Limoncelli 724d5ff6c7
ROUTE53: Fix R53_ALIAS creation failure (#938)
Fixes https://github.com/StackExchange/dnscontrol/issues/937

* Add integration test to repro https://github.com/StackExchange/dnscontrol/issues/937
* Reformat integration tests to be more readable.
* ROUTE53: Create CNAME/R53_ALIAS in best order
* Each R53_ALIAS_* should be its own change, not combined.
* Refactor and simplify (omg it has gotten ugly)
2020-11-12 00:30:40 -05:00
Jakob Ackermann ab47e92cbf
HETZNER: fix retry of POST/PUT requests -- rebuild request body (#926)
Previously for any retry the request body was already consumed and
 the server received an empty body.

Signed-off-by: Jakob Ackermann <das7pad@outlook.com>

Co-authored-by: Tom Limoncelli <tlimoncelli@stackoverflow.com>
2020-11-01 19:34:10 -05:00
Jakob Ackermann 152fa95031
HETZNER: create and modify multiple records in batches (#925)
Signed-off-by: Jakob Ackermann <das7pad@outlook.com>
2020-11-01 19:30:16 -05:00
Tom Limoncelli bb6aecc9ad
Build broke on Windows (#920) 2020-10-29 13:36:47 -04:00
Tom Limoncelli ca30c9c34f
Rename provider handles to *Provider (#914) 2020-10-26 09:25:30 -04:00
Tom Limoncelli d56a8307f3
Be more consistent in API handle variable names (#911) 2020-10-25 12:58:43 -04:00
Jakob Ackermann 2b50af0cbc
NEW PROVIDER: HETZNER DNS Console (#904)
* HETZNER: implement the provider for Hetzner DNS Console

Signed-off-by: Jakob Ackermann <das7pad@outlook.com>

* HETZNER: apply review feedback

- add domain into error messages
- insert sub-strings using `%q`
- insert sub-errors using `%w`
- change api.getZone() signature to return a (potentially `nil`) Zone
   pointer instead of a (potentially empty) Zone value
- sort imports and confirm with `$ goimports -w providers/hetzner/`
- use exact 'api_key' term in error message of settings validation
- add blank line for logic separation
- drop internal record id from correction messages

Co-Authored-By: Tom Limoncelli <tlimoncelli@stackoverflow.com>
Signed-off-by: Jakob Ackermann <das7pad@outlook.com>

* HETZNER: add request rate-limiting handling

There are a limited number of data-points on how their rate-limiting
 works at this time. I deduce from my account to others and use a fixed/
 constant backoff of 1s as the initial delay. Thereafter exponential
 increase with factor 2 (not needed at this time).
Hetzner has not made any official statements on rate-limiting, so this
 is guesswork only.

Signed-off-by: Jakob Ackermann <das7pad@outlook.com>

* HETZNER: address golint complaints

- baseUrl -> baseURL
- mark Record as private -> record
- mark Zone as private -> zone
- mark RequestRateLimiter as private -> requestRateLimiter
- capitalize Id fields as ID
- keep delay logic on same level, move return out of branch

Signed-off-by: Jakob Ackermann <das7pad@outlook.com>

* HETZNER: rate_limited: init the response timestamp on requestRateLimiter

Signed-off-by: Jakob Ackermann <das7pad@outlook.com>

* HETZNER: requestRateLimiter: align local variable with struct name

Signed-off-by: Jakob Ackermann <das7pad@outlook.com>

Co-authored-by: Tom Limoncelli <tlimoncelli@stackoverflow.com>
2020-10-22 09:44:21 -04:00
Tom Limoncelli 3a2b1b2f7b
Internal: deps updates and linting (#905)
* Update dependencies
* writing-providers.md: Update for Go Mod, etc.
* Linting pkg/version
* s/CloudflareAPI/api/g
* s/ApiKey/APIKey/g
* s/ApiToken/APIToken/g
* s/ApiUser/APIUser/g
2020-10-18 14:04:50 -04:00
Tom Limoncelli da1cbad4ec
HEXONET: Implement get-zones, fix module problem (#898)
* VULTR: Update govultr to v1.0.0 (fixes #892) (#897)

* go get -u github.com/hexonet/go-sdk

* Fix HEXONET providers.json entry

* providers.json: json commma

* providers.json: fmtjson

* HEXONET: Implement get-zones. Fix tests and docs.

* fixup!

* Update azure test failures

* Move version info into its own package

* Use new version system
2020-10-12 11:45:44 -04:00
Patrick Gaskin 26c7c356f4
VULTR: Update govultr to v1.0.0 (fixes #892) (#897) 2020-10-08 16:12:56 -04:00
Patrick Gaskin 38d9f059a7
VULTR: AddOrigin is unnecessary (#314) (#896) 2020-10-08 16:12:38 -04:00
Tom Limoncelli b275286dae
Add D_EXTEND (#885) (thanks to @ad8-bdl!)
* fix get-zones code block indentation

* extend D_EXTEND to handle subdomains

* fix targets: make absolute incl. subdomain where necessary

* clarify subdomain target test (not IP && not fqdn)

* Add parse_tests for D and D_EXTEND

* _getDomainObject: examine all domains

* human readable form

* consistent test IP addresses

* Improve docs and formatting

* propagate subdomain to canonicalisation

* en-US spelling

* rm extraneous console.log

* ignore subdomain for CF_REDIRECT

* clarify D_EXTEND doc re. CF_REDIRECT

* rm extraneous linebreak

* _getDomainObject: examine all domains

* human readable form

* consistent test IP addresses

* propagate subdomain to canonicalisation

* en-US spelling

* rm extraneous console.log

* ignore subdomain for CF_REDIRECT

* clarify D_EXTEND doc re. CF_REDIRECT

* rm extraneous linebreak

* GANDI_V5: Use github.com/go-gandi/go-gandi, not github.com/tiramiseb/go-gandi (#883)

* DOCUMENTATION: Fix error in CNAME.md (#877)

The current example `CNAME("def", "test.subdomain"), // def.example.com -> test.subdomain.example.com` is invalid (correctly raises a validation error, "ERROR: in CNAME def.example.com: target (test.subdomain) must end with a (.)")

* typos, fmt; example syntax fixes and real output

* formatting; re-add lost comment

* RecordConfig subdomain should be nullable

* providers/cscglobal/api.go: Fix fmt string

* More tests and docs

* go generate

Co-authored-by: Ben L <47653825+ad8-bdl@users.noreply.github.com>
2020-10-07 14:27:33 -04:00
Tom Limoncelli 678540cfdd
GANDI_V5: Use github.com/go-gandi/go-gandi, not github.com/tiramiseb/go-gandi (#883) 2020-10-02 13:53:03 -04:00
Pieter Maene 683ed698e9
ClouDNS: Return API error only when body unmarshals to errorResponse (#875) 2020-09-29 07:23:14 -04:00
Tom Limoncelli f082ad36c8
AUTODNSSEC -> AUTODNSSEC_ON (#863)
* AUTODNSSEC -> AUTODNSSEC_ON
* Validate AutoDNSSEC values
* AUTODNSSEC now generates a warning and does nothing.
2020-09-27 16:37:42 -04:00
Grégoire Henry 9953bf41e9
AXFRDDNS: fix error message (fix #778) (#871) 2020-09-24 11:01:26 -04:00
Patrik Kernstock 9ad742fc22
INWX: Support creating domains (#855)
* Support create-domains for INWX

* Use own function to decide which NS to use when sandbox

* Updated docs via go generate

* Move domainIndex into inwxAPI struct

* Changed getDefaultNameservers() IF

* Make Tom happy

* Updated docs via go generate
2020-09-21 09:27:50 -04:00
Jan-Philipp Benecke 52c50c88b3
PowerDNS: Implemented AUTODNSSEC (#856)
* PowerDNS: Implemented AUTODNSSEC
2020-09-17 08:46:15 -04:00
Patrik Kernstock 5c0f69ea44
INWX: Remove deprecated nameservers (#852)
ns4 and ns5 are being deprecated, therefore removing them, see: https://www.inwx.de/en/news/604/important-nameserver-changes
2020-09-09 19:41:02 -04:00
Mike Cochrane 9818eb1fca
New Registrar: CSC Global (#827)
* CSC Global Registrar provider

* better error handling. Coding standards.

* Just return the error
2020-09-07 12:00:21 -04:00
Mike Cochrane d6f3f401a5
NEW PROVIDER: DOH: Read-only Registrar that validates NS records (#840) 2020-09-04 10:22:41 -04:00
Sump Runlet f0e08cb01c
AZURE: Cleanup: Errorf is a pure function but its return value is ignored #836 (#843)
Resolves #836
2020-09-04 07:30:41 -04:00
Tom Limoncelli b6fd4dffd7
Cleanups: Fix many issues reported by staticcheck.io (#837)
* Lint: Fix ST1005: error strings should not be capitalized

* Cleanup: Fix a lot of staticcheck.io warnings
2020-08-30 20:38:08 -04:00
Tom Limoncelli de308c0952
Lint: Fix ST1005: error strings should not be capitalized (#834) 2020-08-30 19:52:37 -04:00
Sven Luijten ca136992f8
CLOUDFLARE: Set TTL to 1 for Cloudflare page rules (#828) 2020-08-27 16:45:58 -04:00
Tom Limoncelli d6dd13820f
gofmt (#826) 2020-08-26 13:45:02 -04:00
Robert Blenkinsopp 74dd34443a
NEW PROVIDER: HEDNS: Hurricane Electric DNS (dns.he.net) (#822)
* Add initial dns.he.net provider support

* Update to new IncrementalDiff interface

* Fix ListZones output for `all` query on `get-zones`

* Refactor authentication code for 2FA with better error checking

* Fix integration test and refactor zone record retrieval

* Add option to use `.hedns-session` file to store sessions between runs

* Add comment on `session-file-path`

* Add integration test for TXT records longer than 255 characters

* Add additional checks for expected responses, and better 2FA error checking

* Minor documentation changes

* Revert "Add integration test for TXT records longer than 255 characters"

This reverts commit 657272db

* Add note on provider fragility due to parsing the web-interface

* Resolve go lint issues

* Clarify security warnings in documentation
2020-08-26 13:38:28 -04:00
Sven Peter 443c187dda
Cleanup: INWX fix golint issues (#825) 2020-08-26 13:06:13 -04:00
Mike Cochrane 59747a96f0
Cleanup: Bubble errors up from diff instead of panic (#799) (#817) 2020-08-20 15:49:00 -04:00
Kevin Zander 79357bb667
Add TTL to BIND SoaInfo struct (#820)
Co-authored-by: Kevin Zander <Kevin.Zander@sony.com>
2020-08-20 15:44:15 -04:00
Sump Runlet 266f0b8f33
AZURE: Fixed bug related to having >100 Zones (#816)
Resolves #792
2020-08-18 15:13:08 -04:00
Sven Peter f88c60a8f3
New provider: INWX (#808)
* adds initial support for INWX

* adds all features to the INWX provider

* allows domain for tests in creds.json for INWX

* runs go generate to update docs for INWX

* fixes formatting with gofmt

* changes goinwx to github.com/nrdcg/goinwx v0.8.0

* simplifies inwx sandbox check

* changes inwx unknown key error to a warning

* adds models.PostProcessRecords for inwx records

* replaces strings.TrimRight with [:-1] to remove final dot for inwx

* adds a comment about the domain creds.json key for the inwx provider

* removes warning for invalid creds.json keys in the inwx provider

* adds TOTP calculation support for inwx

* adds comments to inwxProvider

* improves INWX error messages

* adds additional documentation about the TOTP support for INWX

* adds inwx documentation

* bumps goinwx to 0.8.1 to fix the inwx API
2020-08-17 08:45:44 -04:00
herver 98418cf48b
desec: Supports PTR records out of the box (#801) 2020-08-04 09:44:20 -04:00
Jan-Philipp Benecke 4211cf1dc0
Fixing PowerDNS domain creation (#786) 2020-07-30 11:09:21 -04:00
Sump Runlet 42f7568074
Fix for incomplete results from Azure DNS in fetchRecordSets (#791) 2020-07-28 13:35:56 -04:00
Blake Bourque ea328263c7
Route53 uses a custom record type for SPF (#787)
Much like OVH Route53 when queried returns SPF records as their own
type. This small change transcribes the SPF type to TXT

See: https://github.com/StackExchange/dnscontrol/issues/446
See: 644ba70e87/providers/ovh/ovhProvider.go (L169-L172)
2020-07-17 13:02:42 -04:00
Max Ratmeyer 644ba70e87
Fixed MX records on NS1 (#783) 2020-07-14 08:33:21 -04:00
Max Ratmeyer f12cd58d1f
NS1: Revert enabling TXTMulti (#782)
Co-authored-by: Max Ratmeyer <maxratmeyer@Maxs-MacBook-Pro.local>
2020-07-10 07:08:03 -04:00
Tom Limoncelli 2c9301387a aRemove debug statement 2020-07-09 19:34:35 -04:00
Max Ratmeyer f7d39b578a
NS1: Added support for ALIAS, PTR, and TXTMuli (#776) 2020-07-06 20:29:25 -04:00
Tom Limoncelli 541bb805da
linting (#777) 2020-07-06 20:18:24 -04:00
Tom Limoncelli 367a14ab44
Sort updates (cosmetic) (#772)
* Sort updates (cosmetic)

* comments

* More comments
2020-07-01 05:55:20 -04:00