multiport Love LAND nodename
This commit is contained in:
parent
15c9f6eb4b
commit
581eeba35b
|
@ -33,7 +33,7 @@ echo '
|
|||
/_/ /____/
|
||||
|
||||
Multimedia Layer installation https://copylaradio.com
|
||||
'
|
||||
' | lolcat
|
||||
######## 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
|
||||
|
@ -71,7 +71,7 @@ echo '
|
|||
/_/ /_/\__, /_/_/ /_/_/|_|
|
||||
/____/
|
||||
|
||||
'
|
||||
' | lolcat
|
||||
sudo apt-get install fail2ban nginx ssl-cert php-curl php-sqlite3 php-gd php-json php-xml php-mbstring php-fpm sqlite -y || err=1
|
||||
|
||||
# IN CASE, KILL RUNNING OASIS
|
||||
|
@ -107,56 +107,62 @@ fi
|
|||
|
||||
sleep 5
|
||||
|
||||
# CONFIG NGINX - LOVE LAND FRONTAL WEB PAGE
|
||||
sudo cp -f /home/$YOU/.zen/astroport/www/loveland.conf /etc/nginx/conf.d/
|
||||
## TODO optimise loveland.conf
|
||||
### Each Extra Flavour take a new
|
||||
sudo cp /etc/nginx/conf.d/loveland.conf /etc/nginx/conf.d/10010.conf
|
||||
sudo cp /etc/nginx/conf.d/loveland.conf /etc/nginx/conf.d/10020.conf
|
||||
sudo cp /etc/nginx/conf.d/loveland.conf /etc/nginx/conf.d/10030.conf
|
||||
sudo cp /etc/nginx/conf.d/loveland.conf /etc/nginx/conf.d/10030.conf
|
||||
|
||||
|
||||
echo "INSTALL LOVELand WebSite"
|
||||
echo "INSTALL LOVELand WebSite. Linking to /var/www ..."
|
||||
if [[ ! -L /var/www/loveland ]]; then
|
||||
sudo ln -s /home/$YOU/.zen/astroport/www/LOVELand /var/www/loveland
|
||||
fi
|
||||
|
||||
# RompR JUKEBOX
|
||||
echo "JUKEBOX init"
|
||||
sudo chmod -R 777 /var/www/loveland/jukebox/albumart
|
||||
sudo chmod -R 777 /var/www/loveland/jukebox/prefs
|
||||
|
||||
# CONFIG NGINX - LOVE LAND FRONTAL WEB PAGE
|
||||
|
||||
echo "$nodename" | figlet -f slant | lolcat
|
||||
|
||||
# GNU DEBIAN is a wonderfull system !
|
||||
[[ ! $(which nslookup) ]] && sudo apt-get install dnsutils -y
|
||||
|
||||
sudo su - # important, pour obtenir les variables d'environnement de root (pas sudo -s)
|
||||
# What is my IP
|
||||
myIP=$(hostname -I | awk '{print $1}')
|
||||
# Check if IP is from reserved LAN addresses
|
||||
isLAN=$(echo $myIP | grep -E "/(^127\.)|(^192\.168\.)|(^10\.)|(^172\.1[6-9]\.)|(^172\.2[0-9]\.)|(^172\.3[0-1]\.)|(^::1$)|(^[fF][cCdD])/")
|
||||
# Find 1st route gateway
|
||||
myRouter=$(route -n | head -n 3 | tail -n 1 | awk '{print $2}')
|
||||
# Ask to the router its name (BOX DNS or system defined)
|
||||
[[ $isLAN ]] && NODENAME=$(nslookup $myIP $myRouter | head -n 1 | awk -F ' = ' '{print $2}' | sed 's/\.[^.]*$//') \
|
||||
|| NODENAME=$(nslookup $myIP | head -n 1 | awk -F ' = ' '{print $2}' | sed 's/\.[^.]*$//')
|
||||
|
||||
echo $NODENAME
|
||||
|
||||
YOU=$(ps auxf --sort=+utime | grep -w ipfs | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d " " -f 1);
|
||||
PHPVERSION=$(ps auxf | grep php-fpm | grep -v -E 'color=auto|grep' | head -n 1 | grep -oP '(?<=\().*(?=\))' | awk -F '/' '{print $4}')
|
||||
### ASTROPORT STATION PORTAL
|
||||
sudo sed "s/_PHPVERSION_/$PHPVERSION/g" /home/$YOU/.zen/astroport/www/loveland.conf /etc/nginx/conf.d/loveland.conf
|
||||
sudo sed -i "s/_SERVERNAME_/$nodename/g" /etc/nginx/conf.d/loveland.conf
|
||||
sudo sed -i "s/_PORT_/10010/g" /etc/nginx/conf.d/loveland.conf
|
||||
sudo sed -i "s/_APPLI_//g" /etc/nginx/conf.d/loveland.conf
|
||||
sed "s/_PHPVERSION_/$PHPVERSION/g" /home/$YOU/.zen/astroport/www/loveland.conf > /etc/nginx/conf.d/loveland.conf
|
||||
sed -i "s/_NODERNAME_/$NODENAME/g" /etc/nginx/conf.d/loveland.conf
|
||||
sed -i "s/_PORT_/10010/g" /etc/nginx/conf.d/loveland.conf
|
||||
sed -i "s/_APPLI_//g" /etc/nginx/conf.d/loveland.conf
|
||||
|
||||
### GCHANGE G1 Zen
|
||||
sudo sed "s/_PHPVERSION_/$PHPVERSION/g" /home/$YOU/.zen/astroport/www/loveland.conf /etc/nginx/conf.d/gchange.conf
|
||||
sudo sed -i "s/_SERVERNAME_/$nodename/g" /etc/nginx/conf.d/gchange.conf
|
||||
sudo sed -i "s/_PORT_/10020/g" /etc/nginx/conf.d/gchange.conf
|
||||
sudo sed -i "s/_APPLI_/gchange/g" /etc/nginx/conf.d/gchange.conf
|
||||
sed "s/_PHPVERSION_/$PHPVERSION/g" /home/$YOU/.zen/astroport/www/loveland.conf > /etc/nginx/conf.d/gchange.conf
|
||||
sed -i "s/_NODERNAME_/$NODENAME/g" /etc/nginx/conf.d/gchange.conf
|
||||
sed -i "s/_PORT_/10020/g" /etc/nginx/conf.d/gchange.conf
|
||||
sed -i "s/_APPLI_/gchange/g" /etc/nginx/conf.d/gchange.conf
|
||||
|
||||
### CESIUM G1 Zen
|
||||
sudo sed "s/_PHPVERSION_/$PHPVERSION/g" /home/$YOU/.zen/astroport/www/loveland.conf /etc/nginx/conf.d/cesium.conf
|
||||
sudo sed -i "s/_SERVERNAME_/$nodename/g" /etc/nginx/conf.d/cesium.conf
|
||||
sudo sed -i "s/_PORT_/10030/g" /etc/nginx/conf.d/cesium.conf
|
||||
sudo sed -i "s/_APPLI_/cesium/g" /etc/nginx/conf.d/cesium.conf
|
||||
sed "s/_PHPVERSION_/$PHPVERSION/g" /home/$YOU/.zen/astroport/www/loveland.conf > /etc/nginx/conf.d/cesium.conf
|
||||
sed -i "s/_NODERNAME_/$NODENAME/g" /etc/nginx/conf.d/cesium.conf
|
||||
sed -i "s/_PORT_/10030/g" /etc/nginx/conf.d/cesium.conf
|
||||
sed -i "s/_APPLI_/cesium/g" /etc/nginx/conf.d/cesium.conf
|
||||
|
||||
### SSB OASIS Zen
|
||||
sudo sed "s/_SERVERNAME_/$nodename/g" /home/$YOU/.zen/astroport/www/oasis.conf /etc/nginx/conf.d/oasis.conf
|
||||
sudo sed -i "s/_PORT_/10040/g" /etc/nginx/conf.d/oasis.conf
|
||||
sudo sed -i "s/_LPORT_/3000/g" /etc/nginx/conf.d/oasis.conf
|
||||
sudo sed -i "s/_APPLI_//g" /etc/nginx/conf.d/oasis.conf
|
||||
sed "s/_NODERNAME_/$NODENAME/g" /home/$YOU/.zen/astroport/www/oasis.conf > /etc/nginx/conf.d/oasis.conf
|
||||
sed -i "s/_PORT_/10040/g" /etc/nginx/conf.d/oasis.conf
|
||||
sed -i "s/_LPORT_/3000/g" /etc/nginx/conf.d/oasis.conf
|
||||
sed -i "s/_APPLI_//g" /etc/nginx/conf.d/oasis.conf
|
||||
|
||||
|
||||
|
||||
# Disabling default website
|
||||
# sudo rm -f /etc/nginx/sites-enabled/default
|
||||
|
||||
sudo systemctl restart nginx || err=1
|
||||
systemctl restart nginx || err=1
|
||||
|
||||
|
||||
if [[ $err ]]; then
|
||||
|
|
|
@ -216,4 +216,11 @@ KEEP COOL, BE SAFE, BE FREE
|
|||
|
||||
# [Open Collective DONATIONS](https://opencollective.com/monnaie-libre)
|
||||
|
||||
[<img src="https://img.youtube.com/vi/W_FaOWZQdz0/maxresdefault.jpg" width="50%">](https://www.youtube.com/watch?v=W_FaOWZQdz0)
|
||||
### Web 2.0 is dangerous!! You only have window and an apple already biten.
|
||||
[How your many people you don't knwow are owning your data](https://monitor.firefox.com/) ?
|
||||
|
||||
> WE NEED YOU to build more "HyperWeb Cyberspace" Spacecraft(s).
|
||||
|
||||
[Enter "Zen Land" Metaverse](https://oasis.astroport.com)
|
||||
|
||||
|
||||
|
|
|
@ -57,8 +57,8 @@
|
|||
<nav class="navbar navbar-light bg-light static-top">
|
||||
<div class="container">
|
||||
<a class="btn btn-lg btn-primary" href="/profile" onclick="javascript:event.target.port=3000" target="oasis">Oasis</a>
|
||||
<a class="btn btn-lg btn-primary" href="./cesium/index.html" target="cesium">Cesium</a>
|
||||
<a class="btn btn-lg btn-primary" href="./gchange/index.html" target="gchange">Gchange</a>
|
||||
<a class="btn btn-lg btn-primary" href="/index.html" onclick="javascript:event.target.port=10030" target="cesium">Cesium</a>
|
||||
<a class="btn btn-lg btn-primary" href="/index.html" onclick="javascript:event.target.port=10020" target="gchange">Gchange</a>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@ server {
|
|||
|
||||
root /var/www/loveland/_APPLI_;
|
||||
|
||||
server_name _SERVERNAME_;
|
||||
server_name _NODERNAME_;
|
||||
|
||||
# This section can be copied into an existing default setup
|
||||
location / {
|
||||
|
|
|
@ -5,10 +5,10 @@ server {
|
|||
|
||||
root /var/www/loveland/_APPLI_;
|
||||
|
||||
server_name _SERVERNAME_;
|
||||
server_name _NODERNAME_;
|
||||
|
||||
location / {
|
||||
proxy_pass http://127.0.0.1:_LPORT_;
|
||||
proxy_pass http://_NODERNAME_:_LPORT_;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Forwarded-For $remote_addr;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue