From a2d154a429d225e29038ceef6ae4022854096c2e Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Mon, 6 Sep 2021 07:24:37 +0200 Subject: Merging upstream version 20210906. Signed-off-by: Daniel Baumann --- CHANGELOG.txt | 8 ++++++++ VERSION.txt | 2 +- dehydrated/bin/dehydrated-nsupdate | 7 +++---- knot/Makefile | 9 +++++++++ knot/share/cron/knot-zone-reset | 3 +++ 5 files changed, 24 insertions(+), 5 deletions(-) create mode 100755 knot/share/cron/knot-zone-reset diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 605761f..9b39627 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,3 +1,11 @@ +2021-09-06 Daniel Baumann + + * Releasing version 20210906. + + [ Daniel Baumann ] + * Adding knot-reset-zone cron. + * Making dehydrated-nsupdate more robust and cope with local but not-cached authoritative zone outputs. + 2021-09-05 Daniel Baumann * Releasing version 20210905. diff --git a/VERSION.txt b/VERSION.txt index 7633bd1..7ef5329 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -1 +1 @@ -20210905 +20210906 diff --git a/dehydrated/bin/dehydrated-nsupdate b/dehydrated/bin/dehydrated-nsupdate index 7b6ea34..b870e3b 100755 --- a/dehydrated/bin/dehydrated-nsupdate +++ b/dehydrated/bin/dehydrated-nsupdate @@ -79,7 +79,7 @@ do done # find txt record to update -CNAME="$(${DIG} "_acme-challenge.${DOMAIN}" 2>&1 | awk '/CNAME/ { print $5 }' | tail -n1)" +CNAME="$(${DIG} +nocomments +noquestion "_acme-challenge.${DOMAIN}" 2>&1 | grep -v '^;' | awk '/CNAME/ { print $5 }' | tail -n1)" if [ -n "${CNAME}" ] then @@ -93,10 +93,11 @@ ZONE="${TXT_RECORD}" while true do - NAMESERVERS="$(${DIG} NS "${ZONE}" 2>&1 | awk '/NS/ { print $5 }' | tail -n1)" + NAMESERVERS="$(${DIG} +nocomments +noquestion NS "${ZONE}" 2>&1 | grep -v '^;' | awk '/NS/ { print $5 }')" if [ -n "${NAMESERVERS}" ] then + ZONE="$(${DIG} +nocomments +noquestion NS "${ZONE}" 2>&1 | grep -v '^;' | awk '/NS/ { print $1 }' | tail -n1)" break else ZONE="$(echo "${ZONE}" | cut -d '.' -f 2-)" @@ -108,8 +109,6 @@ then NSUPDATE_OPTIONS="-k ${TSIG_KEYFILE}" fi -NAMESERVERS="$(${DIG} +short NS "${ZONE}")" - # update nameservers for NAMESERVER in ${NAMESERVERS} do diff --git a/knot/Makefile b/knot/Makefile index 3a2e4b9..9b3ef3b 100644 --- a/knot/Makefile +++ b/knot/Makefile @@ -61,6 +61,9 @@ test: build: install: build + mkdir -p $(DESTDIR)/etc/cron.d + cp -r share/cron/* $(DESTDIR)/etc/cron.d + mkdir -p $(DESTDIR)/usr/bin cp -r bin/* $(DESTDIR)/usr/bin @@ -71,6 +74,12 @@ uninstall: done rmdir --ignore-fail-on-non-empty --parents $(DESTDIR)/usr/bin || true + for FILE in share/cron/*; \ + do \ + rm -f $(DESTDIR)/etc/cron.d/$$(basename $${FILE}); \ + done + rmdir --ignore-fail-on-non-empty --parents $(DESTDIR)/etc/cron.d || true + rmdir --ignore-fail-on-non-empty --parents $(DESTDIR) || true clean: diff --git a/knot/share/cron/knot-zone-reset b/knot/share/cron/knot-zone-reset new file mode 100755 index 0000000..b6ec7a7 --- /dev/null +++ b/knot/share/cron/knot-zone-reset @@ -0,0 +1,3 @@ +# /etc/cron.d/knot-reset-zone + +0 0 * * * root /usr/bin/knot-reset-zone localhost > /dev/null 2>&1 -- cgit v1.2.3