This commit is contained in:
2025-12-29 19:43:10 +01:00
parent b7360f884b
commit cd4682f6e4
2 changed files with 10 additions and 4 deletions

View File

@@ -2,7 +2,6 @@ from flask import Flask, render_template, request
from flask_minify import minify
from flask_compress import Compress
from http.client import responses
import socket
import waitress
import ping3
@@ -11,7 +10,7 @@ isProdution = True
# READ README YOU STUPID FUCK
app = Flask(__name__.split('.')[0])
# Compress(app)
Compress(app)
if isProdution:
minify(app=app, html=True, js=True, cssless=True)
@@ -44,7 +43,14 @@ def server():
@app.route('/http/<status>')
def httpcodes(status):
status = int(status.replace('\'', ''))
return render_template('error.html.j2', status=status, host=socket.gethostname(), desc=responses[status], site=request.host)
return render_template(
'error.html.j2',
code=status,
host="docker host",
desc=responses[status],
site=request.host,
isup="up" if isUp("10.0.1.200") else "down"
)
if __name__ == '__main__':
if isProdution:

View File

@@ -18,6 +18,6 @@
</div>
</body>
<footer>
HTTP {{ status }} | {{ host }} | {{ site }}
HTTP {{ code }} | {{ host }} | {{ site }} | {{ isup }}
</footer>
</html>