From 6b2246629aa12efdd9febebae26b0c414a51e330 Mon Sep 17 00:00:00 2001 From: Jimmy Briggs Date: Fri, 23 Feb 2024 13:04:28 -0500 Subject: [PATCH] doc: fix README --- README.md | 58 +++++++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 44 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 3d4c3bc..751e953 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,19 @@ ## Contents +- [No Clocks, LLC Domain Name System Records](#no-clocks-llc-domain-name-system-records) + - [Contents](#contents) + - [Overview](#overview) + - [DNSControl](#dnscontrol) + - [Installation](#installation) + - [Usage](#usage) + - [Docker](#docker) + - [GitHub Actions](#github-actions) + - [Configuration](#configuration) + - [creds.json](#credsjson) + - [dnsconfig.js](#dnsconfigjs) + - [DNS Records](#dns-records) + ## Overview No Clocks, LLC utilizes [Porkbun](https://porkbun.com/) as our DNS Provider and Registrar. @@ -19,8 +32,6 @@ DNS zones plus software that processes the DSL and pushes the resulting zones to It can send the same DNS records to multiple providers. -It even generates the most beautiful `BIND` zone files. - It runs anywhere Go runs (Linux, macOS, Windows). The provider model is extensible, so more providers can be added. @@ -63,7 +74,7 @@ dnscontrol push docker run --rm -it -v "$(pwd):/dns" ghcr.io/stackexchange/dnscontrol preview ``` -## GitHub Actions +### GitHub Actions This repository is configured to run the `dnscontrol` commands using GitHub Actions. @@ -72,30 +83,49 @@ The defined DNS records are deployed to the DNS Provider using the GitHub action The GitHub Action is defined in the [`.github/workflows/dnscontrol.yml`](.github/workflows/dnscontrol.yml) file. ```yaml -name: Check +name: DNSControl + +on: + push: + branches: + - main + workflow_dispatch: -on: pull_request +env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + PORKBUN_API_KEY: ${{ secrets.PORKBUN_API_KEY }} + PORKBUN_API_SECRET: ${{ secrets.PORKBUN_API_SECRET }} jobs: - check: + dnscontrol: runs-on: ubuntu-latest + permissions: + id-token: write + contents: read steps: - - uses: actions/checkout@v2 + - name: Checkout + uses: actions/checkout@v4 - - name: DNSControl check + - name: Check uses: koenrh/dnscontrol-action@v3 with: args: check + config_file: 'dnscontrol.js' + creds_file: 'creds.example.json' - # Optionally, if your DNSConfig files are in a non-default location, - # you could specify the paths to the config and credentials file. - config_file: 'dns/dnsconfig.js' + - name: Push + uses: koenrh/dnscontrol-action@v3 + with: + args: push + config_file: 'dnscontrol.js' + creds_file: 'creds.example.json' +``` ## Configuration The configuration for `dnscontrol` is stored in the following files: -- `creds.json` +- `creds.json` (not included in the repository) - `dnsconfig.js` plus an additional, but optional, TypeScript definition file: @@ -113,8 +143,8 @@ See the [creds.example.json](creds.example.json) file for an example of the form { "porkbun": { "TYPE": "PORKBUN", - "api_key": "", - "secret_key": "" + "api_key": "$PORKBUN_API_KEY", + "secret_key": "$PORKBUN_API_SECRET" } } ```