UI - basic read fixes
This commit is contained in:
parent
e6b5f460c9
commit
3a3d527907
@ -71,6 +71,9 @@ http {
|
|||||||
# resolvers to use
|
# resolvers to use
|
||||||
resolver %DNS_RESOLVERS% ipv6=off;
|
resolver %DNS_RESOLVERS% ipv6=off;
|
||||||
|
|
||||||
|
# remove ports when sending redirects
|
||||||
|
port_in_redirect off;
|
||||||
|
|
||||||
# lua path and dicts
|
# lua path and dicts
|
||||||
lua_package_path "/usr/local/lib/lua/?.lua;;";
|
lua_package_path "/usr/local/lib/lua/?.lua;;";
|
||||||
%WHITELIST_IP_CACHE%
|
%WHITELIST_IP_CACHE%
|
||||||
|
|||||||
@ -16,7 +16,7 @@ if [ "$MULTISITE" = "yes" ] ; then
|
|||||||
for server in $servers ; do
|
for server in $servers ; do
|
||||||
SERVER_PREFIX="/etc/nginx/${server}/"
|
SERVER_PREFIX="/etc/nginx/${server}/"
|
||||||
if grep "/etc/letsencrypt/live" ${SERVER_PREFIX}https.conf > /dev/null && [ ! -f /etc/letsencrypt/live/${server}/fullchain.pem ] ; then
|
if grep "/etc/letsencrypt/live" ${SERVER_PREFIX}https.conf > /dev/null && [ ! -f /etc/letsencrypt/live/${server}/fullchain.pem ] ; then
|
||||||
/opt/scripts/certbot-new.sh "$1" "$(cat ${SERVER_PREFIX}email-lets-encrypt.txt)"
|
/opt/scripts/certbot-new.sh "$server" "$(cat ${SERVER_PREFIX}email-lets-encrypt.txt)"
|
||||||
fi
|
fi
|
||||||
if grep "modsecurity.conf" ${SERVER_PREFIX}server.conf > /dev/null ; then
|
if grep "modsecurity.conf" ${SERVER_PREFIX}server.conf > /dev/null ; then
|
||||||
modsec_custom=""
|
modsec_custom=""
|
||||||
|
|||||||
@ -13,21 +13,20 @@ services:
|
|||||||
- ./web-files:/www:ro
|
- ./web-files:/www:ro
|
||||||
- autoconf:/etc/nginx
|
- autoconf:/etc/nginx
|
||||||
environment:
|
environment:
|
||||||
- SERVER_NAME=admin.domain.com # replace with your domain
|
- SERVER_NAME=admin.website.com # replace with your domain
|
||||||
- MULTISITE=yes
|
- MULTISITE=yes
|
||||||
- AUTO_LETS_ENCRYPT=yes
|
- AUTO_LETS_ENCRYPT=yes
|
||||||
- REDIRECT_HTTP_TO_HTTPS=yes
|
- REDIRECT_HTTP_TO_HTTPS=yes
|
||||||
- DISABLE_DEFAULT_SERVER=yes
|
- DISABLE_DEFAULT_SERVER=yes
|
||||||
- USE_CLIENT_CACHE=yes
|
|
||||||
- USE_GZIP=yes
|
- USE_GZIP=yes
|
||||||
- USE_BROTLI=yes
|
- USE_BROTLI=yes
|
||||||
- admin.domain.com_SERVE_FILES=no
|
- admin.website.com_SERVE_FILES=no
|
||||||
- admin.domain.com_USE_AUTH_BASIC=yes
|
- admin.website.com_USE_AUTH_BASIC=yes
|
||||||
- admin.domain.com_AUTH_BASIC_USER=admin # change it to something hard to guess
|
- admin.website.com_AUTH_BASIC_USER=admin # change it to something hard to guess
|
||||||
- admin.domain.com_AUTH_BASIC_PASSWORD=admin # change it to something hard to guess
|
- admin.website.com_AUTH_BASIC_PASSWORD=admin # change it to something hard to guess
|
||||||
- admin.domain.com_USE_REVERSE_PROXY=yes
|
- admin.website.com_USE_REVERSE_PROXY=yes
|
||||||
- admin.domain.com_REVERSE_PROXY_URL=/admin/ # change it to something hard to guess
|
- admin.website.com_REVERSE_PROXY_URL=/admin/ # change it to something hard to guess
|
||||||
- admin.domain.com_REVERSE_PROXY_HOST=http://myui:5000/
|
- admin.website.com_REVERSE_PROXY_HOST=http://myui:5000/
|
||||||
labels:
|
labels:
|
||||||
- "bunkerized-nginx.UI"
|
- "bunkerized-nginx.UI"
|
||||||
|
|
||||||
@ -37,3 +36,8 @@ services:
|
|||||||
volumes:
|
volumes:
|
||||||
- /var/run/docker.sock:/var/run/docker.sock:ro
|
- /var/run/docker.sock:/var/run/docker.sock:ro
|
||||||
- autoconf:/etc/nginx
|
- autoconf:/etc/nginx
|
||||||
|
environment:
|
||||||
|
- ABSOLUTE_URI=https://admin.website.com/admin/ # change it to your full URI
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
autoconf:
|
||||||
|
|||||||
@ -1,12 +1,19 @@
|
|||||||
#!/usr/bin/python3
|
#!/usr/bin/python3
|
||||||
|
|
||||||
from flask import Flask, render_template
|
from flask import Flask, render_template, current_app
|
||||||
|
|
||||||
import wrappers
|
import wrappers
|
||||||
|
import os
|
||||||
|
|
||||||
|
|
||||||
app = Flask(__name__, static_url_path="/", static_folder="static", template_folder="templates")
|
app = Flask(__name__, static_url_path="/", static_folder="static", template_folder="templates")
|
||||||
|
ABSOLUTE_URI = ""
|
||||||
|
if "ABSOLUTE_URI" in os.environ :
|
||||||
|
ABSOLUTE_URI = os.environ["ABSOLUTE_URI"]
|
||||||
|
app.config["ABSOLUTE_URI"] = ABSOLUTE_URI
|
||||||
|
|
||||||
@app.route('/')
|
@app.route('/')
|
||||||
|
@app.route('/home')
|
||||||
def home():
|
def home():
|
||||||
check, instances = wrappers.get_instances()
|
check, instances = wrappers.get_instances()
|
||||||
if not check :
|
if not check :
|
||||||
@ -17,14 +24,14 @@ def home():
|
|||||||
return render_template("home.html", title="Home", instances_number=len(instances), services_number=len(services))
|
return render_template("home.html", title="Home", instances_number=len(instances), services_number=len(services))
|
||||||
|
|
||||||
@app.route('/instances')
|
@app.route('/instances')
|
||||||
def home():
|
def instances():
|
||||||
check, instances = wrappers.get_instances()
|
check, instances = wrappers.get_instances()
|
||||||
if not check :
|
if not check :
|
||||||
return render_template("error.html", title="Error", error=instances)
|
return render_template("error.html", title="Error", error=instances)
|
||||||
return render_template("instances.html", title="Instances", instances=instances)
|
return render_template("instances.html", title="Instances", instances=instances)
|
||||||
|
|
||||||
@app.route('/services')
|
@app.route('/services')
|
||||||
def home():
|
def services():
|
||||||
check, services = wrappers.get_services()
|
check, services = wrappers.get_services()
|
||||||
if not check :
|
if not check :
|
||||||
return render_template("error.html", title="Error", error=services)
|
return render_template("error.html", title="Error", error=services)
|
||||||
|
|||||||
@ -13,5 +13,5 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
main > .container {
|
main > .container {
|
||||||
padding: 60px 15px 0;
|
padding: 100px 15px 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1 +1 @@
|
|||||||
<script src="/js/bootstrap.bundle.min.js"></script>
|
<script src="js/bootstrap.bundle.min.js"></script>
|
||||||
|
|||||||
@ -1,10 +1,11 @@
|
|||||||
<head>
|
<head>
|
||||||
|
<base href="{{ config["ABSOLUTE_URI"] }}">
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
<meta name="description" content="bunkerized-nginx user interface">
|
<meta name="description" content="bunkerized-nginx user interface">
|
||||||
<meta name="author" content="bunkerity">
|
<meta name="author" content="bunkerity">
|
||||||
<title>{{ title }}</title>
|
<title>bunkerized-nginx-ui - {{ title }}</title>
|
||||||
<!-- TODO : favicon -->
|
<!-- TODO : favicon -->
|
||||||
<link href="/css/bootstrap.min.css" rel="stylesheet">
|
<link href="css/bootstrap.min.css" rel="stylesheet">
|
||||||
<link href="/css/custom.css" rel="stylesheet">
|
<link href="css/custom.css" rel="stylesheet">
|
||||||
</head>
|
</head>
|
||||||
|
|||||||
@ -8,13 +8,13 @@
|
|||||||
<div class="collapse navbar-collapse" id="navbarCollapse">
|
<div class="collapse navbar-collapse" id="navbarCollapse">
|
||||||
<ul class="navbar-nav me-auto mb-2 mb-md-0">
|
<ul class="navbar-nav me-auto mb-2 mb-md-0">
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-link" href="/">Home</a>
|
<a class="nav-link" href="home">Home</a>
|
||||||
</li>
|
</li>
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-link" href="/instances">Instances</a>
|
<a class="nav-link" href="instances">Instances</a>
|
||||||
</li>
|
</li>
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-link" href="/services">Services</a>
|
<a class="nav-link" href="services">Services</a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user