diff --git a/.env.example b/.env.example index ee4cd88..1c44024 100644 --- a/.env.example +++ b/.env.example @@ -2,6 +2,7 @@ # schema on each build, so the .sqlx cache is only needed for DB-less builds. # Run scripts/prepare_sqlx_sqlite.sh once first — it creates and migrates the DB. # Use an absolute path so builds work from any working directory. +# Replace the placeholder below with the DATABASE_URL printed by the script. DATABASE_URL=sqlite:///absolute/path/to/wakey-prepare.sqlite3 # Offline mode (CI / packaging): force the committed .sqlx cache. diff --git a/scripts/prepare_sqlx_sqlite.sh b/scripts/prepare_sqlx_sqlite.sh index 732baf1..a333d23 100755 --- a/scripts/prepare_sqlx_sqlite.sh +++ b/scripts/prepare_sqlx_sqlite.sh @@ -24,3 +24,4 @@ cp .sqlx/*.json wakey-control-plane/.sqlx/ echo "SQLx metadata prepared in $ROOT/.sqlx" echo "SQLx package metadata mirrored in $ROOT/wakey-control-plane/.sqlx" echo "Prepare DB (referenced by .env for live compile-time checking): $DB" +echo "DATABASE_URL=$DATABASE_URL" diff --git a/ui/src/App.tsx b/ui/src/App.tsx index 5d690e2..47967ef 100644 --- a/ui/src/App.tsx +++ b/ui/src/App.tsx @@ -207,6 +207,7 @@ export function App() { // Only a connection that stayed up proves the stream is healthy; an // accept-then-close server must not pin us to the first backoff step. if (openedAt && Date.now() - openedAt > 10_000) attempt = 0; + openedAt = 0; // Browsers never reconnect a WebSocket on their own. const delay = Math.min(30_000, 1000 * 2 ** attempt) + Math.random() * 1000; diff --git a/ui/src/pages/terminal/useXterm.ts b/ui/src/pages/terminal/useXterm.ts index cdcb21d..e60f16b 100644 --- a/ui/src/pages/terminal/useXterm.ts +++ b/ui/src/pages/terminal/useXterm.ts @@ -172,6 +172,10 @@ export function useXterm({ pageRef, hostRef }: Options) { toast.info("Nothing to copy"); return; } + if (!navigator.clipboard) { + toast.error("Clipboard access requires HTTPS or localhost"); + return; + } try { await navigator.clipboard.writeText(text); toast.success( @@ -184,6 +188,10 @@ export function useXterm({ pageRef, hostRef }: Options) { } }, []); const paste = useCallback(async (writeData: (data: string) => void) => { + if (!navigator.clipboard) { + toast.error("Clipboard access requires HTTPS or localhost"); + return; + } try { const text = await navigator.clipboard.readText(); if (text) writeData(text);