From ae1eb970f558d9e6c0a9af1b5754cc90ba873a5d Mon Sep 17 00:00:00 2001 From: Jeffrey Cafferata Date: Mon, 31 Oct 2022 20:59:29 +0100 Subject: [PATCH] DOCS: Inline creds.json.tpl-example.txt example (#1784) --- .gitignore | 4 ++-- .../creds.json} | 0 .../creds.json} | 0 .../dnsconfig.js} | 0 docs/creds-json.md | 19 ++++++++++++++++++- docs/getting-started.md | 4 ++-- 6 files changed, 22 insertions(+), 5 deletions(-) rename docs/assets/{creds.json.tpl-example.txt => 1password/creds.json} (100%) rename docs/assets/{creds.json-example.txt => getting-started/creds.json} (100%) rename docs/assets/{dnsconfig.js-example.txt => getting-started/dnsconfig.js} (100%) diff --git a/.gitignore b/.gitignore index 24d2c9b0e..c87a9df67 100644 --- a/.gitignore +++ b/.gitignore @@ -3,8 +3,8 @@ dnscontrol-Darwin dnscontrol-Linux dnscontrol.exe dnscontrol -dnsconfig.js -creds.json +/dnsconfig.js +/creds.json ExternalDNS docs/_site powershell.log diff --git a/docs/assets/creds.json.tpl-example.txt b/docs/assets/1password/creds.json similarity index 100% rename from docs/assets/creds.json.tpl-example.txt rename to docs/assets/1password/creds.json diff --git a/docs/assets/creds.json-example.txt b/docs/assets/getting-started/creds.json similarity index 100% rename from docs/assets/creds.json-example.txt rename to docs/assets/getting-started/creds.json diff --git a/docs/assets/dnsconfig.js-example.txt b/docs/assets/getting-started/dnsconfig.js similarity index 100% rename from docs/assets/dnsconfig.js-example.txt rename to docs/assets/getting-started/dnsconfig.js diff --git a/docs/creds-json.md b/docs/creds-json.md index 9fdbd8f82..dc2909b3a 100644 --- a/docs/creds-json.md +++ b/docs/creds-json.md @@ -202,7 +202,24 @@ This example requires the [1Password command-line tool](https://developer.1passw but works with any shell command that returns a properly formatted `creds.json`. In this case, the 1Password CLI is used to inject the secrets from a 1Password vault, rather than storing them in environment variables. -An example of a template file containing Linode and Cloudflare API credentials is available here: [creds.json.tpl-example.txt]({{ site.github.url }}/assets/creds.json.tpl-example.txt)) +An example of a template file containing Linode and Cloudflare API credentials is available here: [creds.json](https://github.com/StackExchange/dnscontrol/blob/master/docs/assets/1password/creds.json). + +```json +{ + "bind": { + "TYPE": "BIND" + }, + "cloudflare": { + "TYPE": "CLOUDFLAREAPI", + "apitoken": "op://Secrets/Cloudflare DNSControl/credential", + "accountid": "op://Secrets/Cloudflare DNSControl/username" + }, + "linode": { + "TYPE": "LINODE", + "token": "op://Secrets/Linode DNSControl/credential" + } +} +``` ## Don't store secrets in a Git repo! diff --git a/docs/getting-started.md b/docs/getting-started.md index f3c739a89..07dd00bd0 100644 --- a/docs/getting-started.md +++ b/docs/getting-started.md @@ -60,7 +60,7 @@ use BIND for DNS service, it is useful for testing. domains, and so on. Start your `dnsconfig.js` file by downloading -[dnsconfig.js-example.txt]({{ site.github.url }}/assets/dnsconfig.js-example.txt)) +[dnsconfig.js](https://github.com/StackExchange/dnscontrol/blob/master/docs/assets/getting-started/dnsconfig.js) and renaming it. The file looks like: @@ -126,7 +126,7 @@ It is only needed if any providers require credentials (API keys, usernames, passwords, etc.). Start your `creds.json` file by downloading -[creds.json-example.txt]({{ site.github.url }}/assets/creds.json-example.txt)) +[creds.json](https://github.com/StackExchange/dnscontrol/blob/master/docs/assets/getting-started/creds.json) and renaming it. The file looks like: