-
Notifications
You must be signed in to change notification settings - Fork 409
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
Update Subdomain gateway section #431
Conversation
This adds better examples and clarifies best practicies around converting CID v0 to v1 for use in subdomains. It also mentions Base36 as a valid encoding in preparation for ED25519 libp2p-keys shipping with go-ipfs 0.7.0 License: MIT Signed-off-by: Marcin Rataj <lidel@lidel.org>
docs/how-to/address-ipfs-on-web.md
Outdated
|
||
Some browsers and other user agents force lowercase for the authority part of URLs, breaking case-sensitive CIDs before HTTP Gateway has a chance to read them. | ||
Due to these limitaitons, use of short, case-insensitive CIDv1 in subdomain context is advised. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we advising people that they should canonically tell people to use gateway.tld/path
and that it will redirect to the subdomain or is this unrelated?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@aschmahmann Kinda. I've mentioned redirect in CID conversion for subdomains section below.
Should we make this more prominent somehow?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The question is more about what we're telling people. Do we tell them "hey, CIDs in subdomains is a security feature but the correct way for people to talk about URLs is using paths", or say "there are two valid ways to describe URLs"?
If it's the former then we should be louder/more prominent and explain that we'd like people to use CIDv1s so that things look nicer bc we redirect localhost:8080/ipfs/{cid} to {cid}.ipfs.localhost instead of to {cid in different representation}.ipfs.localhost. If it's the latter then we don't have to do anything.
What's your feeling on this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@aschmahmann I think paths make it easier to grasp the concept of "content addressing", so my intuition is that we should be thinking in therms of "hey, CIDs in subdomains is a security feature but the correct way for people to talk about URLs is using paths". So gateway.tld/path
remains "canonical".
Not sure if we need to be more vocal: I believe people who care about subdomains already default to CIDv1, so the hash remains the same. What we cna do, is to ensure our GUIs copy path version instead of subdomain version etc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think your approach is reasonable here as long as we're also trying to ensure that our comms focus on path domains. Sometimes subdomains will inevitably slip in as someone copy-pastes {cid}.ipfs.localhost
from their URL bar and posts it somewhere, but not much to be done there at the moment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor copy edits, and suggested we remove some of the alert-box formatting (this can get really visually noisy in the rendered VuePress site). Thank you for adding this!
Jessica's copy-edits are always correct. Committing now to save Lidel a bit of time. Co-authored-by: Jessica Schilling <jessica@protocol.ai>
License: MIT Signed-off-by: Marcin Rataj <lidel@lidel.org>
Co-authored-by: Marcin Rataj <lidel@lidel.org>
This PR aims to add better examples and clarify best practices around converting CID v0 to v1 for use in subdomains.
It also mentions Base36 as a valid encoding in preparation for ED25519 libp2p-keys shipping with go-ipfs 0.7.0
cc ipfs/kubo#7441 @ipfs/wg-web-browsers