Admin polish: stability fixes, schema security, consistent UI + sidebar #1
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "session/polish"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Admin review pass: stability bugs, security holes in the PocketBase schema, and visual consistency (DaisyUI 5 migration + grouped sidebar). Each commit is self-contained and described in detail.
⚠️ Before / after merging
userscollection allows anonymous sign-up, and every CMS rule only checks "signed in", so anyone could register viadb.<domain>/api/and edit the site or read orders. The new migration closes it. Until deployed: PocketBase dashboard →users→ API rules → Create = superuser only.pocketbase/pb_migrations/is now mounted; the migration applies once on the nextdocker compose up. Check the PocketBase log for a "duplicates — unique index NOT created" line.Stability fixes (confirmed by reproducing)
Secure→ login impossible over HTTP (CADDY_SCHEME=http).POST /login?/logoutto/pages).SITE_TIMEZONE.undefined/slug; preview iframe rendered the whole admin shell.Security / schema (approved)
PocketBase server pinned to
0.23.12(same imagelatestresolved to).Public sign-up closed; orders/baskets/basket_lines writes superuser-only (public app already uses the admin client; basket add verified);
created/updateddates; uniquepages.slug/globals.key. Migration +pb_schema.jsonfor fresh installs (fresh-install path tested).Theme
Admin primary/secondary follow Site design's Primary/Accent with automatic readable text (fixes the old white-on-sage contrast); colours are rendered server-side (public site no longer flashes default colours) and sanitised; the button block's "Secondary" variant now uses the site Accent instead of DaisyUI's default pink.
Visual
DaisyUI 4 → 5 form markup everywhere; shared
Modal,SegmentedControl,ColorFieldfollowing the Globals / background-picker style; grouped sidebar (Website / Bookings / Settings) with mobile drawer; renamed Site design, Services & products, Events, Backup; Monday week start; new login page.Testing
svelte-check: no new errors/warnings vsmain(pre-existing module-resolution errors forpackages/sharedremain).Not changed (follow-ups)
Public site formats prices as EUR and times in the visitor's timezone (
ShopBlock,CheckoutBlock,Header, checkout return); committed compose publishes Caddy on all interfaces.Public site: mobile menu
hidden md:flexwith no fallback). Added a ☰ side drawer from the right (native<dialog>): links, basket, booking button; closes on backdrop/Escape/navigation; current page highlighted on desktop and mobile.--color-primary-content(readable on light brand colours).Shop block & public fixes
/previewnow loads items/slots/events (sharedloadShopData()), so Shop and Upcoming calendar blocks aren't blank in previews.POCKETBASE_ADMIN_*unset).pb.filter(URL was interpolated into the query; rules prevented draft leaks).primary-content(Hero, Shop, Checkout, checkout return, logo fallback).Shop runs inside PocketBase (public app unprivileged)
pocketbase/pb_hooks/shop,/api/shop/*, plus a once-a-minute cron that releases expired holds). Public routes keep their URLs and only proxy + manage the basket cookie.INTERNAL_API_SECRET.order_linescreate/update/delete were public — now superuser-only (migration1791331200).INTERNAL_API_SECRETin.env; Stripe secret/webhook secret now go to the PocketBase service (compose does this); the webhook URL in Stripe is unchanged.POCKETBASE_ADMIN_*can be removed from.env.stripe-mock(local compose only) with signed webhooks: forged/stale signatures rejected, replay creates no duplicate order, holds/stock/booking correct, cron release, failed-payment path; browser add-to-basket and slot booking.1f929c6accidentally contains the file deletions belonging to773fecc, so it doesn't build on its own (the branch does).🤖 Generated with Claude Code
https://claude.ai/code/session_01KgF3Kf47LjPGHKQHszpUAv