From 9775cd5bbdf742f59dfc62e59d66d028a72c5055 Mon Sep 17 00:00:00 2001 From: fl0ppy-d1sk Date: Thu, 26 Oct 2023 15:04:23 +0200 Subject: [PATCH] ci/cd - fix missing string in /ready endpoint and add /ready endpoint to linux tests --- tests/core/antibot/docker-compose.yml | 5 +++-- tests/core/antibot/ready.conf | 8 ++++++++ tests/core/antibot/test.sh | 1 + tests/core/authbasic/docker-compose.yml | 3 ++- tests/core/authbasic/ready.conf | 8 ++++++++ tests/core/authbasic/test.sh | 1 + tests/core/badbehavior/docker-compose.yml | 3 ++- tests/core/badbehavior/ready.conf | 8 ++++++++ tests/core/badbehavior/test.sh | 1 + tests/core/blacklist/docker-compose.yml | 3 ++- tests/core/blacklist/ready.conf | 8 ++++++++ tests/core/blacklist/test.sh | 1 + tests/core/brotli/docker-compose.yml | 3 ++- tests/core/brotli/ready.conf | 8 ++++++++ tests/core/brotli/test.sh | 1 + tests/core/bunkernet/docker-compose.yml | 3 ++- tests/core/bunkernet/ready.conf | 8 ++++++++ tests/core/bunkernet/test.sh | 1 + tests/core/bwcli/docker-compose.yml | 3 ++- tests/core/bwcli/ready.conf | 8 ++++++++ tests/core/bwcli/test.sh | 1 + tests/core/clientcache/docker-compose.yml | 3 ++- tests/core/clientcache/ready.conf | 8 ++++++++ tests/core/clientcache/test.sh | 1 + tests/core/cors/docker-compose.yml | 3 ++- tests/core/cors/ready.conf | 8 ++++++++ tests/core/cors/test.sh | 1 + tests/core/country/docker-compose.yml | 3 ++- tests/core/country/ready.conf | 8 ++++++++ tests/core/country/test.sh | 1 + tests/core/customcert/docker-compose.yml | 3 ++- tests/core/customcert/ready.conf | 8 ++++++++ tests/core/customcert/test.sh | 1 + tests/core/db/docker-compose.yml | 3 ++- tests/core/db/ready.conf | 8 ++++++++ tests/core/db/test.sh | 1 + tests/core/dnsbl/docker-compose.yml | 3 ++- tests/core/dnsbl/ready.conf | 8 ++++++++ tests/core/dnsbl/test.sh | 1 + tests/core/errors/docker-compose.yml | 3 ++- tests/core/errors/ready.conf | 8 ++++++++ tests/core/errors/test.sh | 1 + tests/core/greylist/docker-compose.yml | 3 ++- tests/core/greylist/ready.conf | 8 ++++++++ tests/core/greylist/test.sh | 1 + tests/core/gzip/docker-compose.yml | 5 ++++- tests/core/gzip/ready.conf | 8 ++++++++ tests/core/gzip/test.sh | 1 + tests/core/headers/docker-compose.yml | 3 ++- tests/core/headers/ready.conf | 8 ++++++++ tests/core/headers/test.sh | 1 + tests/core/inject/docker-compose.yml | 3 ++- tests/core/inject/ready.conf | 8 ++++++++ tests/core/inject/test.sh | 1 + tests/core/limit/docker-compose.yml | 3 ++- tests/core/limit/ready.conf | 8 ++++++++ tests/core/limit/test.sh | 1 + tests/core/misc/docker-compose.yml | 3 ++- tests/core/misc/ready.conf | 8 ++++++++ tests/core/misc/test.sh | 1 + tests/core/modsecurity/docker-compose.yml | 3 ++- tests/core/modsecurity/ready.conf | 8 ++++++++ tests/core/modsecurity/test.sh | 1 + tests/core/redirect/docker-compose.yml | 3 ++- tests/core/redirect/ready.conf | 8 ++++++++ tests/core/redirect/test.sh | 1 + tests/core/redis/docker-compose.yml | 3 ++- tests/core/redis/ready.conf | 8 ++++++++ tests/core/redis/test.sh | 1 + tests/core/reversescan/docker-compose.yml | 3 ++- tests/core/reversescan/ready.conf | 8 ++++++++ tests/core/reversescan/test.sh | 1 + tests/core/selfsigned/docker-compose.yml | 3 ++- tests/core/selfsigned/ready.conf | 8 ++++++++ tests/core/selfsigned/test.sh | 1 + tests/core/sessions/docker-compose.yml | 3 ++- tests/core/sessions/ready.conf | 8 ++++++++ tests/core/sessions/test.sh | 1 + tests/core/whitelist/docker-compose.yml | 3 ++- tests/core/whitelist/ready.conf | 8 ++++++++ tests/core/whitelist/test.sh | 1 + 81 files changed, 300 insertions(+), 28 deletions(-) create mode 100644 tests/core/antibot/ready.conf create mode 100644 tests/core/authbasic/ready.conf create mode 100644 tests/core/badbehavior/ready.conf create mode 100644 tests/core/blacklist/ready.conf create mode 100644 tests/core/brotli/ready.conf create mode 100644 tests/core/bunkernet/ready.conf create mode 100644 tests/core/bwcli/ready.conf create mode 100644 tests/core/clientcache/ready.conf create mode 100644 tests/core/cors/ready.conf create mode 100644 tests/core/country/ready.conf create mode 100644 tests/core/customcert/ready.conf create mode 100644 tests/core/db/ready.conf create mode 100644 tests/core/dnsbl/ready.conf create mode 100644 tests/core/errors/ready.conf create mode 100644 tests/core/greylist/ready.conf create mode 100644 tests/core/gzip/ready.conf create mode 100644 tests/core/headers/ready.conf create mode 100644 tests/core/inject/ready.conf create mode 100644 tests/core/limit/ready.conf create mode 100644 tests/core/misc/ready.conf create mode 100644 tests/core/modsecurity/ready.conf create mode 100644 tests/core/redirect/ready.conf create mode 100644 tests/core/redis/ready.conf create mode 100644 tests/core/reversescan/ready.conf create mode 100644 tests/core/selfsigned/ready.conf create mode 100644 tests/core/sessions/ready.conf create mode 100644 tests/core/whitelist/ready.conf diff --git a/tests/core/antibot/docker-compose.yml b/tests/core/antibot/docker-compose.yml index 6c5ab569..d4ccc856 100644 --- a/tests/core/antibot/docker-compose.yml +++ b/tests/core/antibot/docker-compose.yml @@ -23,8 +23,9 @@ services: location /ready { default_type 'text/plain'; rewrite_by_lua_block { - ngx.say('ready') - ngx.exit(ngx.OK) + ngx.print('ready') + ngx.flush(true) + ngx.exit(ngx.HTTP_OK) } } networks: diff --git a/tests/core/antibot/ready.conf b/tests/core/antibot/ready.conf new file mode 100644 index 00000000..c2f800ac --- /dev/null +++ b/tests/core/antibot/ready.conf @@ -0,0 +1,8 @@ +location /ready { + default_type 'text/plain'; + rewrite_by_lua_block { + ngx.print('ready') + ngx.flush(true) + ngx.exit(ngx.HTTP_OK) + } +} \ No newline at end of file diff --git a/tests/core/antibot/test.sh b/tests/core/antibot/test.sh index 5810c4ab..c0a7e177 100755 --- a/tests/core/antibot/test.sh +++ b/tests/core/antibot/test.sh @@ -31,6 +31,7 @@ else echo "USE_ANTIBOT=no" | sudo tee -a /etc/bunkerweb/variables.env echo "ANTIBOT_URI=/challenge" | sudo tee -a /etc/bunkerweb/variables.env sudo touch /var/www/html/index.html + sudo cp ready.conf /etc/bunkerweb/server-http fi manual=0 diff --git a/tests/core/authbasic/docker-compose.yml b/tests/core/authbasic/docker-compose.yml index 415f01df..8663d205 100644 --- a/tests/core/authbasic/docker-compose.yml +++ b/tests/core/authbasic/docker-compose.yml @@ -25,7 +25,8 @@ services: location /ready { default_type 'text/plain'; rewrite_by_lua_block { - ngx.say('ready') + ngx.print('ready') + ngx.flush(true) ngx.exit(ngx.HTTP_OK) } } diff --git a/tests/core/authbasic/ready.conf b/tests/core/authbasic/ready.conf new file mode 100644 index 00000000..c2f800ac --- /dev/null +++ b/tests/core/authbasic/ready.conf @@ -0,0 +1,8 @@ +location /ready { + default_type 'text/plain'; + rewrite_by_lua_block { + ngx.print('ready') + ngx.flush(true) + ngx.exit(ngx.HTTP_OK) + } +} \ No newline at end of file diff --git a/tests/core/authbasic/test.sh b/tests/core/authbasic/test.sh index 01104a3c..6c052bce 100755 --- a/tests/core/authbasic/test.sh +++ b/tests/core/authbasic/test.sh @@ -33,6 +33,7 @@ else echo "AUTH_BASIC_USER=bunkerity" | sudo tee -a /etc/bunkerweb/variables.env echo "AUTH_BASIC_PASSWORD=Secr3tP@ssw0rd" | sudo tee -a /etc/bunkerweb/variables.env sudo wget -O /var/www/html/index.html https://github.com/nginxinc/NGINX-Demos/raw/master/nginx-hello-nonroot/html-version/index.html + sudo cp ready.conf /etc/bunkerweb/server-http fi manual=0 diff --git a/tests/core/badbehavior/docker-compose.yml b/tests/core/badbehavior/docker-compose.yml index d9492616..277f3814 100644 --- a/tests/core/badbehavior/docker-compose.yml +++ b/tests/core/badbehavior/docker-compose.yml @@ -25,7 +25,8 @@ services: location /ready { default_type 'text/plain'; rewrite_by_lua_block { - ngx.say('ready') + ngx.print('ready') + ngx.flush(true) ngx.exit(ngx.HTTP_OK) } } diff --git a/tests/core/badbehavior/ready.conf b/tests/core/badbehavior/ready.conf new file mode 100644 index 00000000..c2f800ac --- /dev/null +++ b/tests/core/badbehavior/ready.conf @@ -0,0 +1,8 @@ +location /ready { + default_type 'text/plain'; + rewrite_by_lua_block { + ngx.print('ready') + ngx.flush(true) + ngx.exit(ngx.HTTP_OK) + } +} \ No newline at end of file diff --git a/tests/core/badbehavior/test.sh b/tests/core/badbehavior/test.sh index c0f13328..88660d6e 100755 --- a/tests/core/badbehavior/test.sh +++ b/tests/core/badbehavior/test.sh @@ -36,6 +36,7 @@ else echo "BAD_BEHAVIOR_COUNT_TIME=60" | sudo tee -a /etc/bunkerweb/variables.env sudo touch /var/www/html/index.html export TEST_TYPE="linux" + sudo cp ready.conf /etc/bunkerweb/server-http fi manual=0 diff --git a/tests/core/blacklist/docker-compose.yml b/tests/core/blacklist/docker-compose.yml index de5193d4..f7c928c8 100644 --- a/tests/core/blacklist/docker-compose.yml +++ b/tests/core/blacklist/docker-compose.yml @@ -41,7 +41,8 @@ services: location /ready { default_type 'text/plain'; rewrite_by_lua_block { - ngx.say('ready') + ngx.print('ready') + ngx.flush(true) ngx.exit(ngx.HTTP_OK) } } diff --git a/tests/core/blacklist/ready.conf b/tests/core/blacklist/ready.conf new file mode 100644 index 00000000..c2f800ac --- /dev/null +++ b/tests/core/blacklist/ready.conf @@ -0,0 +1,8 @@ +location /ready { + default_type 'text/plain'; + rewrite_by_lua_block { + ngx.print('ready') + ngx.flush(true) + ngx.exit(ngx.HTTP_OK) + } +} \ No newline at end of file diff --git a/tests/core/blacklist/test.sh b/tests/core/blacklist/test.sh index 5a80f569..dba0cc37 100755 --- a/tests/core/blacklist/test.sh +++ b/tests/core/blacklist/test.sh @@ -65,6 +65,7 @@ else echo "BLACKLIST_IGNORE_URI_URLS=" | sudo tee -a /etc/bunkerweb/variables.env sudo touch /var/www/html/index.html export TEST_TYPE="linux" + sudo cp ready.conf /etc/bunkerweb/server-http fi manual=0 diff --git a/tests/core/brotli/docker-compose.yml b/tests/core/brotli/docker-compose.yml index d947d221..2a097f0f 100644 --- a/tests/core/brotli/docker-compose.yml +++ b/tests/core/brotli/docker-compose.yml @@ -22,7 +22,8 @@ services: location /ready { default_type 'text/plain'; rewrite_by_lua_block { - ngx.say('ready') + ngx.print('ready') + ngx.flush(true) ngx.exit(ngx.HTTP_OK) } } diff --git a/tests/core/brotli/ready.conf b/tests/core/brotli/ready.conf new file mode 100644 index 00000000..c2f800ac --- /dev/null +++ b/tests/core/brotli/ready.conf @@ -0,0 +1,8 @@ +location /ready { + default_type 'text/plain'; + rewrite_by_lua_block { + ngx.print('ready') + ngx.flush(true) + ngx.exit(ngx.HTTP_OK) + } +} \ No newline at end of file diff --git a/tests/core/brotli/test.sh b/tests/core/brotli/test.sh index ab39b2a6..c802de69 100755 --- a/tests/core/brotli/test.sh +++ b/tests/core/brotli/test.sh @@ -30,6 +30,7 @@ else sudo systemctl stop bunkerweb echo "USE_BROTLI=no" | sudo tee -a /etc/bunkerweb/variables.env sudo touch /var/www/html/index.html + sudo cp ready.conf /etc/bunkerweb/server-http fi manual=0 diff --git a/tests/core/bunkernet/docker-compose.yml b/tests/core/bunkernet/docker-compose.yml index ea6864bd..c4862474 100644 --- a/tests/core/bunkernet/docker-compose.yml +++ b/tests/core/bunkernet/docker-compose.yml @@ -21,7 +21,8 @@ services: location /ready { default_type 'text/plain'; rewrite_by_lua_block { - ngx.say('ready') + ngx.print('ready') + ngx.flush(true) ngx.exit(ngx.HTTP_OK) } } diff --git a/tests/core/bunkernet/ready.conf b/tests/core/bunkernet/ready.conf new file mode 100644 index 00000000..c2f800ac --- /dev/null +++ b/tests/core/bunkernet/ready.conf @@ -0,0 +1,8 @@ +location /ready { + default_type 'text/plain'; + rewrite_by_lua_block { + ngx.print('ready') + ngx.flush(true) + ngx.exit(ngx.HTTP_OK) + } +} \ No newline at end of file diff --git a/tests/core/bunkernet/test.sh b/tests/core/bunkernet/test.sh index d5677dc7..0bcc3800 100755 --- a/tests/core/bunkernet/test.sh +++ b/tests/core/bunkernet/test.sh @@ -46,6 +46,7 @@ else export BUNKERNET_SERVER="http://127.0.0.1:8080" sudo touch /var/www/html/index.html python3 api/main.py & + sudo cp ready.conf /etc/bunkerweb/server-http fi manual=0 diff --git a/tests/core/bwcli/docker-compose.yml b/tests/core/bwcli/docker-compose.yml index fbece59d..96ca5e39 100644 --- a/tests/core/bwcli/docker-compose.yml +++ b/tests/core/bwcli/docker-compose.yml @@ -19,7 +19,8 @@ services: location /ready { default_type 'text/plain'; rewrite_by_lua_block { - ngx.say('ready') + ngx.print('ready') + ngx.flush(true) ngx.exit(ngx.HTTP_OK) } } diff --git a/tests/core/bwcli/ready.conf b/tests/core/bwcli/ready.conf new file mode 100644 index 00000000..c2f800ac --- /dev/null +++ b/tests/core/bwcli/ready.conf @@ -0,0 +1,8 @@ +location /ready { + default_type 'text/plain'; + rewrite_by_lua_block { + ngx.print('ready') + ngx.flush(true) + ngx.exit(ngx.HTTP_OK) + } +} \ No newline at end of file diff --git a/tests/core/bwcli/test.sh b/tests/core/bwcli/test.sh index e05d2fb7..667b4382 100755 --- a/tests/core/bwcli/test.sh +++ b/tests/core/bwcli/test.sh @@ -45,6 +45,7 @@ else export USE_REDIS="yes" export REDIS_HOST="127.0.0.1" sudo touch /var/www/html/index.html + sudo cp ready.conf /etc/bunkerweb/server-http fi cleanup_stack () { diff --git a/tests/core/clientcache/docker-compose.yml b/tests/core/clientcache/docker-compose.yml index 88d2791f..49e6b62e 100644 --- a/tests/core/clientcache/docker-compose.yml +++ b/tests/core/clientcache/docker-compose.yml @@ -24,7 +24,8 @@ services: location /ready { default_type 'text/plain'; rewrite_by_lua_block { - ngx.say('ready') + ngx.print('ready') + ngx.flush(true) ngx.exit(ngx.HTTP_OK) } } diff --git a/tests/core/clientcache/ready.conf b/tests/core/clientcache/ready.conf new file mode 100644 index 00000000..c2f800ac --- /dev/null +++ b/tests/core/clientcache/ready.conf @@ -0,0 +1,8 @@ +location /ready { + default_type 'text/plain'; + rewrite_by_lua_block { + ngx.print('ready') + ngx.flush(true) + ngx.exit(ngx.HTTP_OK) + } +} \ No newline at end of file diff --git a/tests/core/clientcache/test.sh b/tests/core/clientcache/test.sh index 180fa114..4d47f9d4 100755 --- a/tests/core/clientcache/test.sh +++ b/tests/core/clientcache/test.sh @@ -34,6 +34,7 @@ else echo "CLIENT_CACHE_CONTROL=public, max-age=15552000" | sudo tee -a /etc/bunkerweb/variables.env sudo touch /var/www/html/index.html sudo cp image.png /var/www/html/image.png + sudo cp ready.conf /etc/bunkerweb/server-http fi manual=0 diff --git a/tests/core/cors/docker-compose.yml b/tests/core/cors/docker-compose.yml index fd0c3553..1ebbbea9 100644 --- a/tests/core/cors/docker-compose.yml +++ b/tests/core/cors/docker-compose.yml @@ -34,7 +34,8 @@ services: location /ready { default_type 'text/plain'; rewrite_by_lua_block { - ngx.say('ready') + ngx.print('ready') + ngx.flush(true) ngx.exit(ngx.HTTP_OK) } } diff --git a/tests/core/cors/ready.conf b/tests/core/cors/ready.conf new file mode 100644 index 00000000..c2f800ac --- /dev/null +++ b/tests/core/cors/ready.conf @@ -0,0 +1,8 @@ +location /ready { + default_type 'text/plain'; + rewrite_by_lua_block { + ngx.print('ready') + ngx.flush(true) + ngx.exit(ngx.HTTP_OK) + } +} \ No newline at end of file diff --git a/tests/core/cors/test.sh b/tests/core/cors/test.sh index 4d7daef7..7d1d7469 100755 --- a/tests/core/cors/test.sh +++ b/tests/core/cors/test.sh @@ -43,6 +43,7 @@ else echo "CORS_ALLOW_CREDENTIALS=no" | sudo tee -a /etc/bunkerweb/variables.env echo "CORS_ALLOW_METHODS=GET, POST, OPTIONS" | sudo tee -a /etc/bunkerweb/variables.env echo "CORS_ALLOW_HEADERS=DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range" | sudo tee -a /etc/bunkerweb/variables.env + sudo cp ready.conf /etc/bunkerweb/server-http fi manual=0 diff --git a/tests/core/country/docker-compose.yml b/tests/core/country/docker-compose.yml index c376eee0..53587484 100644 --- a/tests/core/country/docker-compose.yml +++ b/tests/core/country/docker-compose.yml @@ -22,7 +22,8 @@ services: location /ready { default_type 'text/plain'; rewrite_by_lua_block { - ngx.say('ready') + ngx.print('ready') + ngx.flush(true) ngx.exit(ngx.HTTP_OK) } } diff --git a/tests/core/country/ready.conf b/tests/core/country/ready.conf new file mode 100644 index 00000000..c2f800ac --- /dev/null +++ b/tests/core/country/ready.conf @@ -0,0 +1,8 @@ +location /ready { + default_type 'text/plain'; + rewrite_by_lua_block { + ngx.print('ready') + ngx.flush(true) + ngx.exit(ngx.HTTP_OK) + } +} \ No newline at end of file diff --git a/tests/core/country/test.sh b/tests/core/country/test.sh index 96562189..f3b5076b 100755 --- a/tests/core/country/test.sh +++ b/tests/core/country/test.sh @@ -36,6 +36,7 @@ else sudo touch /var/www/html/index.html export COUNTRY="" export TEST_TYPE="linux" + sudo cp ready.conf /etc/bunkerweb/server-http fi manual=0 diff --git a/tests/core/customcert/docker-compose.yml b/tests/core/customcert/docker-compose.yml index d389fbcb..0438fc82 100644 --- a/tests/core/customcert/docker-compose.yml +++ b/tests/core/customcert/docker-compose.yml @@ -24,7 +24,8 @@ services: location /ready { default_type 'text/plain'; rewrite_by_lua_block { - ngx.say('ready') + ngx.print('ready') + ngx.flush(true) ngx.exit(ngx.HTTP_OK) } } diff --git a/tests/core/customcert/ready.conf b/tests/core/customcert/ready.conf new file mode 100644 index 00000000..c2f800ac --- /dev/null +++ b/tests/core/customcert/ready.conf @@ -0,0 +1,8 @@ +location /ready { + default_type 'text/plain'; + rewrite_by_lua_block { + ngx.print('ready') + ngx.flush(true) + ngx.exit(ngx.HTTP_OK) + } +} \ No newline at end of file diff --git a/tests/core/customcert/test.sh b/tests/core/customcert/test.sh index a392613f..d65c74a4 100755 --- a/tests/core/customcert/test.sh +++ b/tests/core/customcert/test.sh @@ -32,6 +32,7 @@ else echo "CUSTOM_SSL_CERT=/tmp/certificate.pem" | sudo tee -a /etc/bunkerweb/variables.env echo "CUSTOM_SSL_KEY=/tmp/privatekey.key" | sudo tee -a /etc/bunkerweb/variables.env sudo touch /var/www/html/index.html + sudo cp ready.conf /etc/bunkerweb/server-http fi manual=0 diff --git a/tests/core/db/docker-compose.yml b/tests/core/db/docker-compose.yml index 312d59fc..76b14161 100644 --- a/tests/core/db/docker-compose.yml +++ b/tests/core/db/docker-compose.yml @@ -22,7 +22,8 @@ services: location /ready { default_type 'text/plain'; rewrite_by_lua_block { - ngx.say('ready') + ngx.print('ready') + ngx.flush(true) ngx.exit(ngx.HTTP_OK) } } diff --git a/tests/core/db/ready.conf b/tests/core/db/ready.conf new file mode 100644 index 00000000..c2f800ac --- /dev/null +++ b/tests/core/db/ready.conf @@ -0,0 +1,8 @@ +location /ready { + default_type 'text/plain'; + rewrite_by_lua_block { + ngx.print('ready') + ngx.flush(true) + ngx.exit(ngx.HTTP_OK) + } +} \ No newline at end of file diff --git a/tests/core/db/test.sh b/tests/core/db/test.sh index 9fcb5ebc..347fd019 100755 --- a/tests/core/db/test.sh +++ b/tests/core/db/test.sh @@ -64,6 +64,7 @@ else export GLOBAL_REVERSE_PROXY_HOST="http://app1:8080" export GLOBAL_REVERSE_PROXY_URL="/" export CUSTOM_CONF_MODSEC_test_custom_conf='SecRule REQUEST_FILENAME "@rx ^/db" "id:10000,ctl:ruleRemoveByTag=attack-generic,ctl:ruleRemoveByTag=attack-protocol,nolog"' + sudo cp ready.conf /etc/bunkerweb/server-http fi manual=0 diff --git a/tests/core/dnsbl/docker-compose.yml b/tests/core/dnsbl/docker-compose.yml index 5f24b785..c4d9b38d 100644 --- a/tests/core/dnsbl/docker-compose.yml +++ b/tests/core/dnsbl/docker-compose.yml @@ -22,7 +22,8 @@ services: location /ready { default_type 'text/plain'; rewrite_by_lua_block { - ngx.say('ready') + ngx.print('ready') + ngx.flush(true) ngx.exit(ngx.HTTP_OK) } } diff --git a/tests/core/dnsbl/ready.conf b/tests/core/dnsbl/ready.conf new file mode 100644 index 00000000..c2f800ac --- /dev/null +++ b/tests/core/dnsbl/ready.conf @@ -0,0 +1,8 @@ +location /ready { + default_type 'text/plain'; + rewrite_by_lua_block { + ngx.print('ready') + ngx.flush(true) + ngx.exit(ngx.HTTP_OK) + } +} \ No newline at end of file diff --git a/tests/core/dnsbl/test.sh b/tests/core/dnsbl/test.sh index 4792b318..641d18e3 100755 --- a/tests/core/dnsbl/test.sh +++ b/tests/core/dnsbl/test.sh @@ -36,6 +36,7 @@ else echo "DNSBL_LIST=" | sudo tee -a /etc/bunkerweb/variables.env sudo touch /var/www/html/index.html export TEST_TYPE="linux" + sudo cp ready.conf /etc/bunkerweb/server-http fi manual=0 diff --git a/tests/core/errors/docker-compose.yml b/tests/core/errors/docker-compose.yml index 5e4fb28c..48070e92 100644 --- a/tests/core/errors/docker-compose.yml +++ b/tests/core/errors/docker-compose.yml @@ -23,7 +23,8 @@ services: location /ready { default_type 'text/plain'; rewrite_by_lua_block { - ngx.say('ready') + ngx.print('ready') + ngx.flush(true) ngx.exit(ngx.HTTP_OK) } } diff --git a/tests/core/errors/ready.conf b/tests/core/errors/ready.conf new file mode 100644 index 00000000..c2f800ac --- /dev/null +++ b/tests/core/errors/ready.conf @@ -0,0 +1,8 @@ +location /ready { + default_type 'text/plain'; + rewrite_by_lua_block { + ngx.print('ready') + ngx.flush(true) + ngx.exit(ngx.HTTP_OK) + } +} \ No newline at end of file diff --git a/tests/core/errors/test.sh b/tests/core/errors/test.sh index 6e4bda88..44d63313 100755 --- a/tests/core/errors/test.sh +++ b/tests/core/errors/test.sh @@ -33,6 +33,7 @@ else sudo touch /var/www/html/index.html sudo mkdir -p /var/www/html/errors sudo cp "403.html" "/var/www/html/errors/403.html" + sudo cp ready.conf /etc/bunkerweb/server-http fi manual=0 diff --git a/tests/core/greylist/docker-compose.yml b/tests/core/greylist/docker-compose.yml index 480fb2b8..1cd2d430 100644 --- a/tests/core/greylist/docker-compose.yml +++ b/tests/core/greylist/docker-compose.yml @@ -31,7 +31,8 @@ services: location /ready { default_type 'text/plain'; rewrite_by_lua_block { - ngx.say('ready') + ngx.print('ready') + ngx.flush(true) ngx.exit(ngx.HTTP_OK) } } diff --git a/tests/core/greylist/ready.conf b/tests/core/greylist/ready.conf new file mode 100644 index 00000000..c2f800ac --- /dev/null +++ b/tests/core/greylist/ready.conf @@ -0,0 +1,8 @@ +location /ready { + default_type 'text/plain'; + rewrite_by_lua_block { + ngx.print('ready') + ngx.flush(true) + ngx.exit(ngx.HTTP_OK) + } +} \ No newline at end of file diff --git a/tests/core/greylist/test.sh b/tests/core/greylist/test.sh index 3119b1b6..53d69a2f 100755 --- a/tests/core/greylist/test.sh +++ b/tests/core/greylist/test.sh @@ -55,6 +55,7 @@ else echo "GREYLIST_URI_URLS=" | sudo tee -a /etc/bunkerweb/variables.env sudo touch /var/www/html/index.html export TEST_TYPE="linux" + sudo cp ready.conf /etc/bunkerweb/server-http fi manual=0 diff --git a/tests/core/gzip/docker-compose.yml b/tests/core/gzip/docker-compose.yml index 5110186f..1287d13c 100644 --- a/tests/core/gzip/docker-compose.yml +++ b/tests/core/gzip/docker-compose.yml @@ -4,6 +4,8 @@ services: bw: image: bunkerity/bunkerweb:1.5.3 pull_policy: never + ports: + - 80:8080 labels: - "bunkerweb.INSTANCE=yes" environment: @@ -22,7 +24,8 @@ services: location /ready { default_type 'text/plain'; rewrite_by_lua_block { - ngx.say('ready') + ngx.print('ready') + ngx.flush(true) ngx.exit(ngx.HTTP_OK) } } diff --git a/tests/core/gzip/ready.conf b/tests/core/gzip/ready.conf new file mode 100644 index 00000000..c2f800ac --- /dev/null +++ b/tests/core/gzip/ready.conf @@ -0,0 +1,8 @@ +location /ready { + default_type 'text/plain'; + rewrite_by_lua_block { + ngx.print('ready') + ngx.flush(true) + ngx.exit(ngx.HTTP_OK) + } +} \ No newline at end of file diff --git a/tests/core/gzip/test.sh b/tests/core/gzip/test.sh index e5cf9008..f98d6b9a 100755 --- a/tests/core/gzip/test.sh +++ b/tests/core/gzip/test.sh @@ -30,6 +30,7 @@ else sudo systemctl stop bunkerweb echo "USE_GZIP=no" | sudo tee -a /etc/bunkerweb/variables.env sudo touch /var/www/html/index.html + sudo cp ready.conf /etc/bunkerweb/server-http fi manual=0 diff --git a/tests/core/headers/docker-compose.yml b/tests/core/headers/docker-compose.yml index 132fc148..c81ff90e 100644 --- a/tests/core/headers/docker-compose.yml +++ b/tests/core/headers/docker-compose.yml @@ -36,7 +36,8 @@ services: location /ready { default_type 'text/plain'; rewrite_by_lua_block { - ngx.say('ready') + ngx.print('ready') + ngx.flush(true) ngx.exit(ngx.HTTP_OK) } } diff --git a/tests/core/headers/ready.conf b/tests/core/headers/ready.conf new file mode 100644 index 00000000..c2f800ac --- /dev/null +++ b/tests/core/headers/ready.conf @@ -0,0 +1,8 @@ +location /ready { + default_type 'text/plain'; + rewrite_by_lua_block { + ngx.print('ready') + ngx.flush(true) + ngx.exit(ngx.HTTP_OK) + } +} \ No newline at end of file diff --git a/tests/core/headers/test.sh b/tests/core/headers/test.sh index 698ee476..cebd6680 100755 --- a/tests/core/headers/test.sh +++ b/tests/core/headers/test.sh @@ -48,6 +48,7 @@ else echo "X_FRAME_OPTIONS=SAMEORIGIN" | sudo tee -a /etc/bunkerweb/variables.env echo "X_CONTENT_TYPE_OPTIONS=nosniff" | sudo tee -a /etc/bunkerweb/variables.env echo "X_XSS_PROTECTION=1; mode=block" | sudo tee -a /etc/bunkerweb/variables.env + sudo cp ready.conf /etc/bunkerweb/server-http fi manual=0 diff --git a/tests/core/inject/docker-compose.yml b/tests/core/inject/docker-compose.yml index b0a15d92..e45fb966 100644 --- a/tests/core/inject/docker-compose.yml +++ b/tests/core/inject/docker-compose.yml @@ -21,7 +21,8 @@ services: location /ready { default_type 'text/plain'; rewrite_by_lua_block { - ngx.say('ready') + ngx.print('ready') + ngx.flush(true) ngx.exit(ngx.HTTP_OK) } } diff --git a/tests/core/inject/ready.conf b/tests/core/inject/ready.conf new file mode 100644 index 00000000..c2f800ac --- /dev/null +++ b/tests/core/inject/ready.conf @@ -0,0 +1,8 @@ +location /ready { + default_type 'text/plain'; + rewrite_by_lua_block { + ngx.print('ready') + ngx.flush(true) + ngx.exit(ngx.HTTP_OK) + } +} \ No newline at end of file diff --git a/tests/core/inject/test.sh b/tests/core/inject/test.sh index 381826ff..fd6aa076 100755 --- a/tests/core/inject/test.sh +++ b/tests/core/inject/test.sh @@ -30,6 +30,7 @@ else sudo systemctl stop bunkerweb echo "INJECT_BODY=TEST" | sudo tee -a /etc/bunkerweb/variables.env sudo cp index.html /var/www/html/index.html + sudo cp ready.conf /etc/bunkerweb/server-http fi cleanup_stack () { diff --git a/tests/core/limit/docker-compose.yml b/tests/core/limit/docker-compose.yml index 26565a12..3f3e7c09 100644 --- a/tests/core/limit/docker-compose.yml +++ b/tests/core/limit/docker-compose.yml @@ -26,7 +26,8 @@ services: location /ready { default_type 'text/plain'; rewrite_by_lua_block { - ngx.say('ready') + ngx.print('ready') + ngx.flush(true) ngx.exit(ngx.HTTP_OK) } } diff --git a/tests/core/limit/ready.conf b/tests/core/limit/ready.conf new file mode 100644 index 00000000..c2f800ac --- /dev/null +++ b/tests/core/limit/ready.conf @@ -0,0 +1,8 @@ +location /ready { + default_type 'text/plain'; + rewrite_by_lua_block { + ngx.print('ready') + ngx.flush(true) + ngx.exit(ngx.HTTP_OK) + } +} \ No newline at end of file diff --git a/tests/core/limit/test.sh b/tests/core/limit/test.sh index 12f33cab..35219c29 100755 --- a/tests/core/limit/test.sh +++ b/tests/core/limit/test.sh @@ -35,6 +35,7 @@ else echo "USE_LIMIT_CONN=yes" | sudo tee -a /etc/bunkerweb/variables.env echo "LIMIT_CONN_MAX_HTTP1=1" | sudo tee -a /etc/bunkerweb/variables.env sudo touch /var/www/html/index.html + sudo cp ready.conf /etc/bunkerweb/server-http fi manual=0 diff --git a/tests/core/misc/docker-compose.yml b/tests/core/misc/docker-compose.yml index e447b420..8522af23 100644 --- a/tests/core/misc/docker-compose.yml +++ b/tests/core/misc/docker-compose.yml @@ -33,7 +33,8 @@ services: location /ready { default_type 'text/plain'; rewrite_by_lua_block { - ngx.say('ready') + ngx.print('ready') + ngx.flush(true) ngx.exit(ngx.HTTP_OK) } } diff --git a/tests/core/misc/ready.conf b/tests/core/misc/ready.conf new file mode 100644 index 00000000..c2f800ac --- /dev/null +++ b/tests/core/misc/ready.conf @@ -0,0 +1,8 @@ +location /ready { + default_type 'text/plain'; + rewrite_by_lua_block { + ngx.print('ready') + ngx.flush(true) + ngx.exit(ngx.HTTP_OK) + } +} \ No newline at end of file diff --git a/tests/core/misc/test.sh b/tests/core/misc/test.sh index d10a6d0f..912b8de8 100755 --- a/tests/core/misc/test.sh +++ b/tests/core/misc/test.sh @@ -43,6 +43,7 @@ else echo "DENY_HTTP_STATUS=403" | sudo tee -a /etc/bunkerweb/variables.env sudo touch /var/www/html/index.html export TEST_TYPE="linux" + sudo cp ready.conf /etc/bunkerweb/server-http fi manual=0 diff --git a/tests/core/modsecurity/docker-compose.yml b/tests/core/modsecurity/docker-compose.yml index f945f789..32f38a06 100644 --- a/tests/core/modsecurity/docker-compose.yml +++ b/tests/core/modsecurity/docker-compose.yml @@ -25,7 +25,8 @@ services: location /ready { default_type 'text/plain'; rewrite_by_lua_block { - ngx.say('ready') + ngx.print('ready') + ngx.flush(true) ngx.exit(ngx.HTTP_OK) } } diff --git a/tests/core/modsecurity/ready.conf b/tests/core/modsecurity/ready.conf new file mode 100644 index 00000000..c2f800ac --- /dev/null +++ b/tests/core/modsecurity/ready.conf @@ -0,0 +1,8 @@ +location /ready { + default_type 'text/plain'; + rewrite_by_lua_block { + ngx.print('ready') + ngx.flush(true) + ngx.exit(ngx.HTTP_OK) + } +} \ No newline at end of file diff --git a/tests/core/modsecurity/test.sh b/tests/core/modsecurity/test.sh index 86f26a6b..a3175fee 100755 --- a/tests/core/modsecurity/test.sh +++ b/tests/core/modsecurity/test.sh @@ -34,6 +34,7 @@ else echo "MODSECURITY_SEC_RULE_ENGINE=On" | sudo tee -a /etc/bunkerweb/variables.env echo "MODSECURITY_SEC_AUDIT_LOG_PARTS=ABCFHZ" | sudo tee -a /etc/bunkerweb/variables.env sudo touch /var/www/html/index.html + sudo cp ready.conf /etc/bunkerweb/server-http fi manual=0 diff --git a/tests/core/redirect/docker-compose.yml b/tests/core/redirect/docker-compose.yml index a16f660d..53a433c4 100644 --- a/tests/core/redirect/docker-compose.yml +++ b/tests/core/redirect/docker-compose.yml @@ -22,7 +22,8 @@ services: location /ready { default_type 'text/plain'; rewrite_by_lua_block { - ngx.say('ready') + ngx.print('ready') + ngx.flush(true) ngx.exit(ngx.HTTP_OK) } } diff --git a/tests/core/redirect/ready.conf b/tests/core/redirect/ready.conf new file mode 100644 index 00000000..c2f800ac --- /dev/null +++ b/tests/core/redirect/ready.conf @@ -0,0 +1,8 @@ +location /ready { + default_type 'text/plain'; + rewrite_by_lua_block { + ngx.print('ready') + ngx.flush(true) + ngx.exit(ngx.HTTP_OK) + } +} \ No newline at end of file diff --git a/tests/core/redirect/test.sh b/tests/core/redirect/test.sh index 14770f07..de7f3360 100755 --- a/tests/core/redirect/test.sh +++ b/tests/core/redirect/test.sh @@ -31,6 +31,7 @@ else echo "REDIRECT_TO=" | sudo tee -a /etc/bunkerweb/variables.env echo "REDIRECT_TO_REQUEST_URI=no" | sudo tee -a /etc/bunkerweb/variables.env sudo touch /var/www/html/index.html + sudo cp ready.conf /etc/bunkerweb/server-http fi manual=0 diff --git a/tests/core/redis/docker-compose.yml b/tests/core/redis/docker-compose.yml index 30a3c011..349873ce 100644 --- a/tests/core/redis/docker-compose.yml +++ b/tests/core/redis/docker-compose.yml @@ -33,7 +33,8 @@ services: location /ready { default_type 'text/plain'; rewrite_by_lua_block { - ngx.say('ready') + ngx.print('ready') + ngx.flush(true) ngx.exit(ngx.HTTP_OK) } } diff --git a/tests/core/redis/ready.conf b/tests/core/redis/ready.conf new file mode 100644 index 00000000..c2f800ac --- /dev/null +++ b/tests/core/redis/ready.conf @@ -0,0 +1,8 @@ +location /ready { + default_type 'text/plain'; + rewrite_by_lua_block { + ngx.print('ready') + ngx.flush(true) + ngx.exit(ngx.HTTP_OK) + } +} \ No newline at end of file diff --git a/tests/core/redis/test.sh b/tests/core/redis/test.sh index 12d2abd7..4208c3c6 100755 --- a/tests/core/redis/test.sh +++ b/tests/core/redis/test.sh @@ -83,6 +83,7 @@ else echo "REDIS_SSL=no" | sudo tee -a /etc/bunkerweb/variables.env sudo touch /var/www/html/index.html export TEST_TYPE="linux" + sudo cp ready.conf /etc/bunkerweb/server-http fi manual=0 diff --git a/tests/core/reversescan/docker-compose.yml b/tests/core/reversescan/docker-compose.yml index 13db942e..53cb8ae2 100644 --- a/tests/core/reversescan/docker-compose.yml +++ b/tests/core/reversescan/docker-compose.yml @@ -23,7 +23,8 @@ services: location /ready { default_type 'text/plain'; rewrite_by_lua_block { - ngx.say('ready') + ngx.print('ready') + ngx.flush(true) ngx.exit(ngx.HTTP_OK) } } diff --git a/tests/core/reversescan/ready.conf b/tests/core/reversescan/ready.conf new file mode 100644 index 00000000..c2f800ac --- /dev/null +++ b/tests/core/reversescan/ready.conf @@ -0,0 +1,8 @@ +location /ready { + default_type 'text/plain'; + rewrite_by_lua_block { + ngx.print('ready') + ngx.flush(true) + ngx.exit(ngx.HTTP_OK) + } +} \ No newline at end of file diff --git a/tests/core/reversescan/test.sh b/tests/core/reversescan/test.sh index d06ec176..9f43bd0e 100755 --- a/tests/core/reversescan/test.sh +++ b/tests/core/reversescan/test.sh @@ -33,6 +33,7 @@ else echo "REVERSE_SCAN_TIMEOUT=500" | sudo tee -a /etc/bunkerweb/variables.env sudo touch /var/www/html/index.html export TEST_TYPE="linux" + sudo cp ready.conf /etc/bunkerweb/server-http fi manual=0 diff --git a/tests/core/selfsigned/docker-compose.yml b/tests/core/selfsigned/docker-compose.yml index 3d97e896..ec5846ec 100644 --- a/tests/core/selfsigned/docker-compose.yml +++ b/tests/core/selfsigned/docker-compose.yml @@ -24,7 +24,8 @@ services: location /ready { default_type 'text/plain'; rewrite_by_lua_block { - ngx.say('ready') + ngx.print('ready') + ngx.flush(true) ngx.exit(ngx.HTTP_OK) } } diff --git a/tests/core/selfsigned/ready.conf b/tests/core/selfsigned/ready.conf new file mode 100644 index 00000000..c2f800ac --- /dev/null +++ b/tests/core/selfsigned/ready.conf @@ -0,0 +1,8 @@ +location /ready { + default_type 'text/plain'; + rewrite_by_lua_block { + ngx.print('ready') + ngx.flush(true) + ngx.exit(ngx.HTTP_OK) + } +} \ No newline at end of file diff --git a/tests/core/selfsigned/test.sh b/tests/core/selfsigned/test.sh index 3d341d66..e4dd95e8 100755 --- a/tests/core/selfsigned/test.sh +++ b/tests/core/selfsigned/test.sh @@ -32,6 +32,7 @@ else echo "SELF_SIGNED_SSL_EXPIRY=365" | sudo tee -a /etc/bunkerweb/variables.env echo "SELF_SIGNED_SSL_SUBJ=/CN=www.example.com/" | sudo tee -a /etc/bunkerweb/variables.env sudo touch /var/www/html/index.html + sudo cp ready.conf /etc/bunkerweb/server-http fi manual=0 diff --git a/tests/core/sessions/docker-compose.yml b/tests/core/sessions/docker-compose.yml index 683471d6..45c728b4 100644 --- a/tests/core/sessions/docker-compose.yml +++ b/tests/core/sessions/docker-compose.yml @@ -23,7 +23,8 @@ services: location /ready { default_type 'text/plain'; rewrite_by_lua_block { - ngx.say('ready') + ngx.print('ready') + ngx.flush(true) ngx.exit(ngx.HTTP_OK) } } diff --git a/tests/core/sessions/ready.conf b/tests/core/sessions/ready.conf new file mode 100644 index 00000000..c2f800ac --- /dev/null +++ b/tests/core/sessions/ready.conf @@ -0,0 +1,8 @@ +location /ready { + default_type 'text/plain'; + rewrite_by_lua_block { + ngx.print('ready') + ngx.flush(true) + ngx.exit(ngx.HTTP_OK) + } +} \ No newline at end of file diff --git a/tests/core/sessions/test.sh b/tests/core/sessions/test.sh index 45371616..7b2bc335 100755 --- a/tests/core/sessions/test.sh +++ b/tests/core/sessions/test.sh @@ -33,6 +33,7 @@ else echo "SESSIONS_NAME=random" | sudo tee -a /etc/bunkerweb/variables.env sudo touch /var/www/html/index.html export TEST_TYPE="linux" + sudo cp ready.conf /etc/bunkerweb/server-http fi manual=0 diff --git a/tests/core/whitelist/docker-compose.yml b/tests/core/whitelist/docker-compose.yml index b551ad39..ffad549c 100644 --- a/tests/core/whitelist/docker-compose.yml +++ b/tests/core/whitelist/docker-compose.yml @@ -34,7 +34,8 @@ services: location /ready { default_type 'text/plain'; rewrite_by_lua_block { - ngx.say('ready') + ngx.print('ready') + ngx.flush(true) ngx.exit(ngx.HTTP_OK) } } diff --git a/tests/core/whitelist/ready.conf b/tests/core/whitelist/ready.conf new file mode 100644 index 00000000..c2f800ac --- /dev/null +++ b/tests/core/whitelist/ready.conf @@ -0,0 +1,8 @@ +location /ready { + default_type 'text/plain'; + rewrite_by_lua_block { + ngx.print('ready') + ngx.flush(true) + ngx.exit(ngx.HTTP_OK) + } +} \ No newline at end of file diff --git a/tests/core/whitelist/test.sh b/tests/core/whitelist/test.sh index 9997eead..26612748 100755 --- a/tests/core/whitelist/test.sh +++ b/tests/core/whitelist/test.sh @@ -58,6 +58,7 @@ else echo "WHITELIST_URI_URLS=" | sudo tee -a /etc/bunkerweb/variables.env sudo touch /var/www/html/index.html export TEST_TYPE="linux" + sudo cp ready.conf /etc/bunkerweb/server-http fi manual=0