forked from axiom-team/astroport
image and ipfs service coming
This commit is contained in:
parent
3129425607
commit
35ae033ad9
|
@ -0,0 +1,11 @@
|
|||
[Unit]
|
||||
Description=IPFS daemon
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
User=_USER
|
||||
ExecStart=/usr/local/bin/ipfs daemon --enable-pubsub-experiment --enable-namesys-pubsub --routing=dhtclient --enable-gc
|
||||
Restart=on-failure
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
|
@ -1,7 +1,11 @@
|
|||
# Install IPFS
|
||||
ipfs() {
|
||||
echo -e "${c_yellow}Onboarding IPFS...$c_"
|
||||
[[ -f /usr/local/bin/ipfs ]] && sudo service ipfs stop
|
||||
BASE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
|
||||
is_ipfs_update_installed=$(which ipfs-update)
|
||||
|
||||
if [[ ! $is_ipfs_update_installed ]]; 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"
|
||||
|
@ -18,15 +22,20 @@ ipfs() {
|
|||
|
||||
echo "INSTALL latest ipfs"
|
||||
sudo ipfs-update install latest || err+="Install IPFS"
|
||||
fi
|
||||
|
||||
if [[ ! -f /etc/systemd/system/ipfs.service ]]; then
|
||||
echo "CREATE SYSTEMD ipfs SERVICE"
|
||||
[[ -f /etc/systemd/system/ipfs.service ]] && sudo rm /etc/systemd/system/ipfs.service
|
||||
sudo cp -f $MY_PATH/templates/1/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 systemctl daemon-reload || err+="Restart IPFS"
|
||||
# DO NOT START YET... Must get IPFS swarm.key from a G1SSB Pub !!
|
||||
sudo systemctl daemon-reload || err+="Reload systemd"
|
||||
sudo systemctl enable ipfs || err+="Enable IPFS daemon"
|
||||
# DO NOT START YET... Must get IPFS swarm.key from a G1SSB Pub !!
|
||||
fi
|
||||
|
||||
sudo systemctl stop ipfs
|
||||
echo "ipfs OK. Daemon stop... continue..."
|
||||
}
|
||||
|
||||
$@
|
||||
|
|
|
@ -1,16 +1,11 @@
|
|||
#!/bin/bash
|
||||
scuttlebutt() {
|
||||
|
||||
echo -e "${c_yellow}Onboarding SCUTTLEBUTT...$c_"
|
||||
where_is_ssb_installed=$(which ssb-server)
|
||||
|
||||
# Install npm_modules in ~/.zen/fatlayer_install
|
||||
mkdir -p ~/.zen/fatlayer_install
|
||||
|
||||
BASE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
|
||||
if [[ ! $where_is_ssb_installed ]]; then
|
||||
cd ~/.zen/fatlayer_install
|
||||
# Install dependencies
|
||||
sudo apt-get install -y socat python3-dev libtool python3-setuptools autoconf automake
|
||||
|
||||
|
@ -20,6 +15,7 @@ scuttlebutt() {
|
|||
nvm install --lts
|
||||
|
||||
# Install sbot-server
|
||||
[[ ! -d ~/.ssb_astroport ]] && mkdir -p ~/.ssb_astroport && cd ~/.ssb_astroport
|
||||
npm install sodium-native ssb-backlinks ssb-ws ssb-links ssb-query
|
||||
npm install -g ssb-server
|
||||
fi
|
||||
|
@ -29,11 +25,11 @@ scuttlebutt() {
|
|||
[[ $ssbSERVER == "" ]] && echo "Check your ssb-server install... Cannot find it !!" && exit 1
|
||||
|
||||
# BACKUP OLD SSB
|
||||
[[ -d ~/.ssb ]] && mv ~/.ssb ~/.ssb.$USER # BACKUP OLD SSB
|
||||
[[ ! -d ~/.ssb.$USER && -d ~/.ssb ]] && mv ~/.ssb ~/.ssb.$USER # BACKUP OLD SSB
|
||||
|
||||
# MAKE A LINK ~/.ssb.astroport to ~/.ssb
|
||||
mkdir ~/.ssb.astroport
|
||||
ln -s ~/.ssb.astroport ~/.ssb
|
||||
# MAKE A LINK ~/.ssb_astroport to ~/.ssb
|
||||
[[ ! -d ~/.ssb_astroport ]] && mkdir ~/.ssb_astroport
|
||||
[[ ! -L ~/.ssb ]] && ln -s ~/.ssb_astroport ~/.ssb
|
||||
|
||||
# Create config (TODO: adapt if public Pub or Local Node)
|
||||
nodename=$(cat /etc/hostname)
|
||||
|
@ -84,6 +80,7 @@ EOF
|
|||
# Store current user as sudo will change it
|
||||
currentUser=$USER
|
||||
|
||||
if [[ ! -f /etc/systemd/system/ssb.service ]]; then
|
||||
# Copy SYSTEMD service to correct location
|
||||
sudo cp "$BASE_DIR/ssb.service" /tmp/ssb.service
|
||||
# Copy repplace __USER__ place holder to current user
|
||||
|
@ -96,6 +93,7 @@ EOF
|
|||
sudo systemctl daemon-reload
|
||||
sudo systemctl enable ssb.service
|
||||
sudo systemctl start ssb.service
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 154 KiB |
Binary file not shown.
After Width: | Height: | Size: 111 KiB |
Binary file not shown.
After Width: | Height: | Size: 326 KiB |
Binary file not shown.
Loading…
Reference in New Issue