#!/bin/bash # v3 dev - localhost only, no external IPs per safety boundary # This script enforces localhost + file:// only. set -e cd "$(dirname "$0")/../webapp" echo "🔒 KiddOs v3 — LOCALHOST ONLY MODE" echo " Allowed: http://localhost:5173, http://127.0.0.1:5173, file://dist/index.html" echo " Blocked: any https:// external (scratch.mit.edu etc removed)" echo "" # Check no external URLs in actual code (ignore comments that say blocked) if grep -R "https://scratch.mit.edu\|https://turbowarp\|https://machinelearningforkids" src/ --include="*.jsx" | grep -v "Blocked\|blocked\|❌" ; then echo "❌ Found external URL in code - remove per safety boundary!" exit 1 else echo "✅ No external URLs in App code (localhost only lock OK)" fi if [ ! -d node_modules ]; then npm install fi # Kill old cage/cog if still from v2 test sudo pkill -9 cage cog 2>/dev/null || true sudo rm -f /run/user/1000/wayland-* 2>/dev/null || true sleep 1 echo "" echo "🚀 Starting Vite dev server on localhost:5173..." echo " Edit src/App.jsx -> DSI hot reloads in <1s (still localhost WebSocket)" echo " DSI command (in another SSH):" echo " sudo openvt -f -c 1 -s -- env XDG_RUNTIME_DIR=/run/user/1000 cage -s -- cog --platform=wl http://localhost:5173 --bg-color=#2E3440" echo "" ./node_modules/.bin/vite --host 0.0.0.0 --port 5173