This commit is contained in:
Daniil Gentili 2019-04-22 11:00:10 +00:00
parent dd466e4ab9
commit 3b2cfb815e
3 changed files with 42 additions and 1 deletions

13
README.md Normal file
View File

@ -0,0 +1,13 @@
# Yayponies IPFS mirroring script
Create your own [yayponies](https://yp1.yayponies.no/) mirror, hosted on the [ipfs](https://ipfs.io) distributed network.
Based on the original [YP mirroring script](https://github.com/yaymuffins/YP-MirroringScript).
## Usage
```
git clone --recursive https://github.com/danog/yayponies-ipfs
./install.sh
```

View File

@ -1,5 +1,32 @@
#!/bin/bash
echo "Deploying YayPonies IPFS Mirror"
echo ""
which ipfs &> /dev/null || { echo "Install ipfs, first: https://docs.ipfs.io/introduction/install/" && exit 1; }
echo "This script has only been tested on Debian Jessie and Ubuntu Trusty"
echo "It will install a new IPFS mirror on a newly deployed system"
echo "It SHOULD NOT BE USED ON MULTIPLE SITE CONFIGURATION"
echo "IT SHOULD ALSO NOT BE USED IF PORT 8808 IS UNAVAILABLE"
echo ""
echo "This will install nginx from your distribution repository"
echo "set configuration, cron task"
echo "and finally start your mirror"
echo ""
echo "This program is distributed WITHOUT ANY WARRANTY"
read -n1 -r -p "Press space or enter to continue, any other keys to cancel..." key
if [ "$key" = '' ]; then
echo ""
echo "OK, Starting..."
else
echo ""
echo "OK, Cancelling..."
exit 1
fi
sudo service nginx stop
sudo rm -rf /etc/nginx/sites-enabled/default
sudo rm -rf /etc/nginx/conf.d/default

View File

@ -10,7 +10,8 @@ done
cd ..
hash=$(ipfs name publish /ipfs/$(ipfs add -r ypmirror/ | sed '/ ypmirror$/!d;s/added //;s/ .*//g') | sed 's/:.*//g;s/Published to //g')
echo "Create a DNS TXT record with value dnslink=/ipfs/$hash and name _dnslink.domain.name.
echo "
Create a DNS TXT record with value dnslink=/ipfs/$hash and name _dnslink.domain.name (add a TXT record with name domain.name, too, just to be sure).
Then configure it using https://www.cloudflare.com/distributed-web-gateway
Enjoy!