Scripts to keep a MythicBeasts hosted AAAA record updated with changes to an IPv6 address

@Alex Tucker Alex Tucker authored 35 minutes ago
README.md Add generated files and a README.md 35 minutes ago
mb-aaaa-update Add generated files and a README.md 35 minutes ago
mb-aaaa-update.service Add generated files and a README.md 35 minutes ago
mb-aaaa-update.timer Add generated files and a README.md 35 minutes ago
mb-aaaa.credentials Add generated files and a README.md 35 minutes ago
mb-aaaa.env Add generated files and a README.md 35 minutes ago
README.md

MythicBeasts AAAA updater

While my ISP hands out IPv6 addresses, they change every so often,
so I needed a way to keep my AAAA record up to date.

I used kagi assistant to create this script and configuration, so it is worth
reading through it to check.

install --mode=0644 mb-aaaa-udate.* /etc/systemd/system/
install --mode=0755 mb-aaaa-update /usr/local/sbin/
install --mode=0600 mb-aaaa.credentials /etc/
install --mode=0644 mb-aaaa.env /etc/

Edit /etc/mb-aaaa.env with the domain name (zone) you host in MythicBeasts and
the host name you want to keep up to date.

Visit https://www.mythic-beasts.com/customer/api-users to create an API key to
be used to update your host's AAAA record. The advice is to use a different key
for each host, so give it a name unique to the host and add a "permit" to
restrict to the host, zone and AAAA record. Copy the eventual key and secret
into /etc/mb-aaaa.credentials; the key and secret will only be shown once.

You can check that things are set up by running:

set -a
source /etc/mb-aaaa.env
set +a

MB_DRY_RUN=1 MB_VERBOSE=1 mb-aaaa-update

This should output a line saying what would be done, then:

MB_VERBOSE=1 mb-aaaa-update

should update the record on first run and avoid making an API call on
subsequent runs unless the address has changed.

To make this run automatically every 5 minutes (configurable in
/etc/systemd/system/), run:

systemctl enable --now mb-aaaa-update.timer