mirror of
https://github.com/danog/yayponies-ipfs.git
synced 2024-11-26 11:54:42 +01:00
Final
This commit is contained in:
parent
dd466e4ab9
commit
3b2cfb815e
13
README.md
Normal file
13
README.md
Normal 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
|
||||
```
|
27
install.sh
27
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
|
||||
|
@ -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!
|
||||
|
Loading…
Reference in New Issue
Block a user