Skip to content

feat: offline web static serve #18521

Closed
DroganC wants to merge 5 commits intoanomalyco:devfrom
DroganC:dev
Closed

feat: offline web static serve #18521
DroganC wants to merge 5 commits intoanomalyco:devfrom
DroganC:dev

Conversation

@DroganC
Copy link

@DroganC DroganC commented Mar 21, 2026

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Provided a solution for building an open code web within an internal network

How did you verify your code works?

  1. packages/opencode/src/server/server.ts — If packages/app/dist/index.html exists (or OPENCODE_APP_DIST points at a directory that contains it), serve files from that directory with the same SPA fallback as before (unknown paths → index.html). Otherwise keep the existing proxy behavior.
  2. Flag.OPENCODE_APP_DIST in packages/opencode/src/flag/flag.ts — Documents and centralizes the env var used for the absolute path override.
  3. One log line when local dist is used (serving web UI from local dist with root) so operators can confirm the proxy is not in use.
  4. packages/app — Changelog fetch uses /changelog.json (from public/ after build); notification and project avatar use same-origin favicon paths instead of https://opencode.ai/..., so those requests stay on the server.
  5. docs/OFFLINE_WEB.md (English) — How to build packages/app, which env vars matter, and troubleshooting. CONTRIBUTING.md — Short subsection linking to that doc.

Screenshots / recordings

none

Checklist

  • [ X] I have tested my changes locally
  • [ X] I have not included unrelated changes in this PR

chenlong added 5 commits March 21, 2026 17:24
- Add OPENCODE_APP_DIST and fallback to packages/app/dist when index.html exists
- Fall back to app.opencode.ai proxy when no local build
- Use same-origin changelog and favicon assets in the app
- Document env vars and workflow in docs/OFFLINE_WEB.md
- Ignore offline/ for local models-api.json mirrors

Made-with: Cursor
- Document OPENCODE_APP_DIST in Flag; log once when serving local dist
- Rewrite OFFLINE_WEB.md in English; note issue-first policy for PRs
- Link air-gapped web flow from CONTRIBUTING.md

Made-with: Cursor
Fixes @opencode-ai/app typecheck for dialog-connect-provider and dialog-custom-provider.

Add docs/PR_BODY_offline_web.md as PR description draft for offline web PR.

Made-with: Cursor
@DroganC DroganC requested a review from adamdotdevin as a code owner March 21, 2026 12:52
@github-actions
Copy link
Contributor

This PR doesn't fully meet our contributing guidelines and PR template.

What needs to be fixed:

  • PR description is missing required template sections. Please use the PR template.
  • Not all checklist items are checked. Please confirm you have tested locally and have not included unrelated changes.

Please edit this PR description to address the above within 2 hours, or it will be automatically closed.

If you believe this was flagged incorrectly, please let a maintainer know.

@github-actions github-actions bot added the needs:compliance This means the issue will auto-close after 2 hours. label Mar 21, 2026
@DroganC DroganC closed this Mar 21, 2026
@github-actions
Copy link
Contributor

The following comment was made by an LLM, it may be inaccurate:

Found potential related PRs:

  1. feat(server): embed web UI assets in binary and serve locally (feat(server): embed web UI assets in binary and serve locally #15721)

    • Related to serving web UI assets locally without external proxy
  2. feat: add offline mode to disable non-essential outbound connections (feat: add offline mode to disable non-essential outbound connections #18235)

    • Related to offline functionality and internal network usage
  3. feat(server): support OPENCODE_WEB_URL for local frontend serving (feat(server): support OPENCODE_WEB_URL for local frontend serving #17104)

    • Related to serving local frontend without relying on external URLs

These PRs all address similar functionality around serving the web UI locally and reducing external dependencies, which is the core focus of PR #18521. Check if any of these are still open and if they're addressing the same feature gap.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs:compliance This means the issue will auto-close after 2 hours.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant