Open-source Grok Bot alternative with a virtual machine that bots can use
Enterprise layer loading and license expiry
Sub-features
- Find the bundled enterprise layer in every shipped layout: a checkout
(
enterprise/besideserver/), the npm package (<package>/enterprise/besidedist-server/), and the Docker image and packaged desktop, which carrydist-server/alone (dist-server/enterprise/).OMB_ENTERPRISE_DIR, when set, is the only place looked at. - From 30 days before a key expires:
expiresInDayson/api/edition, a warning in the startup log, and a banner in Settings for admins. The dates reach admin sessions only: a member's/api/editionand config leave outexpiresInDays,graceEndsAtand the notice. - For 14 days after it expires the entitlements keep working, with a notice,
graceEndsAton/api/edition, and a banner saying until when. Then they stop, without a restart. The key format and signature check are unchanged. - On a server install the key may be in
<data>/license.key, inOMB_LICENSE_KEY, or in<data>/license.last-good(the last one accepted); the one issued last wins. The file is checked once a minute and everything read hourly; a broken, missing or older file keeps the licence in force, even across a restart, until its grace ends, logged once. Desktops, Cloud homes and hosted workspaces readOMB_LICENSE_KEYalone, as before. - Optional
seats,plan,sub,serverandiatclaims in the sameomb1/v: 1format, accepted by servers from before them. GET /api/license(owner or admin): validity, source, plan, seats, expiry and days of grace left, never the key.
Driving it
pnpm exec vitest run server/enterprise.test.ts enterprise/server/register.test.ts
pnpm exec vitest run enterprise/server/license.test.ts server/license-refresh.test.ts server/license-source.test.ts server/routes/license.test.ts
pnpm exec vitest run --no-file-parallelism server/license-expiry-api.test.ts server/hosted-access.test.ts
pnpm test:packaged-server
server/enterprise.test.ts builds each layout in a temporary directory and
checks which copy wins, the warning window, the grace period and the moment it
ends. enterprise/server/register.test.ts issues keys with a throwaway signing
pair and checks the layer accepts a key that lapsed less than 14 days ago and
refuses it after. server/license-expiry-api.test.ts boots the control-omb
fixture with a stand-in layer whose key expires in 12 days, expired 2 days
ago, or expires in 90 days, and reads /api/edition, the server log, and
/api/config as an admin and as a chat-only device.
server/hosted-access.test.ts checks a hosted server withdraws readiness the
moment its grace period ends. The packaged-server smoke copies dist-server/
out of the repository, boots it with a key that is not genuine, and fails if
/api/edition says no layer exists; the Docker workflow makes the same check
against the built image.
Gotchas
- Tested on 2026-09-23 against disposable fixtures only: stand-in layers, throwaway signing keys and a temporary home. No real license key, hosted tenant or cloud Admin was involved; this is not production qualification.
- The cloud Admin's own license check (
verifyLicenseKeycalled directly) has no grace period; only the OMB server'sregister()path does. - The Settings banner is proven from fixtures in
src/components/LicenseExpiryBanner.test.ts, not driven headlessly.