Add automated TLS renewal and deployment documentation
Co-Authored-By: Oz <oz-agent@warp.dev>
This commit is contained in:
@ -5,23 +5,20 @@ set -euo pipefail
|
||||
DOMAIN="nxt.bhatfamily.in"
|
||||
HTTP_PORT=8082
|
||||
HTTPS_PORT=8446
|
||||
STRICT_TLS="${STRICT_TLS:-0}"
|
||||
|
||||
CURL_TLS_ARGS=("-k")
|
||||
if [ "${STRICT_TLS}" = "1" ]; then
|
||||
CURL_TLS_ARGS=()
|
||||
fi
|
||||
|
||||
echo "==> Testing HTTP redirect..."
|
||||
curl -I "http://${DOMAIN}:${HTTP_PORT}" || {
|
||||
echo "HTTP test failed."
|
||||
exit 1
|
||||
}
|
||||
curl -I "http://${DOMAIN}:${HTTP_PORT}" >/dev/null
|
||||
|
||||
echo "==> Testing HTTPS endpoint (ignoring self-signed cert errors)..."
|
||||
curl -k -I "https://${DOMAIN}:${HTTPS_PORT}" || {
|
||||
echo "HTTPS test failed."
|
||||
exit 1
|
||||
}
|
||||
echo "==> Testing HTTPS endpoint..."
|
||||
curl "${CURL_TLS_ARGS[@]}" -I "https://${DOMAIN}:${HTTPS_PORT}" >/dev/null
|
||||
|
||||
echo "==> Quick application-level check (Nextcloud status.php)..."
|
||||
curl -k "https://${DOMAIN}:${HTTPS_PORT}/status.php" || {
|
||||
echo "status.php test failed."
|
||||
exit 1
|
||||
}
|
||||
echo "==> Testing Nextcloud status.php..."
|
||||
curl "${CURL_TLS_ARGS[@]}" "https://${DOMAIN}:${HTTPS_PORT}/status.php" >/dev/null
|
||||
|
||||
echo "All tests passed."
|
||||
|
||||
Reference in New Issue
Block a user