started work on moving variables from .lua to nginx
This commit is contained in:
@@ -242,6 +242,8 @@ if [ "$USE_API" = "yes" ] ; then
|
||||
echo "[*] Generated API URI : $API_URI"
|
||||
fi
|
||||
replace_in_file "/etc/nginx/api.conf" "%API_URI%" "$API_URI"
|
||||
list=$(spaces_to_lua "$API_WHITELIST_IP")
|
||||
replace_in_file "/etc/nginx/api.conf" "%API_WHITELIST_IP%" "$list"
|
||||
else
|
||||
replace_in_file "/etc/nginx/nginx.conf" "%USE_API%" ""
|
||||
fi
|
||||
|
||||
@@ -45,9 +45,3 @@ if [ "$(has_value USE_CROWDSEC yes)" != "" ] ; then
|
||||
replace_in_file "/usr/local/lib/lua/crowdsec/crowdsec.conf" "%CROWDSEC_HOST%" "$CROWDSEC_HOST"
|
||||
replace_in_file "/usr/local/lib/lua/crowdsec/crowdsec.conf" "%CROWDSEC_KEY%" "$CROWDSEC_KEY"
|
||||
fi
|
||||
|
||||
# Whitelist IP for API
|
||||
if [ "$USE_API" = "yes" ] ; then
|
||||
list=$(spaces_to_lua "$API_WHITELIST_IP")
|
||||
replace_in_file "/usr/local/lib/lua/api.lua" "%API_WHITELIST_IP%" "$list"
|
||||
fi
|
||||
|
||||
@@ -13,6 +13,8 @@ if [ "$(has_value AUTO_LETS_ENCRYPT yes)" != "" ] || [ "$SWARM_MODE" = "yes" ] ;
|
||||
if [ "$SWARM_MODE" = "yes" ] ; then
|
||||
replace_in_file "/tmp/nginx-temp.conf" "%USE_API%" "include /tmp/api.conf;"
|
||||
replace_in_file "/tmp/api.conf" "%API_URI%" "$API_URI"
|
||||
list=$(spaces_to_lua "$API_WHITELIST_IP")
|
||||
replace_in_file "/tmp/api.conf" "%API_WHITELIST_IP%" "$list"
|
||||
else
|
||||
replace_in_file "/tmp/nginx-temp.conf" "%USE_API%" ""
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user