Commit graph

28 commits

Author SHA1 Message Date
Tom Limoncelli ca5ef2d4ac
HETZNER: Clean up lint warning (#2280)
Co-authored-by: Tom Limoncelli <tal@whatexit.org>
2023-04-16 14:22:03 -04:00
Tom Limoncelli 60470a3886
BUG: Some DNS zones are downloaded twice (#2120)
Signed-off-by: Amelia Aronsohn <squirrel@wearing.black>
Co-authored-by: Tom Limoncelli <tal@whatexit.org>
Co-authored-by: Grégoire Henry <hnrgrgr@users.noreply.github.com>
Co-authored-by: Amelia Aronsohn <squirrel@wearing.black>
Co-authored-by: Kai Schwarz <kschwarz@hexonet.net>
Co-authored-by: Asif Nawaz <asif.nawaz@centralnic.com>
Co-authored-by: imlonghao <git@imlonghao.com>
Co-authored-by: Will Power <1619102+willpower232@users.noreply.github.com>
2023-04-14 15:22:23 -04:00
Jakob Ackermann e230ade9c2
HETZNER: provider maintenance (#2258)
Signed-off-by: Jakob Ackermann <das7pad@outlook.com>
2023-04-03 17:26:05 -04:00
Paul Dee 3b6591fd95
NEW FEATURE: Support DNS LOC record type (#2174) 2023-03-16 14:04:20 -04:00
Tom Limoncelli f63ca8c896
HETZNER: Don't use string.Title() (#2179)
Co-authored-by: Tom Limoncelli <tlimoncelli@stackoverflow.com>
2023-03-15 21:22:05 -04:00
Kim Almasan 9beb00f6b1
Add tlsa to hetzner provider (#2168) 2023-03-15 09:44:18 -04:00
Tom Limoncelli 0491aadd36
BUG: Fix all err scopes (#2160) 2023-03-13 14:19:19 -04:00
Yannik Sembritzki 5e06c249d6
Rename DomainCreator to the more accurate ZoneCreator (#2038)
Co-authored-by: Yannik Sembritzki <yannik@sembritzki.org>
Co-authored-by: Tom Limoncelli <tlimoncelli@stackoverflow.com>
2023-02-07 07:22:49 -05:00
Tom Limoncelli 4083a0ce7e
HETZNER: Adopt diff2 in compatibility mode (#1888) 2023-01-02 08:27:33 -05:00
Tom Limoncelli b0f2945510
REFACTOR: Add diff2 enable flag to all DNS providers (#1851)
This should enable the diff2 code to be inserted with good "git blame" results for new code.  I'm adding this early to catch any problems early.
2022-12-11 15:02:58 -05:00
Tom Limoncelli 61e500b7dc
DEV: Optimize integration tests (#1742) 2022-09-07 14:08:06 -04:00
Tom Limoncelli ccb582b278
CHORE: Linting (#1704)
* Remove deprecated io/ioutil
* fixup!
* staticcheck and linting
* revert models/provider.go
* Fix imports to new style
* linting
2022-08-14 20:46:56 -04:00
Tom Limoncelli cd61c2c766
CHORE: Remove deprecated io/ioutil (#1699)
* Remove deprecated io/ioutil

* fixup!

* fixup!
2022-08-14 12:50:15 -04:00
Tom Limoncelli 31723ad146
PERFORMANCE: Refactor auditrecords.go to loop only once #1570 (#1658)
* stash

* Use rejectif idea

* rename

* wip!

* Convert old systems to new

* fixup!

* fix typo
2022-08-11 17:24:47 -04:00
Jakob Ackermann a00572af4a
Create zone before use (#1642)
* preview/push: ensure zones exists before querying them

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

* HETZNER: reset zone cache when creating a new zone

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

* ROUTE53: reset zone cache when creating a new zone

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

Co-authored-by: Tom Limoncelli <tlimoncelli@stackoverflow.com>
2022-08-01 14:44:17 -04:00
Jan-Philipp Benecke bcb968411a
MAINT: Unify provider outputs to pkg/printer (#1546)
* Unify provider outputs to pkg/printer

Signed-off-by: Jan-Philipp Benecke <jan-philipp@bnck.me>

* No need for custom Errorf

Signed-off-by: Jan-Philipp Benecke <jan-philipp@bnck.me>

* Add missing import for activedir

Signed-off-by: Jan-Philipp Benecke <jan-philipp@bnck.me>

* Add missing fmt import for activedir

Signed-off-by: Jan-Philipp Benecke <jan-philipp@bnck.me>
2022-06-18 09:01:02 -04:00
Tom Limoncelli 444b893e1b
MAINT: Sort various lists (#1433)
* maint: sort lists in build/generate/featureMatrix.go

* maint: sort lists in docs/byo-secrets.md

* maint: sort lists in models/record.go

* maint: sort lists in pkg/normalize/validate.go

* maint: sort lists in providers/activedir/activedirProvider.go

* maint: sort lists in providers/akamaiedgedns/akamaiEdgeDnsProvider.go

* maint: sort lists in providers/axfrddns/axfrddnsProvider.go

* maint: sort lists in providers/azuredns/azureDnsProvider.go

* maint: sort lists in providers/cloudflare/cloudflareProvider.go

* maint: sort lists in providers/cloudns/cloudnsProvider.go

* maint: sort lists in providers/desec/desecProvider.go

* maint: sort lists in providers/digitalocean/digitaloceanProvider.go

* maint: sort lists in providers/dnsimple/dnsimpleProvider.go

* maint: sort lists in providers/dnsmadeeasy/dnsMadeEasyProvider.go

* maint: sort lists in providers/exoscale/exoscaleProvider.go

* maint: sort lists in providers/gandiv5/gandi_v5Provider.go

* maint: sort lists in providers/hedns/hednsProvider.go

* maint: sort lists in providers/hetzner/hetznerProvider.go

* maint: sort lists in providers/hexonet/hexonetProvider.go

* maint: sort lists in providers/inwx/inwxProvider.go

* maint: sort lists in providers/linode/linodeProvider.go

* maint: sort lists in providers/namecheap/namecheapProvider.go

* maint: sort lists in providers/namedotcom/namedotcomProvider.go

* maint: sort lists in providers/netcup/netcupProvider.go

* maint: sort lists in providers/ns1/ns1Provider.go

* maint: sort lists in providers/octodns/octodnsProvider.go

* maint: sort lists in providers/oracle/oracleProvider.go

* maint: sort lists in providers/ovh/ovhProvider.go

* maint: sort lists in providers/packetframe/packetframeProvider.go

* maint: sort lists in providers/powerdns/powerdnsProvider.go

* maint: sort lists in providers/route53/route53Provider.go

* maint: sort lists in providers/vultr/vultrProvider.go

* Update go:build pragmas for windows

* More sorting

* go generate
2022-03-02 11:19:15 -05:00
Jakob Ackermann 2e28dcd644
HETZNER: handle a 404 from listing zones gracefully (#1371)
The API docs do not mention this, but we saw a case in the wild (1370).

Signed-off-by: Jakob Ackermann <das7pad@outlook.com>
2022-01-10 16:08:15 -05:00
Tom Limoncelli 02c5258396
CODE: Fix simple staticcheck items (#1329) 2021-12-14 16:28:37 -05:00
Tom Limoncelli 8d139d182f
gofmt all (#1144) 2021-05-04 14:15:31 -04:00
Tom Limoncelli e69e6f27e4
Linting (#1087)
* fix linting
* rename AuditRecordsor to RecordAuditor
* gandi_v5 to gandiv5
2021-03-08 20:14:30 -05:00
Tom Limoncelli 8dea9edc34
Re-engineer TXT records for simplicity and better compliance (#1063)
TXT records are now handled different.

1. The raw input from dnsconfig.js is passed all the way to the provider. The provider can determine if it can or can't handle such records (auditrecords.go) and processes them internally as such.
2. The CanUseTXTMulti capability is no longer needed.

* DSPs now register a table of functions
* Use audits for txt record variations
* unit tests pass. integration fails.
* fix deepcopy problem
* rename to AuditRecordSupport
* Reduce use of TXTMulti
* Remove CanUseTXTMulti
* fix Test Skip
* fix DO
* fix vultr
* fix NDC
* msdns fixes
* Fix powerdns and cloudflare
* HEDNS: Fix usage of target field to resolve TXT handling (#1067)
* Fix HEXONET

Co-authored-by: Robert Blenkinsopp <robert@blenkinsopp.net>
Co-authored-by: Jakob Ackermann <das7pad@outlook.com>
2021-03-07 13:19:22 -05:00
André Frimberger 533bf5783d
HETZNER: Allow TXTMulti (#963)
Co-authored-by: Tom Limoncelli <tlimoncelli@stackoverflow.com>
2020-11-28 15:40:43 -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
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 ca30c9c34f
Rename provider handles to *Provider (#914) 2020-10-26 09:25:30 -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