Add on-demand preview URLs with custom domains#18
Merged
Conversation
Preview URLs are now created explicitly via the SDK (createPreviewURL/
getPreviewURL/deletePreviewURL) rather than auto-assigned on sandbox
creation. Each preview URL registers a Cloudflare custom hostname
(e.g. sb-xxx.openlovable.cc) for per-sandbox routing through the org's
verified custom domain.
Key changes:
- DB migrations for org custom domains and sandbox_preview_urls table
- Cloudflare client for custom hostname CRUD and domain verification
- API endpoints: POST/GET/DELETE /api/sandboxes/:id/preview
- Dashboard UI for custom domain setup with DNS verification flow
- Proxy routing: both SandboxProxy and ControlPlaneProxy resolve
custom hostnames via DB lookup fallback
- ControlPlaneProxy rewrites Host header to {sandboxID}.{baseDomain}
so workers can match custom domain requests
- Auto-cleanup of preview URLs on sandbox kill
- TypeScript and Python SDK methods for preview URL management
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Remove automatic domain routing from sandboxes. Preview URLs are now the
only way to get HTTP access, each targeting a specific port. Hostname
format {sandboxID}-p{port}.{baseDomain} lets the proxy parse sandbox ID
and port directly — zero DB lookups on the hot path.
- Add DB migration for port column + unique constraint
- Add ContainerAddr to Manager interface (Podman + Firecracker)
- Rewrite proxy to parse hostname instead of DB lookup
- Add friendly HTML placeholder page for upstream unavailable (auto-refresh)
- Update API handlers: create/list/delete preview URLs by port
- Update dashboard, SDKs (TypeScript + Python), and types
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
When an org has a custom domain configured, the dashboard now shows preview URLs using the custom domain (e.g. sb-xxx-p3000.openlovable.cc) as the primary link, with a collapsible "Internal URLs" section showing the base domain URLs underneath. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
motatoes
pushed a commit
that referenced
this pull request
Mar 27, 2026
Add on-demand preview URLs with custom domains
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
sb-xxx.openlovable.cc) created explicitly via the SDK, not auto-assigned on creationcreatePreviewURL/getPreviewURL/deletePreviewURL) and Python SDK methodsChanges
internal/cloudflare/— new CF API client for custom hostname CRUD and domain verificationinternal/db/migrations/— org custom domain columns +sandbox_preview_urlstableinternal/db/store.go— preview URL CRUD + org domain queriesinternal/api/sandbox.go— 3 new API endpoints + auto-cleanup on killinternal/api/dashboard.go— custom domain setup + verification pollinginternal/proxy/— DB hostname lookup fallback + Host header rewrite in ControlPlaneProxysdks/typescript/src/sandbox.ts— 3 new SDK methodssdks/python/opencomputer/sandbox.py— 3 new SDK methodsweb/src/pages/Settings.tsx— custom domain UI with DNS instructionsTest plan
🤖 Generated with Claude Code