logicsrc/apps/pwa
Anthony Ettinger 159ae20be1
fix: broken links on logicsrc.com and the WebAuthn bundle 500 on app.logicsrc.com (#242)
* fix(web): broken doc links and missing OpenI18n/OpenL10n landings

ThreatCrush Link Watch found 14 dead links on logicsrc.com:

- /docs/opencreds linked its sub-documents and sibling specs as relative
  Markdown files (./opencreds/spec.md, ./credential-sharing.md), which
  resolved to /docs/*.md URLs the site never serves. Rendered docs now map
  a link to a served doc to /docs/<slug> and anything else to the file in
  the public repository; redirects keep the already-crawled .md URLs working.
- OpenI18n and OpenL10n were registered with a /<slug> landing that has no
  page, so the sidebar and family grids linked /openi18n and /openl10n.
  They now have no landing (link to their docs), and the old paths redirect.

A contract test checks that no rendered doc keeps a relative .md link, that
every repository target exists, and that every spec landing has a page.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(pwa): serve the WebAuthn bundle from the hoisted install

/vendor/simplewebauthn-browser.umd.js joined apps/pwa/node_modules onto the
path, but the workspace install hoists @simplewebauthn/browser to the repo
root, so every sign-in and settings page loaded a 500 (ENOENT) and passkeys
could not work. Resolve the package like the libsodium vendor routes do.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 11:59:41 -07:00
..
public Machine API keys: headless teams pull for deploy boxes and CI (#230) 2026-10-05 23:08:32 -07:00
src fix: broken links on logicsrc.com and the WebAuthn bundle 500 on app.logicsrc.com (#242) 2026-10-17 11:59:41 -07:00
test Machine API keys: headless teams pull for deploy boxes and CI (#230) 2026-10-05 23:08:32 -07:00
.env.example feat(pwa): logicsrc credentials app — real auth + Turso, redesigned; retire commandboard-api credshare 2026-07-13 14:29:29 +00:00
.gitignore feat(pwa): logicsrc credentials app — real auth + Turso, redesigned; retire commandboard-api credshare 2026-07-13 14:29:29 +00:00
package.json pwa: read vault values in the browser with a pasted identity key (#225) 2026-10-04 02:55:34 -07:00
Procfile feat(pwa): logicsrc credentials app — real auth + Turso, redesigned; retire commandboard-api credshare 2026-07-13 14:29:29 +00:00
railway.json feat(pwa): logicsrc credentials app — real auth + Turso, redesigned; retire commandboard-api credshare 2026-07-13 14:29:29 +00:00
README.md Machine API keys: headless teams pull for deploy boxes and CI (#230) 2026-10-05 23:08:32 -07:00

@logicsrc/pwa — LogicSRC credentials

Express app on Postgres for team credential sharing: auth (email/password, passkeys, CoinPay OAuth, sessions, lsk_ CLI API keys) + end-to-end-encrypted team vaults. Zero-knowledge — the server only stores ciphertext, per-member sealed vault keys, and identity public keys. Decryption happens in the logicsrc CLI.

cp .env.example .env      # set SESSION_SECRET; DATABASE_URL=postgres://… for prod (else a local libSQL file db)
npm install
npm start                 # migrates on boot, serves on :8080

Database

Production runs on Postgres: DATABASE_URL must be a postgres:// URL and the app refuses to start on anything else there (a leftover libsql:// value is called out by name). The client is @profullstack/libsql-pg, which keeps the @libsql/client surface the code was written against and rewrites the remaining SQLite idioms per statement. Development and the tests use libSQL itself (file:./data/local.db by default, :memory: in tests).

Migrations run at boot and live in two dialect copies with the same file names: src/migrations/ (SQLite) and src/migrations-pg/ (Postgres, generated with npx libsql-pg convert-schema and reviewed). npm run migrate applies the copy matching DATABASE_URL. To move an existing Turso database:

DATABASE_URL=postgres://… npm run migrate                                   # schema
npx libsql-pg copy --from "$TURSO_DATABASE_URL" --token "$TURSO_AUTH_TOKEN" \
  --to "$DATABASE_URL" --verify                                             # rows

Set PWA_TEST_DATABASE_URL=postgres://… to run the test suite against a real Postgres (it drops and recreates the public schema of that database).

The CLI connects with LOGICSRC_API=<origin> logicsrc login (browser OAuth-PKCE loopback → an lsk_ key). See docs/credential-sharing.md in the repo root.

Deploy boxes and CI use a machine key instead (logicsrc keys create, or Settings ▸ API keys): one team, optional vault list, read-only by default, optional expiry, and its own identity public key on the api_keys row. Vault keys reach it through credshare_key_grants. Routes: GET|POST /api/keys, DELETE /api/keys/:id (session or a person's key only) and GET|POST /api/credshare/vaults/:id/key-grants, DELETE /api/credshare/vaults/:id/key-grants/:keyId. Migration 005_machine_keys.sql; tests in test/machine-keys.test.mjs.