increase timeout for php-multisite, add API_LISTEN_IP setting, edit default variables.env for Linux and add more logs for tests

This commit is contained in:
florian 2023-03-22 16:24:48 +01:00
parent 578a1a8c8b
commit d331131c09
No known key found for this signature in database
GPG Key ID: 3D80806F12602A7C
7 changed files with 28 additions and 6 deletions

View File

@ -40,7 +40,7 @@ services:
environment:
- DOCKER_HOST=tcp://bw-docker-proxy:2375
volumes:
- ./bw-data:/data
- bw-data:/data
networks:
- bw-universe
- bw-docker
@ -85,3 +85,6 @@ networks:
bw-docker:
net-app1:
net-app2:
volumes:
bw-data:

View File

@ -1,7 +1,7 @@
{
"name": "php-multisite",
"kinds": ["docker", "autoconf", "linux"],
"timeout": 60,
"timeout": 120,
"tests": [
{
"type": "string",

View File

@ -2,8 +2,10 @@ server {
server_name {{ API_SERVER_NAME }};
# HTTP listen
listen 0.0.0.0:{{ API_HTTP_PORT }};
listen {{ API_LISTEN_IP }}:{{ API_HTTP_PORT }};
{% if API_LISTEN_IP != "127.0.0.1" +%}
listen 127.0.0.1:{{ API_HTTP_PORT }};
{% endif +%}
# maximum body size for API
client_max_body_size 1G;

View File

@ -144,6 +144,15 @@
"regex": "^\\d+$",
"type": "text"
},
"API_LISTEN_IP": {
"context": "global",
"default": "0.0.0.0",
"help": "Listen IP address for the API.",
"id": "api-ip-listen",
"label": "API listen IP",
"regex": "^.*$",
"type": "text"
},
"API_SERVER_NAME": {
"context": "global",
"default": "bwapi",

View File

@ -33,14 +33,16 @@ function start() {
# Setup and check /data folder
/usr/share/bunkerweb/helpers/data.sh "ENTRYPOINT"
# Init database
# Create dummy variables.env
if [ ! -f /etc/bunkerweb/variables.env ]; then
echo -e "IS_LOADING=yes\nSERVER_NAME=\nAPI_HTTP_PORT=${API_HTTP_PORT:-7000}\nAPI_SERVER_NAME=${API_SERVER_NAME:-bwapi}\nAPI_WHITELIST_IP=${API_WHITELIST_IP:-127.0.0.0/8}" > /etc/bunkerweb/variables.env
echo -ne "\# remove IS_LOADING=yes when your config is ready\nIS_LOADING=yes\nHTTP_PORT=80\nHTTPS_PORT=443\nAPI_LISTEN_IP=127.0.0.1\nSERVER_NAME=\n" > /etc/bunkerweb/variables.env
fi
# Update database
/usr/share/bunkerweb/gen/save_config.py --variables /etc/bunkerweb/variables.env --init
if [ "$?" -ne 0 ] ; then
log "ENTRYPOINT" "❌" "Scheduler generator failed"
exit 1
fi
fi
# Execute jobs

View File

@ -117,6 +117,11 @@ class KubernetesTest(Test):
cwd="/tmp/kubernetes",
shell=True,
)
run(
"kubectl describe deployment/bunkerweb-db",
cwd="/tmp/kubernetes",
shell=True,
)
run(
"kubectl logs deployment/bunkerweb-db",
cwd="/tmp/kubernetes",

View File

@ -38,6 +38,7 @@ while [ $i -lt 120 ] ; do
i=$((i+1))
done
if [ $i -ge 120 ] ; then
docker-compose logs
echo "❌ Docker stack is not healthy"
exit 1
fi