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

Make /ipfs and /ipns work with self-hosted ipfs.io #72

Merged
3 commits merged into from
Sep 4, 2015

Conversation

ghost
Copy link

@ghost ghost commented Aug 28, 2015

If the host is ipfs.io, and the request is for /ipfs or /ipns,
we don't pass the Host header on to the gateway,
so that IPNSHostnameOption doesn't trigger,
and the /ipfs and /ipns request can succeed.

For all other requests with a Host header and TXT record,
/ipfs and /ipns are not present.

@ghost ghost added the solarnet label Aug 28, 2015
@ghost ghost mentioned this pull request Aug 28, 2015
56 tasks
@@ -76,9 +76,15 @@ server {

resolver 8.8.8.8 8.8.4.4;

set $hosturi $host$uri;
set $proxyhost "";
if ($hosturi !~ "^dogfeed\.ipfs\.io/(ipfs|ipns)(/|$)") {
Copy link
Member

Choose a reason for hiding this comment

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

do we need (dogfeed\.)? ?

Copy link
Member

Choose a reason for hiding this comment

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

(or is this just for dogfeed?)

Copy link
Author

Choose a reason for hiding this comment

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

Oh yes that's just for dogfeed.

@jbenet
Copy link
Member

jbenet commented Aug 28, 2015

LGTM. @lgierth assign to me if you want me to merge it, etc.

@ghost ghost mentioned this pull request Aug 30, 2015
3 tasks
@daviddias daviddias mentioned this pull request Sep 2, 2015
42 tasks
Lars Gierth added 2 commits September 4, 2015 04:01
If the host is ipfs.io, and the request is for /ipfs, /ipns, or /api,
we don't pass the Host header on to the gateway,
so that IPNSHostnameOption doesn't trigger,
and the /ipfs and /ipns request can succeed.

For all other requests with a Host header and TXT record,
/ipfs, /ipns, and /api are not present.

License: MIT
Signed-off-by: Lars Gierth <larsg@systemli.org>
License: MIT
Signed-off-by: Lars Gierth <larsg@systemli.org>
@ghost ghost force-pushed the static-pages-ipfs-ipns branch from 387fbc2 to f51ed06 Compare September 4, 2015 02:02
@ghost
Copy link
Author

ghost commented Sep 4, 2015

@ghost
Copy link
Author

ghost commented Sep 4, 2015

Note: open the /api links in a new tab, a referer which is not ipfs.io, gateway.ipfs.io, or localhost results in a 403.

@jbenet
Copy link
Member

jbenet commented Sep 4, 2015

@lgierth this LGTM!!

we should update the note at the bottom of the site and say that this website is hosted via ipfs :)

License: MIT
Signed-off-by: Lars Gierth <larsg@systemli.org>
@ghost ghost force-pushed the static-pages-ipfs-ipns branch from 81805d9 to 591f969 Compare September 4, 2015 02:54
ghost pushed a commit that referenced this pull request Sep 4, 2015
Make /ipfs and /ipns work with self-hosted ipfs.io
@ghost ghost merged commit 4457e2a into master Sep 4, 2015
@jbenet jbenet removed the in progress label Sep 4, 2015
@ghost ghost deleted the static-pages-ipfs-ipns branch September 4, 2015 14:26
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