fix(supabase): LAN trial serves the app sources only, no Postgres password in Vite

This commit is contained in:
bchanot committed 2026-11-04 23:03:47 +01:00
1 parent 25bdac4dd7
commit fb95255759
3 files changed
+10 -2

No files matched your search

+4
View File
@@ -1,3 +1,4 @@
import { fileURLToPath } from 'node:url'
import { defineConfig, mergeConfig } from 'vite'
import base from '../vite.config'
@@ -24,6 +25,7 @@ if (!PRIVATE_IPV4.test(host))
)
const SUPABASE_ROUTES = ['/auth/v1', '/rest/v1', '/storage/v1']
const REPO = fileURLToPath(new URL('../../../', import.meta.url))
export default defineConfig((env) =>
mergeConfig(base(env), {
@@ -32,6 +34,8 @@ export default defineConfig((env) =>
host,
strictPort: true,
allowedHosts: [host],
// The LAN sees the app's own sources only: never the repository's notes, seed or builds.
fs: { allow: ['apps/app', 'packages', 'node_modules'].map((dir) => REPO + dir) },
proxy: Object.fromEntries(
SUPABASE_ROUTES.map((route) => [route, { target }]),
),