Fix setup warnings and stabilize auto-update workflow
Co-Authored-By: Oz <oz-agent@warp.dev>
This commit is contained in:
@ -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."
|
||||
|
||||
Reference in New Issue
Block a user