A mostly automated way to set up an IPFS Gateway with HTTPS in Docker Containers
Explore the docs »
View Demo
·
Report Bug
·
Request Feature
IPFS is a decentralized protocol that aims to serve content not by addressing it by where it comes from (URI), but instead replacing the central authority and use Content IDentifiers to find content and retrieve it from the closest peer that has content with the same hash.
To make IPFS more accessible, similarly to how IPv6 is/was tunneled in IPv4, IPFS can deliver content via the HTTP protocol by addressing a gateway that has an IPFS node set up.
Having more public gateways helps to share the load of the main ipfs.io
gateway and it can make sharing content with others a lot faster, as you can
seed data from your own gateway, guaranteeing that it is located quickly.
To get a local copy up and running follow these simple steps.
Install Docker and docker-compose as instructed by the linked resources. Make sure to add your user to the docker group!
Furthermore, if you're behind a NAT, you'll need to set up port-forwarding to the device that'll run the gateway. Required are port 80(for incoming HTTP; it will be upgraded to HTTPS via a 301 response), 443(for HTTPS) and 4001(for IPFS).
And lastly, your device needs to have a DNS entry that points to your (static) IP address. If you don't have either, I recommend a service like DuckDNS.
- Clone the repo
git clone https://github.com/Mithrandir2k18/dockerized-https-ipfs-gateway.git
- If you're not on the amd64/x86_64 architecture:
- Execute the
build_go-ipfs.sh
script. - Edit the
docker-compose.yaml
and add an image tag to the service "certbot" that matches your system. Find the tags here and it like this:certbot/certbot:TAGNAME
- Execute the
- Edit the
nginx.conf
file and replace every mention ofmydomain.com
with your registered domain. - Edit the
setup_configs.sh
script and change the first two variables to match your registered domain and email. - Execute the
setup_configs.sh
script. If any errors are shown, cancel it, usingCTRL+C
, debug it, delete the createddata
directory and try again. - At the end of the script you'll be asked some questions. After that your dockerized HTTPS IPFS Gateway should be up and running!
- If you want to start the gateway on each reboot of your device add
sleep 10 && cd /path/to/repo/ && docker-compose up -d
to your crontab!
Once your gateway is up and running and publicly reachable, you can use and
share HTTPS Gateway links like
https://ipfs.io/ipfs/QmPChd2hVbrJ6bfo3WBcTW4iZnpHm8TEzWkLHmLpXhF68A
, but
instead of using the ipfs.io
gateway you can now use links using yours like
this: https://mydomain.com/ipfs/QmPChd2hVbrJ6bfo3WBcTW4iZnpHm8TEzWkLHmLpXhF68A
!
See the open issues for a list of proposed features (and known issues).
Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the MIT License. See LICENSE
for more information.
The license may be subject to change in the future.
Mithrandir2k18 - [email protected]
Project Link: https://github.com/Mithrandir2k18/dockerized-https-ipfs-gateway
- This project was inspired here.
- This project is an implementation of this guide.
- Thanks to alexzorin, who has been a quick and huge help!
- README Template from here.