From 4ebb368b2cae2dc7ac7dd3fed53e3ca15fbbe945 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Sun, 23 Sep 2018 10:27:26 +0200 Subject: [PATCH] unbound: hello bitrot my old friend :P * Base unbound is no longer installed. Path is /usr/local/... * remotecontrol.conf is not enough, need to use unbound.conf * shuffle remote-control content into unbound.conf * disable cache dump / load until its more clever Case in point of how useless is it to have unused scripts hitching along for the ride. --- src/etc/inc/plugins.inc.d/unbound.inc | 44 ++++++++----------------- src/opnsense/scripts/unbound/cache.sh | 4 +-- src/opnsense/scripts/unbound/wrapper.py | 2 +- 3 files changed, 17 insertions(+), 33 deletions(-) diff --git a/src/etc/inc/plugins.inc.d/unbound.inc b/src/etc/inc/plugins.inc.d/unbound.inc index f17207139..9a3a18589 100644 --- a/src/etc/inc/plugins.inc.d/unbound.inc +++ b/src/etc/inc/plugins.inc.d/unbound.inc @@ -353,21 +353,6 @@ include: /var/unbound/domainoverrides.conf {$forward_conf} -### -# Remote Control Config -### -include: /var/unbound/remotecontrol.conf - -EOD; - - copy('/usr/local/etc/inc/plugins.inc.d/unbound/root.min.hints', '/var/unbound/root.hints'); - file_put_contents('/var/unbound/unbound.conf', $unboundconf); -} - -function unbound_remote_control_setup() -{ - if (!file_exists('/var/unbound/remotecontrol.conf') || !file_exists('/var/unbound/unbound_control.key')) { - $remotcfg = << ${CACHE} + ${UNBOUNDCTL} dump_cache > ${CACHE} elif [ "${COMMAND}" = "load" -a -f "${CACHE}" ]; then cat ${CACHE} | ${UNBOUNDCTL} load_cache elif [ "${COMMAND}" = "flush" ]; then diff --git a/src/opnsense/scripts/unbound/wrapper.py b/src/opnsense/scripts/unbound/wrapper.py index b3af3d247..1d5605afe 100755 --- a/src/opnsense/scripts/unbound/wrapper.py +++ b/src/opnsense/scripts/unbound/wrapper.py @@ -36,7 +36,7 @@ import json def unbound_control_reader(action): with tempfile.NamedTemporaryFile() as output_stream: - subprocess.call(['/usr/sbin/unbound-control', '-c', '/var/unbound/remotecontrol.conf', action], + subprocess.call(['/usr/local/sbin/unbound-control', '-c', '/var/unbound/unbound.conf', action], stdout=output_stream, stderr=open(os.devnull, 'wb')) output_stream.seek(0) for line in output_stream: