From 25af35def1703ffad96e279e25ed81a4b95b754f Mon Sep 17 00:00:00 2001 From: Musa Kaleem <131704022+Musa-Kal@users.noreply.github.com> Date: Sat, 21 Nov 2026 12:40:15 -0500 Subject: [PATCH] fix(ci): keepalive reads a public row, the REST root now needs a secret key The daily ping hit /rest/v1/, which Supabase now answers only for secret keys (401 "Secret API key required" with the publishable key), so every run failed. Read one app_config key instead: it is readable with the publishable key and is a real database query. Co-authored-by: Ferrin <177692050+Ferrin-Y@users.noreply.github.com> Co-authored-by: noorelmosrati <182049385+noorelmosrati@users.noreply.github.com> --- .github/workflows/keepalive.yml | 5 +++-- docs/adr/0002-supabase-backend-with-rls-authorization.md | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/keepalive.yml b/.github/workflows/keepalive.yml index ab230d39..38557139 100644 --- a/.github/workflows/keepalive.yml +++ b/.github/workflows/keepalive.yml @@ -1,4 +1,5 @@ -# Free Supabase projects pause after a period of inactivity. Ping the REST API daily. +# Free Supabase projects pause after a period of inactivity. Read one row through the REST API daily. +# The bare /rest/v1/ root only answers secret keys now, so this reads a public feature flag instead. name: Keepalive on: @@ -21,4 +22,4 @@ jobs: curl --fail --silent --show-error --output /dev/null \ --retry 3 --retry-delay 10 \ -H "apikey: ${SUPABASE_PUBLISHABLE_KEY}" \ - "${SUPABASE_URL}/rest/v1/" + "${SUPABASE_URL}/rest/v1/app_config?select=key&limit=1" diff --git a/docs/adr/0002-supabase-backend-with-rls-authorization.md b/docs/adr/0002-supabase-backend-with-rls-authorization.md index 3c1f5ee2..fe8cccc3 100644 --- a/docs/adr/0002-supabase-backend-with-rls-authorization.md +++ b/docs/adr/0002-supabase-backend-with-rls-authorization.md @@ -24,5 +24,5 @@ Authorization lives in Postgres: - One place to audit. A rule written in SQL applies to the web app, the future native app and anyone poking the API with curl. - Policy mistakes are security bugs, so pgTAP coverage for RLS is not optional (see [testing.md](../testing.md)). - Business logic that spans rows has to be written in PL/pgSQL. That is a smaller hiring pool than TypeScript, and harder to debug. -- Free projects pause when idle. `keepalive.yml` pings the REST API daily. +- Free projects pause when idle. `keepalive.yml` reads one `app_config` row through the REST API daily. - Moving off Supabase would mean rebuilding auth, storage and realtime. The schema and RPCs are plain Postgres and would carry over.