Skip to content

Commit

Permalink
ci: create script to update DNS records from hashes.txt (#3458)
Browse files Browse the repository at this point in the history
Description
---
Provides a script that can update DNS TXT records from `meta/hashes.txt` file using Cloudflare API

Motivation and Context
---
Part of the release process once auto updates are working 

How Has This Been Tested?
---
Manually 

https://www.digwebinterface.com/?hostnames=updates.taripulse.com&type=TXT&ns=resolver&useresolver=1.1.1.1
  • Loading branch information
Byron Hambly authored Oct 15, 2021
1 parent 8f8b876 commit 1d11ae4
Show file tree
Hide file tree
Showing 8 changed files with 3,370 additions and 0 deletions.
4 changes: 4 additions & 0 deletions applications/dns/.env.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
TOKEN=
ZONE_ID=
DOMAIN=updates.taripulse.com
FILE=../../meta/hashes.txt
1 change: 1 addition & 0 deletions applications/dns/.nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
lts/fermium
34 changes: 34 additions & 0 deletions applications/dns/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# DNS Update

A script to update DNS records from the hashes file.

## Setup your env

```
cp .env.sample .env
```

- Edit `.env` to include your cloudflare api TOKEN, your ZONE_ID, and the DOMAIN to update.
- Use FILE to set the name of the file to provide records, if not provided then the default `../../meta/hashes.txt` will be used.

## Install deps

```
npm ci
```

## Run

```
npm run update
```

Deletes existing TXT records on the domain, and creates new records from each line in FILE.

## Release process (manual)

- push tag
- build binaries
- replace hashes in file `meta/hashes.txt`
- sign `meta/hashes.txt` with maintainer gpg key and replace sig at `meta/hashes.txt.sig`
- `npm run update` in this folder to update the DNS records to match the txt file
Loading

0 comments on commit 1d11ae4

Please sign in to comment.