Add PROXY_UI_URL for separate UI/package URL advertisement#161
Merged
Conversation
Adds UIBaseURL (env PROXY_UI_URL), advertised separately from BaseURL for deployments where the UI is reached on a public domain while build machines hit a Docker network alias for the package endpoints. Defaults to BaseURL when unset. Consumers: - Logged alongside base_url at startup. - <link rel="canonical"> and og:url / og:title / og:site_name in every UI page, omitted when UIBaseURL is empty. - Banner on the install guide when UIBaseURL differs from BaseURL, clarifying that the URLs in the snippets are the package endpoint and that the UI itself lives elsewhere. Docs call out that the proxy serves UI and package endpoints on the same listener, so reverse proxies fronting the UI publicly must restrict the public route to PathPrefix(/ui) to avoid exposing /npm, /pypi, etc. nginx and Traefik examples both show the path-split pattern.
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.
Addresses the dual-URL ask from #123 (comment).
Adds
UIBaseURL(envPROXY_UI_URL), advertised separately fromBaseURLfor deployments where the UI is reached on a public domain (behind auth) while build machines hit a Docker network alias for the package endpoints. Defaults toBaseURLwhen unset.Consumers in this PR:
base_urlat startup.<link rel="canonical">andog:url/og:title/og:site_namein every UI page, omitted whenUIBaseURLis empty.UIBaseURLdiffers fromBaseURL, clarifying that the URLs in the snippets are the package endpoint and that the UI itself lives elsewhere.BaseURLkeeps its existing meaning: the URL that package managers and metadata rewriting use.Docs also call out the same-port caveat raised in #123 (comment): setting
ui_base_urlonly changes what URL the UI advertises, the listener still serves package endpoints, so any reverse proxy fronting the UI publicly must restrict the public route toPathPrefix(/ui). nginx and Traefik examples in the README show the pattern.