• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

victorb/arch-mirror: IPFS mirror of pacman repositories

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称:

victorb/arch-mirror

开源软件地址:

https://github.com/victorb/arch-mirror

开源编程语言:

Shell 100.0%

开源软件介绍:

arch-mirror

Scripts for syncing arch repositories, adding to IPFS and maintaining publishes to IPNS

Follow along with discussions here: ipfs/notes#84

Usage TLDR

Add Server = https://ipfs.io/ipns/arch.victor.earth/$repo/os/$arch in the top of /etc/pacman.d/mirrorlist

Using as a repository

  • Add https://ipfs.io/ipns/arch.victor.earth/$repo/os/$arch to your list of repositories
  • Run pacman -Syyu to upgrade your packages
  • Enjoy immutable and distributed updates to your system!

There are a few ways you can use the IPFS Arch mirror.

I would recommend to use DNS via IPNS for now, until performance issues with IPNS has been resolved.

Notice: Don't forget to add $repo/os/$arch after when you add it to your mirrorlist.

Usage with local daemon

To get the most benefit of IPFS when downloading packages, you should be running a local go-ipfs node. Once you have it up and running, you can replace ipfs.io with localhost:8080 and everything should work the same, except you get better caching and you help rehost the packages you download.

Tip: as of early 2018 IPFS is having problems with content discovery. To speed up things and avoid timeouts it may be smart to be sure your swarm has a direct connection to one of the peers hosting the mirror:

ipfs swarm connect /ip4/88.18.104.235/tcp/7000/ipfs/QmUWA5FD6otih6aCqnSTSy4cQbcttwCYpA6mYMPJ9qAyKi 
ipfs swarm connect /ip4/167.99.95.100/tcp/4001/ipfs/QmX1WWwNwfEsuzsqWFVstnEkzVFN5i4kefqJQMb5S4umAT

Hosting your own mirror

Requirements

  • go-ipfs version 0.4.14 or later (might work with earlier but tested with 0.4.14)
  • about 150GB of diskspace (real usage will be around ~100GB but good with a buffer)
    • This diskspace requirement only applies if you want to host your own mirror, not if you're using a existing one

Setup

Want to setup your own IPFS mirror? It's easy, just follow these steps:

  • Run ./syncrepo.sh which downloads the latest arch-repository from a Tier 2 mirror to ./arch-repository. Modify the values in syncrepo.sh however you see fit. This script will also end with replacing all symlinks with their target files so adding and browsing via IPFS works correctly.
  • Run ./ipfsify.sh to initialize a local IPFS repository and add the full repository to it
  • Run ./run-daemon.sh to run the daemon

The final output of ./ipfsify.sh should print a IPNS address you can use as the link to the repository.

Make sure to run both syncrepo.sh and ipfsify.sh scripts via cron (or similar software) at least once per day to maintain a updated repository.

Stats (only interesting for people who want to host their own mirror)

  • ./arch-repository/ (downloaded index + packages) ends up ~35GB but after making symlinks into real files, it becomes ~70GB
  • ./.ipfs/ (the IPFS repository) ends up being ~35GB even when making symlinks into real files, because of the de-duplication

Findings

License

MIT 2018 - Victor Bjelkholm




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap