Compare commits
No commits in common. "ec25774fc2dc62125b232352f19d68d1f177fcbf" and "7e5ead8f7649366a17c484aecf8861b192d4eda0" have entirely different histories.
ec25774fc2
...
7e5ead8f76
5 changed files with 21 additions and 51 deletions
|
|
@ -32,7 +32,7 @@ sudo apt install -y git
|
||||||
```
|
```
|
||||||
3. Clone repository
|
3. Clone repository
|
||||||
```bash
|
```bash
|
||||||
git clone https://lab.c95.org/fr4nz/LoMeS.git && cd LoMeS
|
git clone https://lab.c95.org/fr4nz/LoMeS.git && cd LoMeS && git switch dev-1
|
||||||
```
|
```
|
||||||
4. Run development environment setup
|
4. Run development environment setup
|
||||||
```bash
|
```bash
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,6 @@
|
||||||
|
|
||||||
from flask import Flask, render_template
|
from flask import Flask, render_template
|
||||||
import getpass
|
import getpass
|
||||||
import socket
|
|
||||||
|
|
||||||
app = Flask(__name__)
|
app = Flask(__name__)
|
||||||
|
|
||||||
|
|
@ -11,4 +10,5 @@ def index():
|
||||||
user=getpass.getuser()
|
user=getpass.getuser()
|
||||||
return render_template("index.html", user=user)
|
return render_template("index.html", user=user)
|
||||||
|
|
||||||
|
|
||||||
app.run(host="127.0.0.1", port=5000)
|
app.run(host="127.0.0.1", port=5000)
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
trap "exit" INT
|
trap "exit" INT
|
||||||
|
|
||||||
chmod +x lomes-app.py
|
|
||||||
mkdir -p /tmp/LoMeS
|
mkdir -p /tmp/LoMeS
|
||||||
source assets/shell/colors
|
source assets/shell/colors
|
||||||
source assets/config/deps/dependencies
|
source assets/config/deps/dependencies
|
||||||
|
|
@ -71,11 +70,11 @@ fi
|
||||||
|
|
||||||
### NGINX SETUP & CONFIG
|
### NGINX SETUP & CONFIG
|
||||||
|
|
||||||
###### CONNECTION & INTERFACE
|
###### HOST
|
||||||
|
|
||||||
onif=$(/sbin/ip route get 162.249.72.1 | awk '{print $5}' | cut -d/ -f1)
|
onif=$(/sbin/ip route get 162.249.72.1 | awk '{print $5}' | cut -d/ -f1) ### GET ACTIVE NETWORK INTERFACE !
|
||||||
|
|
||||||
while true; do ### SELECT NETWORK INTERFACE !
|
while true; do
|
||||||
echo -e " ${YEL}What network interface will nginx be using?"
|
echo -e " ${YEL}What network interface will nginx be using?"
|
||||||
read -p " current = "$onif" --> " nif
|
read -p " current = "$onif" --> " nif
|
||||||
echo -e "${CRS}"
|
echo -e "${CRS}"
|
||||||
|
|
@ -98,8 +97,8 @@ echo -e "\n ${YEL}Current hostname : ${LCY}$(hostname)${CRS}"
|
||||||
echo -e " ${YEL}Current ip address : ${LCY}$ip4 ${YEL}@ ${LCY}$nif${CRS}"
|
echo -e " ${YEL}Current ip address : ${LCY}$ip4 ${YEL}@ ${LCY}$nif${CRS}"
|
||||||
echo -e "\n ${YEL}This information will be used to configure ${LCY}nginx.conf ${YEL}during the next steps."
|
echo -e "\n ${YEL}This information will be used to configure ${LCY}nginx.conf ${YEL}during the next steps."
|
||||||
|
|
||||||
while true; do ### HOST NAME CHANGE ?
|
while true; do
|
||||||
read -p " Would you like to change the hostname? (y/N) --> " conf_hostname
|
read -p " Would you like to change the hostname? (y/N) --> " conf_hostname ### HOST NAME CHANGE ?
|
||||||
echo -e "${CRS}"
|
echo -e "${CRS}"
|
||||||
|
|
||||||
if [[ "$conf_hostname" = "" || "$conf_hostname" = "n" || "$conf_hostname" = "N" ]]; then
|
if [[ "$conf_hostname" = "" || "$conf_hostname" = "n" || "$conf_hostname" = "N" ]]; then
|
||||||
|
|
@ -122,8 +121,10 @@ while true; do
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
while true; do ### CERTIFICATION & CONFIGURATION
|
###### CERTIFICATION & CONFIGURATION
|
||||||
echo -e "\n ${YEL}Configure nginx with SSL and create a self signed cetrificate?"
|
|
||||||
|
while true; do
|
||||||
|
echo -e "\n ${YEL}Configure SSL and create a self signed cetrificate?"
|
||||||
read -p " (Y/n) --> " installSSL
|
read -p " (Y/n) --> " installSSL
|
||||||
echo -e "${CRS}"
|
echo -e "${CRS}"
|
||||||
|
|
||||||
|
|
@ -166,7 +167,7 @@ while true; do
|
||||||
break
|
break
|
||||||
|
|
||||||
elif [[ "$installSSL" == "n" || "$installSSL" = "N" ]]; then
|
elif [[ "$installSSL" == "n" || "$installSSL" = "N" ]]; then
|
||||||
echo -e "\n ${YEL}Nginx configuration skipped!${CRS}"
|
echo -e "\n ${RED}Encryption disabled${CRS}\n"
|
||||||
break
|
break
|
||||||
|
|
||||||
else
|
else
|
||||||
|
|
@ -175,7 +176,7 @@ while true; do
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
###### NGINX MAINTENANCE
|
###### NGINX MAINTENANCE & LANDING PAGE
|
||||||
|
|
||||||
sudo rm -rf /var/www/html
|
sudo rm -rf /var/www/html
|
||||||
|
|
||||||
|
|
@ -211,13 +212,10 @@ if [ -f "/tmp/LoMeS/honacha" ]; then
|
||||||
echo -e "${CRS}"
|
echo -e "${CRS}"
|
||||||
|
|
||||||
if [[ "$reboot" = "" || "$reboot" = "y" || "$reboot" = "Y" ]]; then
|
if [[ "$reboot" = "" || "$reboot" = "y" || "$reboot" = "Y" ]]; then
|
||||||
echo -e " ${YEL}Rebooting in 10sec..."
|
|
||||||
echo -e " ${YEL}to start flask manually, run ${LCY}python3 lomes-app.py ${YEL}from LoMeS directory${CRS}"
|
|
||||||
sleep 10s
|
|
||||||
sudo reboot
|
sudo reboot
|
||||||
|
break
|
||||||
|
|
||||||
elif [[ "$reboot" = "n" || "$reboot" = "N" ]]; then
|
elif [[ "$reboot" = "n" || "$reboot" = "N" ]]; then
|
||||||
echo -e " ${YEL}to start flask manually, run ${LCY}python3 lomes-app.py ${YEL}from LoMeS directory${CRS}"
|
|
||||||
break
|
break
|
||||||
|
|
||||||
else
|
else
|
||||||
|
|
@ -227,27 +225,8 @@ if [ -f "/tmp/LoMeS/honacha" ]; then
|
||||||
done
|
done
|
||||||
|
|
||||||
else
|
else
|
||||||
|
chmod +x lomes-app.py
|
||||||
while true; do
|
./lomes-app.py &> /dev/null & disown
|
||||||
echo -e "${YEL}" ### START FLASK ?
|
echo -e " ${LGN}Flask is running...${CRS}\n"
|
||||||
read -p " Would you like to start flask? (Y/n) --> " flask_start
|
|
||||||
echo -e "${CRS}"
|
|
||||||
|
|
||||||
if [[ "$flask_start" = "" || "$flask_start" = "y" || "$flask_start" = "Y" ]]; then
|
|
||||||
echo -e " ${YEL}Starting flask in 10sec..."
|
|
||||||
echo -e " ${YEL}to start flask manually, run ${LCY}python3 lomes-app.py ${YEL}from LoMeS directory${CRS}\n"
|
|
||||||
sleep 10s
|
|
||||||
python3 lomes-app.py
|
|
||||||
break
|
|
||||||
|
|
||||||
elif [[ "$flask_start" = "n" || "$flask_start" = "N" ]]; then
|
|
||||||
echo -e " ${YEL}to start flask manually, run ${LCY}python3 lomes-app.py ${YEL}from LoMeS directory${CRS}\n"
|
|
||||||
break
|
|
||||||
|
|
||||||
else
|
|
||||||
echo -e "\n ${YEL}Invalid response... Try again...\n\n Y = (Yes, to start flask)\n N = (No, start flask later)${CRS}\n "
|
|
||||||
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
@ -136,11 +136,3 @@ p {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
color: lightgray;
|
color: lightgray;
|
||||||
}
|
}
|
||||||
|
|
||||||
li {
|
|
||||||
font-size: 16px;
|
|
||||||
padding: 5px;
|
|
||||||
padding-bottom: 10px;
|
|
||||||
text-align: center;
|
|
||||||
color: lightgray;
|
|
||||||
}
|
|
||||||
|
|
@ -15,16 +15,15 @@
|
||||||
</header>
|
</header>
|
||||||
<div class="textBox">
|
<div class="textBox">
|
||||||
<h3>A Local Meshtastic Server in development</h3><br>
|
<h3>A Local Meshtastic Server in development</h3><br>
|
||||||
|
<p><strong>Hi {{user}}</strong></p>
|
||||||
<p>If you see this site, means "LoMeS" development environment is running!</p>
|
<p>If you see this site, means "LoMeS" development environment is running!</p>
|
||||||
<p>Thanks for collaborating and trying to make things more real...</p>
|
<p>Thanks for collaborating and trying to make things more real...</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="textBox">
|
<!-- <div class="textBox">
|
||||||
<h3>Configuration Summary</h3>
|
<h3>Configuration Summary</h3>
|
||||||
<div class="confBox">
|
<div class="confBox">
|
||||||
<ul>
|
<link rel="import" href="assets/html/data/install_log/log.html">
|
||||||
<li>User executing flask : {{user}}</li>
|
</div>-->
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
</body>
|
</body>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue