Fix setup warnings and stabilize auto-update workflow

Co-Authored-By: Oz <oz-agent@warp.dev>
This commit is contained in:
Raghav
2026-04-17 11:30:59 +05:30
parent bb2136aad5
commit 10665b7ef2
4 changed files with 46 additions and 5 deletions

3
.gitignore vendored
View File

@ -11,3 +11,6 @@ nginx/ssl/letsencrypt/
# Runtime logs
logs/
# Local backups
backups/

View File

@ -1,7 +1,7 @@
# docker-compose.yml
services:
db:
image: mariadb:11
image: mariadb:11.4
container_name: nextcloud-db
restart: unless-stopped
command: [
@ -23,7 +23,7 @@ services:
- nextcloud-net
app:
image: nextcloud:29-apache
image: nextcloud:apache
container_name: nextcloud-app
restart: unless-stopped
command:
@ -49,20 +49,31 @@ services:
- MYSQL_DATABASE=${NEXTCLOUD_DB_NAME}
- MYSQL_USER=${NEXTCLOUD_DB_USER}
- MYSQL_PASSWORD=${NEXTCLOUD_DB_PASSWORD}
- REDIS_HOST=redis
- NEXTCLOUD_ADMIN_USER=${NEXTCLOUD_ADMIN_USER}
- NEXTCLOUD_ADMIN_PASSWORD=${NEXTCLOUD_ADMIN_PASSWORD}
- NEXTCLOUD_TRUSTED_DOMAINS=nxt.bhatfamily.in
- NEXTCLOUD_OVERWRITEHOST=nxt.bhatfamily.in:8446
- NEXTCLOUD_OVERWRITEPROTOCOL=https
- NEXTCLOUD_UPDATE=1
- XDG_CACHE_HOME=/tmp/.cache
depends_on:
- db
- redis
volumes:
- nextcloud_data:/var/www/html
- /media/rbhat/DATA/nextcloud/NextCloudData:/var/www/html/data
networks:
- nextcloud-net
redis:
image: redis:7-alpine
container_name: nextcloud-redis
restart: unless-stopped
command: ["redis-server", "--save", "", "--appendonly", "no"]
networks:
- nextcloud-net
web:
image: nginx:1.25-alpine
container_name: nextcloud-web

View File

@ -13,12 +13,36 @@ if [ "${STRICT_TLS}" = "1" ]; then
fi
echo "==> Testing HTTP redirect..."
curl -I "http://${DOMAIN}:${HTTP_PORT}" >/dev/null
http_code="$(curl -s -o /dev/null -w "%{http_code}" "http://${DOMAIN}:${HTTP_PORT}/")"
case "${http_code}" in
301|302|307|308) ;;
*)
echo "ERROR: Expected HTTP redirect status (301/302/307/308), got ${http_code}."
exit 1
;;
esac
echo "==> Testing HTTPS endpoint..."
curl "${CURL_TLS_ARGS[@]}" -I "https://${DOMAIN}:${HTTPS_PORT}" >/dev/null
https_code="$(curl "${CURL_TLS_ARGS[@]}" -s -o /dev/null -w "%{http_code}" "https://${DOMAIN}:${HTTPS_PORT}/")"
case "${https_code}" in
200|301|302|303|307|308) ;;
*)
echo "ERROR: Expected successful HTTPS response/redirect, got ${https_code}."
exit 1
;;
esac
echo "==> Testing Nextcloud status.php..."
curl "${CURL_TLS_ARGS[@]}" "https://${DOMAIN}:${HTTPS_PORT}/status.php" >/dev/null
status_file="$(mktemp)"
trap 'rm -f "${status_file}"' EXIT
status_code="$(curl "${CURL_TLS_ARGS[@]}" -s -o "${status_file}" -w "%{http_code}" "https://${DOMAIN}:${HTTPS_PORT}/status.php")"
if [ "${status_code}" != "200" ]; then
echo "ERROR: Expected /status.php HTTP 200, got ${status_code}."
exit 1
fi
if ! grep -q '"installed":true' "${status_file}"; then
echo "ERROR: /status.php did not return expected installed=true payload."
exit 1
fi
echo "All tests passed."

View File

@ -91,6 +91,9 @@ compose -f "${COMPOSE_FILE}" pull db app web
echo "==> Recreating services"
compose -f "${COMPOSE_FILE}" up -d db app web
echo "==> Restarting web container to refresh nginx upstream resolution"
compose -f "${COMPOSE_FILE}" restart web
if ! wait_for_occ; then
echo "ERROR: Nextcloud OCC did not become ready in time."
exit 1