diff --git a/README.md b/README.md index 31ad722..4119dd0 100644 --- a/README.md +++ b/README.md @@ -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 clone https://lab.c95.org/fr4nz/LoMeS.git && cd LoMeS && git switch dev-1 ``` 4. Run development environment setup ```bash diff --git a/lomes-app.py b/lomes-app.py index 2a116cc..499e3ae 100755 --- a/lomes-app.py +++ b/lomes-app.py @@ -2,7 +2,6 @@ from flask import Flask, render_template import getpass -import socket app = Flask(__name__) @@ -11,4 +10,5 @@ def index(): user=getpass.getuser() return render_template("index.html", user=user) + app.run(host="127.0.0.1", port=5000) diff --git a/lomes-setup.sh b/lomes-setup.sh index 6baf114..25de607 100755 --- a/lomes-setup.sh +++ b/lomes-setup.sh @@ -1,7 +1,6 @@ #!/bin/bash trap "exit" INT -chmod +x lomes-app.py mkdir -p /tmp/LoMeS source assets/shell/colors source assets/config/deps/dependencies @@ -71,11 +70,11 @@ fi ### 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?" read -p " current = "$onif" --> " nif 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 "\n ${YEL}This information will be used to configure ${LCY}nginx.conf ${YEL}during the next steps." -while true; do ### HOST NAME CHANGE ? - read -p " Would you like to change the hostname? (y/N) --> " conf_hostname +while true; do + read -p " Would you like to change the hostname? (y/N) --> " conf_hostname ### HOST NAME CHANGE ? echo -e "${CRS}" if [[ "$conf_hostname" = "" || "$conf_hostname" = "n" || "$conf_hostname" = "N" ]]; then @@ -122,8 +121,10 @@ while true; do fi done -while true; do ### CERTIFICATION & CONFIGURATION - echo -e "\n ${YEL}Configure nginx with SSL and create a self signed cetrificate?" +###### CERTIFICATION & CONFIGURATION + +while true; do + echo -e "\n ${YEL}Configure SSL and create a self signed cetrificate?" read -p " (Y/n) --> " installSSL echo -e "${CRS}" @@ -166,7 +167,7 @@ while true; do break elif [[ "$installSSL" == "n" || "$installSSL" = "N" ]]; then - echo -e "\n ${YEL}Nginx configuration skipped!${CRS}" + echo -e "\n ${RED}Encryption disabled${CRS}\n" break else @@ -175,7 +176,7 @@ while true; do fi done -###### NGINX MAINTENANCE +###### NGINX MAINTENANCE & LANDING PAGE sudo rm -rf /var/www/html @@ -211,13 +212,10 @@ 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 @@ -227,27 +225,8 @@ if [ -f "/tmp/LoMeS/honacha" ]; then done else - - while true; do - echo -e "${YEL}" ### 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}\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 + chmod +x lomes-app.py + ./lomes-app.py &> /dev/null & disown + echo -e " ${LGN}Flask is running...${CRS}\n" fi \ No newline at end of file diff --git a/static/style.css b/static/style.css index b9478d2..7ae2e0e 100644 --- a/static/style.css +++ b/static/style.css @@ -135,12 +135,4 @@ p { padding-bottom: 10px; text-align: center; color: lightgray; -} - -li { - font-size: 16px; - padding: 5px; - padding-bottom: 10px; - text-align: center; - color: lightgray; } \ No newline at end of file diff --git a/templates/index.html b/templates/index.html index 541c51f..678dabe 100644 --- a/templates/index.html +++ b/templates/index.html @@ -15,16 +15,15 @@
Hi {{user}}
If you see this site, means "LoMeS" development environment is running!
Thanks for collaborating and trying to make things more real...