diff --git a/assets/config/nginx/nginx_HTTP.conf b/assets/config/nginx/nginx_HTTP.conf new file mode 100644 index 0000000..293b59a --- /dev/null +++ b/assets/config/nginx/nginx_HTTP.conf @@ -0,0 +1,14 @@ +########################################################### +### ### +### MESHPI NGINX CONFIG ### +### ### +########################################################### + +server { + listen 80; + server_name DOMAIN IPADDR; + + location / { + proxy_pass http://127.0.0.1:5000; + } +} diff --git a/index.html b/index.html deleted file mode 100644 index 678dabe..0000000 --- a/index.html +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - LoMeS | Meshtastic - - - - -
-
- -

Welcome to LoMeS

-
-
-

A Local Meshtastic Server in development


-

Hi {{user}}

-

If you see this site, means "LoMeS" development environment is running!

-

Thanks for collaborating and trying to make things more real...

-
- - -
- - \ No newline at end of file diff --git a/lomes-setup.sh b/lomes-setup.sh index 6baf114..4c93cd5 100755 --- a/lomes-setup.sh +++ b/lomes-setup.sh @@ -13,10 +13,10 @@ echo -e "\n ${LCY}Dependency and Privilege Check running...${CRS}\n" ### PRIVILEGES if (( $(id -u) == 0 )); then ### AM I ROOT ? - echo -e " ${GRN}Privilege check passed...${CRS}\n" + echo -e " ${LCY}- ${GRN}Privilege check passed...${CRS}\n" else - echo -e " ${RED}Privilege check failed... Please run script with sudo or as root!${CRS}\n" + echo -e " ${LCY}- ${RED}Privilege check failed... Please run script with sudo or as root!${CRS}\n" exit 1 fi @@ -28,23 +28,26 @@ dep_check() { if dpkg -s "$pkg" >/dev/null 2>&1; then echo "$pkg" >>/tmp/LoMeS/installed_dev + else echo "$pkg" >>/tmp/LoMeS/missing_dev + fi } for pkg in "${deps[@]}"; do dep_check "$pkg" + done installed="$(cat /tmp/LoMeS/installed_dev 2>/dev/null)" missing="$(cat /tmp/LoMeS/missing_dev 2>/dev/null)" if ! [ "$missing" ]; then - echo -e " ${GRN}Dependencies met. Proceeding...${CRS}\n" + echo -e " ${LCY}- ${GRN}Dependencies met. Proceeding...${CRS}\n" else ### INSTALLING PKGS ! - echo -e " ${RED}Following dependencies are missing :\n\n$missing${CRS}" + echo -e " ${LCY}- ${RED}Following dependencies are missing :\n\n$missing${CRS}" while true; do echo -e "\n ${YEL}Do you wish to install via APT?" @@ -52,8 +55,8 @@ else echo -e "${CRS}" if [[ "$install_dep" = "" || "$install_dep" = "y" || "$install_dep" = "Y" ]]; then - sudo apt update > /dev/null 2>&1 && sudo apt install -y $missing > /dev/null 2>&1 - echo -e " ${GRN}Dependencies installed. Proceeding...${CRS}\n" + sudo apt update > /dev/null 2>&1 && sudo apt install -y $missing --simulate > /dev/null 2>&1 + echo -e " ${LCY}- ${GRN}Dependencies installed. Proceeding...${CRS}\n" sudo rm /tmp/LoMeS/installed_dev /tmp/LoMeS/missing_dev 2>/dev/null break @@ -122,12 +125,12 @@ while true; do fi done -while true; do ### CERTIFICATION & CONFIGURATION +while true; do ### CERTIFICATION & CONFIGURATION HTTPS echo -e "\n ${YEL}Configure nginx with SSL and create a self signed cetrificate?" - read -p " (Y/n) --> " installSSL + read -p " (Y/n) --> " nginxSSL echo -e "${CRS}" - if [[ "$installSSL" = "" || "$installSSL" = "y" || "$installSSL" = "Y" ]]; then + if [[ "$nginxSSL" = "" || "$nginxSSL" = "y" || "$nginxSSL" = "Y" ]]; then echo -e " ${YEL}Enter path to certificates folder" read -p " default = /etc/nginx/ssl --> " cert_path echo -e "${CRS}" @@ -165,8 +168,28 @@ while true; do sudo sed -i "s|KEYPATH|$cert_path/$cert_name|" /etc/nginx/sites-enabled/$(hostname).conf break - elif [[ "$installSSL" == "n" || "$installSSL" = "N" ]]; then - echo -e "\n ${YEL}Nginx configuration skipped!${CRS}" + elif [[ "$nginxSSL" == "n" || "$nginxSSL" = "N" ]]; then + while true; do ### CONFIGURATION HTTP + echo -e " ${YEL}Configure nginx with HTTP?" + read -p " (Y/n) --> " nginxHTTP + echo -e "${CRS}" + + if [[ "$nginxHTTP" = "" || "$nginxHTTP" = "y" || "$nginxHTTP" = "Y" ]]; then + sudo cp assets/config/nginx/nginx_HTTP.conf /etc/nginx/sites-enabled/$(hostname).conf + sudo sed -i "s/DOMAIN/$(hostname).local/g" /etc/nginx/sites-enabled/$(hostname).conf + sudo sed -i "s/IPADDR/$ip4/g" /etc/nginx/sites-enabled/$(hostname).conf + break + + elif [[ "$nginxHTTP" = "n" || "$nginxHTTP" = "N" ]]; then + echo -e " ${LCY}- ${LRD}Keeping nginx default configuration!${CRS}" + break + + else + echo -e " ${YEL}Invalid response... Try again...\n\n Y = (Yes, configure nginx)\n N = (No, skip nginx configuration)${CRS}\n " + break + + fi + done break else @@ -180,7 +203,7 @@ done sudo rm -rf /var/www/html if ! [ "$(sudo nginx -t > /dev/null 2>&1)" ]; then ### NGINX CONF CHECK - echo -e "\n ${LGN}Nginx configuration checks out...${CRS}" + echo -e "\n ${LCY}- ${LGN}Nginx configuration checks out...${CRS}" else echo -e "\n ${LRD}Nginx configuration is malformed!${CRS}" @@ -188,7 +211,7 @@ else fi if ! [ "$(sudo nginx -s reload > /dev/null 2>&1)" ]; then ### RELOAD NGINX - echo -e "\n ${LGN}Nginx reloaded...${CRS}" + echo -e "\n ${LCY}- ${LGN}Nginx reloaded...${CRS}" else echo -e "\n ${LRD}Nginx couldn't reload!${CRS}" @@ -196,7 +219,7 @@ else fi if ! [ -f "/tmp/LoMeS/install_log" ]; then ### LOG CHECK - echo -e "\n ${LGN}No errors while setting up...${CRS}\n" + echo -e "\n ${LCY}- ${LGN}No errors while setting up...${CRS}" else echo -e "\n ${LRD}Error occured during setup! Please check ${LCY}/tmp/LoMeS/install_log ${LRD}for details...${CRS}" @@ -250,4 +273,4 @@ else fi done -fi \ No newline at end of file +fi diff --git a/static/style.css b/static/css/style.css similarity index 59% rename from static/style.css rename to static/css/style.css index b9478d2..700a19e 100644 --- a/static/style.css +++ b/static/css/style.css @@ -6,8 +6,8 @@ @font-face { font-family: 'Gravity'; - src: url('data/font/Gravity-UltraLight.woff2') format('woff2'), - url('data/font/Gravity-UltraLight.woff') format('woff'); + src: url('font/Gravity-UltraLight.woff2') format('woff2'), + url('font/Gravity-UltraLight.woff') format('woff'); font-weight: 200; font-style: normal; font-display: swap; @@ -15,8 +15,8 @@ @font-face { font-family: 'Gravity'; - src: url('data/font/Gravity-Light.woff2') format('woff2'), - url('data/font/Gravity-Light.woff') format('woff'); + src: url('font/Gravity-Light.woff2') format('woff2'), + url('font/Gravity-Light.woff') format('woff'); font-weight: 300; font-style: normal; font-display: swap; @@ -24,8 +24,8 @@ @font-face { font-family: 'Gravity'; - src: url('data/font/Gravity-Bold.woff2') format('woff2'), - url('data/font/Gravity-Bold.woff') format('woff'); + src: url('font/Gravity-Bold.woff2') format('woff2'), + url('font/Gravity-Bold.woff') format('woff'); font-weight: bold; font-style: normal; font-display: swap; @@ -33,8 +33,8 @@ @font-face { font-family: 'Gravity'; - src: url('data/font/Gravity-LightItalic.woff2') format('woff2'), - url('data/font/Gravity-LightItalic.woff') format('woff'); + src: url('font/Gravity-LightItalic.woff2') format('woff2'), + url('font/Gravity-LightItalic.woff') format('woff'); font-weight: 300; font-style: italic; font-display: swap; @@ -42,8 +42,8 @@ @font-face { font-family: 'Gravity'; - src: url('data/font/Gravity-Italic.woff2') format('woff2'), - url('data/font/Gravity-Italic.woff') format('woff'); + src: url('font/Gravity-Italic.woff2') format('woff2'), + url('font/Gravity-Italic.woff') format('woff'); font-weight: normal; font-style: italic; font-display: swap; @@ -51,8 +51,8 @@ @font-face { font-family: 'Gravity Book'; - src: url('data/font/Gravity-Book.woff2') format('woff2'), - url('data/font/Gravity-Book.woff') format('woff'); + src: url('font/Gravity-Book.woff2') format('woff2'), + url('font/Gravity-Book.woff') format('woff'); font-weight: normal; font-style: normal; font-display: swap; @@ -60,8 +60,8 @@ @font-face { font-family: 'Gravity'; - src: url('data/font/Gravity-BoldItalic.woff2') format('woff2'), - url('data/font/Gravity-BoldItalic.woff') format('woff'); + src: url('font/Gravity-BoldItalic.woff2') format('woff2'), + url('font/Gravity-BoldItalic.woff') format('woff'); font-weight: bold; font-style: italic; font-display: swap; @@ -69,8 +69,8 @@ @font-face { font-family: 'Gravity Book'; - src: url('data/font/Gravity-BookItalic.woff2') format('woff2'), - url('data/font/Gravity-BookItalic.woff') format('woff'); + src: url('font/Gravity-BookItalic.woff2') format('woff2'), + url('font/Gravity-BookItalic.woff') format('woff'); font-weight: normal; font-style: italic; font-display: swap; @@ -78,8 +78,8 @@ @font-face { font-family: 'Gravity'; - src: url('data/font/Gravity-Regular.woff2') format('woff2'), - url('data/font/Gravity-Regular.woff') format('woff'); + src: url('font/Gravity-Regular.woff2') format('woff2'), + url('font/Gravity-Regular.woff') format('woff'); font-weight: normal; font-style: normal; font-display: swap; @@ -87,8 +87,8 @@ @font-face { font-family: 'Gravity'; - src: url('data/font/Gravity-UltraLightItalic.woff2') format('woff2'), - url('data/font/Gravity-UltraLightItalic.woff') format('woff'); + src: url('font/Gravity-UltraLightItalic.woff2') format('woff2'), + url('font/Gravity-UltraLightItalic.woff') format('woff'); font-weight: 200; font-style: italic; font-display: swap; @@ -143,4 +143,4 @@ li { padding-bottom: 10px; text-align: center; color: lightgray; -} \ No newline at end of file +} diff --git a/static/data/install_log/log.html b/static/data/install_log/log.html deleted file mode 100644 index bcb14ad..0000000 --- a/static/data/install_log/log.html +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - - -
Hostname
IP Address
Encryption
\ No newline at end of file diff --git a/static/data/font/Gravity-Bold.woff b/static/font/Gravity-Bold.woff similarity index 100% rename from static/data/font/Gravity-Bold.woff rename to static/font/Gravity-Bold.woff diff --git a/static/data/font/Gravity-Bold.woff2 b/static/font/Gravity-Bold.woff2 similarity index 100% rename from static/data/font/Gravity-Bold.woff2 rename to static/font/Gravity-Bold.woff2 diff --git a/static/data/font/Gravity-BoldItalic.woff b/static/font/Gravity-BoldItalic.woff similarity index 100% rename from static/data/font/Gravity-BoldItalic.woff rename to static/font/Gravity-BoldItalic.woff diff --git a/static/data/font/Gravity-BoldItalic.woff2 b/static/font/Gravity-BoldItalic.woff2 similarity index 100% rename from static/data/font/Gravity-BoldItalic.woff2 rename to static/font/Gravity-BoldItalic.woff2 diff --git a/static/data/font/Gravity-Book.woff b/static/font/Gravity-Book.woff similarity index 100% rename from static/data/font/Gravity-Book.woff rename to static/font/Gravity-Book.woff diff --git a/static/data/font/Gravity-Book.woff2 b/static/font/Gravity-Book.woff2 similarity index 100% rename from static/data/font/Gravity-Book.woff2 rename to static/font/Gravity-Book.woff2 diff --git a/static/data/font/Gravity-BookItalic.woff b/static/font/Gravity-BookItalic.woff similarity index 100% rename from static/data/font/Gravity-BookItalic.woff rename to static/font/Gravity-BookItalic.woff diff --git a/static/data/font/Gravity-BookItalic.woff2 b/static/font/Gravity-BookItalic.woff2 similarity index 100% rename from static/data/font/Gravity-BookItalic.woff2 rename to static/font/Gravity-BookItalic.woff2 diff --git a/static/data/font/Gravity-Italic.woff b/static/font/Gravity-Italic.woff similarity index 100% rename from static/data/font/Gravity-Italic.woff rename to static/font/Gravity-Italic.woff diff --git a/static/data/font/Gravity-Italic.woff2 b/static/font/Gravity-Italic.woff2 similarity index 100% rename from static/data/font/Gravity-Italic.woff2 rename to static/font/Gravity-Italic.woff2 diff --git a/static/data/font/Gravity-Light.woff b/static/font/Gravity-Light.woff similarity index 100% rename from static/data/font/Gravity-Light.woff rename to static/font/Gravity-Light.woff diff --git a/static/data/font/Gravity-Light.woff2 b/static/font/Gravity-Light.woff2 similarity index 100% rename from static/data/font/Gravity-Light.woff2 rename to static/font/Gravity-Light.woff2 diff --git a/static/data/font/Gravity-LightItalic.woff b/static/font/Gravity-LightItalic.woff similarity index 100% rename from static/data/font/Gravity-LightItalic.woff rename to static/font/Gravity-LightItalic.woff diff --git a/static/data/font/Gravity-LightItalic.woff2 b/static/font/Gravity-LightItalic.woff2 similarity index 100% rename from static/data/font/Gravity-LightItalic.woff2 rename to static/font/Gravity-LightItalic.woff2 diff --git a/static/data/font/Gravity-Regular.woff b/static/font/Gravity-Regular.woff similarity index 100% rename from static/data/font/Gravity-Regular.woff rename to static/font/Gravity-Regular.woff diff --git a/static/data/font/Gravity-Regular.woff2 b/static/font/Gravity-Regular.woff2 similarity index 100% rename from static/data/font/Gravity-Regular.woff2 rename to static/font/Gravity-Regular.woff2 diff --git a/static/data/font/Gravity-UltraLight.woff b/static/font/Gravity-UltraLight.woff similarity index 100% rename from static/data/font/Gravity-UltraLight.woff rename to static/font/Gravity-UltraLight.woff diff --git a/static/data/font/Gravity-UltraLight.woff2 b/static/font/Gravity-UltraLight.woff2 similarity index 100% rename from static/data/font/Gravity-UltraLight.woff2 rename to static/font/Gravity-UltraLight.woff2 diff --git a/static/data/font/Gravity-UltraLightItalic.woff b/static/font/Gravity-UltraLightItalic.woff similarity index 100% rename from static/data/font/Gravity-UltraLightItalic.woff rename to static/font/Gravity-UltraLightItalic.woff diff --git a/static/data/font/Gravity-UltraLightItalic.woff2 b/static/font/Gravity-UltraLightItalic.woff2 similarity index 100% rename from static/data/font/Gravity-UltraLightItalic.woff2 rename to static/font/Gravity-UltraLightItalic.woff2 diff --git a/static/data/images/favicon.ico b/static/images/favicon.ico similarity index 100% rename from static/data/images/favicon.ico rename to static/images/favicon.ico diff --git a/static/data/images/lomes.svg b/static/images/lomes.svg similarity index 100% rename from static/data/images/lomes.svg rename to static/images/lomes.svg diff --git a/templates/index.html b/templates/index.html index 4e6cf4b..d386b72 100644 --- a/templates/index.html +++ b/templates/index.html @@ -4,13 +4,13 @@ LoMeS | Meshtastic - - + +
- +

Welcome to LoMeS

@@ -30,4 +30,4 @@
- \ No newline at end of file +