feat: add root-path for opencode web#11858
Closed
DaehoYang wants to merge 16 commits intoanomalyco:devfrom
Closed
Conversation
Co-authored-by: DaehoYang <129835752+DaehoYang@users.noreply.github.com>
Co-authored-by: DaehoYang <129835752+DaehoYang@users.noreply.github.com>
Co-authored-by: DaehoYang <129835752+DaehoYang@users.noreply.github.com>
Co-authored-by: DaehoYang <129835752+DaehoYang@users.noreply.github.com>
Co-authored-by: DaehoYang <129835752+DaehoYang@users.noreply.github.com>
Co-authored-by: DaehoYang <129835752+DaehoYang@users.noreply.github.com>
Add --root-path option for reverse proxy support
Co-authored-by: DaehoYang <129835752+DaehoYang@users.noreply.github.com>
Improve rootPath implementation with fallback strategy and refactoring
Removed section on Deployment Modes from server documentation.
Contributor
|
Thanks for your contribution! This PR doesn't have a linked issue. All PRs must reference an existing issue. Please:
See CONTRIBUTING.md for details. |
Contributor
|
The following comment was made by an LLM, it may be inaccurate: Potential Duplicate Found:
Why it's related: PR #7625 appears to address the same feature (base path support for reverse proxy scenarios). The current PR #11858 is also adding root-path support for deploying OpenCode behind a reverse proxy. These likely overlap in functionality or one may be addressing the same issue from a different branch/approach. You may want to check if #7625 is already merged or if there's work duplication. |
Author
|
Duplicate |
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
This pull request adds robust support for deploying the OpenCode web app behind a reverse proxy at a configurable base path (
rootPath). It introduces a new CLI/config option forrootPath, ensures all URLs and static assets are correctly resolved relative to this path, and injects the configuration into the frontend.related issues:
#7624
#6336
and else...
Changes
Reverse Proxy & Root Path Support
rootPathoption to CLI (--root-path), config, and network options, allowing the app to be served at a custom base path for reverse proxy scenarios.rootPathis set, enforcing this with a clear error message if the build is missing.rootPath, avoiding duplicate slashes and ensuring correct asset resolution.Frontend Integration
rootPathinto the frontend via a<base>tag, a script settingwindow.__OPENCODE__.rootPath, and adata-root-pathattribute on the root div, using the newinjectRootPathutility.rootPath, ensuring proper navigation and resource loading.Testing