change dir layout

This commit is contained in:
frennkie 2020-05-18 20:07:22 +01:00
parent d1419b87e9
commit d16d45e04b
6 changed files with 38 additions and 5 deletions

View file

@ -397,6 +397,6 @@ cat <<EOF > /var/cache/raspiblitz/info.json
EOF EOF
# update info.html file # update info.html file
/usr/local/bin/j2 /var/www/blitzweb/info.j2 /var/cache/raspiblitz/info.json -o /var/cache/raspiblitz/info.html /usr/local/bin/j2 /var/www/blitzweb/info/info.j2 /var/cache/raspiblitz/info.json -o /var/cache/raspiblitz/info.html
# EOF # EOF

View file

@ -0,0 +1,21 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>RaspiBlitz Welcome</title>
</head>
<body>
<div class="container">
<h2 class="text-center">
Welcome
</h2>
</div>
</body>
</html>

View file

@ -0,0 +1 @@
/var/cache/raspiblitz/info.html

View file

@ -3,7 +3,7 @@
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>RaspiBlitz Status</title> <title>RaspiBlitz Status</title>
<link rel="stylesheet" href="css/status.css"> <link rel="stylesheet" href="status.css">
</head> </head>
<body> <body>

View file

@ -18,11 +18,11 @@ APOST=\' # close tag for linters: '
################### ###################
if [ "$1" = "1" ] || [ "$1" = "on" ]; then if [ "$1" = "1" ] || [ "$1" = "on" ]; then
echo "Turn ON: Web" echo "Turning ON: Web"
# install # install
sudo apt-get update >/dev/null sudo apt-get update >/dev/null
sudo apt-get install -y nginx >/dev/null sudo apt-get install -y nginx apache2-utils >/dev/null
# make sure that it is enabled and started # make sure that it is enabled and started
sudo systemctl enable nginx >/dev/null sudo systemctl enable nginx >/dev/null
@ -83,6 +83,17 @@ if [ "$1" = "1" ] || [ "$1" = "on" ]; then
sudo cp /home/admin/assets/blitzweb.conf /etc/nginx/sites-available/blitzweb.conf sudo cp /home/admin/assets/blitzweb.conf /etc/nginx/sites-available/blitzweb.conf
sudo ln -sf /etc/nginx/sites-available/blitzweb.conf /etc/nginx/sites-enabled/ sudo ln -sf /etc/nginx/sites-available/blitzweb.conf /etc/nginx/sites-enabled/
if ! [ -f /etc/nginx/.htpasswd ]; then
# ToDo(frennkie) hardcoded admin:changeme <- change it!
echo "changeme" | sudo htpasswd -c -i /etc/nginx/.htpasswd admin
sudo chown www-data:www-data /etc/nginx/.htpasswd
sudo chmod 640 /etc/nginx/.htpasswd
else
sudo chown www-data:www-data /etc/nginx/.htpasswd
sudo chmod 640 /etc/nginx/.htpasswd
fi
# open firewall # open firewall
sudo ufw allow 443 comment 'nginx https_443' 2>/dev/null sudo ufw allow 443 comment 'nginx https_443' 2>/dev/null
@ -95,7 +106,7 @@ if [ "$1" = "1" ] || [ "$1" = "on" ]; then
################### ###################
elif [ "$1" = "0" ] || [ "$1" = "off" ]; then elif [ "$1" = "0" ] || [ "$1" = "off" ]; then
echo "Turn OFF: Web" echo "Turning OFF: Web"
sudo systemctl stop nginx sudo systemctl stop nginx
sudo systemctl disable nginx >/dev/null sudo systemctl disable nginx >/dev/null