From a12673452df7f8a2ab0610c62b199ad080d8f866 Mon Sep 17 00:00:00 2001 From: Torben Nehmer Date: Wed, 30 Sep 2026 13:31:20 +0200 Subject: [PATCH] fix(ci): start-radicale.sh probes readiness with Python - the CI job image has no curl (#156) Files changed: - .gitea/scripts/start-radicale.sh --- .gitea/scripts/start-radicale.sh | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.gitea/scripts/start-radicale.sh b/.gitea/scripts/start-radicale.sh index 412571a..e3d4774 100755 --- a/.gitea/scripts/start-radicale.sh +++ b/.gitea/scripts/start-radicale.sh @@ -24,8 +24,18 @@ htpasswd_encryption = plain filesystem_folder = $work/data CONF "$python" -m radicale --config "$work/config" > "$work/radicale.log" 2>&1 & +# The readiness probe uses the same Python, not curl: ci.yml's job image has no curl. +ready=' +import base64, sys, urllib.request +req = urllib.request.Request("http://127.0.0.1:5232/ci/", method="PROPFIND", + headers={"Depth": "0", "Authorization": "Basic " + base64.b64encode(b"ci:ci-live-secret").decode()}) +try: + urllib.request.urlopen(req, timeout=2) +except Exception: + sys.exit(1) +' i=0 -until curl -fsS -o /dev/null -u ci:ci-live-secret -X PROPFIND -H 'Depth: 0' http://127.0.0.1:5232/ci/; do +until "$python" -c "$ready"; do i=$((i + 1)) if [ "$i" -gt 30 ]; then echo "radicale did not come up:" >&2