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

Update Subdomain gateway section #431

Merged
merged 4 commits into from
Sep 24, 2020
Merged

Conversation

lidel
Copy link
Member

@lidel lidel commented Aug 27, 2020

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

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 Show resolved Hide resolved
docs/how-to/address-ipfs-on-web.md Outdated Show resolved Hide resolved

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.
Copy link
Contributor

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?

Copy link
Member Author

@lidel lidel Aug 28, 2020

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?

Copy link
Contributor

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?

Copy link
Member Author

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.

Copy link
Contributor

@aschmahmann aschmahmann Sep 23, 2020

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.

Copy link
Contributor

@jessicaschilling jessicaschilling left a 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!

docs/how-to/address-ipfs-on-web.md Outdated Show resolved Hide resolved
docs/how-to/address-ipfs-on-web.md Outdated Show resolved Hide resolved
docs/how-to/address-ipfs-on-web.md Outdated Show resolved Hide resolved
docs/how-to/address-ipfs-on-web.md Outdated Show resolved Hide resolved
docs/how-to/address-ipfs-on-web.md Outdated Show resolved Hide resolved
docs/how-to/address-ipfs-on-web.md Outdated Show resolved Hide resolved
docs/how-to/address-ipfs-on-web.md Outdated Show resolved Hide resolved
docs/how-to/address-ipfs-on-web.md Outdated Show resolved Hide resolved
docs/how-to/address-ipfs-on-web.md Outdated Show resolved Hide resolved
docs/how-to/address-ipfs-on-web.md Outdated Show resolved Hide resolved
Jessica's copy-edits are always correct. Committing now to save Lidel a bit of time.

Co-authored-by: Jessica Schilling <jessica@protocol.ai>
docs/how-to/address-ipfs-on-web.md Outdated Show resolved Hide resolved
docs/how-to/address-ipfs-on-web.md Outdated Show resolved Hide resolved
lidel and others added 2 commits September 23, 2020 16:14
License: MIT
Signed-off-by: Marcin Rataj <lidel@lidel.org>
Co-authored-by: Marcin Rataj <lidel@lidel.org>
@johnnymatthews johnnymatthews merged commit a076a49 into master Sep 24, 2020
@johnnymatthews johnnymatthews deleted the subdomain-gateways-b36 branch September 24, 2020 13:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants