add API for Gandi LiveDNS #680

Merged
merged 5 commits into from Feb 28, 2017

Conversation

Projects
None yet
3 participants
@fcrozat
Contributor

fcrozat commented Feb 27, 2017

This adds support for new API (still in beta) available from Gandi

+GANDI_LIVEDNS_API="https://dns.beta.gandi.net/api/v5"
+
+#Usage: dns_gandi_livedns_add _acme-challenge.www.domain.com "XKrxpRBosdIKFzxW_CT3KLZNf6q0HG9i01zxXp5CPBs"
+dns_gandi_livedns_add() {

This comment has been minimized.

@Neilpang

Neilpang Feb 27, 2017

Owner

why not name it dns_gandi instead of dns_gandi_livedns ?

Do you mean gandi has other dns system ?

@Neilpang

Neilpang Feb 27, 2017

Owner

why not name it dns_gandi instead of dns_gandi_livedns ?

Do you mean gandi has other dns system ?

This comment has been minimized.

@fcrozat

fcrozat Feb 27, 2017

Contributor

Gandi DNS is redoing their DNS infrastructure. Their old infrastructure (and API) was making DNS-01 validation very hard to implement (minimum of 20mins for DNS zone push, and sometime, it was even longer). Their new infrastructure (called LiveDNS) is only available as beta, uses a REST api and supports "instant" push of DNS changes. That is why I named it gandi_livedns.. I think they will phase out their "old" API in the near future but I don't know when.

But I can rename it to gandi instead, of course.

@fcrozat

fcrozat Feb 27, 2017

Contributor

Gandi DNS is redoing their DNS infrastructure. Their old infrastructure (and API) was making DNS-01 validation very hard to implement (minimum of 20mins for DNS zone push, and sometime, it was even longer). Their new infrastructure (called LiveDNS) is only available as beta, uses a REST api and supports "instant" push of DNS changes. That is why I named it gandi_livedns.. I think they will phase out their "old" API in the near future but I don't know when.

But I can rename it to gandi instead, of course.

This comment has been minimized.

@Neilpang

Neilpang Feb 27, 2017

Owner

ok, keep it there.

@Neilpang

Neilpang Feb 27, 2017

Owner

ok, keep it there.

dnsapi/dns_gandi_livedns.sh
+ _err "Create your key and export it as GANDI_LIVEDNS_KEY"
+ return 1
+ fi
+

This comment has been minimized.

@Neilpang

Neilpang Feb 27, 2017

Owner

please save the gandi api key, the future auto renewal will use the key again.

_saveaccountconf GANDI_LIVEDNS_KEY   "$GANDI_LIVEDNS_KEY"
@Neilpang

Neilpang Feb 27, 2017

Owner

please save the gandi api key, the future auto renewal will use the key again.

_saveaccountconf GANDI_LIVEDNS_KEY   "$GANDI_LIVEDNS_KEY"
+# Requires GANDI API KEY set in GANDI_LIVEDNS_KEY set as environment variable
+#
+#Author: Frédéric Crozat <fcrozat@suse.com>
+#Report Bugs here: https://github.com/fcrozat/acme.sh

This comment has been minimized.

@Neilpang

Neilpang Feb 27, 2017

Owner

add your repository here to report bugs.

@Neilpang

Neilpang Feb 27, 2017

Owner

add your repository here to report bugs.

This comment has been minimized.

@fcrozat

fcrozat Feb 27, 2017

Contributor

hmm, it is my repository (fcrozat/acme.sh)

@fcrozat

fcrozat Feb 27, 2017

Contributor

hmm, it is my repository (fcrozat/acme.sh)

This comment has been minimized.

@Neilpang

Neilpang Feb 27, 2017

Owner

Sorry, my eyes broken. :)

@Neilpang

Neilpang Feb 27, 2017

Owner

Sorry, my eyes broken. :)

dnsapi/dns_gandi_livedns.sh
+ _debug domain "$_domain"
+ _debug sub_domain "$_sub_domain"
+
+ _gandi_livedns_rest POST "domains/$_domain/records/$_sub_domain/TXT" "{\"rrset_ttl\": 300, \"rrset_values\":[\"$txtvalue\"]}"

This comment has been minimized.

@baloo

baloo Feb 27, 2017

Contributor

You may use PUT here which will overwrite any existing TXT record here. This is also idempotent.

@baloo

baloo Feb 27, 2017

Contributor

You may use PUT here which will overwrite any existing TXT record here. This is also idempotent.

This comment has been minimized.

@baloo

baloo Feb 27, 2017

Contributor

The ttl is also optional, it will default to the soa value

@baloo

baloo Feb 27, 2017

Contributor

The ttl is also optional, it will default to the soa value

This comment has been minimized.

@fcrozat

fcrozat Feb 28, 2017

Contributor

POST vs PUT: the specific API in the doc for creating a record was mentionning POST by default. I'll switch to PUT.
For TTL, draft-ietf-acme-acme-01 is suggesting a TTL of 300.

@fcrozat

fcrozat Feb 28, 2017

Contributor

POST vs PUT: the specific API in the doc for creating a record was mentionning POST by default. I'll switch to PUT.
For TTL, draft-ietf-acme-acme-01 is suggesting a TTL of 300.

@Neilpang

This comment has been minimized.

Show comment
Hide comment
Owner

Neilpang commented Feb 28, 2017

@Neilpang Neilpang merged commit fab2d9d into Neilpang:dev Feb 28, 2017

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
@Neilpang

This comment has been minimized.

Show comment
Hide comment
@Neilpang

Neilpang Feb 28, 2017

Owner

I was not able to use this api.
Do I need to do something to enable this live dns api ?

Owner

Neilpang commented Feb 28, 2017

I was not able to use this api.
Do I need to do something to enable this live dns api ?

@fcrozat

This comment has been minimized.

Show comment
Hide comment
@fcrozat

fcrozat Feb 28, 2017

Contributor

You need to migrate your account to Gandi v5 and switch to their new DNS servers: https://news.beta.gandi.net/en/10215-Gandi-s-new-platform-it-s-here and

Contributor

fcrozat commented Feb 28, 2017

You need to migrate your account to Gandi v5 and switch to their new DNS servers: https://news.beta.gandi.net/en/10215-Gandi-s-new-platform-it-s-here and

@Neilpang

This comment has been minimized.

Show comment
Hide comment
@Neilpang

Neilpang Feb 28, 2017

Owner

trying.

Owner

Neilpang commented Feb 28, 2017

trying.

@Neilpang

This comment has been minimized.

Show comment
Hide comment
@Neilpang

Neilpang Feb 28, 2017

Owner

Merged. Thank you.

Owner

Neilpang commented Feb 28, 2017

Merged. Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment