image and ipfs service coming

This commit is contained in:
qo-op 2020-03-23 21:40:52 +01:00
parent 3129425607
commit 35ae033ad9
7 changed files with 46 additions and 28 deletions

11
.install/ipfs.service Normal file
View File

@ -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

View File

@ -1,8 +1,12 @@
# Install IPFS
ipfs() {
echo -e "${c_yellow}Onboarding IPFS...$c_"
[[ -f /usr/local/bin/ipfs ]] && sudo service ipfs stop
echo -e "${c_yellow}Onboarding IPFS...$c_"
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"
else
@ -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"
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"
[[ -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 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..."
}
$@

View File

@ -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,18 +80,20 @@ EOF
# Store current user as sudo will change it
currentUser=$USER
# Copy SYSTEMD service to correct location
sudo cp "$BASE_DIR/ssb.service" /tmp/ssb.service
# Copy repplace __USER__ place holder to current user
sudo sed -i "s|__USER__|${currentUser}|g" /tmp/ssb.service
sudo sed -i "s|__SSBSERVER__|${ssbSERVER}|g" /tmp/ssb.service
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
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
sudo systemctl daemon-reload
sudo systemctl enable ssb.service
sudo systemctl start ssb.service
# Reload, Enable and start SSB Service
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

BIN
doc/images/astroport3.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 111 KiB

BIN
doc/images/astroport4.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 326 KiB

BIN
doc/message_fred.mp3 Normal file

Binary file not shown.