.install/loveland.sh

This commit is contained in:
qo-op 2020-05-10 23:55:40 +02:00
parent e6879b7fbb
commit 5b3c9e8ca9
2 changed files with 89 additions and 0 deletions

64
.install/loveland.sh Executable file
View File

@ -0,0 +1,64 @@
#!/bin/bash
{
MY_PATH="`dirname \"$0\"`" # relative
MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized
[[ $USER == "root" ]] && echo "DO NOT RUN AS root!! Use regular USER with sudo AUTHORISATION" && exit 1
MACHINE_TYPE=`uname -m`
[ ${MACHINE_TYPE:0:3} == 'arm' ] && isARM="YES"
##################################
## INSTALL TOOLS
######## YOUTUBE-DL ##########
if [[ ! $(which youtube-dl) ]]; then
sudo wget https://yt-dl.org/downloads/latest/youtube-dl -O /usr/local/bin/youtube-dl || exit 1
sudo chmod a+rx /usr/local/bin/youtube-dl
sudo chown $USER /usr/local/bin/youtube-dl
fi
sudo apt install libid3-tools mpd mpc lame -y || err=1
sudo apt-get install lame sox libsox-fmt-mp3 eyed3 python-chardet imagemagick curl -y #libav-tools || err=1
sudo apt-get install ca-certificates git-core binutils rsync alsa-utils bc espeak mpg321 fuse atomicparsley -y || err=1
## CONFIG MPD
sudo cp -f $MY_PATH/templates/copylaradio/mpd.conf /etc/mpd.conf
sudo sed -i "s/_USER/$USER/g" /etc/mpd.conf || err=1
mkdir -p ~/.zen/music
mkdir -p ~/.zen/playlists
sudo chown -R $USER /var/lib/mpd/ /var/run/mpd /run/mpd /var/log/mpd
sudo service mpd restart || err=1
### NGINX
sudo apt-get install fail2ban nginx ssl-cert openssl-blacklist php-curl php-sqlite3 php-gd php-json php-xml php-mbstring php-fpm sqlite -y || err=1
# CONFIG NGINX - LOVE LAND
sudo cp -f $MY_PATH/../www/loveland.conf /etc/nginx/conf.d/
$PHPVERSION=$(ps auxf | grep php-fpm | grep -v -E 'color=auto|grep' | head -n 1 | grep -oP '(?<=\().*(?=\))' | awk -F '/' '{print $4}')
sudo sed -i "s/_PHPVERSION_/$PHPVERSION/g" /etc/nginx/conf.d/loveland.conf
sudo systemctl restart nginx || err=1
#################################
## Get _CopyLaRadio distrib
# ipfs get Qm.... > /tmp/copylaradio.zip
# Add CopyLaRadio to system PATH
#export PATH=$PATH:/home/$USER/_CopyLaRadio
# etc....
# INSTALL ROMPR WebSite LINKs
sudo ln -s $MY_PATH/../www/LOVELand /var/www/loveland
sudo chmod 777 $MY_PATH/../www/LOVELand/jukebox/albumart
sudo chmod 777 $MY_PATH/../www/LOVELand/jukebox/prefs
if [[ $err ]]; then
echo -e "${c_red}Installation de copylaradio incomplète$c_"
exit 1
else
echo -e "${c_green}CopyLaRadio a été installé avec succès$c_"
exit 0
fi
}

25
zen/ipfs_OPEN_ports.sh Executable file
View File

@ -0,0 +1,25 @@
#!/bin/bash
################################################################################
# Author: Fred (support@qo-op.com)
# Version: 0.1
# License: AGPL-3.0 (https://choosealicense.com/licenses/agpl-3.0/)
################################################################################
# Activate SUPPORT MODE: open ssh over IPFS
MY_PATH="`dirname \"$0\"`" # relative
MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized
exit
# Arrange local port forwarded to swarm
# GET _uidna
YOU=$(ps aux --sort=+utime | grep ipfs | tail -n 1 | cut -d " " -f 1)
IPFSNODEID=$(ipfs id -f='<id>\n')
UIDNA=$(cat ~/.zen/ipfs/.$IPFSNODEID/G1SSB/_uidna)
p2p close --all
ipfs p2p listen /x/ssh-$UIDNA /ip4/127.0.0.1/tcp/22
ipfs p2p listen /x/http-$UIDNA /ip4/127.0.0.1/tcp/80
ipfs p2p listen /x/https-$UIDNA /ip4/127.0.0.1/tcp/443
ipfs p2p ls