Commit Graph

9 Commits

Author SHA1 Message Date
Kevin Neaton
044790a838 feat: Directory page UI improvements
These changes are needed to prepare for the Directory page UI improvements
implemented in https://github.com/ipfs/dir-index-html/issues/37.

- update dir-index-html type structs
- emit gateway URL for root links
- emit CID of each directoryItem
- emit size of directory
- emit breadcrumbs
2020-08-19 20:09:35 -04:00
Marcin Rataj
6b6569f3e5
refactor: cleanup/comment
https://github.com/ipfs/go-ipfs/pull/7319#discussion_r472734905

License: MIT
Signed-off-by: Marcin Rataj <lidel@lidel.org>
2020-08-19 15:59:47 +02:00
Marcin Rataj
2ff6f1a80d
test(gateway): IPNS cleanup and implicit defaults fix
This ensures implicit defaults are always present, even when
Gateway.PublicGateways is defined in the config.

User still can disable them, but needs to do it per hostname.

License: MIT
Signed-off-by: Marcin Rataj <lidel@lidel.org>
2020-08-06 14:00:16 +02:00
Michael Muré
13e6bcfb4f
feat: wildcard support for public gateways
Add support for one or more wildcards in the hostname definition
of a public gateway. This is useful for example to support easily
multiples environment.

Wildcarded hostname are set in the config as for example "*.domain.tld".
2020-07-24 20:51:22 +02:00
Marcin Rataj
231fab811d feat: support ED25519 libp2p-key in subdomains
This:

- adds subdomain gateway support for ED25519 CIDs in a way that fits in
  a single DNS label to enable TLS for every IPNS website.

- cleans up subdomain redirect logic and adds more explicit error
  handling.

TL;DR on router logic:

When CID is longer than 63 characters, router at /ipfs/* and /ipns/*
converts to Base36, and if that does not help, returns a human readable
400 Bad Request error.

Addressing code review:
https://github.com/ipfs/go-ipfs/pull/7441#pullrequestreview-440043209

refactor: use b36 for all libp2p-keys in subdomains
Consensus reached in
https://github.com/ipfs/go-ipfs/pull/7441#discussion_r452372828
https://github.com/ipfs/go-ipfs/pull/7441#discussion_r451477890
https://github.com/ipfs/go-ipfs/pull/7441#discussion_r452500272
2020-07-10 16:25:20 -04:00
Michael Muré
87dfc46e03 feat: support X-Forwarded-Host when doing gateway redirect 2020-07-10 14:13:11 -04:00
Steven Allen
84341d0c5a fix: use the correct context when resolving dnsaddr links 2020-06-17 19:44:28 -07:00
Marcin Rataj
f9567a0a0f fix(gateway): curl without redirect on localhost
When request is sent to http://localhost:8080/ipfs/$cid response has
HTTP 301 status code and "Location" header with redirect destination at
$cid.ipfs.localhost:8080

Redirect is followed by browsersi, but not by commandline tools.
Status 301 is ignored by curl in default mode: it will print response
and won't follow redirect, user needs to add -L for that.

To fix curl, we return correct payload in body of HTTP 301 response,
but set Clear-Site-Data header to ensure Origin sandbox can't be abused.

This requires a surgical workaround:
If Location header is present in ResponseWriter's Header map,
we ensure http.ServeContent() returns HTTP 301

Context: https://github.com/ipfs/go-ipfs/pull/6982

License: MIT
Signed-off-by: Marcin Rataj <lidel@lidel.org>
2020-03-18 08:50:40 -07:00
Marcin Rataj
3ecccd6e1d feat(gateway): subdomain and proxy gateway
License: MIT
Signed-off-by: Marcin Rataj <lidel@lidel.org>
2020-03-18 08:50:38 -07:00