From 15418347e8ce5ca58be4365ff0eeb1348cfa38e0 Mon Sep 17 00:00:00 2001 From: Patrick Oberdorf <p.oberdorf@mobilistics.de> Date: Thu, 31 Aug 2023 22:52:10 +0200 Subject: [PATCH] add remote control env var --- README.md | 1 + assets/unbound.conf | 2 +- start.sh | 2 ++ 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 858952c..83aa046 100644 --- a/README.md +++ b/README.md @@ -37,3 +37,4 @@ These options can be set via the environment variable -e flag: - **STATISTICS_CUMULATIVE**: enable cumulative statistics, without clearing them after printing. (Default: "no", Possible Values: "yes, no") - **EXTENDED_STATISTICS**: enable extended statistics (query types, answer codes, status) printed from unbound-control. (Default: "no", Possible Values: "yes, no") - **INTERFACE**: Sets the interface to listen on useful when using --net=host (Default 0.0.0.0, Possible Values: "<ipaddress>", "<ipaddress>@<port>") +- **REMOTE_CONTROL_ENABLE**: Enable the remote control feature (Default "yes", Possible Values: "yes, no") diff --git a/assets/unbound.conf b/assets/unbound.conf index eb96ddf..845264b 100644 --- a/assets/unbound.conf +++ b/assets/unbound.conf @@ -593,7 +593,7 @@ python: remote-control: # Enable remote control with unbound-control(8) here. # set up the keys and certificates with unbound-control-setup. - control-enable: yes + control-enable: {{REMOTE_CONTROL_ENABLE}} # Set to no and use an absolute path as control-interface to use # a unix local named pipe for unbound-control. diff --git a/start.sh b/start.sh index 8563816..6ae86a9 100644 --- a/start.sh +++ b/start.sh @@ -22,6 +22,7 @@ STATISTICS_INTERVAL=${STATISTICS_INTERVAL:-0} STATISTICS_CUMULATIVE=${STATISTICS_CUMULATIVE:-no} EXTENDED_STATISTICS=${EXTENDED_STATISTICS:-no} INTERFACE=${INTERFACE:-0.0.0.0} +REMOTE_CONTROL_ENABLE=${REMOTE_CONTROL_ENABLE:-yes} sed 's/{{DO_IPV6}}/'"${DO_IPV6}"'/' -i /usr/local/etc/unbound/unbound.conf @@ -46,5 +47,6 @@ sed 's/{{STATISTICS_INTERVAL}}/'"${STATISTICS_INTERVAL}"'/' -i /usr/local/etc/un sed 's/{{STATISTICS_CUMULATIVE}}/'"${STATISTICS_CUMULATIVE}"'/' -i /usr/local/etc/unbound/unbound.conf sed 's/{{EXTENDED_STATISTICS}}/'"${EXTENDED_STATISTICS}"'/' -i /usr/local/etc/unbound/unbound.conf sed 's/{{INTERFACE}}/'"${INTERFACE}"'/' -i /usr/local/etc/unbound/unbound.conf +sed 's/{{REMOTE_CONTROL_ENABLE}}/'"${REMOTE_CONTROL_ENABLE}"'/' -i /usr/local/etc/unbound/unbound.conf exec /usr/local/sbin/unbound -c /usr/local/etc/unbound/unbound.conf -d -v -- GitLab