Commit graph

229 commits

Author SHA1 Message Date
Saurabh Gupta 99cef24d8f
SOFTLAYER: Fixed Lets Encrypt Certificate issue #668 (#669) 2020-02-28 11:12:56 -05:00
Joel Margolis a57bf35788
EXOSCALE: Update exoscale/egoscale client to v0.23.0 (#664)
* Update Exoscale provider

* Update vendor folder for exoscale/egoscale v0.23.0

* Fix typos and SRV parsing

* Add . at the end of SRV records for exoscale
2020-02-27 23:06:12 -05:00
Joel Margolis 1232c17293
HEXONET: Update hexonet-sdk to v2.2.3+incompatible (#662)
* Update hexonet-sdk to v2.2.3+incompatible

* Update vendor

* Go mod tidy
2020-02-27 13:04:17 -05:00
Tom Limoncelli 1616c50ba7
GANDI_V5: Upgrade to newest github.com/tiramiseb/go-gandi 2020-02-27 12:06:24 -05:00
Saurabh Gupta 7c9a23b215
SOFTLAYER: Fixed Softlayer TXT Record existence Issue #583 (#659) 2020-02-27 11:14:13 -05:00
Tom Limoncelli 7789b4dbdc
get-zones: Implement --ttl flag for pretty and dsl (#654) 2020-02-25 07:23:40 -05:00
Tom Limoncelli 8b8f193afb
Update privider-list.md (#653)
* AZUREDNS is now an officially supported provider
* Update missing providers (https://github.com/StackExchange/dnscontrol/issues/632)

Fixes https://github.com/StackExchange/dnscontrol/issues/632
2020-02-25 07:23:04 -05:00
Tom Limoncelli 3ce5b22d1a
BIND: Simplify serial number generation (#652)
* The old algorithm was very complex for no good reason.
* The new algorithm is simply: Use yymmdd00 or (previous serial number +1) whichever is bigger.
2020-02-23 14:50:00 -05:00
Tom Limoncelli 772ca4e7dd
Linting (#647)
* linting
* Fix adding-new-rtypes.md to include validation
* BIND: improve docs wrt SOA records, get-zones
2020-02-23 14:47:14 -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
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 b360ddd1e9
NAMEDOTCOM: Implement get-zones (#645)
* NAMEDOTCOM: Implement get-zones
2020-02-21 15:03:27 -05:00
Tom Limoncelli 1ec696e4fa
Implement get-zones (#641) 2020-02-21 13:49:10 -05:00
Tom Limoncelli f5d6f8074d
BIND: Implement get-zones (#642)
* BIND: implement get-zones
* BIND: Implement ZoneLister
2020-02-21 13:48:55 -05:00
Phil Pennock d221471e38
dnsimple: bug-fix SSHFP, add multi TXT support (#639)
* dnsimple: bug-fix SSHFP, add multi TXT support

The default logic for encoding SSHFP records was dropping the key and
hash algorithms and just posting the content, the `Can` check didn't
stop attempts to use SSHFP.  So, implement SSHFP support.

DNSimple support multiple DNS strings in a TXT record, by representing
the payload as quoted strings already.  This doesn't appear to be
documented, but it does actually work.

* Update docs support matrix too

* fix go fmt missing upstream

Tests failing on my branch for something broken upstream

* fix typo in error message
2020-02-21 13:23:30 -05:00
Tom Limoncelli 7c0e02539c
ACTIVEDIRECTORY: Implement get-zones (#643)
* activedir: implement get-zones
2020-02-21 12:54:00 -05:00
Tom Limoncelli 386275fde1
ROUTE53: Fully implement get-zones (#638)
* ROUTE53: Implement ListZones

* DNSIMPLE: Fix comment
2020-02-20 15:07:34 -05:00
Amelia Aronsohn b45c6b6b6c
DNSimple: Implement GetZones and ListZones (#637)
* Update to latest dnsimple-go

* Implement GetZoneRecords

* Better naming

* Return NS records in GetZoneRecords

* Be clearer with the comment.

As an employee I confirm this is exactly how this works. No guessing needed.

* Respect that Puncycode encoding can blow up

* Implement ListZones and the ZoneLister Interface

* Categorize DNSIMPLE

* Update docs with go generate

* vendor modules

* Don't store intermediary Zone data
2020-02-20 14:52:19 -05:00
Juho Teperi ca99517ced
Do get zones (#635)
* Implement GetZoneRecords for Digitalocean provider
* Clean fixme comment from digitalocean provider
2020-02-19 13:11:49 -05:00
Vatsalya Goel f12d4bb8d6
Implement Get Zone for Azure DNS (#631)
* Implement Get Zone for Azure DNS

* Internalize getExistingRecord
2020-02-18 11:35:13 -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
Vatsalya Goel cd680cc738
Upgraded Azure SDK to 39.1.0 (#627)
* Upgrade Azure DNS API
* vendor modules
* Fixed AZURE_DNS Empty TXT Record
* Fix preview
2020-02-18 08:45:31 -05:00
Vatsalya Goel d2625cf17a
Using Alias Records breaks DNSControl (#616) 2020-02-07 14:25:08 -05:00
Vatsalya Goel 450accf0a5
AZURE: Bug: Wrong domain updated in query (#615) 2020-02-05 18:19:24 -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
George Pittarelli cae35a2c8f NAMECHEAP: Add CAA support (#533) 2020-01-28 10:54:58 -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 2d88d81392 NEW PROVIDER: Internet.bs (#590)
* Ineternet.bs: first version of provider
* Ineternet.bs: code and documentation cleanup
2020-01-27 08:25:20 -05:00
Juho Teperi bfa36ebbf8 DIGITALOCEAN: CAA is supported with some caveats (#592)
Change the tests to skip test case with CAA `;` value for Digitalocean,
because that specific feature isn't supported.

Closes #588
2020-01-24 12:21:01 -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
Anton Yurchenko 253cd07154 NEW PROVIDER: ClouDNS (#578)
* ClouDNS: first version of provider
* ClouDNS: documentation
* ClouDNS: code cleanup
* ClouDNS: GetNameservers now uses ClouDNS API to fetch NS servers list
* ClouDNS: CAA support
* ClouDNS: TLSA support
* ClouDNS: tests credentials now use variables instead of hardcoded values
* ClouDNS: SSHFP support
* ClouDNS: export only necessary methods
2020-01-20 14:07:38 -05:00
Tom Limoncelli 2c0361b0d5
BUG: Correctly spell Cabability (#582) 2020-01-12 11:24:10 -05:00
mm 7df73b187c ROUTE53: Messages don't display correctly in big batch mode (#580)
* fixed description for paginated r53 updates

Signed-off-by: marco.messerschmidt <marco.messerschmidt@zalando.de>

* fixed description for paginated r53 updates

Signed-off-by: marco.messerschmidt <marco.messerschmidt@zalando.de>

* Update route53Provider.go

reset batch site
2020-01-10 08:47:20 -05:00
Vatsalya Goel df3adef5ec Do some cleanup for AzureDNS code (#551) 2019-12-09 13:51:23 -05:00
Hugo Barros 0f396cd135 ROUTE53: Add AWS_PROFILE functionality (#567)
* Add AWS_PROFILE functionality for Route53 provider

* Document named profiles authentication option for Route53
2019-12-04 10:17:28 -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
Mark Henderson d48009a621 DOCUMENTATION: Azure DNS dual host support is limited (#560) 2019-10-31 09:44:42 -04:00
Benoît Knecht 4e6d05b716 CLOUDFLARE: Support API tokens (#555)
Cloudflare API tokens are a new way to authenticate to Cloudflare API.
Unlike the Global API key, tokens can be given specific permissions to
only access parts of the API. See [1] for details.

[1] https://blog.cloudflare.com/api-tokens-general-availability/

This commit introduces a new credential for cloudflare called
`apitoken`, which is mutually exclusive with `apiuser` and `apikey`.

In order for DNSControl to work with this token, it should have the
right to read DNS zones and edit DNS records.

Closes #534
2019-10-23 11:48:00 -04:00
Craig Peterson 96583a9188 make test more chaotic (still passes) 2019-10-09 09:54:40 -04:00
Craig Peterson 2f41bf007f pull out records with identical content first. Saves from ordering issues. 2019-10-09 09:54:40 -04:00
Craig Peterson 33ecf81431 failing test for #552 2019-10-09 09:54:40 -04:00
Vatsalya Goel 813a186865 Add Azure DNS (#547)
* Add Azure DNS

* Remove unused code

* Fix failing tests and update build
2019-09-18 21:45:13 -04:00
rdalverny 79c548b168 GANDI-LIVEDNS: Support for multi TXT records verified (#545)
It seems it does support them.
2019-08-26 14:07:02 -04:00
rdalverny b968de3ef7 GANDI-LIVE: Print actual changes to be pushed (#546)
* gandi/livedns: Print actual changes to be pushed

Currently, preview & push output prints all domain records values:

    $ dnscontrol preview
    ----- DNS Provider: gandi...1 correction
    #1: Setting dns records for example.com:
    mail.example.com.
    1.2.3.4
    "ga"
    "bu"
    "zo"

With this change, it would only show what changes from current state:

    $ dnscontrol preview
    ----- DNS Provider: gandi...1 correction
    #1: Setting dns records for example.com:
    CREATE TXT ga.example.com "ga" ttl=10800
    MODIFY TXT bu.example.com "bu" ttl=10800
    DELETE TXT meu.example.com "meu" ttl=10800

* Add import
2019-08-26 13:38:07 -04:00
Patrick Gaskin cafd4d387a vultr: Added support for SSHFP records (#531) 2019-07-15 12:28:37 -04:00
Patrick Gaskin 44a7ba5711 Switch to official Vultr API library (#529)
* vultr: Switched to official API library (closes #528)

* vultr: Renamed vultr.VultrApi to vultr.Provider

* vendor: Updated govultr
2019-07-15 10:31:55 -04:00
Craig Peterson 08deda6746
Integration tests running in azure pipelines (#516) 2019-07-02 12:32:54 -04:00
Craig Peterson 5b5ae861ae fix format again 2019-06-27 01:29:13 -04:00