From d1308f5aca143803a1b90a1806f90fefb404773d Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Wed, 29 Jul 2020 01:55:55 +0000 Subject: [PATCH] update instructions for greenlock v4 --- README.md | 48 +++++++++++++++++++++++++++++++----------------- 1 file changed, 31 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index 6810075..4249785 100644 --- a/README.md +++ b/README.md @@ -30,26 +30,25 @@ Register and DuckDNS Domain and Save the API Token: # Usage -First you create an instance with your credentials: - -```js -var dns01 = require('acme-dns-01-duckdns').create({ - baseUrl: 'https://www.duckdns.org/update', // default - token: 'xxxx' -}); -``` - -Then you can use it with any compatible ACME library, +Then you can use this with any compatible ACME library, such as Greenlock.js or ACME.js. -### Greenlock.js +### Greenlock CLI + +```bash +npx greenlock defaults --challenge-dns-01 acme-dns-01-duckdns --challenge-dns-01-token xxxx +``` + +### Greenlock API ```js -var Greenlock = require('greenlock-express'); -var greenlock = Greenlock.create({ +greenlock.manager.defaults({ challenges: { - 'dns-01': dns01 - // ... + 'dns-01': { + module: 'acme-dns-01-duckdns', + baseUrl: 'https://www.duckdns.org/update', // default + token: 'xxxxxxx' + } } }); ``` @@ -60,11 +59,26 @@ documentation for more details. ### ACME.js +First you create an instance with your credentials: + ```js -// TODO +var dns01 = require('acme-dns-01-duckdns').create({ + baseUrl: 'https://www.duckdns.org/update', // default + token: 'xxxx' +}); ``` -See the [ACME.js](https://git.rootprojects.org/root/acme-v2.js) for more details. +```js +acme.certificates.create({ + account, + accountKey, + csr, + domains, + challenges: { 'dns-01': dns01 } +}); +``` + +See the [ACME.js](https://git.rootprojects.org/root/acme.js) for more details. ### Build your own