From 3b2cfb815ed1cf33056cd1647e1e2c270bb49ebc Mon Sep 17 00:00:00 2001 From: Daniil Gentili Date: Mon, 22 Apr 2019 11:00:10 +0000 Subject: [PATCH] Final --- README.md | 13 +++++++++++++ install.sh | 27 +++++++++++++++++++++++++++ script.sh | 3 ++- 3 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..5be5ff5 --- /dev/null +++ b/README.md @@ -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 +``` diff --git a/install.sh b/install.sh index 9df8d16..6867678 100755 --- a/install.sh +++ b/install.sh @@ -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 diff --git a/script.sh b/script.sh index 6fce419..fa4d0be 100755 --- a/script.sh +++ b/script.sh @@ -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!