Skip to content

🛡️ Warracker is an open source, self-hostable warranty tracker to monitor expirations, store receipts, files. You own the data, your rules!

Docker: set gunicorn HOME=/home/warracker and fix health JSON check in smoke test

sassanixa94fa74ba9bc
diff --git a/Docker/supervisord.conf b/Docker/supervisord.conf
index e314d13..9ceb554 100644
--- a/Docker/supervisord.conf
+++ b/Docker/supervisord.conf
@@ -23,6 +23,7 @@ stderr_logfile_maxbytes=0
command=/opt/venv/bin/gunicorn --config /app/gunicorn_config.py 'backend:create_app()'
directory=/app
user=warracker
+environment=HOME="/home/warracker",USER="warracker"
autostart=true
autorestart=true
startsecs=5
diff --git a/tests/docker_smoke_test.sh b/tests/docker_smoke_test.sh
index 0115912..e094e2f 100755
--- a/tests/docker_smoke_test.sh
+++ b/tests/docker_smoke_test.sh
@@ -221,7 +221,8 @@ docker run -d --name "${APP_CTR}" --network "${NET}" \
"${IMAGE}" >/dev/null
wait_for_health "${APP_CTR}" "http://127.0.0.1:18006/api/health"
-if docker logs "${APP_CTR}" 2>&1 | grep -q "${DB_PASS}"; then
+dburl_logs="$(docker logs "${APP_CTR}" 2>&1 || true)"
+if grep -q "${DB_PASS}" <<< "${dburl_logs}"; then
fail "DATABASE_URL password leaked into container logs"
fi
stop_app