ci/cd - trying to fix race condition for core tests

This commit is contained in:
fl0ppy-d1sk 2023-10-26 13:49:44 +02:00
parent ed0e156bcb
commit 274a8cdfb9
No known key found for this signature in database
GPG Key ID: 93EE47CC3D061500
48 changed files with 297 additions and 44 deletions

View File

@ -19,6 +19,14 @@ services:
# ? ANTIBOT settings # ? ANTIBOT settings
USE_ANTIBOT: "no" USE_ANTIBOT: "no"
ANTIBOT_URI: "/challenge" ANTIBOT_URI: "/challenge"
CUSTOM_CONF_SERVER_HTTP_ready: |
location /ready {
default_type 'text/plain';
rewrite_by_lua_block {
ngx.say('ready')
ngx.exit(ngx.OK)
}
}
networks: networks:
bw-universe: bw-universe:
bw-services: bw-services:

View File

@ -14,13 +14,15 @@ try:
retries = 0 retries = 0
while not ready: while not ready:
with suppress(RequestException): with suppress(RequestException):
status_code = get("http://www.example.com", headers={"Host": "www.example.com"}).status_code resp = get("http://www.example.com/ready", headers={"Host": "www.example.com"})
status_code = resp.status_code
text = resp.text
if status_code >= 500: if resp.status_code >= 500:
print("❌ An error occurred with the server, exiting ...", flush=True) print("❌ An error occurred with the server, exiting ...", flush=True)
exit(1) exit(1)
ready = status_code < 400 ready = status_code < 400 and text == "ready"
if retries > 10: if retries > 10:
print("❌ The service took too long to be ready, exiting ...", flush=True) print("❌ The service took too long to be ready, exiting ...", flush=True)

View File

@ -21,6 +21,14 @@ services:
AUTH_BASIC_LOCATION: "sitewide" AUTH_BASIC_LOCATION: "sitewide"
AUTH_BASIC_USER: "bunkerity" AUTH_BASIC_USER: "bunkerity"
AUTH_BASIC_PASSWORD: "Secr3tP@ssw0rd" AUTH_BASIC_PASSWORD: "Secr3tP@ssw0rd"
CUSTOM_CONF_SERVER_HTTP_ready: |
location /ready {
default_type 'text/plain';
rewrite_by_lua_block {
ngx.say('ready')
ngx.exit(ngx.HTTP_OK)
}
}
networks: networks:
bw-universe: bw-universe:
bw-services: bw-services:

View File

@ -14,13 +14,15 @@ try:
retries = 0 retries = 0
while not ready: while not ready:
with suppress(RequestException): with suppress(RequestException):
status_code = get("http://www.example.com", headers={"Host": "www.example.com"}).status_code resp = get("http://www.example.com/ready", headers={"Host": "www.example.com"})
status_code = resp.status_code
text = resp.text
if status_code >= 500: if status_code >= 500:
print("❌ An error occurred with the server, exiting ...", flush=True) print("❌ An error occurred with the server, exiting ...", flush=True)
exit(1) exit(1)
ready = status_code <= 401 ready = status_code <= 401 and text == "ready"
if retries > 10: if retries > 10:
print("❌ The service took too long to be ready, exiting ...", flush=True) print("❌ The service took too long to be ready, exiting ...", flush=True)

View File

@ -21,6 +21,14 @@ services:
BAD_BEHAVIOR_BAN_TIME: "86400" BAD_BEHAVIOR_BAN_TIME: "86400"
BAD_BEHAVIOR_THRESHOLD: "10" BAD_BEHAVIOR_THRESHOLD: "10"
BAD_BEHAVIOR_COUNT_TIME: "60" BAD_BEHAVIOR_COUNT_TIME: "60"
CUSTOM_CONF_SERVER_HTTP_ready: |
location /ready {
default_type 'text/plain';
rewrite_by_lua_block {
ngx.say('ready')
ngx.exit(ngx.HTTP_OK)
}
}
networks: networks:
bw-universe: bw-universe:
bw-services: bw-services:

View File

@ -0,0 +1 @@
ready

View File

@ -13,13 +13,15 @@ try:
retries = 0 retries = 0
while not ready: while not ready:
with suppress(RequestException): with suppress(RequestException):
status_code = get("http://www.example.com", headers={"Host": "www.example.com"}).status_code resp = get("http://www.example.com/ready", headers={"Host": "www.example.com"})
status_code = resp.status_code
text = resp.text
if status_code >= 500: if status_code >= 500:
print("❌ An error occurred with the server, exiting ...", flush=True) print("❌ An error occurred with the server, exiting ...", flush=True)
exit(1) exit(1)
ready = status_code < 400 ready = status_code < 400 and text == "ready"
if retries > 10: if retries > 10:
print("❌ The service took too long to be ready, exiting ...", flush=True) print("❌ The service took too long to be ready, exiting ...", flush=True)

View File

@ -37,6 +37,14 @@ services:
BLACKLIST_IGNORE_USER_AGENT_URLS: "" BLACKLIST_IGNORE_USER_AGENT_URLS: ""
BLACKLIST_IGNORE_URI: "" BLACKLIST_IGNORE_URI: ""
BLACKLIST_IGNORE_URI_URLS: "" BLACKLIST_IGNORE_URI_URLS: ""
CUSTOM_CONF_SERVER_HTTP_ready: |
location /ready {
default_type 'text/plain';
rewrite_by_lua_block {
ngx.say('ready')
ngx.exit(ngx.HTTP_OK)
}
}
networks: networks:
bw-universe: bw-universe:
bw-services: bw-services:

View File

@ -10,13 +10,15 @@ try:
retries = 0 retries = 0
while not ready: while not ready:
with suppress(RequestException): with suppress(RequestException):
status_code = get("http://www.example.com", headers={"Host": "www.example.com"}).status_code resp = get("http://www.example.com/ready", headers={"Host": "www.example.com"})
status_code = resp.status_code
text = resp.text
if status_code >= 500: if status_code >= 500:
print("❌ An error occurred with the server, exiting ...", flush=True) print("❌ An error occurred with the server, exiting ...", flush=True)
exit(1) exit(1)
ready = status_code < 400 or status_code == 403 ready = status_code < 400 or status_code == 403 and text == "ready"
if retries > 10: if retries > 10:
print("❌ The service took too long to be ready, exiting ...", flush=True) print("❌ The service took too long to be ready, exiting ...", flush=True)

View File

@ -18,6 +18,14 @@ services:
# ? BROTLI settings # ? BROTLI settings
USE_BROTLI: "no" USE_BROTLI: "no"
CUSTOM_CONF_SERVER_HTTP_ready: |
location /ready {
default_type 'text/plain';
rewrite_by_lua_block {
ngx.say('ready')
ngx.exit(ngx.HTTP_OK)
}
}
networks: networks:
bw-universe: bw-universe:
bw-services: bw-services:

View File

@ -10,13 +10,15 @@ try:
retries = 0 retries = 0
while not ready: while not ready:
with suppress(RequestException): with suppress(RequestException):
status_code = get("http://www.example.com", headers={"Host": "www.example.com"}).status_code resp = get("http://www.example.com/ready", headers={"Host": "www.example.com"})
status_code = resp.status_code
text = resp.text
if status_code >= 500: if status_code >= 500:
print("❌ An error occurred with the server, exiting ...", flush=True) print("❌ An error occurred with the server, exiting ...", flush=True)
exit(1) exit(1)
ready = status_code < 400 ready = status_code < 400 and text == "ready"
if retries > 10: if retries > 10:
print("❌ The service took too long to be ready, exiting ...", flush=True) print("❌ The service took too long to be ready, exiting ...", flush=True)

View File

@ -17,6 +17,14 @@ services:
# ? BUNKERNET settings # ? BUNKERNET settings
USE_BUNKERNET: "yes" USE_BUNKERNET: "yes"
BUNKERNET_SERVER: "http://bunkernet-api:8080" BUNKERNET_SERVER: "http://bunkernet-api:8080"
CUSTOM_CONF_SERVER_HTTP_ready: |
location /ready {
default_type 'text/plain';
rewrite_by_lua_block {
ngx.say('ready')
ngx.exit(ngx.HTTP_OK)
}
}
networks: networks:
bw-universe: bw-universe:
bw-services: bw-services:

View File

@ -10,13 +10,15 @@ try:
retries = 0 retries = 0
while not ready: while not ready:
with suppress(RequestException): with suppress(RequestException):
status_code = get("http://www.example.com", headers={"Host": "www.example.com"}).status_code resp = get("http://www.example.com/ready", headers={"Host": "www.example.com"})
status_code = resp.status_code
text = resp.text
if status_code >= 500: if status_code >= 500:
print("❌ An error occurred with the server, exiting ...", flush=True) print("❌ An error occurred with the server, exiting ...", flush=True)
exit(1) exit(1)
ready = status_code < 400 ready = status_code < 400 and text == "ready"
if retries > 10: if retries > 10:
print("❌ The service took too long to be ready, exiting ...", flush=True) print("❌ The service took too long to be ready, exiting ...", flush=True)

View File

@ -15,6 +15,14 @@ services:
LOG_LEVEL: "info" LOG_LEVEL: "info"
USE_REDIS: "yes" USE_REDIS: "yes"
REDIS_HOST: "bw-redis" REDIS_HOST: "bw-redis"
CUSTOM_CONF_SERVER_HTTP_ready: |
location /ready {
default_type 'text/plain';
rewrite_by_lua_block {
ngx.say('ready')
ngx.exit(ngx.HTTP_OK)
}
}
networks: networks:
- bw-universe - bw-universe

View File

@ -20,6 +20,14 @@ services:
CLIENT_CACHE_EXTENSIONS: "jpg|jpeg|png|bmp|ico|svg|tif|css|js|otf|ttf|eot|woff|woff2" CLIENT_CACHE_EXTENSIONS: "jpg|jpeg|png|bmp|ico|svg|tif|css|js|otf|ttf|eot|woff|woff2"
CLIENT_CACHE_ETAG: "yes" CLIENT_CACHE_ETAG: "yes"
CLIENT_CACHE_CONTROL: "public, max-age=15552000" CLIENT_CACHE_CONTROL: "public, max-age=15552000"
CUSTOM_CONF_SERVER_HTTP_ready: |
location /ready {
default_type 'text/plain';
rewrite_by_lua_block {
ngx.say('ready')
ngx.exit(ngx.HTTP_OK)
}
}
networks: networks:
bw-universe: bw-universe:
bw-services: bw-services:

View File

@ -10,13 +10,15 @@ try:
retries = 0 retries = 0
while not ready: while not ready:
with suppress(RequestException): with suppress(RequestException):
status_code = get("http://www.example.com/image.png", headers={"Host": "www.example.com"}).status_code resp = get("http://www.example.com/ready", headers={"Host": "www.example.com"})
status_code = resp.status_code
text = resp.text
if status_code >= 500: if status_code >= 500:
print("❌ An error occurred with the server, exiting ...", flush=True) print("❌ An error occurred with the server, exiting ...", flush=True)
exit(1) exit(1)
ready = status_code < 400 ready = status_code < 400 and text == "ready"
if retries > 10: if retries > 10:
print("❌ The service took too long to be ready, exiting ...", flush=True) print("❌ The service took too long to be ready, exiting ...", flush=True)

View File

@ -30,6 +30,14 @@ services:
CORS_ALLOW_CREDENTIALS: "no" CORS_ALLOW_CREDENTIALS: "no"
CORS_ALLOW_METHODS: "GET, POST, OPTIONS" CORS_ALLOW_METHODS: "GET, POST, OPTIONS"
CORS_ALLOW_HEADERS: "DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range" CORS_ALLOW_HEADERS: "DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range"
CUSTOM_CONF_SERVER_HTTP_ready: |
location /ready {
default_type 'text/plain';
rewrite_by_lua_block {
ngx.say('ready')
ngx.exit(ngx.HTTP_OK)
}
}
networks: networks:
bw-universe: bw-universe:
bw-services: bw-services:

View File

@ -14,18 +14,20 @@ try:
ready = False ready = False
retries = 0 retries = 0
while not ready: while not ready:
with suppress(RequestException): with suppress(RequestException):
status_code = get( resp = get(
f"http{'s' if ssl else ''}://www.example.com", f"http{'s' if ssl else ''}://www.example.com/ready",
headers={"Host": "www.example.com"}, headers={"Host": "www.example.com"},
verify=False, verify=False,
).status_code )
status_code = resp.status_code
text = resp.text
if status_code >= 500: if status_code >= 500:
print("❌ An error occurred with the server, exiting ...", flush=True) print("❌ An error occurred with the server, exiting ...", flush=True)
exit(1) exit(1)
ready = status_code < 400 ready = status_code < 400 and text == "ready"
if retries > 10: if retries > 10:
print("❌ The service took too long to be ready, exiting ...", flush=True) print("❌ The service took too long to be ready, exiting ...", flush=True)

View File

@ -18,6 +18,14 @@ services:
# ? COUNTRY settings # ? COUNTRY settings
BLACKLIST_COUNTRY: "" BLACKLIST_COUNTRY: ""
WHITELIST_COUNTRY: "" WHITELIST_COUNTRY: ""
CUSTOM_CONF_SERVER_HTTP_ready: |
location /ready {
default_type 'text/plain';
rewrite_by_lua_block {
ngx.say('ready')
ngx.exit(ngx.HTTP_OK)
}
}
networks: networks:
bw-universe: bw-universe:
bw-us-network: bw-us-network:

View File

@ -10,13 +10,15 @@ try:
retries = 0 retries = 0
while not ready: while not ready:
with suppress(RequestException): with suppress(RequestException):
status_code = get("http://www.example.com", headers={"Host": "www.example.com"}).status_code resp = get("http://www.example.com/ready", headers={"Host": "www.example.com"})
status_code = resp.status_code
text = resp.text
if status_code >= 500: if status_code >= 500:
print("❌ An error occurred with the server, exiting ...", flush=True) print("❌ An error occurred with the server, exiting ...", flush=True)
exit(1) exit(1)
ready = status_code < 400 or status_code == 403 ready = status_code < 400 or status_code == 403 and text == "ready"
if retries > 10: if retries > 10:
print("❌ The service took too long to be ready, exiting ...", flush=True) print("❌ The service took too long to be ready, exiting ...", flush=True)

View File

@ -20,6 +20,14 @@ services:
USE_CUSTOM_SSL: "no" USE_CUSTOM_SSL: "no"
CUSTOM_SSL_CERT: "/certs/certificate.pem" CUSTOM_SSL_CERT: "/certs/certificate.pem"
CUSTOM_SSL_KEY: "/certs/privatekey.key" CUSTOM_SSL_KEY: "/certs/privatekey.key"
CUSTOM_CONF_SERVER_HTTP_ready: |
location /ready {
default_type 'text/plain';
rewrite_by_lua_block {
ngx.say('ready')
ngx.exit(ngx.HTTP_OK)
}
}
networks: networks:
bw-universe: bw-universe:
bw-services: bw-services:

View File

@ -18,6 +18,14 @@ services:
REVERSE_PROXY_URL: "/" REVERSE_PROXY_URL: "/"
LOG_LEVEL: "info" LOG_LEVEL: "info"
CUSTOM_CONF_MODSEC_test_custom_conf: 'SecRule REQUEST_FILENAME "@rx ^/db" "id:10000,ctl:ruleRemoveByTag=attack-generic,ctl:ruleRemoveByTag=attack-protocol,nolog"' CUSTOM_CONF_MODSEC_test_custom_conf: 'SecRule REQUEST_FILENAME "@rx ^/db" "id:10000,ctl:ruleRemoveByTag=attack-generic,ctl:ruleRemoveByTag=attack-protocol,nolog"'
CUSTOM_CONF_SERVER_HTTP_ready: |
location /ready {
default_type 'text/plain';
rewrite_by_lua_block {
ngx.say('ready')
ngx.exit(ngx.HTTP_OK)
}
}
networks: networks:
bw-universe: bw-universe:
bw-services: bw-services:

View File

@ -18,6 +18,14 @@ services:
# ? DNSBL settings # ? DNSBL settings
USE_DNSBL: "yes" USE_DNSBL: "yes"
DNSBL_LIST: "" DNSBL_LIST: ""
CUSTOM_CONF_SERVER_HTTP_ready: |
location /ready {
default_type 'text/plain';
rewrite_by_lua_block {
ngx.say('ready')
ngx.exit(ngx.HTTP_OK)
}
}
networks: networks:
bw-universe: bw-universe:
bw-services: bw-services:

View File

@ -11,13 +11,15 @@ try:
retries = 0 retries = 0
while not ready: while not ready:
with suppress(RequestException): with suppress(RequestException):
status_code = get("http://www.example.com", headers={"Host": "www.example.com"}, timeout=3).status_code resp = get("http://www.example.com/ready", headers={"Host": "www.example.com"})
status_code = resp.status_code
text = resp.text
if status_code >= 500: if status_code >= 500:
print("❌ An error occurred with the server, exiting ...", flush=True) print("❌ An error occurred with the server, exiting ...", flush=True)
exit(1) exit(1)
ready = status_code < 400 or status_code == 403 ready = status_code < 400 or status_code == 403 and text == "ready"
if retries > 10: if retries > 10:
print("❌ The service took too long to be ready, exiting ...", flush=True) print("❌ The service took too long to be ready, exiting ...", flush=True)

View File

@ -19,6 +19,14 @@ services:
# ? ERRORS settings # ? ERRORS settings
ERRORS: "" ERRORS: ""
INTERCEPTED_ERROR_CODES: "400 401 403 404 405 413 429 500 501 502 503 504" INTERCEPTED_ERROR_CODES: "400 401 403 404 405 413 429 500 501 502 503 504"
CUSTOM_CONF_SERVER_HTTP_ready: |
location /ready {
default_type 'text/plain';
rewrite_by_lua_block {
ngx.say('ready')
ngx.exit(ngx.HTTP_OK)
}
}
networks: networks:
bw-universe: bw-universe:
bw-services: bw-services:

View File

@ -14,13 +14,15 @@ try:
retries = 0 retries = 0
while not ready: while not ready:
with suppress(RequestException): with suppress(RequestException):
status_code = get("http://www.example.com", headers={"Host": "www.example.com"}).status_code resp = get("http://www.example.com/ready", headers={"Host": "www.example.com"})
status_code = resp.status_code
text = resp.text
if status_code >= 500: if status_code >= 500:
print("❌ An error occurred with the server, exiting ...", flush=True) print("❌ An error occurred with the server, exiting ...", flush=True)
exit(1) exit(1)
ready = status_code < 400 ready = status_code < 400 and text == "ready"
if retries > 10: if retries > 10:
print("❌ The service took too long to be ready, exiting ...", flush=True) print("❌ The service took too long to be ready, exiting ...", flush=True)

View File

@ -27,6 +27,14 @@ services:
GREYLIST_USER_AGENT_URLS: "" GREYLIST_USER_AGENT_URLS: ""
GREYLIST_URI: "" GREYLIST_URI: ""
GREYLIST_URI_URLS: "" GREYLIST_URI_URLS: ""
CUSTOM_CONF_SERVER_HTTP_ready: |
location /ready {
default_type 'text/plain';
rewrite_by_lua_block {
ngx.say('ready')
ngx.exit(ngx.HTTP_OK)
}
}
networks: networks:
bw-universe: bw-universe:
bw-services: bw-services:

View File

@ -10,13 +10,15 @@ try:
retries = 0 retries = 0
while not ready: while not ready:
with suppress(RequestException): with suppress(RequestException):
status_code = get("http://www.example.com", headers={"Host": "www.example.com"}).status_code resp = get("http://www.example.com/ready", headers={"Host": "www.example.com"})
status_code = resp.status_code
text = resp.text
if status_code >= 500: if status_code >= 500:
print("❌ An error occurred with the server, exiting ...", flush=True) print("❌ An error occurred with the server, exiting ...", flush=True)
exit(1) exit(1)
ready = status_code < 400 or status_code == 403 ready = status_code < 400 or status_code == 403 and text == "ready"
if retries > 10: if retries > 10:
print("❌ The service took too long to be ready, exiting ...", flush=True) print("❌ The service took too long to be ready, exiting ...", flush=True)

View File

@ -18,6 +18,14 @@ services:
# ? GZIP settings # ? GZIP settings
USE_GZIP: "no" USE_GZIP: "no"
CUSTOM_CONF_SERVER_HTTP_ready: |
location /ready {
default_type 'text/plain';
rewrite_by_lua_block {
ngx.say('ready')
ngx.exit(ngx.HTTP_OK)
}
}
networks: networks:
bw-universe: bw-universe:
bw-services: bw-services:

View File

@ -10,13 +10,15 @@ try:
retries = 0 retries = 0
while not ready: while not ready:
with suppress(RequestException): with suppress(RequestException):
status_code = get("http://www.example.com", headers={"Host": "www.example.com"}).status_code resp = get("http://www.example.com/ready", headers={"Host": "www.example.com"})
status_code = resp.status_code
text = resp.text
if status_code >= 500: if status_code >= 500:
print("❌ An error occurred with the server, exiting ...", flush=True) print("❌ An error occurred with the server, exiting ...", flush=True)
exit(1) exit(1)
ready = status_code < 400 ready = status_code < 400 and text == "ready"
if retries > 10: if retries > 10:
print("❌ The service took too long to be ready, exiting ...", flush=True) print("❌ The service took too long to be ready, exiting ...", flush=True)

View File

@ -32,6 +32,14 @@ services:
X_FRAME_OPTIONS: "SAMEORIGIN" X_FRAME_OPTIONS: "SAMEORIGIN"
X_CONTENT_TYPE_OPTIONS: "nosniff" X_CONTENT_TYPE_OPTIONS: "nosniff"
X_XSS_PROTECTION: "1; mode=block" X_XSS_PROTECTION: "1; mode=block"
CUSTOM_CONF_SERVER_HTTP_ready: |
location /ready {
default_type 'text/plain';
rewrite_by_lua_block {
ngx.say('ready')
ngx.exit(ngx.HTTP_OK)
}
}
networks: networks:
bw-universe: bw-universe:
bw-services: bw-services:

View File

@ -12,17 +12,19 @@ try:
retries = 0 retries = 0
while not ready: while not ready:
with suppress(RequestException): with suppress(RequestException):
status_code = get( resp = get(
f"http{'s' if ssl else ''}://www.example.com", f"http{'s' if ssl else ''}://www.example.com/ready",
headers={"Host": "www.example.com"}, headers={"Host": "www.example.com"},
verify=False, verify=False,
).status_code )
status_code = resp.status_code
text = resp.text
if status_code >= 500: if status_code >= 500:
print("❌ An error occurred with the server, exiting ...", flush=True) print("❌ An error occurred with the server, exiting ...", flush=True)
exit(1) exit(1)
ready = status_code < 400 ready = status_code < 400 and text == "ready"
if retries > 10: if retries > 10:
print("❌ The service took too long to be ready, exiting ...", flush=True) print("❌ The service took too long to be ready, exiting ...", flush=True)

View File

@ -17,6 +17,14 @@ services:
# ? INJECT settings # ? INJECT settings
INJECT_BODY: "TEST" INJECT_BODY: "TEST"
CUSTOM_CONF_SERVER_HTTP_ready: |
location /ready {
default_type 'text/plain';
rewrite_by_lua_block {
ngx.say('ready')
ngx.exit(ngx.HTTP_OK)
}
}
networks: networks:
bw-universe: bw-universe:
bw-services: bw-services:

View File

@ -10,13 +10,15 @@ try:
retries = 0 retries = 0
while not ready: while not ready:
with suppress(RequestException): with suppress(RequestException):
status_code = get("http://www.example.com", headers={"Host": "www.example.com"}).status_code resp = get("http://www.example.com/ready", headers={"Host": "www.example.com"})
status_code = resp.status_code
text = resp.text
if status_code >= 500: if status_code >= 500:
print("❌ An error occurred with the server, exiting ...", flush=True) print("❌ An error occurred with the server, exiting ...", flush=True)
exit(1) exit(1)
ready = status_code < 400 ready = status_code < 400 and text == "ready"
if retries > 10: if retries > 10:
print("❌ The service took too long to be ready, exiting ...", flush=True) print("❌ The service took too long to be ready, exiting ...", flush=True)

View File

@ -22,6 +22,14 @@ services:
LIMIT_REQ_RATE: "2r/s" LIMIT_REQ_RATE: "2r/s"
USE_LIMIT_CONN: "yes" USE_LIMIT_CONN: "yes"
LIMIT_CONN_MAX_HTTP1: "1" LIMIT_CONN_MAX_HTTP1: "1"
CUSTOM_CONF_SERVER_HTTP_ready: |
location /ready {
default_type 'text/plain';
rewrite_by_lua_block {
ngx.say('ready')
ngx.exit(ngx.HTTP_OK)
}
}
networks: networks:
bw-universe: bw-universe:
bw-services: bw-services:

View File

@ -29,6 +29,14 @@ services:
HTTP2: "yes" HTTP2: "yes"
LISTEN_HTTP: "yes" LISTEN_HTTP: "yes"
DENY_HTTP_STATUS: "403" DENY_HTTP_STATUS: "403"
CUSTOM_CONF_SERVER_HTTP_ready: |
location /ready {
default_type 'text/plain';
rewrite_by_lua_block {
ngx.say('ready')
ngx.exit(ngx.HTTP_OK)
}
}
networks: networks:
bw-universe: bw-universe:
bw-services: bw-services:

View File

@ -21,6 +21,14 @@ services:
MODSECURITY_SEC_AUDIT_ENGINE: "RelevantOnly" MODSECURITY_SEC_AUDIT_ENGINE: "RelevantOnly"
MODSECURITY_SEC_RULE_ENGINE: "On" MODSECURITY_SEC_RULE_ENGINE: "On"
MODSECURITY_SEC_AUDIT_LOG_PARTS: "ABCFHZ" MODSECURITY_SEC_AUDIT_LOG_PARTS: "ABCFHZ"
CUSTOM_CONF_SERVER_HTTP_ready: |
location /ready {
default_type 'text/plain';
rewrite_by_lua_block {
ngx.say('ready')
ngx.exit(ngx.HTTP_OK)
}
}
networks: networks:
bw-universe: bw-universe:
bw-services: bw-services:

View File

@ -10,13 +10,15 @@ try:
retries = 0 retries = 0
while not ready: while not ready:
with suppress(RequestException): with suppress(RequestException):
status_code = get("http://www.example.com", headers={"Host": "www.example.com"}).status_code resp = get("http://www.example.com/ready", headers={"Host": "www.example.com"})
status_code = resp.status_code
text = resp.text
if status_code >= 500: if status_code >= 500:
print("❌ An error occurred with the server, exiting ...", flush=True) print("❌ An error occurred with the server, exiting ...", flush=True)
exit(1) exit(1)
ready = status_code < 400 ready = status_code < 400 and text == "ready"
if retries > 10: if retries > 10:
print("❌ The service took too long to be ready, exiting ...", flush=True) print("❌ The service took too long to be ready, exiting ...", flush=True)

View File

@ -18,6 +18,14 @@ services:
# ? REDIRECT settings # ? REDIRECT settings
REDIRECT_TO: "" REDIRECT_TO: ""
REDIRECT_TO_REQUEST_URI: "no" REDIRECT_TO_REQUEST_URI: "no"
CUSTOM_CONF_SERVER_HTTP_ready: |
location /ready {
default_type 'text/plain';
rewrite_by_lua_block {
ngx.say('ready')
ngx.exit(ngx.HTTP_OK)
}
}
networks: networks:
bw-universe: bw-universe:
bw-services: bw-services:

View File

@ -12,13 +12,15 @@ try:
retries = 0 retries = 0
while not ready: while not ready:
with suppress(RequestException): with suppress(RequestException):
status_code = get("http://www.example.com", headers={"Host": "www.example.com"}).status_code resp = get("http://www.example.com/ready", headers={"Host": "www.example.com"})
status_code = resp.status_code
text = resp.text
if status_code >= 500: if status_code >= 500:
print("❌ An error occurred with the server, exiting ...", flush=True) print("❌ An error occurred with the server, exiting ...", flush=True)
exit(1) exit(1)
ready = status_code < 400 ready = status_code < 400 and text == "ready"
if retries > 10: if retries > 10:
print("❌ The service took too long to be ready, exiting ...", flush=True) print("❌ The service took too long to be ready, exiting ...", flush=True)

View File

@ -29,6 +29,14 @@ services:
REDIS_PORT: "6379" REDIS_PORT: "6379"
REDIS_DATABASE: "0" REDIS_DATABASE: "0"
REDIS_SSL: "no" REDIS_SSL: "no"
CUSTOM_CONF_SERVER_HTTP_ready: |
location /ready {
default_type 'text/plain';
rewrite_by_lua_block {
ngx.say('ready')
ngx.exit(ngx.HTTP_OK)
}
}
networks: networks:
bw-universe: bw-universe:
bw-services: bw-services:

View File

@ -19,6 +19,14 @@ services:
USE_REVERSE_SCAN: "yes" USE_REVERSE_SCAN: "yes"
REVERSE_SCAN_PORTS: "80" REVERSE_SCAN_PORTS: "80"
REVERSE_SCAN_TIMEOUT: "500" REVERSE_SCAN_TIMEOUT: "500"
CUSTOM_CONF_SERVER_HTTP_ready: |
location /ready {
default_type 'text/plain';
rewrite_by_lua_block {
ngx.say('ready')
ngx.exit(ngx.HTTP_OK)
}
}
networks: networks:
bw-universe: bw-universe:
bw-services: bw-services:

View File

@ -20,6 +20,14 @@ services:
GENERATE_SELF_SIGNED_SSL: "no" GENERATE_SELF_SIGNED_SSL: "no"
SELF_SIGNED_SSL_EXPIRY: "365" SELF_SIGNED_SSL_EXPIRY: "365"
SELF_SIGNED_SSL_SUBJ: "/CN=www.example.com/" SELF_SIGNED_SSL_SUBJ: "/CN=www.example.com/"
CUSTOM_CONF_SERVER_HTTP_ready: |
location /ready {
default_type 'text/plain';
rewrite_by_lua_block {
ngx.say('ready')
ngx.exit(ngx.HTTP_OK)
}
}
networks: networks:
bw-universe: bw-universe:
bw-services: bw-services:

View File

@ -19,6 +19,14 @@ services:
# ? SESSIONS settings # ? SESSIONS settings
SESSIONS_SECRET: "random" SESSIONS_SECRET: "random"
SESSIONS_NAME: "random" SESSIONS_NAME: "random"
CUSTOM_CONF_SERVER_HTTP_ready: |
location /ready {
default_type 'text/plain';
rewrite_by_lua_block {
ngx.say('ready')
ngx.exit(ngx.HTTP_OK)
}
}
networks: networks:
bw-universe: bw-universe:
bw-services: bw-services:

View File

@ -30,6 +30,14 @@ services:
WHITELIST_USER_AGENT_URLS: "" WHITELIST_USER_AGENT_URLS: ""
WHITELIST_URI: "" WHITELIST_URI: ""
WHITELIST_URI_URLS: "" WHITELIST_URI_URLS: ""
CUSTOM_CONF_SERVER_HTTP_ready: |
location /ready {
default_type 'text/plain';
rewrite_by_lua_block {
ngx.say('ready')
ngx.exit(ngx.HTTP_OK)
}
}
networks: networks:
bw-universe: bw-universe:
bw-services: bw-services:

View File

@ -10,13 +10,15 @@ try:
retries = 0 retries = 0
while not ready: while not ready:
with suppress(RequestException): with suppress(RequestException):
status_code = get("http://www.example.com", headers={"Host": "www.example.com"}).status_code resp = get("http://www.example.com/ready", headers={"Host": "www.example.com"})
status_code = resp.status_code
text = resp.text
if status_code >= 500: if status_code >= 500:
print("❌ An error occurred with the server, exiting ...", flush=True) print("❌ An error occurred with the server, exiting ...", flush=True)
exit(1) exit(1)
ready = status_code < 400 or status_code == 403 ready = status_code < 400 or status_code == 403 and text == "ready"
if retries > 10: if retries > 10:
print("❌ The service took too long to be ready, exiting ...", flush=True) print("❌ The service took too long to be ready, exiting ...", flush=True)

View File

@ -15,7 +15,7 @@ resource "scaleway_k8s_cluster" "cluster" {
version = "1.24.7" version = "1.24.7"
cni = "cilium" cni = "cilium"
private_network_id = scaleway_vpc_private_network.pn.id private_network_id = scaleway_vpc_private_network.pn.id
delete_additional_resources = false delete_additional_resources = true
} }
# Create k8s pool # Create k8s pool
resource "scaleway_k8s_pool" "pool" { resource "scaleway_k8s_pool" "pool" {

View File

@ -2,7 +2,7 @@ terraform {
required_providers { required_providers {
scaleway = { scaleway = {
source = "scaleway/scaleway" source = "scaleway/scaleway"
version = "2.30.0" version = "2.31.0"
} }
kubectl = { kubectl = {
source = "gavinbunney/kubectl" source = "gavinbunney/kubectl"