Skip to content
This repository has been archived by the owner on Mar 25, 2022. It is now read-only.

gateway: add /refs/* #95

Merged
1 commit merged into from
Nov 9, 2015
Merged

gateway: add /refs/* #95

1 commit merged into from
Nov 9, 2015

Conversation

ghost
Copy link

@ghost ghost commented Oct 3, 2015

Rewrites requests for /refs/a/b/c to c.b.a.refs.ipfs.io.

Also replaces conditionals with location directives,
which are evaluated more efficiently.

Part of the gateway-dmca-denylist thing: ipfs/kubo#1551 https://github.com/ipfs/gateway-dmca-denylist

@ghost ghost added the solarnet label Oct 3, 2015
set $proxyhost $host;
location /refs/ {
rewrite "^/refs/([^/]+)/([^/]+)/([^/]+)$" "/" break;
proxy_set_header Host $3.$2.$1.refs.ipfs.io;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this doesn't seem robust enough to also handle:

refs.ipfs.io
a.refs.ipfs.io
b.a.refs.ipfs.io

maybe we should just have one ipfs graph, with its root at refs.ipfs.io, redirect /refs/... to refs.ipfs.io, and it could handle $refs/a/b/c.

@jbenet
Copy link
Member

jbenet commented Oct 3, 2015

@lgierth am good to ship this if you dont have much time, but think we probably should leverage ipfs graphs to have a root at refs.ipfs.io. We could still have a.b.c.refs.ipfs.io -> refs.ipfs.io/a/b/c with nginx.

@ghost ghost mentioned this pull request Oct 5, 2015
88 tasks
@RichardLitt RichardLitt mentioned this pull request Oct 8, 2015
19 tasks
@ghost
Copy link
Author

ghost commented Oct 20, 2015

Ooh yep that's a lot simpler -- we'll just have one refs tool that maintains refs.ipfs.io.

@RichardLitt RichardLitt mentioned this pull request Oct 21, 2015
35 tasks
@ghost ghost mentioned this pull request Nov 3, 2015
11 tasks
Rewrites requests for /refs/* to refs.ipfs.io/*.

Also replaces conditionals with location directives,
which are evaluated more efficiently.

License: MIT
Signed-off-by: Lars Gierth <[email protected]>
@ghost
Copy link
Author

ghost commented Nov 9, 2015

lerage ipfs graphs to have a root at refs.ipfs.io

That's what it does now -- see https://ipfs.io/refs. We'll have to fix the gateway's directory listings once more :/

ghost pushed a commit that referenced this pull request Nov 9, 2015
@ghost ghost merged commit 6142fb0 into master Nov 9, 2015
@jbenet jbenet removed the in progress label Nov 9, 2015
@ghost ghost deleted the gateway-refs branch November 9, 2015 17:29
This pull request was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant