Skip to content

feat(den): self-host Linux tarball with installer, systemd units, and upgrade spec - #3499

Open
benjaminshafii wants to merge 5 commits into
devfrom
feat/den-selfhost-tarball
Open

feat(den): self-host Linux tarball with installer, systemd units, and upgrade spec#3499
benjaminshafii wants to merge 5 commits into
devfrom
feat/den-selfhost-tarball

Conversation

@benjaminshafii

Copy link
Copy Markdown
Member

What

Community-supported (best effort) native Linux packaging for the self-hosted Den stack, first step for #2084: one downloadable tarball that installs den-api + den-web on a plain Linux box (target: Proxmox LXC, no Docker).

  • scripts/den/build-selfhost-bundle.mjs (+ root script den:selfhost:bundle): builds den-api, den-web, and den-db assets, does a production pnpm deploy per service (patches applied, sharp native install for the target host), bundles a Node 22 runtime (--node-source download|host), and emits dist-selfhost/openwork-den-<platform>-<arch>-<version>.tar.gz.
  • install.sh: versioned installs under <prefix>/versions/<v> with an atomic current symlink flip, preserves den.env on upgrade, installs systemd units (--no-systemd/--no-user/--prefix/--config-dir/--systemd-dir for non-root or test installs), creates the openwork-den system user.
  • bin/openwork-den: migrate | start-api | start-web launcher; migrate runs the same den-db bootstrap.js the Helm migration job uses.
  • systemd: openwork-den-api.service (ExecStartPre runs migrate, so migrations always run before start), openwork-den-web.service (After/Wants api), openwork-den.target.
  • CI: new den-selfhost-bundle job in publish-ee-images.yml builds linux-x64 and uploads the artifact; on v* tags it attaches the tarball to the GitHub release. x64-only for now: sharp needs a native build host and no arm64 runner is used in this repo yet.

Validation

Spec: evals/specs/den-selfhost-tarball.slow.test.ts (testkit, gated on OPENWORK_EVAL_APP_SPECS=1 + local MySQL) encodes the approved demo narration frame by frame: tarball contents incl. bundled node, no-Docker install, installer contract (config template, two services + target, service user), openwork-den migrate against an ephemeral MySQL db (__drizzle_migrations witness), both services healthy on configured ports, bootstrap admin sign-in on a single private org with outsider signup rejected (403), then an upgrade that flips current, preserves den.env byte-for-byte, re-migrates idempotently, keeps the same admin working, and rejects a wrong password.

Commands run (both green, second run on the PR head SHA):

  • OPENWORK_EVAL_APP_SPECS=1 pnpm --dir evals exec vitest run --config vitest.config.ts den-selfhost-tarball → 1 passed (366s, and 368s rerun at a207591)
  • node scripts/den/build-selfhost-bundle.mjs --node-source host → produced openwork-den-darwin-arm64-0.18.13.tar.gz
  • pnpm evals:typecheck → clean

Evidence tape published in the sticky PR comment. The CI job itself is config-only and not runtime-proven here.

Notes

  • packages/types/tsup.config.ts: added existing-source entry points (workspace, desktop-ipc, connect-link, url) because the deployed production bundle resolves built JS instead of workspace TS sources.
  • your-connections-screen.tsx: pre-existing den-web typecheck error (React.Ref without a React import), fixed minimally because the den-web typecheck is part of this change's verification.
  • Linux distro packages (.deb/.rpm) remain out of scope; this tarball is the community-supported first step discussed in [Feature]: Restore .deb and .rpm Linux packaging targets dropped in Tauri → Electron migration #2084.

@vercel

vercel Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
openwork-app Ready Ready Preview Aug 4, 2026 2:25pm
openwork-den Ready Ready Preview Aug 4, 2026 2:25pm
openwork-den-worker-proxy Ready Ready Preview Aug 4, 2026 2:25pm
openwork-diagnostics Ready Ready Preview Aug 4, 2026 2:25pm
openwork-landing Ready Ready Preview, v0 Aug 4, 2026 2:25pm

@benjaminshafii

benjaminshafii commented Aug 4, 2026

Copy link
Copy Markdown
Member Author

Photo roll — one-native-den-tarball-installs-starts-and-upgrades-without-losing-its-admin — 0/0 frames passed · 6 facts

0/0 frames passed · 6 facts · 6 expectations passed · 0 failed

ℹ️ FACT — 1. One platform tarball contains Den API, Den Web, and a bundled Node runtime

openwork-den-darwin-arm64-0.18.13.tar.gz; openwork-den-0.18.13/bin/node, openwork-den-0.18.13/bin/openwork-den, openwork-den-0.18.13/services/den-api/dist/main.js, openwork-den-0.18.13/services/den-web/.next/BUILD_ID, openwork-den-0.18.13/install.sh

  • PASS One platform tarball contains Den API, Den Web, and a bundled Node runtime — openwork-den-darwin-arm64-0.18.13.tar.gz; openwork-den-0.18.13/bin/node, openwork-den-0.18.13/bin/openwork-den, openwork-den-0.18.13/services/den-api/dist/main.js, openwork-den-0.18.13/services/den-web/.next/BUILD_ID, openwork-den-0.18.13/install.sh

ℹ️ FACT — 2. The native install has no Docker dependency and uses a reachable network MySQL database

MySQL reachable at 127.0.0.1:3306; install and launch scripts contain no Docker invocation

  • PASS The native install has no Docker dependency and uses a reachable network MySQL database — MySQL reachable at 127.0.0.1:3306; install and launch scripts contain no Docker invocation

ℹ️ FACT — 3. install.sh creates the service account contract, config template, two services, and target

Installed den.env and three units under the isolated prefix; units run as openwork-den

  • PASS install.sh creates the service account contract, config template, two services, and target — Installed den.env and three units under the isolated prefix; units run as openwork-den

ℹ️ FACT — 4. openwork-den migrate prepares MySQL with the same Den DB bootstrap used by cloud

Migration exited 0 and __drizzle_migrations exists in den_selfhost_51143_mseqi7d3_44760f0399f0

  • PASS openwork-den migrate prepares MySQL with the same Den DB bootstrap used by cloud — Migration exited 0 and __drizzle_migrations exists in den_selfhost_51143_mseqi7d3_44760f0399f0

ℹ️ FACT — 5. Den API and Web start on configured ports with one private organization and its bootstrap admin

API /health and Web /api/ready returned 2xx; admin endpoint returned 2xx; outsider signup returned 403

  • PASS Den API and Web start on configured ports with one private organization and its bootstrap admin — API /health and Web /api/ready returned 2xx; admin endpoint returned 2xx; outsider signup returned 403

ℹ️ FACT — 6. Upgrade flips current, preserves den.env, migrates before restart, and keeps the existing admin

current -> versions/0.18.13+1; config bytes and mtime preserved; same admin signed in; wrong password returned 401

  • PASS Upgrade flips current, preserves den.env, migrates before restart, and keeps the existing admin — current -> versions/0.18.13+1; config bytes and mtime preserved; same admin signed in; wrong password returned 401

Roll created 2026-08-04T14:09:21.333Z · Source: evals/results/rolls/2026-08-04T14-09-21-332Z-one-native-den-tarball-installs-starts-and-upgrades-without-losing-its-admin/roll.json · Repro: pnpm fraimz:publish -- --pr 3499 --roll 2026-08-04T14-09-21-332Z-one-native-den-tarball-installs-starts-and-upgrades-without-losing-its-admin

Comment thread scripts/den/build-selfhost-bundle.mjs
Comment thread scripts/den/selfhost/bin/openwork-den
@mintlify

mintlify Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
differentai 🟢 Ready View Preview Aug 4, 2026, 2:11 PM

💡 Tip: Enable Workflows to automatically generate PRs for you.

Comment thread scripts/den/build-selfhost-bundle.mjs
Comment thread .github/workflows/publish-ee-images.yml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants