Commit graph

245 commits

Author SHA1 Message Date
fuero 4586ad1281
Direct SOA record management (#1115)
* Adds SOA record to JS, zone parsing and record validation

* adds JS parsing test for SOA record

* fix validation & regenerates static resources

* Adds label and target test for SOA record

* Removes serial from SOA JS macro

* Adds generated resources

* reformat with gofmt

Co-authored-by: Tom Limoncelli <tlimoncelli@stackoverflow.com>
2021-05-04 15:47:26 -04:00
Tom Limoncelli 4ab4d4c9ed
IGNORE_NAME: Should work at domain apex (#1118)
* IGNORE_NAME: Add test at apex
* Fix IGNORE_NAME at apex
* Add comments and documentation
* Add a flag to disable IGNORE_NAME safety checks
2021-04-13 08:59:47 -04:00
Julius Rickert 836ae8854d
NEW MACRO: DMARC_BUILDER (#1047) 2021-03-08 08:50:14 -05:00
Tom Limoncelli 9f0ac5dfba
DKIM is a no-op now (#1084) 2021-03-07 15:01:03 -05:00
Tom Limoncelli 50a24605e6
Fix TXT docs, remove AUTOSPLIT (#1083) 2021-03-07 14:34:00 -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
Tom Limoncelli 21e85e6528
"Target" RecordConfig should not be exported (#1061)
* Unexport RecordConfig.Target
* Fix tests
* HEDNS: Fix usage of target field to resolve TXT handling (#1067)

Co-authored-by: Robert Blenkinsopp <robert@blenkinsopp.net>
2021-03-04 18:58:23 -05:00
Tom Limoncelli 95c48ca220 Fix broken test 2021-03-01 20:48:29 -05:00
Tom Limoncelli 975055fb20
BUG: D_EXTEND should not apply DEFAULTS{} (#1055)
* BUG: D_EXTEND should not apply DEFAULTS{}

Fixes https://github.com/StackExchange/dnscontrol/issues/1042

* go generate
2021-03-01 10:53:29 -05:00
Jan-Philipp Benecke 06a1cc3d38
POWERDNS: Some minor fixes for ALIAS and TXTMulti and integration testing (#1065)
* POWERDNS: Some minor fixes for ALIAS and integration testing
* POWERDNS: Readd missing error handling
2021-03-01 07:09:49 -05:00
Tom Limoncelli a2042c2eda
NS1: Support NS1_URLFWD (#1046) 2021-02-10 11:57:15 -05:00
Tom Limoncelli c547beacc0
NEW FEATURE: Support Split Horizon DNS (#1034)
* Implement main feature
* BIND: Permit printf-like file name formats
* BIND: Make filenameformat work forwards and backwards.
* Fix extrator test cases
2021-02-05 12:12:45 -05:00
Tom Limoncelli 36289f7157
BUG: Labels that are FQDN can cause panics (#1040) 2021-02-05 11:58:17 -05:00
Tom Limoncelli eaa382e58d js_test.go should leave behind actuals 2021-02-01 07:33:41 -05:00
Armand Grillet 0d9cc35deb
Add SPF support for RecordConfig (#1020)
This type is identical to TXT but used for other purposes, it is
officially supported by OctoDNS.

Co-authored-by: Tom Limoncelli <tlimoncelli@stackoverflow.com>
2021-01-24 15:36:48 -05:00
Yuhui Xu 6efedd689d
New feature: FETCH() permits http gets in dnsconfig.js (#1007)
add PANIC() and error-handled FETCH()
2021-01-06 10:45:32 -05:00
Tom Limoncelli 18d99fd30f
Add .gitattributes file and fix line endings to match. (#1004)
* NEW: .gitattributes
* Fix line endings
* Fix File Endings
2020-12-25 10:18:01 -05:00
Tom Limoncelli 063d550816
js_test.go should generate & test zonefile output too (#986)
* js_test.go: Do a zonefile test if $TESTNAME/parse_tests/{zonefile} exists.
* Add parse_tests zone files for all the tests that make sense.
* js_test.go: Addd the test datafile when displaying failures.
* 007-importTransformTTL.js: Was referring to a non-existent domain.
* 012-duration.js: Had duplicate DNS records.
* 029-dextendsub.js: Move CF-related tests to separate test.
* validate.go: Report non-existent domains as an error.
* cloudflareProvider.go: newCloudflare should not talk to the API.
2020-12-03 09:33:39 -05:00
Tom Limoncelli 6443a31ca8
Fix REV and PTR (#979)
* Fix REV and PTR
2020-12-03 08:33:37 -05:00
Tom Limoncelli 2e7311078c
MAINT: Fix parse_test numbering (#985) 2020-12-01 11:22:12 -05:00
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 13a1360779
TXT records should check length at check/preview time (#947)
* TXT records should check length
* Add validation to TXT generator
* Split and validate long TXT targets
* Add a metaparameter to TXT records to indicate autosplit is requested.
* SPF_BUILDER marks TXT records as needing to be autosplit.
* Validate should check for overly-long TXT targets
2020-11-18 07:05:26 -05:00
Tom Limoncelli 80c81b990a TESTING: Fix broken test 2020-10-30 12:04:41 -04:00
Jan-Philipp Benecke 512aa7d4b3
NEW FEATURE: Set JS variables from command line (#913)
* Add ability to specify variables that are passed to js

* Use SplitN to respect a = in value part

* Add JSON parsing for cli variables

* Remove JSON parsing for cli variables

* Add a function to set CLI defaults

* Update static.go
2020-10-27 10:43:00 -04:00
Patrik Kernstock 29c7ff3a05
Fix #910 (#912)
@patschi Thanks you for the speedy fix!  (and thank you for knowing Javascript!)
2020-10-25 13:29:25 -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 c899706309 Fix version 2020-10-12 12:55:10 -04:00
Tom Limoncelli a07a8cc731 Release v3.4.0 2020-10-12 12:13:07 -04:00
Tom Limoncelli 7acf8427f1 go generate 2020-10-12 11:54:18 -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
Tom Limoncelli 8205a8a356 Fix JSON comma 2020-10-07 16:04:13 -04:00
Tom Limoncelli dba20387bf
Fix D_EXTEND matching bug (#888)
* Use a standard JSON comparison tool

* Fixes https://github.com/StackExchange/dnscontrol/issues/886

* Delete file in wrong place.

* Remove the need for minify
2020-10-07 16:03:36 -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 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
Patrik Kernstock d56ffd3698 Display file where error occurred 2020-09-21 09:39:45 -04:00
Tom Limoncelli 74ea58f514 Better error messages 2020-09-21 09:39:45 -04:00
Tom Limoncelli 408e7eb0ce
NAMESERVER() validity check fixed (#866) 2020-09-20 10:41:42 -04:00
Tom Limoncelli 4432d38252
go get -u github.com/miekg/dns v1.1.31 (#846) 2020-09-04 16:26:56 -04:00
Mike Cochrane 66ec6dfa0f
MSTeams Notifier: Fix init bug in teamsNotifier (#845) 2020-09-04 11:50:58 -04:00
Mike Cochrane ff6aee9da4
Remove debug line left from development (#835) (#839) 2020-08-31 07:17:38 -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 Misilo cb9a82717b
Allow for Name's that start with _ (#830)
* Allow for Name's that start with _

* update tests

Co-authored-by: Tom Limoncelli <tlimoncelli@stackoverflow.com>
2020-08-30 20:35:07 -04:00
Tom Limoncelli de308c0952
Lint: Fix ST1005: error strings should not be capitalized (#834) 2020-08-30 19:52:37 -04:00
Tom Limoncelli d6dd13820f
gofmt (#826) 2020-08-26 13:45:02 -04:00
Mike Cochrane 59747a96f0
Cleanup: Bubble errors up from diff instead of panic (#799) (#817) 2020-08-20 15:49:00 -04:00
Patrik Kernstock 576c2bd582
New feature: require_glob() (similar to require() but supports globs) (#804)
* Initial implementation of findFiles/globe/glob

* Fixed path, some small improvements

* filepath.Dir() calls Clean() automatically anyway

* Relative path support (like require()), renamed func

* Check file ext prefix, further comments, var renaming

* Updated static.go after merge

* Added doc for glob()

* Tiny adjustment of description of glob()

* Updated docs for possible pattern

* Reworked glob, added public-facing require_glob()

* Updated docs with examples

* Updated static.go

* go generate
2020-08-19 14:00:40 -04:00
Mike Cochrane 960dc66bd2
New feature: IGNORE_TARGET. Rename INGORE to IGNORE_NAME (#806) 2020-08-18 11:14:34 -04:00
Mike Cochrane 889ed75668
Notifications: Add support for Microsoft Teams (#812) 2020-08-14 12:23:54 -04:00
Patrik Kernstock d2d210a5af
New features: DU() and getConfiguredDomains() to assist modifying domains (#800)
* Added DU() and getConfiguredDomains()

* Added docs for both new functions

* Added a space between option and its value

* Renamed "DU" to "D_EXTEND", adjusted docs

* Fixed: Changed old DU() calls to D_EXTEND()
2020-08-04 09:43:02 -04:00
Michael Russell f21c8fc400
SPF Optimizer: Enable the use of TXTMulti records to support longer SPF records (#794)
* Add multiple string support to SPF optimizer

Notes:

* This implements [RFC 4408][rfc] for the SPF optimizer. Allowing for
more SPF records to fit within the 10 lookups by using multiple strings.
* By default the max size of the TXT remains at 255. Meaning users will
still only get a single 255 length string unless they modify `txtMaxSize`
and opt into this feature.
* The general recommendation when using multiple strings for TXT records
is to keep the size within a single UDP packet. It seems like the
maximum size for this depends on a bunch of factors that are sometimes
outside of your control. A similar tool has a [formula for estimating the
maximum allowed size][formula]. However I felt giving a user
configurable size would fit with the current configuration style that
dnscontrol has. Similar to how dnscontrol recommends only flattening a
record if absolutely needed, I can see this length being increased by
only enough to get you within 10 lookups.

[rfc]: https://tools.ietf.org/html/rfc4408#section-3.1.3
[formula]: https://github.com/oasys/mkspf/blob/master/Overhead.md

* Add a nice comment for the Chunks function
2020-07-31 13:28:13 -04:00
Michael Russell 237c573c2a
Make it possible to disable the raw SPF optimizer debug record (#795)
Open to other configuration opens for how best to make this optional. Or
potentially making this an opt in configuration item which would be a
breaking change.

The main reason that someone would want to disable this is if their raw
SPF record goes over the 255 characters. This is potentially another
place that could get some multi string support. But as it is only used
for debugging purposes it seems like there should be a way to outright
disable it too.
2020-07-31 10:40:22 -04:00
Tom Limoncelli 530bf10bfa
NEW: spf flattener can make first record extra short (#781)
* NEW: spf flattener can make first record extra short

* fixup!
2020-07-09 12:52:49 -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
Matthew Huxtable ff8ce26cee
Provider support for DS records as children only (#765)
This functionality is required by the GCLOUD provider, which supports
recordsets of type DS but only for child records of the zone, to enable
further delegation. It does not support them at the apex of the zone (@)
because Google Cloud DNS is not itself a registrar which needs to model
this information.

A related change (14ff68b151, #760) was
previously introduced to enable DS support in Google, which broke
integration tests with this provider.

To cleanly support this, we introduce a new provider capability
CanUseDSForChildren and appropriate integration tests. Further, it is no
longer possible to verify a provider has the proper capabilities for a
zone simply by existence of particular records; we adapt the capability
checks to enable inspection of the individual recordsets where this is
required.

Closes #762
2020-06-18 17:24:13 -04:00
Tom Limoncelli 676d98fc4a
Linting (#767)
What could possibly go wrong?
2020-06-18 09:37:57 -04:00
Tom Limoncelli 97d91cda4c
Implement a simple lexagraphic sort. (#755) 2020-05-30 12:03:33 -04:00
Nicolai Ehemann 4713bbad7d Rebase and regenerate 2020-05-30 11:06:13 -04:00
Tom Limoncelli e57eaccac9 Merge 2020-05-30 11:06:13 -04:00
Tom Limoncelli c0354a585d DS: More cleanups 2020-05-30 11:06:12 -04:00
Tom Limoncelli a89ab89ab6
Fix the merge mess I made with the DS merge (#754)
* DS: More cleanups

* Added DS for cloudflare provider with tests

* Merge

* Added generated files

* Regenerated documentation matrix

* rebased and regenerated

* Updated integration tests

* Rebase and regenerate

* More cleanups

Co-authored-by: Robert Koch <robert@kochie.io>
Co-authored-by: Nicolai Ehemann <nicolai.ehemann@enerko-informatik.de>
2020-05-30 11:05:54 -04:00
Tom Limoncelli 87a5c4b339
New RTYPE: DS records now supported! (#753)
Thanks to @haraldkoch for starting this, @McNetic for picking it up.

* Added DS record type

* Added DS for cloudflare provider with tests

* Removed DS validation, fixed parse test

* Added generated files

* Added dnsimple ds record

* Regenerated documentation matrix

* rebased and regenerated

* Updated integration tests

* Rebase and regenerate

* Enable DS record type for provider desec

* Added DS record type

* Added DS for cloudflare provider with tests

* Removed DS validation, fixed parse test

* Added generated files

* Added dnsimple ds record

* Regenerated documentation matrix

* rebased and regenerated

* Updated integration tests

* Rebase and regenerate

* Enable DS record type for provider desec

* Rebase and fixes

Co-authored-by: Robert Koch <robert@kochie.io>
Co-authored-by: Nicolai Ehemann <nicolai.ehemann@enerko-informatik.de>
2020-05-30 10:40:21 -04:00
ddrght12345 5269540827
Add _domainconnect to the underscore whitelist (#751) 2020-05-29 21:41:40 -04:00
Tom Limoncelli 6263e856c9
get-certs now generates a .pem file in addition to .key and .crt (#750) 2020-05-29 16:56:46 -04:00
Jan-Philipp Benecke d3a90f0a2d
Added slack notifications (#749)
* Added slack notification

* Added slack notification to doc.

* Send notifications as single message & updated doc. example

* Remove not needed variable
2020-05-29 09:26:48 -04:00
Tom Limoncelli 87607da685
'get-certs' permissions too open (#745)
Fixes https://github.com/StackExchange/dnscontrol/issues/728
2020-05-22 10:26:22 -04:00
Tom Limoncelli 24b7d0641e Update github.com/StackExchange/dnscontrol/v2 2020-04-14 16:49:03 -04:00
Tom Limoncelli 1b5935d1af
Release 3.0.0 Candidate (#699)
Final changes before V3.0.0 release

* Remove old Gandi.  Fixes #575
* Many cleanups
* go mod tidy && go mod vendor

* integration_test.go: Output subtest name

* Cleanups

* integration_test.go: Description should include sub-test name
* Add a whitespace test to js/parse_tests/017-txt.js

* Cloudflare strips whitespace from end of TXT

* Fixes https://github.com/StackExchange/dnscontrol/issues/700

* Whitespace at end of TXT records

Name.com strips the whitespace from the end of a TXT record. There's
nothing we can do other than file a bug.

* Fixes https://github.com/StackExchange/dnscontrol/issues/701
2020-03-22 13:38:37 -04:00
Tom Limoncelli 14e48b9b07
linting (#693)
Co-authored-by: Tom Limoncelli <tlimoncelli@stackoverflow.com>
2020-03-10 16:53:17 -04:00
Tom Limoncelli 24484f1e0c
move providers/diff to pkg/diff like we should have 2 years ago (#692)
Co-authored-by: Tom Limoncelli <tlimoncelli@stackoverflow.com>
2020-03-10 16:35:43 -04:00
Vatsalya Goel 884118f6dd
AZURE_DNS: Add support for Alias: AZURE_ALIAS() (#675)
* Add support for Alias in Azure

* Actioned comments and added parse tests

* GetTargetDebug

* Go formatting
2020-03-02 11:25:42 -05:00
Tom Limoncelli 3f68215841
GetNameservers is inconsistent across providers (#655)
* Warn if GetNameservers returns FQDN+dot strings
* Simplify logic that covers for the inconsistency
* Fix azuredns, gcloud, bind, route53
* Clean up cloudflare, digitalocean, dnsimple, gandi_v5, namedotcom
2020-03-01 10:33:24 -05:00
Tom Limoncelli b7b0b20798
Fix broken tests (#672) 2020-02-29 09:01:51 -05:00
Tom Limoncelli 4adef209c7
AZUREDNS: Do not warn about underscore for acm-validations.aws (#661)
* Check for acm-validations.aws.
2020-02-27 23:10:35 -05:00
Tom Limoncelli 798cdffd81
CLOUDFLARE: get-zones --ttl flag should handle CF's magic TTLs better (#657)
Fixes https://github.com/StackExchange/dnscontrol/issues/630
2020-02-27 11:11:59 -05:00
Tom Limoncelli 7789b4dbdc
get-zones: Implement --ttl flag for pretty and dsl (#654) 2020-02-25 07:23:40 -05:00
Phil Pennock 4fed6534c7
Tests: ensure provider capabilities are checked (#650)
* Tests: ensure provider capabilities are checked

Adds test: `TestCapabilitiesAreFiltered`

We have a number of records and pseudo-records which in theory can only
be used with a given provider if that provider indicates support.  In
practice, we've been missing the checks for that support and have been
passing the records down anyway.  The advice comment in the
providers/capabilities.go file to edit `checkProviderCapabilities()` has
not been reliably followed.

We need an internal self-consistency test.  The constants are not
directly exported or enumerable based solely on the package interfaces
at run-time, but with source access for a test suite, we can use the
`go/ast` and related interfaces to examine the code, extract all the
constants from a given package, figure out which ones we want to be
handled, and then insist that they're handled.

Before my recent work, we only checked:

    ALIAS PTR SRV CAA TLSA

After this commit, we check:

    ALIAS AUTODNSSEC CAA NAPTR PTR R53_ALIAS SSHFP SRV TLSA

I've added `AUTODNSSEC` as a new feature; `SSHFP` and `PTR` were caught
in other recent commits from me; implementing this test caused me to
have to add `NAPTR` and `R53_ALIAS`.  I whitelist `CanUseTXTMulti` as a
special-case.

This should prevent regressions.  We will probably want to post publicly
to warn people that if they're using SSHFP/PTR/NAPTR/R53_ALIAS then they
should check the feature matrix and if they don't see their provider
listed, to report is as "hey that actually works" so we can update the
provider flags.  Bonus: our feature matrix will suddenly be more
accurate.

* Add comments/docs for capabilities authors

* fixup!

* fixup!
2020-02-25 07:22:32 -05:00
Tom Limoncelli 9812ecd9ff
BIND: Improve SOA serial number handling (#651)
* github.com/miekg/dns
* Greatly simplify the logic for handling serial numbers. Related code was all over the place. Now it is abstracted into one testable method makeSoa. This simplifies code in many other places.
* Update docs/_providers/bind.md: Edit old text. Add SOA description.
* SOA records are now treated like any other record internally. You still can't specify them in dnsconfig.js, but that's by design.
* The URL for issue 491 was wrong in many places
* BIND: Clarify GENERATE_ZONEFILE message
2020-02-23 13:58:49 -05:00
Phil Pennock 3c41a39252
BIND: Implement AutoDNSSEC (#648)
There's a philosophy issue here around what is the Bind output meant to
do.  Since AFAIK we're not integrating into Bind's catalog zones or the
like, we're just targeting the zonefiles, we're not in a position to do
_anything_ relating to registrar options such as setting up DS glue.

So at one level, enabling AutoDNSSEC for Bind is a lie. But without
this, folks can't target a Bind zone as a secondary provider for their
domain, to get debug dumps of the zone output, because the checks for
"Can" block it.  So I think this commit achieves a happy compromise: we
write a comment into the Bind zonefile, indicating that DNSSEC was
requested.

Actually: we add support for arbitrary zone comments to be written into
a zonefile via a slightly ugly "can be `nil`" parameter.  We then write
in a generation timestamp comment, and if AutoDNSSEC was requested we
then write that in too.
2020-02-22 13:27:24 -05:00
Tom Limoncelli 7384743f6d
pretty helpers.js (#649) 2020-02-22 12:07:10 -05:00
Phil Pennock 9b239f41a3
Add AUTODNSSEC, implement for DNSimple (#640)
* Add AUTODNSSEC, implement for DNSimple

There are two models for DNSSEC in DNS management: either dnscontrol
manages all the DNSSEC records and has to be invoked regularly for
re-signing, or the provider manages DNSSEC automatically and dnscontrol
is not involved beyond saying "yeah, do that".

This implements the latter, as a model, and for one provider.

Potentially we could tune/configure options for DNSSEC such as
algorithm, but DNSimple don't expose that API so I haven't implemented
it.

This minimal model should be something which maps into other providers
cleanly.

* Fix missing CanAutoDNSSEC on provider

* Validation fix for master broken

This is broken in master and causing Travis in my branch to fail.  The
validation tool runs with `gofmt -s` to require "simplify", and so
rejects an ignored second bound variable to range iteration.

* Correct wire in the AUTODNSSEC validation step
2020-02-22 07:09:31 -05:00
Tom Limoncelli 87ad01d194
Add "get-zone" command (#613)
* Add GetZoneRecords to DNSProvider interface
* dnscontrol now uses ufave/cli/v2
* NEW: get-zones.md
* HasRecordTypeName should be a method on models.Records not models.DomainConfig
* Implement BIND's GetZoneRecords
* new WriteZoneFile implemented
* go mod vendor
* Update docs to use get-zone instead of convertzone
* Add CanGetZone capability and update all providers.
* Get all zones for a provider at once (#626)
* implement GetZoneRecords for cloudflare
* munge cloudflare ttls
* Implement GetZoneRecords for cloudflare (#625)

Co-authored-by: Craig Peterson <192540+captncraig@users.noreply.github.com>
2020-02-18 08:59:18 -05:00
Tom Hughes 6c4192bf82
Add _mta-sts to labels allowed to have an underscore (#617)
Although _mta-sts is normally used with a TXT record it can
also be used with a CNAME record to delegate the authority.

See sections 3.1 and 8.2 of RFC8461 for details.
2020-02-07 14:20:24 -05:00
Tom Limoncelli 36a05608e0
DOCS: Explain nameservers vs ns (#608) 2020-01-29 13:47:32 -05:00
Tom Limoncelli 92b51dbc65
Update github.com/mjibson/esc (#515)
* Update github.com/mjibson/esc

* Update github.com/mjibson/esc
* Fix generate.go to new signature for esc.Run

* Internal: Upgrade to lastest "esc"
2020-01-29 13:43:25 -05:00
Patrick Gaskin 6e8d5b59ab Fixed issues from go vet (#605)
* CloudFlare provider is missing quotes on a JSON struct tag.
* ACME package has a unnecessary JSON struct tag.
* Route53 provider has an unreachable return.
2020-01-28 12:10:58 -05:00
Patrick Gaskin 825ba2d081 Switch to Go 1.13 error wrapping (#604)
* Replaced errors.Wrap with fmt.Errorf (#589)

* Find:    errors\.Wrap\(([^,]+),\s+(["`][^"`]*)(["`])\)
  Replace: fmt.Errorf($2: %w$3, $1)

* Replaced errors.Wrapf with fmt.Errorf (#589)

* Find:    errors\.Wrapf\(([^,]+),\s+(["`][^"`]*)(["`])\)
  Replace: fmt.Errorf($2: %w$3, $1)
* Find:    errors\.Wrapf\(([^,]+),\s+(["`][^"`]*)(["`])(,[^)]+)\)
* Replace: fmt.Errorf($2: %w$3$4, $1)

* Replaced errors.Errorf with fmt.Errorf (#589)

* Find:    errors\.Errorf
  Replace: fmt.Errorf

* Cleaned up remaining imports

* Cleanup

* Regenerate provider support matrix

This was broken by #533 ... and it's now the third time this has been missed.
2020-01-28 11:06:56 -05:00
Patrick Gaskin 2f83aa9302 Internals: Switch to v2 go.mod, drop GOPATH, and fix Azure Pipelines (#595)
* Switched to v2 go.mod

Also set GO111MODULE=on in build stuff to always use Go modules
even when in GOPATH.

* Ensure go.mod, go.sum, and vendor are up to date

* Attempt to fix Azure pipelines

* Add set -e to properly fail on exit (it didn't seem to be
  propagating properly before).
* Set workingDirectory for GoFmt and GoGen (this might be why it
  fails unlike compile and unitests).

* Another attempt to fix Azure Pipelines

* Use the Go env template for all go-related jobs.

* Completely fixed Azure Pipelines

* Added a display name to GoFmt for consistency.
* Fixed diffs for GoFmt and GoGen.
* Show git status for checks.

* Drop GOPATH for tests

TODO: Do the same for integration tests.

* Drop GOPATH for integration tests

* Show more diffs

* Regenerate provider support matrix

This wasn't done in #590...
2020-01-28 10:42:31 -05:00
Anton Yurchenko 262acdd3d8 get-certs: DNS01 challenge skipping preCheckDNS (#591) 2020-01-23 17:54:07 -05:00
Tom Limoncelli f6ce421fdd
NEW PROVIDER: GANDI_V5 (deprecates GANDI) (#572)
* GANDI_v5: Add Registrar support
* Add GANDI deprecation warning
* vendor github.com/tiramiseb/go-gandi
2020-01-20 14:13:32 -05:00
Tom Limoncelli 2c0361b0d5
BUG: Correctly spell Cabability (#582) 2020-01-12 11:24:10 -05:00
Craig Peterson 2ee086d41c
switch to new go-acme imports from xenolf. Fix api changes (#540)
* switch to new go-acme imports from xenolf. Fix api changes

* update many vault related dependencies
2019-07-29 10:54:32 -04:00
Tom Limoncelli be10c5f7c2
Bugfix: redirect: should be redirect= (#507) 2019-06-21 07:48:59 -04:00
Tom Limoncelli 2d9d93653b
SPF Optimizer: Add "redirect:" support (#506)
FYI: The support is very minimal. It only supports redirect if it is the last item in an SPF record. At that point, it is equivalent to include.

* In SFP, treat redirect like a special include.
* Document SPF redirect: limited implementation.
2019-06-19 18:46:56 +01:00
Patrik Kernstock 539820f87a CF: Add ability to manage UniversalSSL (#496)
* Added Cloudflare UniveralSSL control
* Added CF_UNIVERSALSSL_ON/OFF macros
* Updated docs
* Small docs update
* go generate
2019-06-13 07:32:54 -04:00
Tom Limoncelli 8b86eec6bf go generate 2019-05-30 19:52:35 -04:00
Craig Peterson be5b588035
add must_staple option to cert. Default false (#502) 2019-05-29 14:03:36 -04:00
Koen Vlaswinkel 5538de6682 IGNORE() now supports glob pattern/wildcards (#463) 2019-05-27 10:14:29 -04:00
Nikolay Kolev b3e35b56a2 DOC: Apply brand-preferred case (#429)
* Apply brand-preferred case

* Apply case to own branding as well
2019-05-23 09:29:21 -04:00
Oscar Moreno Garza 608dd7af56 NEW: require() now supports loading JSON too (#474) 2019-05-23 09:26:40 -04:00