You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The default SQLite db path is package-relative: <package-root>/data/sideshow.db, derived in server/index.ts (SIDESHOW_DATA → SIDESHOW_DB, both defaulting under <root>/data/). This causes two distinct failure modes, only the first of which #157 fixed:
Missing parent dir (ENOENT) — fixed by fix: create sqlite db parent directory before opening #157. node:sqlite does not create parent dirs, and the package ships no data/ folder, so npx sideshow serve and nvm-global installs (user-owned node_modules) crashed on first run. The mkdirSync(dirname(path), { recursive: true }) guard in createSqliteStorage resolved this.
Read-only package dir (EACCES) — still broken. A sudo npm install -g sideshow puts the package under /usr/lib/node_modules/, which is root-owned. The mkdir guard then throws EACCES (permission denied), not ENOENT, and the server still crashes. Repro: chmod 555 the parent of SIDESHOW_DB and boot.
Data wiped on reinstall (latent data loss). Even when writable, data living under node_modules/sideshow/data/ is deleted by npm install -g on upgrade. A user who runs sideshow for weeks, upgrades, and loses their workspace has no warning.
Proposal
Default the data/db path to a user-owned home location — ~/.sideshow/sideshow.{json,db} (or XDG: ~/.local/share/sideshow/). Specifically:
Change the SIDESHOW_DATA / SIDESHOW_DB defaults in server/index.ts to resolve under the home dir rather than the package root.
Add a one-time migration of an existing <package-root>/data/sideshow.{db,json} → ~/.sideshow/, mirroring the existing migrateJsonToSqlite pattern (sentinel setting, idempotent, never overwrites non-empty target).
Problem
The default SQLite db path is package-relative:
<package-root>/data/sideshow.db, derived inserver/index.ts(SIDESHOW_DATA→SIDESHOW_DB, both defaulting under<root>/data/). This causes two distinct failure modes, only the first of which #157 fixed:Missing parent dir (ENOENT) — fixed by fix: create sqlite db parent directory before opening #157.
node:sqlitedoes not create parent dirs, and the package ships nodata/folder, sonpx sideshow serveandnvm-global installs (user-ownednode_modules) crashed on first run. ThemkdirSync(dirname(path), { recursive: true })guard increateSqliteStorageresolved this.Read-only package dir (EACCES) — still broken. A
sudo npm install -g sideshowputs the package under/usr/lib/node_modules/, which is root-owned. The mkdir guard then throws EACCES (permission denied), not ENOENT, and the server still crashes. Repro:chmod 555the parent ofSIDESHOW_DBand boot.Data wiped on reinstall (latent data loss). Even when writable, data living under
node_modules/sideshow/data/is deleted bynpm install -gon upgrade. A user who runssideshowfor weeks, upgrades, and loses their workspace has no warning.Proposal
Default the data/db path to a user-owned home location —
~/.sideshow/sideshow.{json,db}(or XDG:~/.local/share/sideshow/). Specifically:SIDESHOW_DATA/SIDESHOW_DBdefaults inserver/index.tsto resolve under the home dir rather than the package root.mkdirSyncguard from fix: create sqlite db parent directory before opening #157 as defense-in-depth (a user may still pointSIDESHOW_DBinto a not-yet-created dir).<package-root>/data/sideshow.{db,json}→~/.sideshow/, mirroring the existingmigrateJsonToSqlitepattern (sentinel setting, idempotent, never overwrites non-empty target).Context
mkdirSyncguard (fixes the npx / user-owned-global ENOENT case). This issue covers the remaining EACCES case + the reinstall-data-loss case.Acceptance
sudo npm install -g sideshow && sideshow serveboots withoutSIDESHOW_DBset, writing to~/.sideshow/.node_modules).<pkg>/data/location are migrated once on boot.:memory:contract suite and allSIDESHOW_*overrides unchanged.