Add Local Gateway URL setting for reverse proxy and Docker support#2486
Open
NiltonVolpato wants to merge 4 commits intoipfs:mainfrom
Open
Add Local Gateway URL setting for reverse proxy and Docker support#2486NiltonVolpato wants to merge 4 commits intoipfs:mainfrom
NiltonVolpato wants to merge 4 commits intoipfs:mainfrom
Conversation
Adds a new 'Local Gateway URL' setting that allows users to override the gateway address from Kubo config. This is useful when: - Running Kubo in Docker - Accessing WebUI through a reverse proxy - Accessing from a different host than where Kubo runs The setting takes priority over the Kubo config gateway address. When empty, the behavior falls back to the existing logic. Fixes ipfs#2458
Ensures URLs like 'https://example.com/' and 'https://example.com' are handled the same way, avoiding double slashes when constructing paths like /ipfs/CID.
The ipld-explorer-components (Explore page) uses localStorage key
'kuboGateway' with {host, port, protocol} format. This change syncs
our 'ipfsLocalGateway' setting to that format so the Explore page
also uses the correct gateway URL.
Fixes Explore page using 127.0.0.1:8080 instead of custom gateway.
…flakiness
The e2e test uses getByText('Addresses') which matches any element
containing 'address' (case-insensitive). Changed 'gateway address' to
'gateway URL' in the description to avoid matching this query.
|
Triage: Will look at in conjunction with kubo v0.42.0 |
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.
Problem
When running Kubo in Docker or behind a reverse proxy, the WebUI generates incorrect gateway URLs (e.g.,
http://127.0.0.1:8080) for:This happens because the WebUI reads the gateway address from Kubo's config, which typically contains Docker-internal addresses like
/ip4/0.0.0.0/tcp/8080that get converted to127.0.0.1:8080.Fixes #2458
Solution
Adds a new "Local Gateway URL" setting that allows users to override the gateway URL used by the WebUI.
Priority order for gateway URL:
Changes
LocalGatewayFormcomponent in SettingsipfsLocalGatewaylocalStorage keyselectGatewayUrlto check local override firstkuboGatewayformat for IPLD Explore page compatibilityHow to Use
https://ipfs.example.com)Leave empty to use the existing behavior (auto-detect from Kubo config).
Testing