mirror of
https://github.com/bunkerity/bunkerized-nginx
synced 2023-12-13 21:30:18 +01:00
remove php-cookie-flags from tests, use HTTP(S)_PORT for temp nginx on linux and fix wrong volume path for autoconf tests
This commit is contained in:
parent
461789aed6
commit
bf22faddc6
|
@ -1,12 +0,0 @@
|
|||
{
|
||||
"name": "php-cookie",
|
||||
"kinds": ["docker"],
|
||||
"timeout": 60,
|
||||
"tests": [
|
||||
{
|
||||
"type": "string",
|
||||
"url": "https://www.example.com",
|
||||
"string": "Cookie 'my_cookie' is set!"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -80,8 +80,11 @@ function start() {
|
|||
|
||||
log "SYSTEMCTL" "ℹ️" "Starting BunkerWeb service ..."
|
||||
|
||||
# Setup and check /data folder
|
||||
/usr/share/bunkerweb/helpers/data.sh "SYSTEMCTL"
|
||||
# Create dummy variables.env
|
||||
if [ ! -f /etc/bunkerweb/variables.env ]; then
|
||||
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
|
||||
log "SYSTEMCTL" "ℹ️" "Created dummy variables.env file"
|
||||
fi
|
||||
|
||||
# Stop scheduler if it's running
|
||||
stop_scheduler
|
||||
|
@ -90,8 +93,16 @@ function start() {
|
|||
stop_nginx
|
||||
|
||||
# Generate temp conf for jobs and start nginx
|
||||
HTTP_PORT="$(grep "^HTTP_PORT=" /etc/bunkerweb/variables.env | cut -d '=' -f 2)"
|
||||
if [ "$HTTP_PORT" = "" ] ; then
|
||||
HTTP_PORT="8080"
|
||||
fi
|
||||
HTTPS_PORT="$(grep "^HTTPS_PORT=" /etc/bunkerweb/variables.env | cut -d '=' -f 2)"
|
||||
if [ "$HTTPS_PORT" = "" ] ; then
|
||||
HTTPS_PORT="8443"
|
||||
fi
|
||||
if [ ! -f /var/tmp/bunkerweb/tmp.env ] ; then
|
||||
echo -ne "IS_LOADING=yes\nHTTP_PORT=80\nHTTPS_PORT=443\nAPI_LISTEN_IP=127.0.0.1\nSERVER_NAME=\n" > /var/tmp/bunkerweb/tmp.env
|
||||
echo -ne "IS_LOADING=yes\nHTTP_PORT=${HTTP_PORT}\nHTTPS_PORT=${HTTPS_PORT}\nAPI_LISTEN_IP=127.0.0.1\nSERVER_NAME=\n" > /var/tmp/bunkerweb/tmp.env
|
||||
fi
|
||||
/usr/share/bunkerweb/gen/main.py --variables /var/tmp/bunkerweb/tmp.env --no-linux-reload
|
||||
if [ $? -ne 0 ] ; then
|
||||
|
@ -100,10 +111,10 @@ function start() {
|
|||
fi
|
||||
|
||||
# Start nginx
|
||||
log "SYSTEMCTL" "ℹ️" "Starting nginx ..."
|
||||
log "SYSTEMCTL" "ℹ️" "Starting temp nginx ..."
|
||||
nginx
|
||||
if [ $? -ne 0 ] ; then
|
||||
log "SYSTEMCTL" "❌" "Error while executing nginx"
|
||||
log "SYSTEMCTL" "❌" "Error while executing temp nginx"
|
||||
exit 1
|
||||
fi
|
||||
count=0
|
||||
|
@ -122,11 +133,6 @@ function start() {
|
|||
fi
|
||||
log "SYSTEMCTL" "ℹ️" "nginx started ..."
|
||||
|
||||
# Create dummy variables.env
|
||||
if [ ! -f /etc/bunkerweb/variables.env ]; then
|
||||
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
|
||||
log "SYSTEMCTL" "ℹ️" "Updating database ..."
|
||||
if [ ! -f /var/lib/bunkerweb/db.sqlite3 ]; then
|
||||
|
|
|
@ -58,7 +58,7 @@ class AutoconfTest(Test):
|
|||
Test.replace_in_file(compose, r"\./bw\-data:/", "/tmp/bw-data:/")
|
||||
with open(compose, "r") as f :
|
||||
data = safe_load(f.read())
|
||||
data["services"]["bunkerweb"]["volumes"] = ["/tmp/www:var/www/html"]
|
||||
data["services"]["bunkerweb"]["volumes"] = ["/tmp/www:/var/www/html"]
|
||||
with open(compose, "w") as f :
|
||||
f.write(dump(data))
|
||||
proc = run(
|
||||
|
|
Loading…
Reference in a new issue