From dfdc625f8fc38f19542fed68c5792118b33aae6a Mon Sep 17 00:00:00 2001 From: JP Mens Date: Sat, 19 Dec 2020 16:48:31 +0100 Subject: [PATCH] rfc2136: add command example (#1321) * RFC2136 example This small patch adds an example to the RFC2136 provider. * review and generate. Co-authored-by: Fernandez Ludovic --- docs/content/dns/zz_gen_rfc2136.md | 22 +++++++++++++++++++--- providers/dns/rfc2136/rfc2136.toml | 18 +++++++++++++++++- 2 files changed, 36 insertions(+), 4 deletions(-) diff --git a/docs/content/dns/zz_gen_rfc2136.md b/docs/content/dns/zz_gen_rfc2136.md index 954c21ae..e0ef749b 100644 --- a/docs/content/dns/zz_gen_rfc2136.md +++ b/docs/content/dns/zz_gen_rfc2136.md @@ -18,9 +18,25 @@ Configuration for [RFC2136](https://tools.ietf.org/html/rfc2136). - Code: `rfc2136` -{{% notice note %}} -_Please contribute by adding a CLI example._ -{{% /notice %}} +Here is an example bash command using the RFC2136 provider: + +```bash +RFC2136_NAMESERVER=127.0.0.1 \ +RFC2136_TSIG_KEY=lego \ +RFC2136_TSIG_ALGORITHM=hmac-sha256. \ +RFC2136_TSIG_SECRET=YWJjZGVmZGdoaWprbG1ub3BxcnN0dXZ3eHl6MTIzNDU= \ +lego --email myemail@example.com --dns rfc2136 --domains my.example.org run + +## --- + +keyname=lego; keyfile=lego.key; tsig-keygen $keyname > $keyfile + +RFC2136_NAMESERVER=127.0.0.1 \ +RFC2136_TSIG_KEY="$keyname" \ +RFC2136_TSIG_ALGORITHM="$( awk -F'[ ";]' '/algorithm/ { print $2 }' $keyfile )." \ +RFC2136_TSIG_SECRET="$( awk -F'[ ";]' '/secret/ { print $3 }' $keyfile )" \ +lego --email myemail@example.com --dns rfc2136 --domains my.example.org run +``` diff --git a/providers/dns/rfc2136/rfc2136.toml b/providers/dns/rfc2136/rfc2136.toml index 020a0968..eed21430 100644 --- a/providers/dns/rfc2136/rfc2136.toml +++ b/providers/dns/rfc2136/rfc2136.toml @@ -4,7 +4,23 @@ URL = "https://tools.ietf.org/html/rfc2136" Code = "rfc2136" Since = "v0.3.0" -Example = '''''' +Example = ''' +RFC2136_NAMESERVER=127.0.0.1 \ +RFC2136_TSIG_KEY=lego \ +RFC2136_TSIG_ALGORITHM=hmac-sha256. \ +RFC2136_TSIG_SECRET=YWJjZGVmZGdoaWprbG1ub3BxcnN0dXZ3eHl6MTIzNDU= \ +lego --email myemail@example.com --dns rfc2136 --domains my.example.org run + +## --- + +keyname=lego; keyfile=lego.key; tsig-keygen $keyname > $keyfile + +RFC2136_NAMESERVER=127.0.0.1 \ +RFC2136_TSIG_KEY="$keyname" \ +RFC2136_TSIG_ALGORITHM="$( awk -F'[ ";]' '/algorithm/ { print $2 }' $keyfile )." \ +RFC2136_TSIG_SECRET="$( awk -F'[ ";]' '/secret/ { print $3 }' $keyfile )" \ +lego --email myemail@example.com --dns rfc2136 --domains my.example.org run +''' [Configuration] [Configuration.Credentials]