Commit graph

37 commits

Author SHA1 Message Date
Tom Limoncelli 541bb805da
linting (#777) 2020-07-06 20:18:24 -04:00
Tom Limoncelli 24b7d0641e Update github.com/StackExchange/dnscontrol/v2 2020-04-14 16:49:03 -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
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 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
Tom Limoncelli b360ddd1e9
NAMEDOTCOM: Implement get-zones (#645)
* NAMEDOTCOM: Implement get-zones
2020-02-21 15:03:27 -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
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
Patrick Gaskin 70ce16ff23 Fix handling of SRV records with no target (indicated by ".")
According to the RFC, the way to indicate that a SRV has no target is to set the target to ".".  Some providers do not handle this, or the API returns "" instead of ".".  This situation is now tested in the integration tests and all providers (that support this) have been fixed.



* Cloudflare: Fix decoding empty SRV target (fixes #561)

SRV records with empty (".") targets are now returned as false by
the API, which breaks Unmarshaling it into a string.

* Use custom type for Cloudflare SRV target

Rewrote the SRV target decoding to use a custom type for (un)marshaling, as
Cloudflare returns false for null targets, but it requires a single period
for giving it one. The target code has also been made more flexible to future
API changes with additional normalization.

This has been tested with record creation, deletion, and update and works
as of 2019-11-05.

* DigitalOcean: Fix target FQDN for null targets

Without this, dnscontrol thinks an update is needed (.. != .) even
when the SRV target is correct.

* DNSimple: Fix parsing of null SRV target

DNSimple only returns two fields when the target is null.

* NameDotCom: Add note about not supporting null SRV targets, skip test

* DNSimple: Do not append a . unless we have all three parts

Signed-off-by: Amelia Aronsohn <squirrel@wearing.black>

* Regenerated provider matrix
2019-11-14 11:25:20 -05:00
Tom Limoncelli a5dcad06a3
Fix integration tests (NAMEDOTCOM, CLOUDFLARE) (#498)
NAMEDOTCOM: TXTMulti is broken. Disable.
CLOUDFLARE: Fix SSHFP tests.
2019-05-27 15:10:00 -04:00
Tom Limoncelli 5f77888296
DOCUMENTATION: Document bugid 491 (#492) 2019-05-20 14:37:23 -04:00
Craig Peterson 6d6f685f70
trim trailing dots from discovered nameservers in central place 2019-05-15 12:57:17 -04:00
Tom Limoncelli a7eba97ada
Refactor in preparation to unexport RecordConfig.{Name,NameFQDN,Target} (#337)
* Preparing for the unexport of Name/NameFQDN/Target
* Cleanups
2018-03-19 17:18:58 -04:00
Tom Limoncelli de4455942b
Refactor RecordConfig: Add getters/setters (#314)
* Replace RecordConfig.Name and .NameFQDN with getters and setters.
* Replace RecordConfig.Target with getters and setters.
* Eliminate the CombinedTarget concept.
* Add RecordConfig.PopulateFromString to reduce code in all providers.
* encode and decode name.com txt records (#315)
* Replace fmt.Errorf with errors.Errorf
2018-02-15 12:02:50 -05:00
Tom Limoncelli 4b1dc82c9b
Switch from fmt.Error* to errors.Error* (#317) 2018-02-05 16:17:20 -05:00
Pat Moroney d5adb3faf6 trim trailing '.' from FQDN (#307) 2018-01-24 18:41:10 -05:00
Pat Moroney 91e2cf67ef NAMEDOTCOM: add TXTMulti capability (#299)
* add TXTMulti capability to the namedotcom provider
* run go generate
* escape multi txt records before sending to the API
2018-01-11 07:23:59 -05:00
Pat Moroney 716cc0843a Namecom v4 api (#298)
* new Name.com api version and go client library
* vendor github.com/namedotcom/go/namecom
2018-01-10 16:49:20 -05:00
Tom Limoncelli b7c251190f
Vet and Lint the entire system (#296)
* govet and golint corrections
2018-01-09 12:53:16 -05:00
Tom Limoncelli de88bfe8b7
Add support for TXT records with multiple strings (BIND, ROUTE53) (#293)
* BIND: Support TXT records with multiple strings (#289)
* ROUTE53: Add support for TXT records with multiple strings (#292)
2018-01-04 19:19:35 -05:00
Tom Limoncelli e7472f76f3 Downcase DNS names (#253)
* Downcase DNS names
* Document opinions
2017-11-07 14:12:17 -08:00
Craig Peterson a342aa7e90 add ability to linkify provider matrix 2017-09-14 16:25:39 -04:00
Craig Peterson 3a90435357 Create a dynamic provider features matrix (#201)
* adding simple provider feature matrix generator

* filling out matrix

* clean output

* dead code

* explanatory text

* explanatory text

* typo

* move stuff around

* clean

* editing
2017-09-14 16:13:17 -04:00
Pat Moroney 93764da4e3 Namecom punycode (#170)
* convert records to punycode before processing

* make IDN CNAME target use a real IDN TLD
2017-08-05 08:08:22 -07:00
Tom Limoncelli 2cbabd859b Make it easier to add new Rtypes. (#169)
* NEW: docs/adding-new-rtypes.md
* Mark all "if" and "switch" statements with `#rtype_variations`
* Make consistent use of `default: panic()`
2017-08-04 12:26:29 -07:00
Pat Moroney 8d390aad24 add the new ANAME record type to the records list (#158) 2017-07-20 16:39:40 -04:00
Tom Limoncelli 4bdaf37c78 NAMEDOTCOM CanUseAlias 2017-07-20 10:10:43 -04:00
Tom Limoncelli d55b20ecdb Add SRV Record Type (#136)
* Add support for SRV records for NAMEDOTCOM and ROUTE53.
* Improve docs
* Rename RR() to ToRR().
* Rename RecordConfig Priority to MxPreference (affects json IR data)
2017-07-19 15:53:40 -04:00
Pat Moroney 5b71da6a48 add ALIAS support for Name.com provider (#156) 2017-07-19 13:23:17 -04:00
Tom Limoncelli d346d561a0 NAMEDOTCOM needs parameterization to permit integration testing. 2017-07-13 15:21:16 -04:00
Craig Peterson 20253130cf allowing metadata to force remove all nameservers 2017-05-23 13:38:14 -04:00
Pat Moroney e9f6749c0f Name.com now manages NS records by itself. (#92) 2017-04-19 15:20:26 -06:00
Craig Peterson 0d386c20ec Fix bug in name.com provider
Fixes #28
2017-01-13 12:30:04 -07:00
Craig Peterson 12f006441b Refactoring diff package interface (#22)
* initial refactoring of diffing

* making cloudflare and others compile

* gandi and gcloud. no idea if gandi works anymore.

* r53

* namedotcom wasn't working.
2017-01-11 12:38:07 -07:00
Craig Peterson 1ea80d5347 Nameserver overhaul (#17)
* go changes to support nameservers_from

* clear nameservers before giving to dsp.

* work

* work

* nameserver updates.

* remove unused

* name.com stinks at NS records.

* whitespace

* removing web(belongs in own repo). First sketch of DSP vs NAMESERVER_FROM

* add DEFAULTS to replace defaultDsps.

* initial gcloud provider. Simple records work.

* namedotcom can do subdomain ns records now.

* fix for mx and txt

* kill dsp acronym
2016-12-16 13:10:27 -07:00
Craig Peterson ef0bbf53af migrate code for github 2016-08-22 18:31:50 -06:00