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 3. Clone repository
```bash ```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 4. Run development environment setup
```bash ```bash

View file

@ -2,6 +2,7 @@
from flask import Flask, render_template from flask import Flask, render_template
import getpass import getpass
import socket
app = Flask(__name__) app = Flask(__name__)
@ -10,5 +11,4 @@ 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)

View file

@ -1,6 +1,7 @@
#!/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
@ -70,11 +71,11 @@ fi
### NGINX SETUP & CONFIG ### 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?" 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}"
@ -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 " ${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 while true; do ### HOST NAME CHANGE ?
read -p " Would you like to change the hostname? (y/N) --> " conf_hostname ### HOST NAME CHANGE ? read -p " Would you like to change the hostname? (y/N) --> " conf_hostname
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
@ -121,10 +122,8 @@ while true; do
fi fi
done done
###### CERTIFICATION & CONFIGURATION while true; do ### 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}"
@ -167,7 +166,7 @@ while true; do
break break
elif [[ "$installSSL" == "n" || "$installSSL" = "N" ]]; then elif [[ "$installSSL" == "n" || "$installSSL" = "N" ]]; then
echo -e "\n ${RED}Encryption disabled${CRS}\n" echo -e "\n ${YEL}Nginx configuration skipped!${CRS}\n"
break break
else else
@ -176,7 +175,7 @@ while true; do
fi fi
done done
###### NGINX MAINTENANCE & LANDING PAGE ###### NGINX MAINTENANCE
sudo rm -rf /var/www/html sudo rm -rf /var/www/html
@ -212,10 +211,13 @@ 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
@ -225,8 +227,26 @@ if [ -f "/tmp/LoMeS/honacha" ]; then
done done
else else
chmod +x lomes-app.py
./lomes-app.py &> /dev/null & disown while true; do ### 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}"
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 fi

View file

@ -136,3 +136,11 @@ 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;
}

View file

@ -15,15 +15,16 @@
</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">
<link rel="import" href="assets/html/data/install_log/log.html"> <ul>
</div>--> <li>User executing flask : {{user}}</li>
</ul>
</div>
</div> </div>
</section> </section>
</body> </body>