feat(web): add OPENCODE_APP_DIST for remote/offline access#6218
Closed
joelhooks wants to merge 1 commit into
Closed
feat(web): add OPENCODE_APP_DIST for remote/offline access#6218joelhooks wants to merge 1 commit into
joelhooks wants to merge 1 commit into
Conversation
┌─────────────────────────────────────────┐ │ 📡 REMOTE ACCESS UNLOCKED │ ├─────────────────────────────────────────┤ │ │ │ phone ──tailscale──▶ mac:7625 │ │ │ │ │ ┌────▼────┐ │ │ │ opencode │ │ │ │ web │ │ │ └────┬────┘ │ │ │ │ │ ┌───────────▼───────────┐ │ │ │ local app/dist │ │ │ │ (no proxy needed) │ │ │ └───────────────────────┘ │ │ │ └─────────────────────────────────────────┘ Serve web UI locally instead of proxying to app.opencode.ai. Fixes blank page on remote access (Tailscale, LAN, mobile). Enables full offline capability. - Add findAppDist() for local SPA serving - Add .hive to .gitignore - Add server tests for health endpoints and app-dist
Contributor
Author
|
@rekram1-node what do you think? the deployed ui was broken for me today and causing issues and this would open up some options. I don't think it'd have unintentional consequences. |
Member
|
@joelhooks we recently merged an attempted fix for this setup, can you test on latest with your tailscale network and lmk if still an issue? |
Contributor
Author
|
@adamdotdevin technically since i'm building my own web client i don't need this functionality but think having an escape hatch from a "has been broken" proxy/cdn might be valuable. totally fine if it closes though |
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
Adds
OPENCODE_APP_DISTenv var to serve the web UI locally instead of proxying to app.opencode.ai.Fixes blank page when accessing
opencode webremotely (Tailscale, LAN, mobile) - the proxied JS tries to connect tolocalhost:4096which doesn't exist on the remote device.Also enables full offline capability.
Why it works
The default proxy to app.opencode.ai keeps the CLI lean and allows UI updates without CLI releases. But the hosted JS assumes localhost access, which breaks remote use and requires internet connectivity.
When serving locally via
OPENCODE_APP_DIST:location.hostname= your actual host (e.g.,192.168.1.xor Tailscale hostname)window.location.originopencode web, so it just worksUsage
Port 7625 is arbitrary - use any available port. Access via
http://<tailscale-hostname>:<port>orhttp://<lan-ip>:<port>.Default behavior unchanged - still proxies unless env var is set.
Changes
server.ts- local SPA serving whenOPENCODE_APP_DISTis set.gitignore- ignore.hive/directorytest/server/- tests for health endpoints and app-dist serving