Commit Graph
7 Commits
Author SHA1 Message Date
Gerhard Scheikl fa457de8ec fix(auth): route server-side Supabase calls via internal URL to avoid edge rate-limit
Server-side Supabase calls (middleware getUser/refresh, server components,
admin client) all egress through the Docker gateway as a single NATed IP and
traverse Caddy's per-IP /auth/* rate limiter (8 events/s). A handful of active
users saturate that shared bucket, 429ing getUser()/token refresh; the
middleware then treats the session as invalid and bounces to /login, while a
manual refresh lands under budget and works again.

Add SUPABASE_INTERNAL_URL (e.g. http://kong-prod:8000) used only by the
server-side clients (middleware, lib/supabase/server.ts, admin getSupabaseAdmin
/getSupabaseAnon), falling back to the public URL when unset. Browser clients
keep the public URL so real per-user-IP edge rate limiting still applies.

Also bake the arg in the Dockerfile/build and make the web-prod network alias
durable via WEB_ALIAS (dev sets web-dev) so the dev container can't reclaim the
web-prod alias on redeploy.
2026-06-02 12:45:10 +02:00
linumiq_net-user 9f8477f16f URL update 2026-06-02 10:30:30 +02:00
linumiq_net-user aad01f1fc5 security-update 2026-05-31 10:19:06 +02:00
linumiq_net-user 6b59c01744 dev: parameterize compose so one file serves prod + dev
image/container/network/project names now come from env (WEB_IMAGE,
WEB_CONTAINER, WEB_NETWORK, WEB_PROJECT) with prod values as defaults. Dev
supplies its values via the gitignored .env.production. Makes dev->main merge
safe (prod resolves to web/web:1.0.0/edge by default).
2026-05-30 14:18:40 +02:00
linumiq_net-user f1cca454e2 dev: parameterize compose for dev build (web-dev image/container, dev_edge network)
- image web-dev:1.0.0, container web-dev, network dev_edge
- NEXT_PUBLIC_* build args resolved from gitignored .env.production
  (api-dev/app-dev URLs) so the dev bundle targets the dev API.
- ignore .env.production (dev secrets) in this branch.
2026-05-30 13:24:23 +02:00
linumiq_net-user 6c1221c60f security update 2026-05-30 12:49:51 +02:00
root c935e39fa1 initial commit 2026-05-29 17:07:00 +02:00