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.
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
feat: improved Origin detection via img tag #117
feat: improved Origin detection via img tag #117
Changes from 1 commit
5bae793
2a80dfe
ac2dbac
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
load events + timers + promises is some sticky business...
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.
indeed: entire
app.js
needs to be re-written from scratch in modern JS (painfully needs rate-limiting via execution queues, similar to ones we have injs-libp2p-delegated-*
)@jessicaschilling just like with cid.ipfs.io, we should rewrite this app (both backend and frontend) at some point (2021 Q1/Q2-ish?)
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.
@lidel There's a long tail of improvements to the gateway checker that never got completed here: #93
I'd suggest seeing what of that could be salvaged, or at least using that as the base issue for a rewrite. I'll add the notes from this PR to that issue.
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've reached out to @LinusCDE, and we are working on a fix, but for now its better to remove it to reduce confusion.
We will add it back when it supports proper subdomain isolation and interop with path-gateways
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.
Good idea. Something came up, so it's good to remove it for now. I'll try to address it tomorrow.
Would a redirect from
https://cosmos-ink.net/ipfs/<cid>
andhttps://ipfs.cosmos-ink.net/ipfs/<cid>
tohttps://<cid>.ipfscosmos-ink.net/
to the trick?What about the IPNS? Same for that?
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.
Yes, redirects will work (ideally, redirect returned by go-ipfs, because that gives you CID conversion for free)
For ipns you could use
https://<libp2p-key>.ipns.cosmos-ink.net/
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.
@lidel I've now added a rule that should fix that.
This nginx rule is applied to
ipfs.cosmos-ink.net
,ipns.cosmos-ink.net
,cosmos-ink.net
.Basicially for any path like
https://(ipfs.)cosmos-ink.net/ipfs/<cid>/<otherstuff>
I 301 it tohttps://<cid>.ipfs.cosmos-ink.net/<otherstuff>
. Same goes for ipns.I also added your PublicGateway suggestion from your second mail.
Running it on my Pi (cosmos-ink.net main domain) would be probably more trouble at this point, because I would need to rebuild the docker-image for armv7 or aarch64 support. But for any conversion that isn't
https://(ipfs|ipns).cosmos-ink.net/(ipfs/ipns)/...
, go-ipfs can feel free to convert that.For the ipfs/ipns subdomains I also added two entries to prevent using that redirection rule when the cid is already in the subdomain (to allow
https://<cid>.ipfs.cosmos-ink.net/ipfs/...
in case ipfs web apps have a directory called "ipfs").Could you check whether it now works as expected? I'll probably then create a PR to re-add the entry.
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.
It works fine for CIDv1, but redirect alone is not enough if someone passes CIDv0.
To illustrate, if you open https://cosmos-ink.net/ipfs/QmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR it should redirect to https://bafybeigdyrzt5sfp7udm7hu76uh7y26nf3efuylqabf3oclgtqy55fbzdi.ipfs.cosmos-ink.net/
(go-ipfs takes care of CID conversion, without the cid conversion the
Qm..
CIDv0 will be force-lowercased and fail).ps. Do you mind commenting in ipfs/kubo#4931 regarding the need for docker image working out of the box on rpi?