few changes

This commit is contained in:
Fr4nz D13trich 2025-10-14 21:46:07 +02:00
parent 7e5ead8f76
commit 9e90100b9d
5 changed files with 50 additions and 21 deletions

View file

@ -32,7 +32,7 @@ sudo apt install -y git
```
3. Clone repository
```bash
git clone https://lab.c95.org/fr4nz/LoMeS.git && cd LoMeS && git switch dev-1
git clone https://lab.c95.org/fr4nz/LoMeS.git && cd LoMeS && git switch dev-stable
```
4. Run development environment setup
```bash

View file

@ -2,6 +2,7 @@
from flask import Flask, render_template
import getpass
import socket
app = Flask(__name__)
@ -10,5 +11,4 @@ def index():
user=getpass.getuser()
return render_template("index.html", user=user)
app.run(host="127.0.0.1", port=5000)

View file

@ -1,6 +1,7 @@
#!/bin/bash
trap "exit" INT
chmod +x lomes-app.py
mkdir -p /tmp/LoMeS
source assets/shell/colors
source assets/config/deps/dependencies
@ -70,11 +71,11 @@ fi
### NGINX SETUP & CONFIG
###### HOST
###### CONNECTION & INTERFACE
onif=$(/sbin/ip route get 162.249.72.1 | awk '{print $5}' | cut -d/ -f1) ### GET ACTIVE NETWORK INTERFACE !
onif=$(/sbin/ip route get 162.249.72.1 | awk '{print $5}' | cut -d/ -f1)
while true; do
while true; do ### SELECT NETWORK INTERFACE !
echo -e " ${YEL}What network interface will nginx be using?"
read -p " current = "$onif" --> " nif
echo -e "${CRS}"
@ -97,8 +98,8 @@ echo -e "\n ${YEL}Current hostname : ${LCY}$(hostname)${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."
while true; do
read -p " Would you like to change the hostname? (y/N) --> " conf_hostname ### HOST NAME CHANGE ?
while true; do ### HOST NAME CHANGE ?
read -p " Would you like to change the hostname? (y/N) --> " conf_hostname
echo -e "${CRS}"
if [[ "$conf_hostname" = "" || "$conf_hostname" = "n" || "$conf_hostname" = "N" ]]; then
@ -121,10 +122,8 @@ while true; do
fi
done
###### CERTIFICATION & CONFIGURATION
while true; do
echo -e "\n ${YEL}Configure SSL and create a self signed cetrificate?"
while true; do ### CERTIFICATION & CONFIGURATION
echo -e "\n ${YEL}Configure nginx with SSL and create a self signed cetrificate?"
read -p " (Y/n) --> " installSSL
echo -e "${CRS}"
@ -167,7 +166,7 @@ while true; do
break
elif [[ "$installSSL" == "n" || "$installSSL" = "N" ]]; then
echo -e "\n ${RED}Encryption disabled${CRS}\n"
echo -e "\n ${YEL}Nginx configuration skipped!${CRS}\n"
break
else
@ -176,7 +175,7 @@ while true; do
fi
done
###### NGINX MAINTENANCE & LANDING PAGE
###### NGINX MAINTENANCE
sudo rm -rf /var/www/html
@ -212,10 +211,13 @@ if [ -f "/tmp/LoMeS/honacha" ]; then
echo -e "${CRS}"
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
break
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
else
@ -225,8 +227,26 @@ if [ -f "/tmp/LoMeS/honacha" ]; then
done
else
chmod +x lomes-app.py
./lomes-app.py &> /dev/null & disown
echo -e " ${LGN}Flask is running...${CRS}\n"
while true; do ### START FLASK ?
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}"
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}"
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

View file

@ -136,3 +136,11 @@ p {
text-align: center;
color: lightgray;
}
li {
font-size: 16px;
padding: 5px;
padding-bottom: 10px;
text-align: center;
color: lightgray;
}

View file

@ -15,15 +15,16 @@
</header>
<div class="textBox">
<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>Thanks for collaborating and trying to make things more real...</p>
</div>
<!-- <div class="textBox">
<div class="textBox">
<h3>Configuration Summary</h3>
<div class="confBox">
<link rel="import" href="assets/html/data/install_log/log.html">
</div>-->
<ul>
<li>User executing flask : {{user}}</li>
</ul>
</div>
</div>
</section>
</body>