Let Cloudron turn on named admins, the ops token, and Umami after the image is built.

Tracker env is read at request time and the CSP already allows the analytics host, so staging can set a rule admin, an ops bearer token, and the cookieless Umami site without rebuilding.
This commit is contained in:
adilallo committed 2026-11-23 11:51:55 -07:00
1 parent 36112f95d3
commit f7d88a7d5c
9 files changed
+132 -49

No files matched your search

+26
View File
@@ -6,6 +6,7 @@
# ./scripts/staging-smoke.sh
# ./scripts/staging-smoke.sh communityrule.info
# EMAIL=you@example.com ./scripts/staging-smoke.sh staging.communityrule.info
# OPS_PRUNE_TOKEN=... ./scripts/staging-smoke.sh # also checks /api/ops/rule-counts with the bearer token
#
# Manual follow-up (not automated here): click magic link in inbox, publish a rule,
# optional upload with UPLOAD_ROOT set.
@@ -67,6 +68,31 @@ check_json_contains 'templates seeded (non-empty)' '"slug":'
check_http "GET /api/rules" "$BASE/api/rules" "200"
check_json_contains 'rules list shape' '"rules":['
check_http "GET /api/ops/rule-counts (logged out)" "$BASE/api/ops/rule-counts" "401"
if [ -n "${OPS_PRUNE_TOKEN:-}" ]; then
status="$(curl -sS -o /tmp/staging-smoke-body.$$ -w '%{http_code}' \
-H "Authorization: Bearer $OPS_PRUNE_TOKEN" \
"$BASE/api/ops/rule-counts" || echo '000')"
if [ "$status" = "200" ]; then
pass "GET /api/ops/rule-counts (ops token) (HTTP 200)"
check_json_contains 'rule-counts finished' '"finished":'
else
fail "GET /api/ops/rule-counts (ops token) (expected HTTP 200, got $status)"
head -c 500 "/tmp/staging-smoke-body.$$" 1>&2 || true
printf '\n' 1>&2
fi
else
printf 'SKIP GET /api/ops/rule-counts (ops token) (set OPS_PRUNE_TOKEN= to run)\n'
fi
check_http "GET / (homepage)" "$BASE/" "200"
if grep -Fq 'data-website-id' "/tmp/staging-smoke-body.$$" 2>/dev/null; then
pass "Umami tracker on homepage"
else
fail "Umami tracker on homepage (missing data-website-id)"
fi
if [ -n "${EMAIL:-}" ]; then
status="$(curl -sS -o /tmp/staging-smoke-body.$$ -w '%{http_code}' \
-X POST "$BASE/api/auth/magic-link/request" \