Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS
JavaScript ai-agentsdashboarddeveloper-toolsdigital-twinquantified-selfsecond-brainself-hostedtailscale
fix: Database page works on Windows (db.sh path + mkdir)
[._.]/ Adam Eivye9dc3d21b064
diff --git a/.changelog/NEXT.md b/.changelog/NEXT.mdindex 88fe27130a..9c0ae88b33 100644--- a/.changelog/NEXT.md+++ b/.changelog/NEXT.md@@ -8,6 +8,10 @@- **Songs: a live vocal tuner while you record** — the song recorder now shows the note you're singing and how flat or sharp it is, in real time, right next to the metronome. Hit a take and the tuner reads the same microphone you're recording into (it never opens a second mic), displaying the detected note and a green/yellow/red cents needle that swings flat ↔ sharp and centers when you're in tune. When you're not recording, a **Tune** button opens a standalone tuning mode that listens to the mic without recording or saving anything — handy for warming up or finding a starting pitch. Mobile-friendly, and the mic and analysis shut down cleanly the moment you stop or leave the page. Built on the in-house pitch-detection core — no third-party audio library. (#1023)- **[issue-1026] Songs: sing a melody and turn it into sheet music** — the score editor has a new **Sing to score** panel. Press Sing, get a one-bar count-in so you know where the downbeat is, sing your phrase, then press Stop — PortOS listens to the melody, picks out the notes, snaps their timing to the song's tempo, and writes them out as notation. The detected notes preview on a real staff before you commit, and you can append them to the end of your score or drop them in place of whatever you've selected in the editor. Notes are spelled to match the song's key (flats in a flat key), and it all runs on the built-in pitch detection — no extra audio library.+## Fixed++- **Database page works on Windows** — the Database page's Start/Fix/Status actions invoke the `db.sh` manager through bash; on Windows the script's native path (`H:\…\db.sh`) was passed with backslashes, which bash collapsed into a bogus path (exit 127, "No such file or directory"), so the page reported the Docker database as stopped even while it was running. The path is now normalized to forward slashes, which Git Bash accepts on Windows. A second Windows-only failure in the per-backend export path (spawning `mkdir -p`, which isn't a real executable on Windows) was also fixed by using Node's filesystem API instead. Mac/Linux behavior is unchanged.+## Changed- **Songs: built-in alert stacks cleanly on mobile** — the "Built-in default" banner on the song page now stacks its label, description, and Refresh action vertically on narrow screens instead of cramming them onto one row, with full-width touch targets for the refresh/confirm buttons.diff --git a/server/routes/database.js b/server/routes/database.jsindex 511919ca11..b96d3f9ca0 100644--- a/server/routes/database.js+++ b/server/routes/database.js@@ -1,6 +1,6 @@import { Router } from 'express';import { execFile } from 'child_process';-import { existsSync } from 'fs';+import { existsSync, mkdirSync } from 'fs';import { join } from 'path';import { asyncHandler, ServerError } from '../lib/errorHandler.js';import { checkHealth, query } from '../lib/db.js';@@ -8,7 +8,12 @@ import { PATHS } from '../lib/fileUtils.js';import { resolvePgDumpBinary } from '../lib/pgTools.js';const rootDir = PATHS.root;-const dbScript = join(rootDir, 'scripts', 'db.sh');+// Pass the script path to bash with forward slashes. On Windows the native+// path is `H:\...\db.sh`; bash treats each backslash as an escape character+// and collapses it to `H:...db.sh` (exit 127, "No such file or directory").+// Git Bash accepts drive paths with forward slashes (`H:/.../db.sh`), so+// normalize separators here. POSIX paths are unaffected (no backslashes).+const dbScript = join(rootDir, 'scripts', 'db.sh').replace(/\\/g, '/');const router = Router();@@ -484,7 +489,10 @@ router.post('/export', asyncHandler(async (req, res) => {throw new ServerError(`${backend} database not running on port ${port}`, { status: 400 });}const dumpDir = join(rootDir, 'data', 'db-dumps');- await runCmd('mkdir', ['-p', dumpDir], 5_000);+ // Use Node's fs (not `mkdir -p`): on Windows `mkdir` is a cmd.exe builtin,+ // not a spawnable executable, and `-p` isn't a valid flag — execFile would+ // fail with ENOENT. `recursive: true` is the cross-platform equivalent.+ mkdirSync(dumpDir, { recursive: true });const dumpFile = join(dumpDir, `portos-${backend}-${label}.sql`);// Use -f flag to write output directly — no shell redirect needed, avoids shell injection.// Resolve a pg_dump whose major is >= the TARGET backend's server (probed