31 lines
615 B
Plaintext
31 lines
615 B
Plaintext
divert(-1)
|
|
dnl === Load allowed networks from environment ===
|
|
define(`ALLOWED_NETWORKS', `esyscmd(`echo $ALLOWED_NETWORKS')')dnl
|
|
|
|
dnl === Split into tokens ===
|
|
define(`_firstword', `substr(`$1', `0', index(`$1 ', ` '))')dnl
|
|
define(`_restwords', `substr(`$1', incr(index(`$1 ', ` ')))')dnl
|
|
|
|
dnl === Recursive loop ===
|
|
define(`_foreach', `
|
|
ifelse(`$1', `', `', `
|
|
Allow $1
|
|
_foreach(_firstword(_restwords($2)), _restwords($2))')')dnl
|
|
define(`foreach', `_foreach(_firstword($1), $1)')dnl
|
|
divert
|
|
|
|
|
|
Port 3128
|
|
Listen 0.0.0.0
|
|
|
|
User nobody
|
|
Group nobody
|
|
|
|
LogLevel Info
|
|
|
|
foreach(ALLOWED_NETWORKS)
|
|
|
|
ConnectPort 443
|
|
Timeout 600
|
|
|