Commit graph

245 commits

Author SHA1 Message Date
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
Tom Limoncelli 443b99aa59
CHORE: Remove duplicate ToDiff code (#1684) 2022-08-11 16:13:24 -04:00
Tom Limoncelli 0a6fa677f3
Fix broken test (#1659) 2022-08-08 10:30:21 -04:00
MisterErwin 7865e37c8f
Add RWTH provider (#1629)
* Add RWTH provider

* fix Owners order

* Reorganize RWTH Provider

* Fix staticcheck and code style issues

Co-authored-by: Tom Limoncelli <tlimoncelli@stackoverflow.com>
2022-08-04 14:40:27 -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
Amelia Aronsohn befb52be86
DNSIMPLE: Fix TXT Handling, Second Edition (#1624)
* Fix typo and add sandbox information

* Use SetTargetTXT in GetZoneRecords

This fixes the behavior documented in #1622

Also apply cleanup to GetZoneRecords

* Remove SetTargetTXT, does not work in all tests

* Set The most correct TXT handling

* Well, There's your problem

* Add an audit and test for unpaired quotes

* Add some commentary

Co-authored-by: Tom Limoncelli <tlimoncelli@stackoverflow.com>
2022-07-22 09:36:28 -04:00
Tom Limoncelli bcaa6b15cb
AuditRecords should report the provider name (#1628) 2022-07-18 12:59:22 -04:00
Tom Limoncelli 959f721c04
MAINT: Update TXT docs, suggest not using TxtNoLen255 (#1548)
* suggest not using TxtNoLen255

* Rename functions

* wip!

* fixing!
2022-06-20 11:34:05 -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
Jan-Philipp Benecke ba2c7f9c0e
MAINT: Enforcing formatted code (#1544)
* Enforcing formatted code

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

* Show lines

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

* Run check after deps are installed

Signed-off-by: Jan-Philipp Benecke <jan-philipp@bnck.me>
2022-06-18 08:56:04 -04:00
Tom Limoncelli 752e25471d
NEW PROVIDER: CSCGLOBAL as DNS Service Provider (#1516)
* Move the registrar features to a separate file

* Prepare the testing framework

* Roughed out functions

* Fix up structs

* WIP!

* First tests pass

* wip!

* Flesh out remaining rTypes, get nameservers, etc

* Fix TXT records

* Clean up code

* More cleanups. Fix CAA/SRV

* Linting

* Cleanups/linting

* Fix CAA [more] and more cleanups

* CSC does not like very long txt records

* Use timer only when interactive

* Disable CAA for now

* Update docs

* Remove debug printf

* add go-isatty

* cleanups
2022-06-12 16:01:08 -04:00
Jan-Philipp Benecke cfa104858d
FEATURE: --creds can refer to a command line to execute in addition to a file or script (#1521)
* Allow commands for creds file & refactoring

* Minor fix

* Add shell command ability to docs

Signed-off-by: Jan-Philipp Benecke <jan-philipp.benecke@jpbe.de>

Co-authored-by: Tom Limoncelli <tlimoncelli@stackoverflow.com>
2022-06-06 14:37:45 -04:00
Tom Limoncelli 58b2704fde
BUG: With TYPE in creds.json, CAA compatibility check breaks (#1514) 2022-05-29 12:14:17 -04:00
Tom Limoncelli 997e1a0901
BUGFIX: Skip AuditRecords when running dnscontrol check (#1508)
Fixes 1507
2022-05-23 13:27:53 -04:00
Tom Limoncelli 9e6d642e35
NEW FEATURE: Moving provider TYPE from dnsconfig.js to creds.json (#1500)
Fixes https://github.com/StackExchange/dnscontrol/issues/1457

* New-style creds.json implememented backwards compatible

* Update tests

* Update docs

* Assume new-style TYPE
2022-05-08 14:23:45 -04:00
Costas Drogos 6e802f2257 Emit warning in case of label having multiple TTLs
An RRSet (=label) consisting of multiple records with different TTLs is
something not supported by most providers, and should be avoided.
Furthermore it is deprecated in rfc2181#section-5.2

Emit a warning for now during validation, eventually turning it into a full-blown error.

Fixes #1372
2022-05-04 11:20:27 -04:00
Costas Drogos c8a5060dfb
Emit warning in case of label having multiple TTLs (#1489)
* Emit warning in case of label having multiple TTLs

An RRSet (=label) consisting of multiple records with different TTLs is
something not supported by most providers, and should be avoided.
Furthermore it is deprecated in rfc2181#section-5.2

Emit a warning for now during validation, eventually turning it into a full-blown error.

Fixes #1372

* normalize: less verbose checkLabelHasMultipleTTLs

Code would previously emit a warning for each record it found matching a
previously found label but with a different ttl. This could potentially become
too verbose of an output for larger zones.

Split the loop into two loops, one storing labels and their records' TTLs, the
second checking for multiple TTLs, in order to minimize the messages logged to
one message per problematic label, regardless for the number of records involved.

Co-authored-by: Tom Limoncelli <tlimoncelli@stackoverflow.com>
2022-05-04 08:41:16 -04:00
Costas Drogos 156ec01ea0
TESTING: pkg/js/parse_tests: fix a broken test (#1498)
012_duration creates multiple records under the same label, with different TTLs
We plan to deprecate this going forward, in #1372.

Modify the test in a way that creates one label per record, each having a
different TTL format as before, to be validated.
2022-05-03 19:46:48 -04:00
Tom Limoncelli 19550aeed9
Refactor: Rename providers/config to pkg/credsfile (#1494) 2022-05-02 20:12:30 -04:00
Tom Limoncelli 99210c9d1c
Make skip_fqdn_check error message easier to understand and fix (#1477) 2022-04-04 14:05:49 -04:00
Tom Limoncelli 91592ce4a7
MAINT: "DUPLICATE E_RECORD" no longer a hard error (#1465) 2022-03-25 12:09:24 -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
tpdn fc75f89271
ClouDNS: Add CLOUDNS_WR (Web Redirects) (#1421)
Co-authored-by: Tom Limoncelli <tlimoncelli@stackoverflow.com>
2022-03-02 09:21:51 -05:00
Tom Limoncelli 886dbf6d00
MAINT: Make staticcheck more strict and fix new warnings (#1408)
* Make staticcheck more strict and fix new warnings
2022-02-11 14:30:45 -05:00
Tom Limoncelli f9c4887d95 Revert "Make staticcheck more strict and fix new warnings"
This reverts commit 5c456e2513.
2022-02-11 12:14:24 -05:00
Tom Limoncelli a70354775e Make staticcheck more strict and fix new warnings 2022-02-11 12:14:22 -05:00
Tom Limoncelli dcb0e58b99
MAINT: Linting (#1380)
* MAINT: Linting

* Unsort for a smaller diff

* fix hexonet error checking
2022-01-27 15:58:56 -05:00
Tom Limoncelli 360a6266c5 Revert "CLEANUP: Fix many golint/staticcheck issues"
This reverts commit de64f90c51.
2022-01-25 10:35:21 -05:00
Tom Limoncelli de64f90c51 CLEANUP: Fix many golint/staticcheck issues 2022-01-25 10:33:48 -05:00
Hampton 998a25aa08
BUG: Support RFC2317 by allowing slash in CNAME target (#1360)
Co-authored-by: Tom Limoncelli <tlimoncelli@stackoverflow.com>
2022-01-03 10:24:33 -05:00
Tom Limoncelli 7ae27aa0b9 Security: Fix many staticcheck warnings 2021-12-14 09:47:32 -05:00
norman-zon 58a5a4bcf0
Remove length checking from TxtNoMultipleStrings (#1308)
All functions in should test for only one condition. There already is a
function that tests for long TXT records: TxtNoLongStrings.
Add calls to TxtNoLongStrings in all providers that use
TxtNoMultipleStrings, to keep functionality, except for NS1 and ClouDNS,
which allow for any TXT record length, but not for multiple strings per
TXT.
2021-11-23 14:35:01 -05:00
Julius Rickert 6d48725e52
Add test cases for IDN domains (#1302)
Recreated IR json file
2021-11-03 10:45:01 -04:00
F.D.Castel 0d12eb7dc6
CLOUDFLAREAPI: Adds CF_WORKER_ROUTE (#1243)
* CLOUDFLAREAPI: Adds CF_WORKER_ROUTE.

- CLOUDFLAREAPI: Initial support for CF_WORKER_ROUTE.
- Put CF_WORKER_ROUTE behind a per-domain feature-flag.
- Adds Integration Test.
- Create Cloudflare workers for tests.
- Updates documentation.

* Workaround for updateWorkerRoute causing stack overflow.

* Sets AccountID.

* Updates to latest master (Thanks @tresni!).

* Removes $CLOUDFLAREAPI_ACCOUNTNAME.

* Add alltrue() filter and -cfworkers flag

* Final workers changes

* alltrue() should be implemented like other filters.
* Update documentation.

Co-authored-by: Tom Limoncelli <tlimoncelli@stackoverflow.com>
2021-10-11 16:04:49 -04:00
Vincent Hagen 8c5db2e11c
Add R53_ZONE as an domain identifier (#1241)
Using R53_ZONE allows you to differentiate between split horizon
domains across zones.
2021-09-02 16:54:54 -04:00
Tom Limoncelli 3fa5712232
NEW MACROS: DOMAIN_ELSEWHERE and DOMAIN_ELSEWHERE_AUTO (#1237)
* NEW MACROS: DOMAIN_ELSEWHERE and DOMAIN_ELSEWHERE_AUTO
* Finish docs
2021-09-02 15:41:22 -04:00
Patrik Kernstock 9316517291
DMARC_BUILDER: specify version, use values when specified (#1236)
* Allow version, use values when specified

* Updated DMARC_BUILDER docs
2021-08-14 14:43:39 -04:00
Vincent Hagen 6fc3534aa3
Add INCLUDE statement to include records from other domains (#1219) 2021-07-25 12:03:58 -04:00
Vincent Hagen 243762d171
SPF Flatten for non apex domains (#1220) 2021-07-25 11:53:31 -04:00
nemunaire 80f22df705
MAINTENANCE: Return error instead of panic when converting RR to RC (#1199) 2021-07-06 11:03:29 -04:00
Tom Limoncelli 0630c185cf
Release v3.10.1 (#1194)
* Release v3.10.1

* Update dependencies

* RELENG: Update doc to verify version string

* Fix codeql issue
2021-07-01 10:17:43 -04:00
Tom Limoncelli 4b68e14039
Fix codeql errors (#1181) 2021-07-01 09:30:02 -04:00
Tom Limoncelli 654736be29
Improve MSDNS naptr support (#1165)
* MSDNS: Improve reliability of zone dump

* Update tests

* MSDNS: Add initial NAPTR support

* Update

* fix tests

* fix tests

* Fixing integration tests for NAPTR

* Handle bad JSON. Handle NAPTR TTLs
2021-06-24 18:26:21 -04:00
Tom Limoncelli 6d64fc8cac
Fix CodeQL issues (#1173) 2021-06-24 18:15:09 -04:00
Steven Vernick be1f03fb75
NEW PROVIDER: AkamaiEdgeDNS (#1174)
* downcase TLSA

* Akamai provider

* Akamai provider

* EdgeDNS provider

* AkamaiEdgeDNS provider

* AkamaiEdgeDNS provider

* AkamaiEdgeDNS provider

Co-authored-by: Tom Limoncelli <tlimoncelli@stackoverflow.com>
2021-06-22 10:24:49 -04:00
Tom Limoncelli 1cea854e1c
MAINT: Adopt go 1.16's embed feature (#1162)
* MAINT: Switch from esc to embed
* Simplify
* Update minimum go version in docs and pipelines
* go generate
2021-06-04 15:50:47 -04:00
Tom Limoncelli 1ec61c536b
Release v3.9.0 (#1156)
* Release v3.9.0

* go generate
2021-05-13 12:48:05 -04:00
Jan-Philipp Benecke cf8e288339
PowerDNS: fix order problems of delete corrections & some cleanup (#1153)
Signed-off-by: Jan-Philipp Benecke <jan-philipp.benecke@jpbe.de>
2021-05-10 10:18:40 -04:00
Tom Limoncelli 24083d3f76
Add integration test for SOA (#1147)
* Add integration test for SOA

* Add docs for SOA record

* MAINT: Rename SoaInfo to SoaDefaults.

gorename -v -from '"github.com/StackExchange/dnscontrol/v3/providers/bind".SoaInfo' -to SoaDefaults
2021-05-07 14:39:26 -04:00