Files
openwork/services/den/.env.example
ben 0e88389849 feat(den): add daytona-backed docker dev flow (#918)
* feat(den): add daytona-backed docker dev flow

* fix(den): allow multiple cloud workers in dev

* fix(den): use Daytona snapshots for sandbox runtime

Use a prebuilt Daytona snapshot for the dev worker runtime so sandboxes start with openwork and opencode already installed. Pass the snapshot through the local Docker flow and add a helper to build the snapshot image for repeatable setup.

* chore(den): lower Daytona snapshot defaults

Reduce the default snapshot footprint to 1 CPU and 2GB RAM so local Daytona worker testing fits smaller org limits more easily.

* Omar is comfortable

Make Daytona-backed cloud workers stable enough to reconnect through a dedicated proxy instead of persisting expiring signed preview URLs. Split the proxy into its own deployable service, share Den schema access through a common package, and fix the web badge so healthy workers show ready.

* chore(den-db): add Drizzle package scripts

Move the shared schema package toward owning its own migration workflow by adding generate and migrate commands plus a local Drizzle config.

* chore: update lockfile

Refresh the workspace lockfile so the new den-db Drizzle tooling is captured in pnpm-lock.yaml.

* feat(den-worker-proxy): make Vercel deployment-ready

Align the proxy service with Vercel's Hono runtime entry pattern and keep a separate Node server entry for Docker/local runs. Also scaffold the Vercel project/env setup and wire Render deploy sync to pass Daytona variables needed for daytona mode.

* feat(den-db): add db mode switch for PlanetScale

Support DB_MODE=planetscale with Drizzle's PlanetScale serverless driver while keeping mysql2 as the local default. This lets Vercel-hosted services use HTTP database access without changing local development workflows.

* refactor(den-db): adopt shared TypeID ids

Move the Den TypeID system into a shared utils package and use it across auth, org, worker, and sandbox records so fresh databases get one consistent internal ID format. Wire Better Auth into the same generator and update Den request boundaries to normalize typed ids cleanly.

* fix(den): restore docker dev stack after refactor

Include the shared utils package in the Den Docker images, expose MySQL to the host for local inspection, and fix the remaining Den build/runtime issues surfaced by the Docker path after the shared package and TypeID changes.

* docs(den): document Daytona snapshot setup

Add README guidance for building and publishing the prebuilt Daytona runtime snapshot, including the helper script, required env, and how to point Den at the snapshot for local Daytona mode.

* refactor(den-db): reset migrations and load env files

Replace the old Den SQL migration history with a fresh baseline for the current schema, and let Drizzle commands load database credentials from env files. Default to mysql when DATABASE_URL is present and otherwise use PlanetScale credentials so local Docker and hosted environments can share the same DB package cleanly.

* fix(den): prepare manual PlanetScale deploys

Update the Render workflow and Docker build path for the shared workspace packages, support PlanetScale credentials in the manual SQL migration runner, and stop auto-running DB migrations on Den startup so schema changes stay manual.

* feat(den-v2): add Daytona-first control plane

Create a new den-v2 service from the current Daytona-enabled control plane, default it to Daytona provisioning, and add a dedicated Render deployment workflow targeting the new v2 Render service.

* feat(den-worker-proxy): redirect root to landing

Send root proxy traffic to openworklabs.com so direct visits to the worker proxy domain do not hit worker-resolution errors.

---------

Co-authored-by: OmarMcAdam <gh@mcadam.io>
2026-03-16 21:20:26 -07:00

74 lines
2.3 KiB
Plaintext

DATABASE_URL=
DATABASE_HOST=
DATABASE_USERNAME=
DATABASE_PASSWORD=
DB_MODE=
BETTER_AUTH_SECRET=
BETTER_AUTH_URL=http://localhost:8788
DEN_BETTER_AUTH_TRUSTED_ORIGINS=http://localhost:3005,http://localhost:5173
GITHUB_CLIENT_ID=
GITHUB_CLIENT_SECRET=
GOOGLE_CLIENT_ID=
GOOGLE_CLIENT_SECRET=
PORT=8788
WORKER_PROXY_PORT=8789
CORS_ORIGINS=http://localhost:3005,http://localhost:5173
PROVISIONER_MODE=stub
OPENWORK_DAYTONA_ENV_PATH=
WORKER_URL_TEMPLATE=https://workers.example.com/{workerId}
RENDER_API_BASE=https://api.render.com/v1
RENDER_API_KEY=
RENDER_OWNER_ID=
RENDER_WORKER_REPO=https://github.com/different-ai/openwork
RENDER_WORKER_BRANCH=dev
RENDER_WORKER_ROOT_DIR=services/den-worker-runtime
RENDER_WORKER_PLAN=standard
RENDER_WORKER_REGION=oregon
RENDER_WORKER_OPENWORK_VERSION=0.11.113
RENDER_WORKER_NAME_PREFIX=den-worker
RENDER_WORKER_PUBLIC_DOMAIN_SUFFIX=openwork.studio
RENDER_CUSTOM_DOMAIN_READY_TIMEOUT_MS=240000
RENDER_PROVISION_TIMEOUT_MS=900000
RENDER_HEALTHCHECK_TIMEOUT_MS=180000
RENDER_POLL_INTERVAL_MS=5000
VERCEL_API_BASE=https://api.vercel.com
VERCEL_TOKEN=
VERCEL_TEAM_ID=
VERCEL_TEAM_SLUG=prologe
VERCEL_DNS_DOMAIN=openwork.studio
POLAR_FEATURE_GATE_ENABLED=false
POLAR_API_BASE=https://api.polar.sh
POLAR_ACCESS_TOKEN=
POLAR_PRODUCT_ID=
POLAR_BENEFIT_ID=
POLAR_SUCCESS_URL=http://localhost:8788
POLAR_RETURN_URL=http://localhost:8788
DAYTONA_API_URL=https://app.daytona.io/api
DAYTONA_API_KEY=
DAYTONA_TARGET=
DAYTONA_SNAPSHOT=
DAYTONA_SANDBOX_IMAGE=node:20-bookworm
DAYTONA_SANDBOX_CPU=2
DAYTONA_SANDBOX_MEMORY=4
DAYTONA_SANDBOX_DISK=8
DAYTONA_SANDBOX_PUBLIC=false
DAYTONA_SANDBOX_AUTO_STOP_INTERVAL=0
DAYTONA_SANDBOX_AUTO_ARCHIVE_INTERVAL=10080
DAYTONA_SANDBOX_AUTO_DELETE_INTERVAL=-1
DAYTONA_SIGNED_PREVIEW_EXPIRES_SECONDS=86400
DAYTONA_WORKER_PROXY_BASE_URL=https://workers.den.openworklabs
DAYTONA_SANDBOX_NAME_PREFIX=den-daytona-worker
DAYTONA_VOLUME_NAME_PREFIX=den-daytona-worker
DAYTONA_WORKSPACE_MOUNT_PATH=/workspace
DAYTONA_DATA_MOUNT_PATH=/persist/openwork
DAYTONA_RUNTIME_WORKSPACE_PATH=/tmp/openwork-workspace
DAYTONA_RUNTIME_DATA_PATH=/tmp/openwork-data
DAYTONA_SIDECAR_DIR=/tmp/openwork-sidecars
DAYTONA_OPENWORK_PORT=8787
DAYTONA_OPENCODE_PORT=4096
DAYTONA_OPENWORK_VERSION=
DAYTONA_CREATE_TIMEOUT_SECONDS=300
DAYTONA_DELETE_TIMEOUT_SECONDS=120
DAYTONA_HEALTHCHECK_TIMEOUT_MS=300000
DAYTONA_POLL_INTERVAL_MS=5000