2026-11-21 — Live database brought up to the repo migrations; is_admin hole closed
The live Supabase project had none of the repo migrations applied. Applied April + November migrations (except the consent and voice-bucket files), fixed the broken 0404 seed file, and closed client writes to the weekly post counter. Verified as a signed-in non-admin user.
Live state before
Live project: oxixxrzdrryfztfxlady (eu-central-1). No repo file names it; identified by schema (it has cms_*, forum_*, profiles; the other projects in the Supabase org belong to other apps). Migration history held only 20260223222935 add_sharing_columns. Missing: every file in supabase/migrations/ and apps/web/scripts/004–006. Any signed-in user could set their own is_admin (profiles_update_own had no column restriction).
Applied to live (2026-11-21, in this order)
| Migration | Note |
|---|---|
apps/web/scripts/004_documents_pipeline_v2.sql | as in repo |
apps/web/scripts/005_document_llm_rate_limit.sql | as in repo |
apps/web/scripts/006_feature_flags_column.sql | as in repo; needed by the hardening trigger |
20260402_monetization_schema.sql | as in repo |
20260403_content_tables.sql | as in repo |
20260407_community_post_limit_2.sql | as in repo |
20261119_post_limit_webhook_events.sql | same end state; drop trigger if exists + create trigger sent as create or replace trigger |
20261119_profiles_rls_hardening.sql | same end state; create or replace trigger, and alter policy for the three existing policies instead of drop + create |
20261119_yoga_meets.sql | same end state; drop policy if exists lines omitted (tables were new) |
20261121_post_count_client_lockdown.sql | new, see below |
The drop-free variants were used because the Supabase connector asks for an interactive confirmation on DROP statements, which could not be answered from the session. Repo files are unchanged; replaying them on a fresh database gives the same result.
Not applied
20261119_user_consents.sql— on hold by owner decision until the trigger requires consents and sets the timestamp server-side (#715).20260405_voice_feedback_bucket.sql— allows unauthenticated uploads ("test mode"); left out pending a decision.20260404_seed_content.sql— was invalid as written (see below). Fixed in this PR but not yet applied live. Until it is, Lexikon and Magazin serve the built-in fallback content (apps/web/lib/content.ts), which is the same text.
Repo changes
20260404_seed_content.sql: all six MagazinsectionsJSON literals were invalid JSON — German opening quotes „ were closed with an ASCII", which ends the JSON string. 70 closing quotes replaced with “ (U+201C). No other character changed; all six literals now parse.- New
20261121_post_count_client_lockdown.sql: the two client insert/update policies oncommunity_post_counts(from 0402) are set tofalseand renamedpost_counts_no_client_insert/post_counts_no_client_update, so users can no longer reset their own weekly counter.increment_post_count(uid)now refuses API callers (anon,authenticated) whoseuidis not their own. The forum insert trigger is unaffected.
Verification (live, inside a rolled-back transaction, as role authenticated with a non-admin user's JWT claims)
- Own profile update setting
is_admin = true,subscription_tier = 'premium',feature_flags = {...}: row updated, those three columns unchanged (false,free,{});pseudonymchanged as expected. - Update of another user's profile: 0 rows. Re-keying own row to another id: blocked by RLS.
- Forum post or comment with another
author_id: blocked by RLS. - Free tier: posts 1 and 2 succeed, post 3 blocked; counter = 2.
- Resetting or inserting own counter row: 0 rows / blocked.
increment_post_count(<other user>): blocked. - Afterwards: no test rows left, profile unchanged.
Follow-ups
- Apply the fixed
20260404_seed_content.sqlto live. increment_document_llm_call(p_user_id, p_day)(script 005) has the same pattern asincrement_post_count: SECURITY DEFINER, callable with any user id. Not changed here.profiles_select_public_pseudonym(using (true)) still exposes every profile column, includingshare_password_hash, to every caller (noted in the hardening migration).admin_update_all_profileslets a user update their own row as a second permissive policy; the trigger still pins the privileged columns.- Decide on
20260405_voice_feedback_bucket.sqland fix20261119_user_consents.sql.
2026-11-21 — Production outage from the start-up env check; check made non-fatal
The start-up check added on 2026-11-19 threw in production because NEXT_PUBLIC_SITE_URL was unset. Every server-rendered route on www.fragjulia.de failed from the first deployment that built with it until this fix. The check now only logs.
2026-05-02 — Audit cron: DRY_RUN flip after 7-day shake-out
Both audit workflows (closed-issue-audit daily, changelog-audit-weekly Mondays) flipped from DRY_RUN 'true' to 'false' after the 7-day post-merge observation window from PR #684 (merged 2026-04-25) showed clean run logs. closed-issue-audit now writes the missing-changelog label and a single comment to issues closed-as-completed without a matching changelog closes: reference. The weekly digest remains a workflow-run-page summary; no new issue spam.