From e5123734460239460c18a1e143f7b7443f1417c2 Mon Sep 17 00:00:00 2001 From: Otto Moerbeek Date: Fri, 7 Jun 2024 13:49:49 +0200 Subject: [PATCH] Install a small YAML default config instead of one with everything commented out --- .../debian/recursor/debian-buster/rules | 23 +++++++++++-------- builder-support/specs/pdns-recursor.spec | 20 +++++++++++----- 2 files changed, 28 insertions(+), 15 deletions(-) diff --git a/builder-support/debian/recursor/debian-buster/rules b/builder-support/debian/recursor/debian-buster/rules index 00bb032a61..2806c456a8 100755 --- a/builder-support/debian/recursor/debian-buster/rules +++ b/builder-support/debian/recursor/debian-buster/rules @@ -41,15 +41,20 @@ override_dh_auto_install: install -m 644 -t debian/pdns-recursor/usr/share/pdns-recursor/snmp RECURSOR-MIB.txt rm -f debian/pdns-recursor/etc/powerdns/recursor.conf-dist rm -f debian/pdns-recursor/etc/powerdns/recursor.yml-dist - dir=$$(mktemp -d) && touch "$$dir/recursor.yml" && ./pdns_recursor --config-dir="$$dir" --config=default 2> /dev/null | sed \ - -e 's!^#\(.*config_dir: \).*!\1/etc/powerdns!' \ - -e 's!^#\(.*hint_file: \).*!\1/usr/share/dns/root.hints!' \ - -e 's!^#\(.*include_dir: \).*!\1/etc/powerdns/recursor.d!' \ - -e 's!^#\(.*local_address: \).*\1!127.0.0.1!' \ - -e 's!^#\(.*lua_config_file: \).*!\1/etc/powerdns/recursor.lua!' \ - -e 's!^#\(.*quiet: \)=.*!\1=true!' \ - -e '/^#.*version_string:.*/d' \ - > debian/pdns-recursor/etc/powerdns/recursor.conf + @echo "\ + dnssec:\n\ + # validation: process\n\ + recursor:\n\ + hint_file: /usr/share/dns/root.hints\n\ + include_dir: /etc/powerdns/recursor.d\n\ + lua_config_file: /etc/powerdns/recursor.lua\n\ + incoming:\n\ + # listen:\n\ + # - 127.0.0.1\n\ + outgoing:\n\ + # source_address:\n\ + # - 0.0.0.0\n\ + " > debian/pdns-recursor/etc/powerdns/recursor.conf override_dh_auto_test: ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS))) diff --git a/builder-support/specs/pdns-recursor.spec b/builder-support/specs/pdns-recursor.spec index cd0a4637db..bc478d433e 100644 --- a/builder-support/specs/pdns-recursor.spec +++ b/builder-support/specs/pdns-recursor.spec @@ -81,15 +81,23 @@ make %{?_smp_mflags} check || (cat test-suite.log && false) %install make install DESTDIR=%{buildroot} -%{__cp} %{buildroot}%{_sysconfdir}/%{name}/recursor.{yml-dist,conf} %{__mkdir} %{buildroot}%{_sysconfdir}/%{name}/recursor.d # change user and group to pdns-recursor and add default include-dir -sed -i \ - -e 's/# \(.*setuid: \).*/\1pdns-recursor/' \ - -e 's/# \(.*setgid: \).*/\1pdns-recursor/' \ - -e 's!# \(.*include_dir: \).*!\1%{_sysconfdir}/%{name}/recursor.d!' \ - %{buildroot}%{_sysconfdir}/%{name}/recursor.conf +cat << EOF > %{buildroot}%{_sysconfdir}/%{name}/recursor.conf +dnssec: + # validation: process +recursor: + include_dir: %{_sysconfdir}/%{name}/recursor.d + setuid: pdns-recursor + setgid: pdns-recursor +incoming: + # listen: + # - 127.0.0.1 +outgoing: + # source_address: + # - 0.0.0.0 +EOF %{__install } -d %{buildroot}/%{_sharedstatedir}/%{name} -- 2.47.2