|
1 | 1 | bifrost-gateway |
2 | 2 | ======================= |
3 | 3 |
|
4 | | -> Gateway implementation used by [protocol/bifrost-infra](https://github.com/protocol/bifrost-infra) |
| 4 | +> A lightweight IPFS Gateway daemon backed by a remote data store. |
5 | 5 |
|
| 6 | +- [About](#about) |
| 7 | +- [Usage](#usage) |
| 8 | + - [Local build](#local-build) |
| 9 | + - [Configuration](#configuration) |
| 10 | + - [Docker](#docker) |
| 11 | +- [FAQ](#faq) |
| 12 | + - [How to run with local gateway](#how-to-run-with-local-gateway) |
| 13 | + - [How to run with Saturn CDN backend](#how-to-run-with-saturn-cdn-backend) |
| 14 | + - [How to debug](#how-to-debug) |
| 15 | + - [How does this work at ipfs.io and dweb.link](#how-does-this-work-at-ipfsio-and-dweblink) |
| 16 | +- [Contributing](#contributing) |
| 17 | +- [License](#license) |
| 18 | + |
| 19 | +## Maintainers |
| 20 | + |
| 21 | +IPFS Stewards |
| 22 | + |
| 23 | +## About |
| 24 | + |
| 25 | +`bifrost-gateway` provides a single binary daemon implementation of [HTTP+Web Gateway Specs](https://specs.ipfs.tech/http-gateways/). |
| 26 | + |
| 27 | +It is capable of serving requests to: |
| 28 | +- [path gateway](https://docs.ipfs.tech/how-to/address-ipfs-on-web/#path-gateway) at `127.0.0.1` |
| 29 | +- [subdomain gateway](https://docs.ipfs.tech/how-to/address-ipfs-on-web/#subdomain-gateway) requests with `Host: localhost` |
| 30 | +- [DNSLink gateway](https://docs.ipfs.tech/how-to/address-ipfs-on-web/#dnslink-gateway) based on `Host` header |
| 31 | + |
| 32 | +Supported response types include both deserialized flat files, and [verifiable Block/CAR](https://docs.ipfs.tech/reference/http/gateway/#trustless-verifiable-retrieval). |
| 33 | + |
| 34 | +For more information about IPFS Gateways, see: |
| 35 | + |
| 36 | +- Specifications at [specs.ipfs.tech/http-gateways](https://specs.ipfs.tech/http-gateways/) |
| 37 | +- Conformance tests at [ipfs/gateway-conformance](https://github.com/ipfs/gateway-conformance) |
| 38 | +- Go implementation at [boxo/gateway](https://github.com/ipfs/boxo/tree/main/gateway) |
6 | 39 |
|
7 | 40 | ## Usage |
8 | 41 |
|
9 | | -Local build: |
| 42 | +### Local build |
10 | 43 |
|
11 | 44 | ```console |
12 | 45 | $ go build |
13 | | -$ ./bifrost-gateway |
| 46 | +$ ./bifrost-gateway --help |
14 | 47 | ``` |
15 | 48 |
|
| 49 | +### Configuration |
| 50 | + |
| 51 | +See `./bifrost-gateway --help` and [`./docs/environment-variables.md`](./docs/environment-variables.md) |
| 52 | + |
| 53 | + |
16 | 54 | ### Docker |
17 | 55 |
|
18 | | -```console |
19 | | -$ docker pull ipfs/bifrost-gateway:main-latest |
20 | | -$ docker run --rm -it --net=host ipfs/bifrost-gateway:main-latest |
21 | | -``` |
| 56 | +Official Docker images are provided at [hub.docker.com/r/ipfs/bifrost-gateway](https://hub.docker.com/r/ipfs/bifrost-gateway/tags). |
22 | 57 |
|
23 | | -When using Docker, make sure to pass necessary config via [`./docs/environment-variables.md`](./docs/environment-variables.md). |
| 58 | +- Releases |
| 59 | + - `latest` and `release` always point at the latest release |
| 60 | + - `vN.N.N` point at a specific [release tag](https://github.com/ipfs/bifrost-gateway/releases) |
| 61 | +- Developer builds |
| 62 | + - `main-latest` always points at the `HEAD` of the `main` branch |
| 63 | + - `main-YYYY-DD-MM-GITSHA` points at a specific commit from the `main` branch |
24 | 64 |
|
25 | | -List of available revisions: https://hub.docker.com/r/ipfs/bifrost-gateway/tags |
26 | 65 |
|
27 | | -### How to run with Saturn CDN backend |
| 66 | +When using Docker, make sure to pass necessary config via `-e`: |
| 67 | +```console |
| 68 | +$ docker pull ipfs/bifrost-gateway:release |
| 69 | +$ docker run --rm -it --net=host -e PROXY_GATEWAY_URL=http://127.0.0.1:8080 ipfs/bifrost-gateway:release |
| 70 | +``` |
28 | 71 |
|
29 | | -[Saturn](https://strn.network) is an open-source, community-run Content Delivery Network (CDN). |
30 | | -`bifrost-gateway` supports it via the [Caboose](https://github.com/filecoin-saturn/caboose) backend, |
31 | | -which takes care of discovering and evaluating Saturn CDN peers. |
| 72 | +See [`./docs/environment-variables.md`](./docs/environment-variables.md). |
32 | 73 |
|
33 | | -See [_Saturn Backend_ in `./docs/environment-variables.md`](./docs/environment-variables.md#saturn-backend) |
| 74 | +## FAQ |
34 | 75 |
|
35 | 76 | ### How to run with local gateway |
36 | 77 |
|
37 | | -Saturn is implementation detail specific to ipfs.io infrastructure. |
38 | | -One can run `bifrost-gateway` without it. All you need is endpoint that supports |
39 | | -[verifiable response types](https://docs.ipfs.tech/reference/http/gateway/#trustless-verifiable-retrieval). |
| 78 | +All you need is a [trustless gateway](https://specs.ipfs.tech/http-gateways/trustless-gateway/) endpoint that supports [verifiable response types](https://docs.ipfs.tech/reference/http/gateway/#trustless-verifiable-retrieval). |
40 | 79 |
|
41 | | -To run without Saturn and use Gateway provided by a local IPFS node like [Kubo](https://github.com/ipfs/kubo): |
| 80 | +To run against a compatible, local trustless gateway provided by [Kubo](https://github.com/ipfs/kubo) or [IPFS Desktop](https://docs.ipfs.tech/install/ipfs-desktop/): |
42 | 81 |
|
43 | 82 | ```console |
44 | 83 | $ PROXY_GATEWAY_URL="http://127.0.0.1:8080" ./bifrost-gateway |
45 | 84 | ``` |
46 | 85 |
|
47 | 86 | See [_Proxy Backend_ in `./docs/environment-variables.md`](./docs/environment-variables.md#proxy-backend) |
48 | 87 |
|
| 88 | +### How to run with Saturn CDN backend |
49 | 89 |
|
50 | | -### How to debug? |
51 | | - |
52 | | -See [`GOLOG_LOG_LEVEL`](./docs/environment-variables.md#golog_log_level). |
53 | | - |
54 | | -## Configuration |
55 | | - |
56 | | -See `./bifrost-gateway --help` and [`./docs/environment-variables.md`](./docs/environment-variables.md) |
| 90 | +[Saturn](https://strn.network) is a CDN that provides a pool of [trustless gateways](https://specs.ipfs.tech/http-gateways/trustless-gateway/). |
57 | 91 |
|
58 | | -## Documentation |
| 92 | +`bifrost-gateway` supports it via the [Caboose](https://github.com/filecoin-saturn/caboose) backend, |
| 93 | +which takes care of discovering and evaluating Block/CAR gateways (in Saturn called L1 nodes/peers) for increased availability. |
59 | 94 |
|
60 | | -- HTTP Gateway implementation: [go-libipf/gateway](https://github.com/ipfs/go-libipfs/tree/main/gateway#readme) |
61 | | -- IPFS backend provided by: [Project Rhea (decentralized IPFS gateway)](https://pl-strflt.notion.site/Project-Rhea-decentralized-IPFS-gateway-3d5906e7a0d84bea800d5920005dfea6) |
| 95 | +See [_Saturn Backend_ in `./docs/environment-variables.md`](./docs/environment-variables.md#saturn-backend) |
62 | 96 |
|
63 | | -## Goals |
| 97 | +### How to debug |
64 | 98 |
|
65 | | -This repository provides implementation of HTTP gateway capable of serving requests to: |
66 | | -- [path gateway](https://docs.ipfs.tech/how-to/address-ipfs-on-web/#path-gateway) at `ipfs.io` |
67 | | -- [subdomain gateway](https://docs.ipfs.tech/how-to/address-ipfs-on-web/#subdomain-gateway) at `dweb.link` |
68 | | -- [selected DNSLink websites](https://github.com/protocol/bifrost-infra/blob/b6f85a54fddf1c21a966f8d5e5a3e31f54ad5431/ansible/inventories/bifrost/group_vars/collab_cluster.yml#L140-L271) on their own domain names. |
| 99 | +See [`GOLOG_LOG_LEVEL`](./docs/environment-variables.md#golog_log_level). |
69 | 100 |
|
70 | | -This includes deserialized flat files, and special response types like verifiable Block/CAR. |
| 101 | +### How does this work at ipfs.io and dweb.link |
71 | 102 |
|
72 | | -## High level design |
| 103 | +This is WIP, but the high level architecture is: |
73 | 104 |
|
74 | 105 | ```mermaid |
75 | 106 | graph LR |
@@ -97,15 +128,19 @@ graph LR |
97 | 128 | B ..->|fa:fa-cubes TBD HTTP GET CAR x N | S |
98 | 129 | ``` |
99 | 130 |
|
| 131 | +`bifrost-gateway` nodes are responsible for processing requests to: |
100 | 132 |
|
101 | | -- IPFS Gateway interface based on reference implementation from [go-libipfs/gateway](https://github.com/ipfs/go-libipfs/tree/main/gateway#readme). |
102 | | -- IPFS Backend based on https://strn.network and HTTP client talking to it via [caboose](https://github.com/filecoin-saturn/caboose) or something else. |
103 | | -- Functional gaps facilitated by temporary delegation to legacy Kubo RPC `(/api/v0`) infra already used by js-ipfs (or dedicated one). |
| 133 | +- [path gateway](https://docs.ipfs.tech/how-to/address-ipfs-on-web/#path-gateway) at `ipfs.io` |
| 134 | +- [subdomain gateway](https://docs.ipfs.tech/how-to/address-ipfs-on-web/#subdomain-gateway) at `dweb.link` |
| 135 | +- [selected DNSLink websites](https://github.com/protocol/bifrost-infra/blob/b6f85a54fddf1c21a966f8d5e5a3e31f54ad5431/ansible/inventories/bifrost/group_vars/collab_cluster.yml#L140-L271) on their own domain names. |
104 | 136 |
|
| 137 | +Caveats: |
105 | 138 |
|
106 | | -## Lead Maintainer |
| 139 | +- IPFS Gateway interface based on reference implementation from [boxo/gateway](https://github.com/ipfs/boxo/tree/main/gateway#readme). |
| 140 | +- IPFS Backend based on https://strn.network and HTTP client talking to it via [caboose](https://github.com/filecoin-saturn/caboose) with `STRN_LOGGER_SECRET`. |
| 141 | + - Learn more at [Project Rhea (decentralized IPFS gateway)](https://pl-strflt.notion.site/Project-Rhea-decentralized-IPFS-gateway-3d5906e7a0d84bea800d5920005dfea6) |
| 142 | +- Functional gaps facilitated by temporary delegation to legacy Kubo RPC (`/api/v0`) at `https://node[0-3].delegate.ipfs.io` infra (already used by js-ipfs). |
107 | 143 |
|
108 | | -- IPFS Stewards |
109 | 144 |
|
110 | 145 | ## Contributing |
111 | 146 |
|
|
0 commit comments