MichaIng / DietPi-Website

Repository for the DietPi OS website
https://dietpi.com/
Creative Commons Attribution Share Alike 4.0 International
27 stars 18 forks source link

Host DietPi images on IPFS #97

Open ravenclaw900 opened 3 years ago

ravenclaw900 commented 3 years ago

I think that it would be a good idea to host some DietPi images on IPFS, as an optional download option. I do already have a up-to-date mirror of the disk images directory at /ipns/k51qzi5uqu5dit856p8codd8mdkhfgic8m93jl4i2udrr1o35uvtnc2nbvtfyi.

MichaIng commented 3 years ago

Quite an idea. But we'd need to find a way to do IPFS file updates directly from our server to avoid doubled upload but without doubling disk usage on our server, which is limited. Like a daemon that watches image file changes via inotify and in case feeds them into a local IPFS node or so, or can the node do such by itself? But the disk usage for that node needs to be limited, much lower than the actual images size, not sure if/how that would work, e.g. supporting it with other nodes from community members.

Some of the benefits of IPFS are btw not that huge in our case, due to do Cloudflare cache which has most of the frequently downloaded images decentralised available. I set 1 month TTL for those, clearing single images cache on demand, but as only ~50-60% of bandwidth is served from the edge cache, they are not really all served from cache (which I would expect with 1 month cache time).

ravenclaw900 commented 3 years ago

I use the handy ipfs-sync tool for syncing files, and IPFS has a feature that let's you add files without duplicating them.

MichaIng commented 3 years ago

Hmm, but that feature removes the original files, doesn't it?

Finally, when adding files with ipfs add, pass the --nocopy flag to use the filestore instead of copying the files into your local IPFS repo.

Although this sounds like the original files stay in place. A simple test will do 😄.