various bug fixes on templates and nginx update to 1.20.1

This commit is contained in:
bunkerity
2021-05-27 09:53:14 +02:00
parent e2f02ee91e
commit 4a73ae8197
18 changed files with 94 additions and 176 deletions

View File

@@ -94,7 +94,7 @@ pid="$!"
if [ "$1" == "test" ] ; then
sleep 10
echo -n "autotest" > /www/index.html
check=$(curl "http://localhost:8080")
check=$(curl -H "User-Agent: legit" "http://localhost:8080")
if [ "$check" == "autotest" ] ; then
exit 0
fi

View File

@@ -10,11 +10,13 @@ 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"
API_WHITELIST_IP="${API_WHITELIST_IP-192.168.0.0/16 172.16.0.0/12 10.0.0.0/8}"
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
HTTP_PORT="${HTTP_PORT-8080}"
replace_in_file "/tmp/nginx-temp.conf" "%HTTP_PORT%" "$HTTP_PORT"
nginx -c /tmp/nginx-temp.conf
if [ "$?" -eq 0 ] ; then