Mirrord
Handy tool to create and manage IPFS mirrors.
Install
go get -u -v gitlab.com/NatoBoram/mirrord
cd ~/go/src/gitlab.com/NatoBoram/mirrord
go install
Dependencies
Usage
Configuration file examples can be found in the configs folder.
Add a configuration file to ~/.config/mirrord/config.json
. This file contains paths to scripts to be ran before and after the update process. Example : config.json
{
"before_script": "",
"after_script": ""
}
before_script
and after_script
are paths to scripts to be ran before and after the update process.
Add mirrors to ~/.config/mirrord/mirrors/*.json
. Every file in this directory will be considered mirrors and will be used. Example : ubuntu.json
.
{
"name": "ubuntu",
"update": "/home/ubuntu/Bash/rsync_ubuntu.sh",
"path": "/mnt/Seagate/mirrors/ubuntu",
"snapshots": "/mnt/Seagate/snapshots/ubuntu"
}
name
is simply the name of the mirror. It will be used to generate an IPNS key. update
is the path to your update script. path
is where the mirror is located; it will be added to IPFS. snapshots
is optional; only set it if you want to use --nocopy
and Btrfs snapshots.
Mirrord has two modes : One using --nocopy
with Btrfs snapshots and one without both. It's impossible to mix them because of limitations from IPFS.
This is currently being used to create an IPFS mirror of the Ubuntu Archives. Read more.
deb http://localhost:8080/ipns/QmRzYWabKciZNiRxnyPZGbcY8XWDBkqUwNdjXpsm1q2v7F/ubuntu focal main restricted universe multiverse # IPNS
deb http://localhost:8080/ipns/QmRzYWabKciZNiRxnyPZGbcY8XWDBkqUwNdjXpsm1q2v7F/ubuntu focal-updates main restricted universe multiverse # IPNS
deb http://localhost:8080/ipns/QmRzYWabKciZNiRxnyPZGbcY8XWDBkqUwNdjXpsm1q2v7F/ubuntu focal-backports main restricted universe multiverse # IPNS
deb http://localhost:8080/ipns/QmRzYWabKciZNiRxnyPZGbcY8XWDBkqUwNdjXpsm1q2v7F/ubuntu focal-security main restricted universe multiverse # IPNS
deb http://localhost:8080/ipns/QmRzYWabKciZNiRxnyPZGbcY8XWDBkqUwNdjXpsm1q2v7F/ubuntu focal-proposed main restricted universe multiverse # IPNS
License
GNU GPLv3 🄯 Nato Boram