mirror of
https://github.com/NLnetLabs/unbound.git
synced 2026-12-05 08:05:15 +00:00
allowed to use PROXYv2. This limits the proxy access to only the allowed netblocks. Thanks to Qifan Zhang from Palo Alto Networks for the report.
23 lines
659 B
Plaintext
23 lines
659 B
Plaintext
# #-- proxy_allowed.pre--#
|
|
# source the master var file when it's there
|
|
[ -f ../.tpkg.var.master ] && source ../.tpkg.var.master
|
|
# use .tpkg.var.test for in test variable passing
|
|
[ -f .tpkg.var.test ] && source .tpkg.var.test
|
|
|
|
. ../common.sh
|
|
get_random_port 1
|
|
UNBOUND_PORT=$RND_PORT
|
|
echo "UNBOUND_PORT=$UNBOUND_PORT" >> .tpkg.var.test
|
|
|
|
# make config file
|
|
sed -e 's/@PORT\@/'$UNBOUND_PORT'/' -e 's/@TOPORT\@/'$FWD_PORT'/' < proxy_allowed.conf > ub.conf
|
|
# start unbound in the background
|
|
PRE="../.."
|
|
$PRE/unbound -d -c ub.conf >unbound.log 2>&1 &
|
|
UNBOUND_PID=$!
|
|
echo "UNBOUND_PID=$UNBOUND_PID" >> .tpkg.var.test
|
|
|
|
cat .tpkg.var.test
|
|
wait_unbound_up unbound.log
|
|
|