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,8 +1,12 @@
|
||||||
# Install IPFS
|
# Install IPFS
|
||||||
ipfs() {
|
ipfs() {
|
||||||
echo -e "${c_yellow}Onboarding IPFS...$c_"
|
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
|
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
|
||||||
|
@ -18,15 +22,20 @@ 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
|
||||||
|
|
||||||
|
if [[ ! -f /etc/systemd/system/ipfs.service ]]; then
|
||||||
|
echo "CREATE SYSTEMD ipfs SERVICE"
|
||||||
|
sudo cp -f $BASE_DIR/ipfs.service /etc/systemd/system/
|
||||||
|
sudo sed -i "s/_USER/$USER/g" /etc/systemd/system/ipfs.service
|
||||||
|
|
||||||
echo "CREATE SYSTEMD ipfs SERVICE"
|
sudo systemctl daemon-reload || err+="Reload systemd"
|
||||||
[[ -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 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 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
|
||||||
|
|
||||||
|
sudo systemctl stop ipfs
|
||||||
|
echo "ipfs OK. Daemon stop... continue..."
|
||||||
}
|
}
|
||||||
|
|
||||||
$@
|
$@
|
||||||
|
|
|
@ -1,16 +1,11 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
scuttlebutt() {
|
scuttlebutt() {
|
||||||
|
|
||||||
echo -e "${c_yellow}Onboarding SCUTTLEBUTT...$c_"
|
echo -e "${c_yellow}Onboarding SCUTTLEBUTT...$c_"
|
||||||
where_is_ssb_installed=$(which ssb-server)
|
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)"
|
BASE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||||
|
|
||||||
if [[ ! $where_is_ssb_installed ]]; then
|
if [[ ! $where_is_ssb_installed ]]; then
|
||||||
cd ~/.zen/fatlayer_install
|
|
||||||
# Install dependencies
|
# Install dependencies
|
||||||
sudo apt-get install -y socat python3-dev libtool python3-setuptools autoconf automake
|
sudo apt-get install -y socat python3-dev libtool python3-setuptools autoconf automake
|
||||||
|
|
||||||
|
@ -20,6 +15,7 @@ scuttlebutt() {
|
||||||
nvm install --lts
|
nvm install --lts
|
||||||
|
|
||||||
# Install sbot-server
|
# 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 sodium-native ssb-backlinks ssb-ws ssb-links ssb-query
|
||||||
npm install -g ssb-server
|
npm install -g ssb-server
|
||||||
fi
|
fi
|
||||||
|
@ -29,11 +25,11 @@ scuttlebutt() {
|
||||||
[[ $ssbSERVER == "" ]] && echo "Check your ssb-server install... Cannot find it !!" && exit 1
|
[[ $ssbSERVER == "" ]] && echo "Check your ssb-server install... Cannot find it !!" && exit 1
|
||||||
|
|
||||||
# BACKUP OLD SSB
|
# 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
|
# MAKE A LINK ~/.ssb_astroport to ~/.ssb
|
||||||
mkdir ~/.ssb.astroport
|
[[ ! -d ~/.ssb_astroport ]] && mkdir ~/.ssb_astroport
|
||||||
ln -s ~/.ssb.astroport ~/.ssb
|
[[ ! -L ~/.ssb ]] && ln -s ~/.ssb_astroport ~/.ssb
|
||||||
|
|
||||||
# Create config (TODO: adapt if public Pub or Local Node)
|
# Create config (TODO: adapt if public Pub or Local Node)
|
||||||
nodename=$(cat /etc/hostname)
|
nodename=$(cat /etc/hostname)
|
||||||
|
@ -84,18 +80,20 @@ EOF
|
||||||
# Store current user as sudo will change it
|
# Store current user as sudo will change it
|
||||||
currentUser=$USER
|
currentUser=$USER
|
||||||
|
|
||||||
# Copy SYSTEMD service to correct location
|
if [[ ! -f /etc/systemd/system/ssb.service ]]; then
|
||||||
sudo cp "$BASE_DIR/ssb.service" /tmp/ssb.service
|
# Copy SYSTEMD service to correct location
|
||||||
# Copy repplace __USER__ place holder to current user
|
sudo cp "$BASE_DIR/ssb.service" /tmp/ssb.service
|
||||||
sudo sed -i "s|__USER__|${currentUser}|g" /tmp/ssb.service
|
# Copy repplace __USER__ place holder to current user
|
||||||
sudo sed -i "s|__SSBSERVER__|${ssbSERVER}|g" /tmp/ssb.service
|
sudo sed -i "s|__USER__|${currentUser}|g" /tmp/ssb.service
|
||||||
|
sudo sed -i "s|__SSBSERVER__|${ssbSERVER}|g" /tmp/ssb.service
|
||||||
|
|
||||||
sudo mv /tmp/ssb.service /etc/systemd/system/ssb.service
|
sudo mv /tmp/ssb.service /etc/systemd/system/ssb.service
|
||||||
|
|
||||||
# Reload, Enable and start SSB Service
|
# Reload, Enable and start SSB Service
|
||||||
sudo systemctl daemon-reload
|
sudo systemctl daemon-reload
|
||||||
sudo systemctl enable ssb.service
|
sudo systemctl enable ssb.service
|
||||||
sudo systemctl start 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