You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: choose share link type, add native uris (#2482)
* feat: add local gateway URL options to share modal
allow copying local gateway links for use in external apps,
with optional localhost subdomain mode for web apps
- actions.js: doFilesShareLink returns local and subdomain links
- ShareModal: checkbox to toggle local link, nested checkbox for
localhost subdomains, QR hidden in local mode
- Modals: passes new link variants to ShareModal
- en/files.json: added translation keys for new UI elements
* feat: honor gateway override in local links
The share modal's local links flow through selectGatewayUrl, so the
Local Gateway URL override added in #2486 reaches them. Subdomain links
are offered only for domain gateways, since subdomain gateways cannot
resolve on a bare IP such as 127.0.0.1.
- files.js: add getLocalLinks, deriving both links from the gateway url
(host, port, scheme); gate the subdomain link to domain hosts and to
CIDs that fit a 63-char DNS label; share filename and base32 logic
with getShareableLink
- actions.js: build the local links via getLocalLinks
- share-modal: clear the subdomain choice when the local link is
unchecked, so it cannot silently reapply
- protocol.ts: type the share-link result as ShareLinks, not string
* fix: loopback share links and error handling
Refine the local gateway share links so they resolve from other apps and
never leave the modal hanging when generation fails.
- files.js: a single loopback check in getLocalLinks drives both links,
so the path link uses 127.0.0.1 (no DNS) and the subdomain link uses
localhost (origins need a hostname); domain gateways and non-loopback
IPs are left as-is
- modals: catch a failed link generation and show an error instead of a
stuck "Generating..."
- en/files.json: add the error string; mark the plain link as HTTP
* feat: native share links by default
Share Link and Publish to IPNS copy native ipfs:// and ipns:// URIs
by default, with opt-in HTTP gateway links for cases that need them.
- add a Settings "Sharing IPFS Links" section to choose the link
type: native, local path/subdomain, or public path/subdomain
- public gateways default to empty and are opt-in; a public option
stays disabled until its URL is set, and clearing it reverts to
native
- native URIs use canonical CIDv1: base32 for /ipfs, base36
libp2p-key for /ipns; the same choice drives Publish to IPNS
- local links normalize loopback per type: 127.0.0.1 for path,
localhost for subdomain
- remove online gateway reachability probes; previews, thumbnails,
IPLD explorer and IPNS links load from the local gateway (override
or Kubo config), never a third-party gateway unless configured
- consolidate the localhost to 127.0.0.1 subresource fix across
previews, thumbnails, downloads, CAR links and pinning icons
- Explore links honor the configured gateways; a local gateway
change refreshes previews at once and reloads the explorer on the
next visit
* fix: local links must not use public gateway
Share modal and content links labeled as local could point at the
public path gateway when the Kubo config exposed no usable gateway
address. Local links draw from the local gateway only (user override
or Kubo config), with related fixes and cleanups:
- loopback host rewrites apply to http only, so an https://localhost
gateway keeps its certificate-valid hostname
- a link type without its gateway resolves to native before building,
removing per-caller fallbacks in share and publish flows
- open-in-new-tab links (file preview, IPNS keys) honor the local
subdomain choice from Settings for per-CID origin isolation
- pinning service icons resolve against the current gateway at read
time and are omitted when no gateway is configured; previews and
thumbnails skip gateway embeds in the same case
- shared toLoopbackIpUrl and GatewayForm replace per-site localhost
rewrites and three near-identical gateway forms
- re-saving an unchanged Local Gateway URL no longer schedules an
Explore page reload
* fix: keep existing public gateway defaults
keep the defaults users already have (ipfs.io path gateway, dweb.link
subdomain gateway, share links on dweb.link) so this PR can merge
without changing any default behavior. defaulting to native ipfs://
sharing is left for a follow-up: DEFAULT_SHARE_LINK_TYPE and the
DEFAULT_*_GATEWAY constants are the only knobs to flip.
- a gateway cleared in Settings stays cleared across reloads; only a
never-written setting gets the default
- selecting a public link type persists the gateway it points at, so an
explicit opt-in keeps its gateway if the defaults change later
Copy file name to clipboardExpand all lines: public/locales/en/settings.json
+33-2Lines changed: 33 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -24,8 +24,39 @@
24
24
},
25
25
"apiDescription": "<0>If your node is configured with a <1>custom Kubo RPC API address</1>, including a port other than the default 5001, enter it here.</0>",
26
26
"localGatewayDescription": "<0>If you access the WebUI through a reverse proxy, Docker, or a different host, enter the gateway URL your browser can reach. Leave empty to use the first <1>gateway address</1> from your Kubo config.</0>",
27
-
"publicSubdomainGatewayDescription": "<0>Select a default <1>Subdomain Gateway</1> for generating shareable links.</0>",
28
-
"publicPathGatewayDescription": "<0>Select a fallback <1>Path Gateway</1> for generating shareable links for CIDs that exceed the 63-character DNS limit.</0>",
27
+
"shareLink": {
28
+
"title": "Sharing IPFS Links",
29
+
"intro": "This controls the link you copy with Share Link or Publish to IPNS. Each option fits a specific need, so pick the one that matches how the link will be opened.",
30
+
"pathVsSubdomain": "Gateway links come in two shapes: <0>path</0> and <1>subdomain</1>. A path link puts everything from that gateway on one origin, the boundary your browser uses for cache, cookies, and saved logins, so one page can see what another left behind. A subdomain link gives each item its own origin, so your browser keeps them apart. Use a subdomain link for opening or hosting web pages, and a path link for non-browser apps.",
31
+
"recommendedBadge": "Recommended",
32
+
"gatewayGroupTitle": "HTTP gateway links",
33
+
"gatewayGroupNote": "These open in any HTTP client, but depend on a specific URL being reachable.",
34
+
"usesGateway": "Produces links like",
35
+
"subdomainNote": "Each item gets its own origin. Learn <0>how browsers keep sites apart</0>.",
36
+
"publicGatewayHelp": "New to public gateways? Find one with the <0>Public Gateway Checker</0>, or <1>run your own</1>.",
37
+
"publicGatewayEmptyHint": "To use this, enter a gateway address below.",
38
+
"native": {
39
+
"label": "Native (ipfs:// and ipns:// addresses)",
40
+
"description": "These addresses don't depend on any HTTP server, so they keep working even when a public gateway is down. Best for sharing with people peer-to-peer.",
41
+
"companionNote": "To open them, you and the people you share with can install the <0>IPFS Companion</0> browser extension. Everyone then loads content directly from each other, instead of depending on someone else's HTTP server."
42
+
},
43
+
"localPath": {
44
+
"label": "Local gateway, path link",
45
+
"description": "Opens content straight from your node on this computer. Good for local apps that aren't a browser. Does not work for sharing with other people."
46
+
},
47
+
"localSubdomain": {
48
+
"label": "Local gateway, subdomain link",
49
+
"description": "Like the option above, but for web apps on this computer that need origin isolation for security. Does not work for sharing with other people. Needs a gateway on localhost, not a raw IP."
50
+
},
51
+
"publicPath": {
52
+
"label": "Public gateway, path link",
53
+
"description": "A link anyone on the internet can open through a public gateway. Without origin isolation, don't use it for sensitive web apps."
54
+
},
55
+
"publicSubdomain": {
56
+
"label": "Public gateway, subdomain link",
57
+
"description": "Like the option above, but the safer choice for opening or hosting web pages and apps that require origin isolation."
58
+
}
59
+
},
29
60
"retrievalDiagnosticService": {
30
61
"title": "Retrieval Diagnostic Service",
31
62
"description": "Configure the URL of the <0>ipfs-check</0> service used for <1>retrieval diagnostics</1>. This service checks if content can be successfully fetched from your node and other nodes hosting a specific CID, helping you troubleshoot sharing issues."
Copy file name to clipboardExpand all lines: public/locales/en/welcome.json
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -14,7 +14,7 @@
14
14
"header": "What is IPFS?",
15
15
"paragraph1": "<0><0>A hypermedia distribution protocol</0> that incorporates ideas from Kademlia, BitTorrent, Git, and more</0>",
16
16
"paragraph2": "<0><0>A peer-to-peer file transfer network</0> with a completely decentralized architecture and no central point of failure, censorship, or control</0>",
17
-
"paragraph3": "<0><0>An on-ramp to tomorrow's web</0> — traditional browsers can access IPFS files through gateways like <2>https://dweb.link</2> or directly using the <4>IPFS Companion</4> extension</0>",
17
+
"paragraph3": "<0><0>An on-ramp to tomorrow's web</0>: traditional browsers can access IPFS content through an HTTP gateway, or directly with the <2>IPFS Companion</2> extension</0>",
18
18
"paragraph4": "<0><0>A next-gen CDN</0> — just add a file to your node to make it available to the world with cache-friendly content-hash addressing and BitTorrent-style bandwidth distribution</0>",
19
19
"paragraph5": "<0><0>A developer toolset</0> for building <2>completely distributed apps and services</2>, backed by a robust open-source community</0>"
0 commit comments