DEV Community

loading...
Cover image for Deploy a Censorship Resistant Website for FREE πŸ”“πŸŒŽ

Deploy a Censorship Resistant Website for FREE πŸ”“πŸŒŽ

0xbanana profile image 🍌🍌🍌 ・2 min read

Internet censorship is the control or suppression of what can be accessed, published, or viewed on the Internet.

I believe in a free and open internet and to help keep it that we're going to learn how to deploy a censorship resistant static website in just a few minutes with a few free tools.

To achieve censorship resistance we're going to use IPFS (Interplanetary File System) a distributed system for storing and accessing files, websites, and data.

You can run your own IPFS node to increase the strength of the network and store your own files but for this tutorial we're going to use a free service to manage our content and more importantly manage our pinned content.

IPFS nodes treat the data they store like a cache, meaning that there is no guarantee that the data will continue to be stored. Pinning tells an IPFS server that the data is important and mustn’t be thrown away.

I'm a fan of using https://pinata.cloud, once you've made an account, select upload and you'll be presented with something like below.

pinata.cloud upload interface

Notice "Upload Directory" is selected and "Preserve directory name" is not checked. Select the directory of your site contents and upload them. Once uploaded, select "Pin Explorer" from the nav menu.

pinata.cloud pins interface

Using the hash provided by IPFS, we now have the address of our deployed directory. In the case of the screenshot above my content is stored at hash QmdFWa8PEruGXistCu8MFRwb2bncH2xAYx34nYqEBaxaVk. Using a public IPFS gateway we can see the content at the hash address. Here is a list of public gateways and their status'.

https://ipfs.io/ipfs/QmdFWa8PEruGXistCu8MFRwb2bncH2xAYx34nYqEBaxaVk/

Screenshot of website hosted on ipfs

It may take a few minutes for the data to propagate through the network but you now have a censorship resistant website!


Enjoyed the post? Let me know! πŸ’›πŸ¦„πŸ”–

Discussion (9)

pic
Editor guide
Collapse
yuanhao profile image
YuanHao Chiang

First time I hear about IPFS 😲 excuse my ignorance, but what happens if internet providers decide to block IPFS gateways -- I imagine it's possible to have a list of the hashes offline (albeit the offline list would be huge).

Collapse
0xbanana profile image
🍌🍌🍌 Author

You can run your own IPFS node which will connect you to the network. You can setup your own IPFS gateway and make that public as well.

Collapse
lcoenen profile image
LoΓ―c Coenen

IPFS is the future! It can be quite slow if you don't have your own server though. Have you checked out Arweave? It's adding an incentive layer on the top of IFPS.

Collapse
0xbanana profile image
🍌🍌🍌 Author

I havent! I'll take a look. Im not a big fan of incentive layers, if there is no inherent incentive, an extra bolt on layer wont fix it.

Collapse
kayis profile image
K

Sounds pretty slick!

So an IPFS gateway is the link between IPFS and HTTP?

Do they provide a way to use a custom domain?

Collapse
0xbanana profile image
🍌🍌🍌 Author

There are domain providers, and some tools out there to use custom CRYPTO domains (.eth .zil).

You can always use a domain redirect with a standard DNS provider to point to a IPFS GW address.
In my situation I setup a subdomain (d.jasonschorr.com) that points to ipfs.io/ipfs/

Collapse
luccaprado profile image
Lucca Prado

Really nice, I want to study this. Thanks for sharing!

Collapse
0xbanana profile image
🍌🍌🍌 Author

Thanks for the feedback! You're welcome!

Collapse
shalvah profile image
Shalvah

Cool. Would be nice if you had explained how IPFS ensures censorship resistance.