Commit graph

16 commits

Author SHA1 Message Date
bbf640abeb
App grants: one secret sealed to an external app (key hub phase 1) (#286)
Some checks failed
CI / build (push) Has been cancelled
Deploy to dev2 / deploy (push) Has been cancelled
test / test (push) Has been cancelled
* App grants: hand one secret to an external app, sealed to its per-user inbox

Phase 1 of the CoinPay <-> logicsrc key hub (spec: claude.ai/artifact/LAZgAiqWqeLQ14uJ5JpdKb).

- /grant consent page: logicsrc fetches the request manifest from the app's
  own origin over TLS (/.well-known/logicsrc-grant/<nonce>), public hosts
  only, so the page shows a verified origin, not a claimed name
- The browser decrypts with the identity key (as the vault page does) and
  seals with @profullstack/sealed-secrets to the app's inbox; the server
  stores ciphertext + metadata only (app_grant_requests, app_grants)
- Signed Standard Webhooks to the app: grant.delivered / updated / revoked
- Signing keys (wallet, seed, SSH) are refused for apps
- rotate-keys re-seals the new value to every app grant on the old
  fingerprint (resealAppGrants); /apps lists and revokes grants

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

* App grants: re-check the webhook host is public on every delivery

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

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 05:16:37 -08:00
sh1pt-actions-fleet[bot]
fd0a6047e3
fix: fill company website from OpenProfile (#281)
Some checks failed
CI / build (push) Has been cancelled
Deploy to dev2 / deploy (push) Has been cancelled
test / test (push) Has been cancelled
Co-authored-by: Anthony Ettinger <anthony@profullstack.com>
2026-11-01 16:15:23 +00:00
sh1pt-actions-fleet[bot]
53e08902cb
feat: import OpenProfile on connect (#280)
Co-authored-by: Anthony Ettinger <anthony@profullstack.com>
2026-11-01 14:23:39 +00:00
sh1pt-actions-fleet[bot]
4daee10537
Use the latest shared footer (#277)
* Use latest shared footer

* Use latest shared footer and restore square badges

* Keep the existing workspace lock structure

---------

Co-authored-by: Anthony Ettinger <anthony@profullstack.com>
2026-10-31 07:14:35 +00:00
sh1pt-actions-fleet[bot]
e60d31a1b4
refactor(pwa): paid auto-rotation runs on @profullstack/key-rotation (#273)
Some checks are pending
CI / build (push) Waiting to run
Deploy to dev2 / deploy (push) Waiting to run
test / test (push) Waiting to run
The checkout, webhook settle, return check and expiry/renewal sweep from #272
move into the new @profullstack/key-rotation package (0.1.0) so other fleet
apps can sell the same add-on. lib/auto-rotation.mjs keeps its exports and
binds the package to credshare_teams, owners/admins, the audit log and the
app.logicsrc.com CoinPay business. No schema or behaviour change.

Co-authored-by: Anthony Ettinger <anthony@profullstack.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-29 05:33:56 +00:00
sh1pt-actions-fleet[bot]
0cfb94e56c
feat(rotation): buy automatic rotation, $29 per team per 30 days (CoinPay) (#272)
- Rotation page button + POST /api/credshare/teams/:slug/rotation/auto/checkout
  open a CoinPay hosted checkout (owner/admin only).
- POST /api/coinpay/webhook and the page's return check settle once per checkout
  session (rotation_payments); paying again extends from the current end.
- Hourly sweep: renewal email 3 days before, switch off when the days run out.
  A team switched on by hand (paid_until NULL) never expires.
- Migration 012 (both dialects), CSP form-action allows coinpayportal.com.

Co-authored-by: Anthony Ettinger <anthony@profullstack.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-29 05:12:01 +00:00
sh1pt-actions-fleet[bot]
87bbc50423
Rotation on every surface: desktop rotator, Rotation page + run queue, MCP tools (CLI 0.15.0) (#269)
- method "desktop": dashboard-only keys (OpenAI, ElevenLabs, Brave Search,
  Civitai, Cloudflare Global API Key roll, Anthropic/Claude OAuth report-only)
  rotated by an agent on a W3BS Agentic Desktop Layer host (--desktop /
  LOGICSRC_DESKTOP_HOST). Agent browser only, old key by its last 4 chars,
  DOM-to-file capture (wl-paste fallback), two-phase revoke after health,
  rollback deletes the new key, remote file shredded. needs-login and busy
  are waits, not failures. Roll needs --allow-roll plus a capture self-test.
- app.logicsrc.com: /teams/:slug/rotation plan page + rotation run queue
  (migration 010), API routes; runner: rotate-keys --from-queue.
- MCP: rotation_plan, rotation_set, rotate_keys (dry run default), rotation_runs.
- docs/rotation.md: desktop rotators and every surface.

Co-authored-by: Anthony Ettinger <anthony@profullstack.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-29 04:30:18 +00:00
Anthony Ettinger
ae6298851b security: harden credentials app after the 2026-10-27 dev2 incident (CLI 0.10.0)
An attacker with root on dev2 read identity.json (identity secret key + a user
lsk_ token) and used the token against app.logicsrc.com. This closes the gaps
that made that worse than it had to be, and adds the tools to recover.

Identity keys
- A registered identity public key is never replaced by a login any more
  ("last login wins" let a stolen token swap in an attacker key). Changing it
  needs `logicsrc teams rotate-identity`: the server seals a random answer to
  the CURRENT key (single use, 5 min); the CLI proves possession and re-seals
  every vault grant to the new key in one transaction (POST /keys/rotate).
- Lost key: reset from a signed-in browser (Settings), which drops every grant
  sealed to the old key. `logicsrc teams key --import` moves a key to a new box.

Vault re-key
- `logicsrc teams rekey <team> <project> <env>` and `--all`: new vault key,
  values re-encrypted client side, re-sealed to every current member and
  machine key. Server bumps credshare_vaults.key_version; writes that name a
  retired version get 409, and the rekey UPDATE only touches rows whose value
  did not change mid-flight. A verify pass (per vault and a final sweep)
  re-seals any value a racing older client wrote under the retired key.

Key pinning (TOFU)
- CLI pins teammates' and machine keys' fingerprints in known-keys.json (0600)
  and refuses to seal (grant, rekey) to a changed key without
  --accept-key-change. `teams members` shows fingerprints and pin status;
  the dashboard shows fingerprints and public/pins.js flags changes.

Audit
- Every person read of a vault key (/grant) and of ciphertext (/secrets) is
  audited with IP and user agent (also denied reads and identity events).
  GET /teams/:slug/audit, `logicsrc teams audit`, and tables on the dashboard
  and vault pages.

At rest / transport
- Session tokens stored as sha256 (rows hashed in migration 007); CLI auth
  codes hashed. New API keys no longer travel in the /settings URL.
- CSP (script-src 'self', no inline script or handlers, frame-ancestors none),
  HSTS, X-Frame-Options, Referrer-Policy no-referrer, COOP/CORP, no-store on
  authenticated pages. Inline scripts moved to /app.js and
  /vendor/profile-enhance.js.
- The shared footer renders from the bundled template of a pinned
  @profullstack/footer 0.5.0 (allowlist sanitizer); no runtime CDN fetch.
- Migrations can run as a separate owner role (MIGRATE_DATABASE_URL) so the
  app can connect as a DML-only role with an append-only audit table.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-28 16:04:22 +00:00
297c5df54a
chore(deps): upgrade all dependencies; next 16.4.3 (RCE GHSA-2464-fhr4-w9xw) (#257)
- next 16.3.8 -> 16.4.3 (GHSA-2464-fhr4-w9xw, GHSA-673q-mjm6-r5xr)
- every workspace dependency to latest; majors: express 5, @simplewebauthn 14,
  imapflow 2 (status() may return false), nodemailer 10, libsodium-wrappers 0.8,
  commander 15, vite 8, @vitejs/plugin-react 6, typescript 7 (base tsconfig
  lists types: ["node"]), @logicsrc/validators 0.6, openmcp 0.4, hqtui 0.11,
  stack 0.5, x402-gateway 0.13
- bun 1.4.4 (image + packageManager)
- bun audit: 3 critical / 34 high -> 0

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-26 07:06:46 -07:00
50eb8ac30d
feat(pwa): signup profile fields via @profullstack/profile (#256)
The create-account form (/?mode=up) asks for first/last name (required) and
company domain, job title, LinkedIn (optional) beside the email box, rendered
by renderProfileFields. /auth/register validates them with validateProfile
before the user exists and stores them with saveSignupProfile in a new
user_profiles table keyed by users.id. GET/PUT/PATCH /api/v1/me/profile
(session cookie) and a "Your details" card on /settings. Sign-in, passkey and
CoinPay are unchanged.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-26 04:24:44 -07:00
ff0c903c6d
Profullstack footer on the app.logicsrc.com sign-in page (#255)
Some checks are pending
CI / build (push) Waiting to run
Deploy to dev2 / deploy (push) Waiting to run
test / test (push) Waiting to run
* Profullstack footer on the app.logicsrc.com sign-in page (webring + built.indie + pwamart badges)

Server-rendered @profullstack/footer (clearnet template) under the LogicSRC
footer on the public sign-in page (/), bundled at boot and refreshed from the
@latest template every 15 min. Serves /.well-known/openwebring.json for the
Profullstack ring. Lockfile footer 0.2.1 -> 0.2.6 (checked with bun 1.4.2
--frozen-lockfile).

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

* PWA manifest + meta description: say what the app is (it carried a moshcode tagline)

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

* test(web): ring nav has previous/next only since footer 0.2.2 (no random hop)

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

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-26 03:45:08 -07:00
5bebc50beb
pwa: read vault values in the browser with a pasted identity key (#225)
* pwa: read vault values in the browser with a pasted identity key

The web app listed vaults but could never show a value: decryption needs the
member's X25519 secret key, which only lives in identity.json on the machine
that ran `logicsrc login`.

Each vault now has a page (/teams/:slug/vaults/:id, linked from the
dashboard) listing its secret names. Paste the identity key (or the whole
identity.json) and public/vault.js decrypts in the browser with the same
libsodium calls as the CLI: crypto_box_seal_open for the grant, then
crypto_secretbox_open_easy per value. Nothing is sent to the server.

- The pasted key is checked against the public key the server has on file
  before use, so a key from another machine is named, not a generic failure.
- Show / Copy per value, Download .env, Forget key. The key is kept in
  sessionStorage unless "remember on this device" is ticked.
- A member with no identity yet can create one in the browser. That
  registers only the public half, and is offered only when no key is
  registered, since replacing one would orphan every grant sealed to it.
- libsodium is served from node_modules at /vendor (no CDN), like simplewebauthn.
- Vault pages are no-store and the service worker no longer caches no-store pages.
- CLI: `logicsrc teams key` prints the secret key to stdout alone (pipe to
  pbcopy) and warns when the server holds a different public key. The page
  also gives a jq one-liner for CLIs released before this command.

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

* pwa: rename data-secret to data-key-name

ThreatCrush read data-secret="…" as a hardcoded credential (2 high, both
the attribute name, never a value).

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

* CLI 0.5.0 for teams key; install via install.sh, not npm

@logicsrc/cli is not on npm; the CLI ships through
curl -fsSL https://logicsrc.com/install.sh | sh, which builds master and
reports the version from packages/cli/package.json. 0.5.0 marks the first
build with teams key, and the vault page now says so and points older
installs at the jq fallback.

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

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-04 02:55:34 -07:00
20797a98f1
Run on Bun: bun install, bun --bun next, both dev2 sites on Bun (#222)
Some checks are pending
CI / build (push) Waiting to run
Deploy to dev2 / deploy (push) Waiting to run
test / test (push) Waiting to run
* Run on Bun: bun install, bun --bun next, both dev2 sites on Bun

Moves logicsrc.com and app.logicsrc.com (one image) off Node + npm onto Bun,
following the fleet recipe (phonenumbers.bot pilot).

- Package manager: bun.lock migrated from package-lock.json, so every resolved
  version is unchanged; packageManager bun@1.4.2. Root scripts run each
  workspace with `bun run --cwd <dir>` instead of `npm --workspace`.
- Bun 1.4.2, not the fleet's 1.4.0: 1.4.0 re-resolves this workspace's `file:`
  cross-references differently on every install, so its own lockfile never
  passes --frozen-lockfile. 1.4.2 is stable on it.
- Runtime: logicsrc-web runs `bun --bun next build/start`; apps/pwa (Express,
  app.logicsrc.com) runs `bun src/server.mjs`.
- Image: .nixpacks/Dockerfile (the path both dev2 compose stacks build) is now
  a hand-written oven/bun image carrying the whole workspace, run as the
  non-root bun user. ENTRYPOINT stays `bash -l -c` so a compose `command:` is
  one string, as before; app.logicsrc.com's compose starts it with
  "npm --workspace @logicsrc/pwa run start", which .nixpacks/npm (the image's
  only `npm`) turns into `bun run start` in apps/pwa. Port 3000, the PUBLIC_URL
  build arg and the / health path are unchanged. The nixpacks .nix and
  build.sh are gone.
- CI: both workflows install with bun and run every script through bun (Node
  stays only as the interpreter for vitest/tsc/node --test/Playwright, as
  before), and CI now boots the site under Bun.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* ci: boot check on port 3100 and stop it before Playwright needs 3000

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* fix(web): keep next dev on port 5174, which Playwright waits on

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-01 08:14:40 -07:00
4ac750e65b
feat(pwa): move app.logicsrc.com from Turso/libSQL to Postgres via @profullstack/libsql-pg (#218)
Production reads DATABASE_URL (postgres://) through @profullstack/libsql-pg,
which keeps the @libsql/client surface; no query changed. A missing,
non-Postgres or leftover libsql:// URL fails at boot in production. Dev and
tests keep libSQL (file:/:memory:) as a devDependency. Postgres migrations in
src/migrations-pg/ (converted with libsql-pg convert-schema, same file names
so the copied _migrations ledger matches); migrate.mjs picks the dialect.
Tests run against Postgres with PWA_TEST_DATABASE_URL.

Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-25 09:28:40 -07:00
e4723f31b1 feat(credentials): manage team members and rotate invites
Some checks are pending
CI / build (push) Waiting to run
test / test (push) Waiting to run
2026-08-04 19:16:02 +00:00
9ba044577f feat(pwa): logicsrc credentials app — real auth + Turso, redesigned; retire commandboard-api credshare
Some checks failed
CI / build (push) Has been cancelled
test / test (push) Has been cancelled
Adds apps/pwa: an Express + libSQL/Turso app that is now the home of team
credential sharing, with the moshcode-style auth stack ported and reskinned to
match logicsrc.com (light theme, Inter, green accent).

apps/pwa
- auth: email/password (scrypt), passkeys (WebAuthn), CoinPay OAuth, cookie
  sessions, and lsk_ API keys for the CLI via a loopback OAuth-PKCE flow
  (/cli/authorize + /cli/token). Ported from the moshcode PWA.
- credshare API (/api/credshare/*): teams, members, invites, vaults, sealed
  grants, ciphertext secrets, audit — authed by session OR Bearer lsk_ key.
  Zero-knowledge: only ciphertext + sealed vault keys + public keys stored.
- teams dashboard, accept-invite, and settings (API keys) pages, server-rendered
  in the LogicSRC brand (lib/html.mjs).
- migrations (libSQL) 001_auth + 002_credshare, migrate-on-boot; Turso via
  TURSO_DATABASE_URL / TURSO_AUTH_TOKEN, or a local file db for dev.
- trimmed moshcode-specific approvals/credits/push/deliver.

CLI
- `logicsrc login` now does browser loopback OAuth-PKCE against the app and
  stores an lsk_ token (email-OTP removed); --token for CI. Client repointed.

Distribution
- install.sh (served at logicsrc.com/install.sh) installs the CLI from the
  GitHub repo: tarball -> npm install -> `npm run build:cli` -> logicsrc wrapper.
- root build:cli builds only the CLI's workspace chain (skips web/api/next).

Cleanup
- removed the commandboard-api credshare backend (superseded by the PWA) and its
  Supabase/Turso stores + libsql dep; commandboard-api tests green (40).
- removed the Next.js /teams page (the PWA is the web UI now).

Verified end-to-end: two accounts register on the PWA, mint lsk_ keys, CLI login
uploads identity keys, owner pushes an encrypted .env, teammate invited ->
accepted -> granted -> pulls the exact file. Server stores ciphertext only.
Full workspace build + tests green.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-13 14:29:29 +00:00