If you like DNray Forum, you can support it by - BTC: bc1qppjcl3c2cyjazy6lepmrv3fh6ke9mxs7zpfky0 , TRC20 and more...

 

Static website with IPFS

Started by diy05, Aug 14, 2022, 09:22 AM

Previous topic - Next topic

diy05Topic starter

In short, IPFS offers a way to host distributed static sites that can be accessed via public caching gates on the Internet without requiring visitors to install any programs.



These sites can be distributed even without a routable static IP address and remain operational for several hours due to the cache on the gates. By linking your domain to the gates and adding DNS records to multiple gates, you can increase reliability and load balancing. IPFS is useful for static blogs, simple websites, file archives, and transferring large files at once.

IPFS is a decentralized peer-to-peer file transfer system similar to BitTorrent, but with HTTP access. The IPFS daemon temporarily caches files downloaded by users and distributes them to other requesting users. IPFS also permits files to be "pinned" so they don't disappear from the cache. All files added to IPFS receive global hash identifiers that do not change, while addressing in the network is carried out by content identifiers that contain a multihash. Experimental support for publisher-subscriber protocols has been added and JavaScript implementation works in the browser, allowing for the creation of dynamic sites with real-time interaction.

One advantage of IPFS over other technologies is accessing resources from the Internet through gates installed by companies and technology enthusiasts. Cloudflare is the largest gate and it also issues free HTTPS certificates for domains. IPFS permits efficient, distributed and decentralized distribution and downloading of data and can be used for homeless hosting of static sites, uncensored hosting of high-risk sites, distribution of periodically changing data, and as an alternative to CDN.

Creating a site in IPFS is easy through the graphical utility Siderus Orion. Simply install the utility, run it, click File > Add Directory and select the directory with your site files. Your static site will then be available to other users as long as the program is running or the site remains in the gate's cache.

To bind an IPFS hash to a domain and make a website easily reachable, you need to add A and AAAA records pointing to the gate's IP address or a CNAME record pointing to the gate's domain name. Additionally, you must include a TXT record "_dnslink", indicating "dnslink=/ipfs/HASH". Cloudflare provides HTTPS certificates for linked domains. If you don't require HTTPS support, you can add multiple A/AAAA records to several gates at once, as seen on the project forum. Updating the site will also require updating the TXT record for the domain.

To avoid updating the TXT record every time the site is updated, IPFS permits generating a static hash identifier - IPNS - that points to a changing hash. The IPNS record does need to be updated manually every few hours but resolves domains faster than /ipfs/. It's also worth noting that IPNS can resolve domain dnslink records, meaning sites can be opened through links such as https://cloudflare-ipfs.com/ipns/uncleoutrage.com.
  •  


kpripper

Popularizing IPFS is undoubtedly a positive development, but the project lacks funding and resources, which adversely affects its progress. Currently, IPFS has two clients - Go and JS - that consume significant amounts of memory and CPU, struggle with NAT and have been developing the JS version of DHT for two years. Progress is slow, as developers work on the project in their spare time.

To develop this direction further, an alternative idea could involve leveraging distributed networks in response to recent bans, such as those on toggle switches, for example, by utilizing fediverse systems and hosting images on IPFS. With free hosting available, this proposal could be a significant boost to the project's success.
  •  

Hemanth malli

The primary benefit of IPFS is its decentralized distribution of content, which facilitates access to Internet content even under irregular network conditions or through offline caching.
As Huang indicated, sites and web applications can be created and distributed similar to the Bitcoin network. This is an advantage over HTTP, as first-class interconnections are not always present in certain regions, such as developing countries or rural areas.
  •  

Merwin

IPFS (InterPlanetary File System) is pretty slick for hosting static sites. It's a peer-to-peer system, kinda like BitTorrent, but you access it via HTTP. No need for a static IP either, which is a game-changer for folks with dynamic setups. The caching on public gateways helps keep your site alive for hours, even if you're not constantly hosting it. Just toss your domain on a few different gateways using DNS records, and boom—you've got redundancy and load balancing without breaking a sweat.
One cool thing is how everything's addressed by content IDs using a multihash. It means files get global hash IDs that stay consistent no matter what. You can even pin files so they don't vanish from the cache. Oh, and they've been playing around with pub-sub protocols, so dynamic sites and real-time stuff is getting closer. Plus, there's JavaScript implementation right in the browser, so we're not just stuck with static content.

The biggest perk, though, is that you can access IPFS stuff through public gateways like Cloudflare, which, by the way, dishes out free HTTPS certs. This makes it great for situations where you want distributed, decentralized hosting without needing a traditional CDN. Static blogs, file archives, high-risk sites, you name it, IPFS can handle it.

Setting up a site on IPFS is a breeze with Siderus Orion. You basically drag and drop your site files into the app, and voila, your site's live for anyone who knows the hash. To make it user-friendly, you'll wanna add A and AAAA records to your domain pointing to the gateway's IP, or just use a CNAME. Don't forget the TXT record for "_dnslink" pointing to your IPFS hash—this tells the gateway where your site lives on IPFS. Updating your site means tweaking the TXT record, but there's an option called IPNS (InterPlanetary Name System) for a static identifier that points to the latest version of your site.

Now, IPNS does need manual updating every few hours, but it's still quicker than updating DNS records every time. Also, IPNS can resolve dnslink records, making your site accessible via URLs like https://cloudflare-ipfs.com/ipns/uncleoutrage.com, which is pretty neat for branding.

Sure, there are some hurdles—like getting everything set up and keeping the IPNS updated—but if you're in the game for decentralized hosting with some cutting-edge tech, IPFS is worth a shot.
  •  


If you like DNray forum, you can support it by - BTC: bc1qppjcl3c2cyjazy6lepmrv3fh6ke9mxs7zpfky0 , TRC20 and more...