fix(supabase): LAN trial serves the app sources only, no Postgres password in Vite
This commit is contained in:
1 parent
25bdac4dd7
commit
fb95255759
3 files changed
+10
-2
No files matched your search
@@ -1,3 +1,4 @@
|
|||||||
|
import { fileURLToPath } from 'node:url'
|
||||||
import { defineConfig, mergeConfig } from 'vite'
|
import { defineConfig, mergeConfig } from 'vite'
|
||||||
import base from '../vite.config'
|
import base from '../vite.config'
|
||||||
|
|
||||||
@@ -24,6 +25,7 @@ if (!PRIVATE_IPV4.test(host))
|
|||||||
)
|
)
|
||||||
|
|
||||||
const SUPABASE_ROUTES = ['/auth/v1', '/rest/v1', '/storage/v1']
|
const SUPABASE_ROUTES = ['/auth/v1', '/rest/v1', '/storage/v1']
|
||||||
|
const REPO = fileURLToPath(new URL('../../../', import.meta.url))
|
||||||
|
|
||||||
export default defineConfig((env) =>
|
export default defineConfig((env) =>
|
||||||
mergeConfig(base(env), {
|
mergeConfig(base(env), {
|
||||||
@@ -32,6 +34,8 @@ export default defineConfig((env) =>
|
|||||||
host,
|
host,
|
||||||
strictPort: true,
|
strictPort: true,
|
||||||
allowedHosts: [host],
|
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(
|
proxy: Object.fromEntries(
|
||||||
SUPABASE_ROUTES.map((route) => [route, { target }]),
|
SUPABASE_ROUTES.map((route) => [route, { target }]),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -78,7 +78,11 @@ sudo ufw allow from 192.168.1.0/24 to any port 5193 proto tcp
|
|||||||
|
|
||||||
Protections : réseau local de confiance uniquement (jamais d'exposition publique), compte à mot de passe et
|
Protections : réseau local de confiance uniquement (jamais d'exposition publique), compte à mot de passe et
|
||||||
double authentification pour l'administration, RLS sur toutes les tables, pile jetable. DEV (`supabase_*_faunosteo`)
|
double authentification pour l'administration, RLS sur toutes les tables, pile jetable. DEV (`supabase_*_faunosteo`)
|
||||||
n'est ni lu ni arrêté. Le site est servi en HTTP simple : ne réutilisez pas ici un mot de passe qui compte.
|
n'est ni lu ni arrêté. Le site est servi en HTTP simple : sur le réseau, le mot de passe, les codes TOTP et la
|
||||||
|
session de l'essai circulent en clair. N'utilisez donc qu'un réseau de confiance (pas un Wi-Fi public ou partagé),
|
||||||
|
et jamais un mot de passe qui compte. Seuls les fichiers de l'application sont servis (pas les notes du dépôt, ni
|
||||||
|
le seed, ni les secrets de la pile). Sur un réseau douteux, préférez `FAUNOSTEO_TRIAL_HOST=127.0.0.1` et le
|
||||||
|
tunnel SSH.
|
||||||
|
|
||||||
### Double authentification (TOTP)
|
### Double authentification (TOTP)
|
||||||
|
|
||||||
|
|||||||
@@ -446,7 +446,7 @@ cmd_trial() {
|
|||||||
( cd apps/app && FAUNOSTEO_TRIAL_GATEWAY="http://127.0.0.1:$PORT_TRIAL_GATEWAY" \
|
( cd apps/app && FAUNOSTEO_TRIAL_GATEWAY="http://127.0.0.1:$PORT_TRIAL_GATEWAY" \
|
||||||
FAUNOSTEO_TRIAL_HOST="$TRIAL_HOST" \
|
FAUNOSTEO_TRIAL_HOST="$TRIAL_HOST" \
|
||||||
VITE_SUPABASE_URL="http://$TRIAL_HOST:$PORT_TRIAL_APP" VITE_SUPABASE_ANON_KEY="$SB_ANON_KEY" \
|
VITE_SUPABASE_URL="http://$TRIAL_HOST:$PORT_TRIAL_APP" VITE_SUPABASE_ANON_KEY="$SB_ANON_KEY" \
|
||||||
exec node_modules/.bin/vite --config vite/trial.config.ts --host "$TRIAL_HOST" \
|
exec env -u PGPASSWORD node_modules/.bin/vite --config vite/trial.config.ts --host "$TRIAL_HOST" \
|
||||||
--port $PORT_TRIAL_APP --strictPort ) &
|
--port $PORT_TRIAL_APP --strictPort ) &
|
||||||
trial_pid=$!
|
trial_pid=$!
|
||||||
wait "$trial_pid"
|
wait "$trial_pid"
|
||||||
|
|||||||
Reference in new issue
Block a user