Merge branch 'master' of https://git.p2p.legal/axiom-team/astroport
This commit is contained in:
commit
8463f23d73
|
@ -1,12 +1,26 @@
|
||||||
# Install IPFS
|
#!/bin/bash
|
||||||
ipfs() {
|
|
||||||
echo -e "${c_yellow}Onboarding IPFS...$c_"
|
|
||||||
BASE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
||||||
|
|
||||||
is_ipfs_update_installed=$(which ipfs-update)
|
# Install IPFS
|
||||||
|
|
||||||
if [[ ! $is_ipfs_update_installed ]]; then
|
MY_PATH="`dirname \"$0\"`" # relative
|
||||||
|
MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized
|
||||||
|
|
||||||
|
## Config
|
||||||
|
diskSize="5G"
|
||||||
|
templates="$MY_PATH/templates/ipfs"
|
||||||
|
|
||||||
|
if [ "$EUID" -eq 0 ]
|
||||||
|
then echo -e "${c_red}Veuillez ne pas executez ce script en root. Choisissez un utilisateur pour votre serveur G1sms+ (nous recommandons l'utilisateur pi)$c_"
|
||||||
|
exit 1
|
||||||
|
else echo -e "${c_yellow}OK $USER, let's go!$c_";
|
||||||
|
fi
|
||||||
|
|
||||||
|
[[ -d ~/.ipfs-old/ ]] && echo "Backup exist, please remove backup before execute this script" && exit 1
|
||||||
|
[[ -d ~/.ipfs/ ]] && rm -rf ~/.ipfs-old && mv ~/.ipfs/ ~/.ipfs-old
|
||||||
|
|
||||||
|
ipfs_install() {
|
||||||
|
echo -e "${c_yellow}Onboarding IPFS...$c_"
|
||||||
|
[[ -f /usr/local/bin/ipfs ]] && sudo service ipfs stop
|
||||||
if [[ $ARM == "yes" ]]; then
|
if [[ $ARM == "yes" ]]; then
|
||||||
wget https://dist.ipfs.io/ipfs-update/v1.5.2/ipfs-update_v1.5.2_linux-arm.tar.gz -O $MY_PATH/ipfs-update.tar.gz || err+="Download ipfs-update"
|
wget https://dist.ipfs.io/ipfs-update/v1.5.2/ipfs-update_v1.5.2_linux-arm.tar.gz -O $MY_PATH/ipfs-update.tar.gz || err+="Download ipfs-update"
|
||||||
else
|
else
|
||||||
|
@ -23,19 +37,41 @@ ipfs() {
|
||||||
echo "INSTALL latest ipfs"
|
echo "INSTALL latest ipfs"
|
||||||
sudo ipfs-update install latest || err+="Install IPFS"
|
sudo ipfs-update install latest || err+="Install IPFS"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ ! -f /etc/systemd/system/ipfs.service ]]; then
|
if [[ ! -f /etc/systemd/system/ipfs.service ]]; then
|
||||||
echo "CREATE SYSTEMD ipfs SERVICE"
|
echo "CREATE SYSTEMD ipfs SERVICE"
|
||||||
sudo cp -f $BASE_DIR/ipfs.service /etc/systemd/system/
|
sudo cp -f $BASE_DIR/ipfs.service /etc/systemd/system/
|
||||||
sudo sed -i "s/_USER/$USER/g" /etc/systemd/system/ipfs.service
|
sudo sed -i "s/_USER/$USER/g" /etc/systemd/system/ipfs.service
|
||||||
|
|
||||||
sudo systemctl daemon-reload || err+="Reload systemd"
|
echo "CREATE SYSTEMD ipfs SERVICE"
|
||||||
|
[[ -f /etc/systemd/system/ipfs.service ]] && sudo rm /etc/systemd/system/ipfs.service
|
||||||
|
sudo cp -f $templates/ipfs.service /etc/systemd/system/
|
||||||
|
sudo sed -i "s/_USER/$USER/g" /etc/systemd/system/ipfs.service
|
||||||
|
|
||||||
|
sudo systemctl daemon-reload || err+="Restart IPFS"
|
||||||
sudo systemctl enable ipfs || err+="Enable IPFS daemon"
|
sudo systemctl enable ipfs || err+="Enable IPFS daemon"
|
||||||
# DO NOT START YET... Must get IPFS swarm.key from a G1SSB Pub !!
|
|
||||||
fi
|
################
|
||||||
|
# BECOME $USER
|
||||||
sudo systemctl stop ipfs
|
# INIT ipfs
|
||||||
echo "ipfs OK. Daemon stop... continue..."
|
ipfs init -p lowpower
|
||||||
|
# ipfs init -p server ## Uncomment for server infrastructure
|
||||||
|
|
||||||
|
# ACTIVATE CONFIG OPTIONS
|
||||||
|
# PUBSUB
|
||||||
|
ipfs config Pubsub.Router gossipsub
|
||||||
|
# MAXSTORAGE
|
||||||
|
ipfs config Datastore.StorageMax $diskSize
|
||||||
|
## PORT FORWARD (SSH)
|
||||||
|
ipfs config --json Experimental.Libp2pStreamMounting true
|
||||||
|
|
||||||
|
######### UPDATE BOOTSTRAP LIST ###########
|
||||||
|
ipfs bootstrap rm --all
|
||||||
|
|
||||||
|
sudo systemctl daemon-reload || err+="Restart IPFS"
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$@
|
ipfs_install
|
||||||
|
|
||||||
|
exit 0
|
||||||
|
|
|
@ -51,9 +51,6 @@ $MY_PATH/.install/export_colors.sh
|
||||||
|
|
||||||
# --------------------------------------------
|
# --------------------------------------------
|
||||||
|
|
||||||
# Install IPFS
|
|
||||||
source .install/ipfs.sh
|
|
||||||
|
|
||||||
# Install ScuttleButt
|
# Install ScuttleButt
|
||||||
source .install/scuttlebutt.sh
|
source .install/scuttlebutt.sh
|
||||||
|
|
||||||
|
@ -71,7 +68,7 @@ iptubes() {
|
||||||
functions=$(declare -F | awk '{print $NF}' | sort | egrep -v "^_" )
|
functions=$(declare -F | awk '{print $NF}' | sort | egrep -v "^_" )
|
||||||
|
|
||||||
## Check IPFS install
|
## Check IPFS install
|
||||||
[[ -z $(which ipfs) ]] && ipfs
|
[[ -z $(which ipfs) ]] && source .install/ipfs.sh
|
||||||
|
|
||||||
echo -e "${c_green}Astroport UP$c_"
|
echo -e "${c_green}Astroport UP$c_"
|
||||||
[[ -z $args ]] && echo -e "Select a gate to install:" && read apps
|
[[ -z $args ]] && echo -e "Select a gate to install:" && read apps
|
||||||
|
|
2
iptubes
2
iptubes
|
@ -1 +1 @@
|
||||||
Subproject commit 24847070307a3342d5d3237aedfe118fc3bc2284
|
Subproject commit 9bb02920fda14aa064f49a243369cd7a4acb61f4
|
Loading…
Reference in New Issue