This commit is contained in:
Mateusz Gruszczyński committed 2026-11-22 14:21:54 +01:00
commit fa432bebda
189 files changed
+26219

No files matched your search

+17
View File
@@ -0,0 +1,17 @@
Package: easydns
Version: @VERSION@
Architecture: @ARCH@
Maintainer: EasyDNS maintainers <maintainers@example.invalid>
Installed-Size: @SIZE@
Depends: libc6 (>= 2.34), ca-certificates, adduser
Section: net
Priority: optional
Homepage: https://example.invalid/easydns
Description: DNS server: primary, secondary, recursive, forwarder, hybrid
EasyDNS is an authoritative (primary/secondary with AXFR/IXFR, NOTIFY, TSIG,
DNSSEC signing), recursive (iterative, DNSSEC-validating), forwarding and hybrid
DNS server with DoT/DoH, REST API and Prometheus metrics.
.
Includes the EasyDNS Tools: easydig, easyhost, easynslookup, easytrace,
easydnssec, easyptr, easyzone, easyconf, easybench, easywhois, easydoh,
easydot and easydiff (short names ed, eh, ... are created when free).
+46
View File
@@ -0,0 +1,46 @@
#!/bin/sh
set -e
TOOLS="edns:easydns ed:easydig eh:easyhost ens:easynslookup etrace:easytrace ednssec:easydnssec eptr:easyptr ezone:easyzone econf:easyconf ebench:easybench ewhois:easywhois edoh:easydoh edot:easydot ediff:easydiff"
if [ "$1" = "configure" ]; then
if ! getent passwd easydns >/dev/null; then
adduser --system --group --home /etc/easydns/data --no-create-home --shell /usr/sbin/nologin easydns >/dev/null
fi
# /etc/easydns: config, zones.d/, keys.d/ (root:easydns, not world-readable – may hold keys)
install -d -o root -g easydns -m 0750 /etc/easydns /etc/easydns/zones.d /etc/easydns/keys.d
# data_dir: zone files (data/zones/), secondary copies, journals, control token
install -d -o easydns -g easydns -m 0750 /etc/easydns/data /etc/easydns/data/zones
chgrp easydns /etc/easydns/config.yaml 2>/dev/null || true
chmod 0640 /etc/easydns/config.yaml 2>/dev/null || true
# Short tool names only when the name is free (e.g. `ed` is often the line editor).
for pair in $TOOLS; do
s="${pair%%:*}"; l="${pair##*:}"
if [ ! -e "/usr/bin/$s" ] && ! command -v "$s" >/dev/null 2>&1; then
ln -s "$l" "/usr/bin/$s"
fi
done
if [ -d /run/systemd/system ]; then
systemctl daemon-reload >/dev/null || true
if [ -n "$2" ] && systemctl is-active --quiet easydns.service; then
# Upgrade of a running server: restart only if the new version accepts the
# configuration (checked as the service user); otherwise keep the old one running.
if command -v runuser >/dev/null 2>&1; then
CHECK="runuser -u easydns -- /usr/bin/easydns check-config --config /etc/easydns/config.yaml"
else
CHECK="/usr/bin/easydns check-config --config /etc/easydns/config.yaml"
fi
if $CHECK >/tmp/easydns-upgrade-check.log 2>&1; then
systemctl restart easydns.service && echo "EasyDNS upgraded from $2 and restarted."
rm -f /tmp/easydns-upgrade-check.log
else
echo "WARNING: the new EasyDNS rejects /etc/easydns/config.yaml; the previous version keeps running."
echo " details: /tmp/easydns-upgrade-check.log fix, then: systemctl restart easydns"
fi
elif [ -z "$2" ]; then
echo "EasyDNS installed (hybrid: authoritative + recursive for LAN)."
echo " config: /etc/easydns/config.yaml zones: /etc/easydns/data/zones/"
echo " new zone: easydns zone create example.com --ns ns1.example.com --ip 192.0.2.1"
echo " start: systemctl enable --now easydns then: easydns status"
fi
fi
fi
exit 0
+18
View File
@@ -0,0 +1,18 @@
#!/bin/sh
set -e
TOOLS="edns:easydns ed:easydig eh:easyhost ens:easynslookup etrace:easytrace ednssec:easydnssec eptr:easyptr ezone:easyzone econf:easyconf ebench:easybench ewhois:easywhois edoh:easydoh edot:easydot ediff:easydiff"
if [ "$1" = "remove" ] || [ "$1" = "purge" ]; then
# remove only symlinks we created
for pair in $TOOLS; do
s="${pair%%:*}"; l="${pair##*:}"
if [ -L "/usr/bin/$s" ] && [ "$(readlink "/usr/bin/$s")" = "$l" ]; then rm -f "/usr/bin/$s"; fi
done
fi
if [ "$1" = "purge" ]; then
# /etc/easydns holds your zone files and keys: never deleted automatically
rm -f /etc/easydns/data/control.token
echo "EasyDNS purged. /etc/easydns (zones, keys, data) was kept – remove it manually if no longer needed."
fi
[ -d /run/systemd/system ] && systemctl daemon-reload >/dev/null 2>&1 || true
exit 0
+6
View File
@@ -0,0 +1,6 @@
#!/bin/sh
set -e
if [ "$1" = "remove" ] && [ -d /run/systemd/system ]; then
systemctl stop easydns.service easydns-blocklists.timer >/dev/null 2>&1 || true
fi
exit 0