Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CID to IPNS _redirects #325

Closed
Winterhuman opened this issue Sep 23, 2022 · 4 comments
Closed

CID to IPNS _redirects #325

Winterhuman opened this issue Sep 23, 2022 · 4 comments
Labels
kind/enhancement A net-new feature or an improvement to an existing feature kind/stale need/author-input Needs input from the original author

Comments

@Winterhuman
Copy link

Winterhuman commented Sep 23, 2022

I was just reading ipfs/kubo#8890 & ipfs/ipfs-docs#1275 when I realised the spec only defines redirecting paths to other paths (e.g. cid.ipfs.dweb.link/blog/* -> cid.ipfs.dweb.link/new-blog/:splat), however, I think it would be very useful to be able to redirect users from CIDs to IPNS addresses. e.g.

cid.ipfs.dweb.link -> key.ipns.dweb.link

I'm opening this issue to discuss some of the problems with this before continuing with an IPIP proposal. For instance, would this make deliberately navigating to individual CIDs more difficult (such as for archiving)? Perhaps the gateway should prompt the user with a message asking if they want to redirect (like .onion redirects in a way)? And if this opens any privacy or security issues.

@Winterhuman Winterhuman added the need/triage Needs initial labeling and prioritization label Sep 23, 2022
@lidel
Copy link
Member

lidel commented Sep 23, 2022

Is this just a "nice to have" exploration, or do you have a real world use case in mind for this?

IPIP 0002 had specific problems in mind (link rot, SPA, 404s), and we solved multiple of them there while being cognizant to have the same behavior everywhere (subdomains, native handlers in Brave, DNSLink website hosting). That is why path redirects from IPIP 0002 are applied only within a single DAG.

If I understand your proposal correctly, you want to not only redirect from one content root to another, but mix immutable namespace with mutable one. The former would not work for DNSLink websites, because they have only a single root, so your proposal would introduce special-casing for that and different behavior in different contexts. The latter is just a hard no: an immutable content path should always return the same result, so we would have to add even more special casing and exclude HTTP 200 responses.

It does not sound feasible, but lmk if I misunderstood your intent.

@lidel lidel added the need/author-input Needs input from the original author label Sep 23, 2022
@Winterhuman
Copy link
Author

Winterhuman commented Sep 24, 2022

I agree with your assessment, good points on how it would affect DNSLink and other systems that I hadn't considered. My use case is that if you, let's say, run a blog, and someone accesses one of your blog posts by it's CID, it's not possible to go past the blog post's own root to the blog's homepage (using the blog's root's CID would be impossible in general since that's a loop, but for IPNS it's technically possible).

I think what I'm looking for is some sort of "root button", a link on a blog post which takes you to the homepage regardless of if the blog post is accessed on it's own CID or not, but, without using a key.ipns.gateway.tld link which centralises on one gateway. Last time I checked, ipfs:// & ipns:// links aren't handled by IPFS gateways, perhaps that's what I'm looking for?

Let me know if you have any better solutions, you'd probably have a better idea than I do of how to safely and easily handle this situation

@guseggert guseggert added kind/enhancement A net-new feature or an improvement to an existing feature and removed need/triage Needs initial labeling and prioritization labels Oct 6, 2022
@github-actions
Copy link

Oops, seems like we needed more information for this issue, please comment with more details or this issue will be closed in 7 days.

@Winterhuman
Copy link
Author

I'm going to close this issue, using _redirects to solve this isn't viable, I'll open a separate issue if I think of anything

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement A net-new feature or an improvement to an existing feature kind/stale need/author-input Needs input from the original author
Projects
None yet
Development

No branches or pull requests

3 participants