This commit is contained in:
2026-08-24 23:11:35 +02:00
parent 42fe8d9a76
commit ecc110641b
5 changed files with 32 additions and 13 deletions
+6 -6
View File
@@ -1,11 +1,12 @@
from flask import Flask, jsonify, request, render_template, redirect, session, flash
import auth
import re
from os import environ, urandom
HOSTS_PATH = "/app/hosts.d/izbi"
DB_PATH = "/app/sqlite.db"
HOSTS_PATH = ( environ["HOSTS"] if "HOSTS" in environ else"/app/data/hosts.d/" ) + "/izbi"
DB_PATH = environ["DB_PATH"] if "DB_PATH" in environ else "/app/data/sqlite.db"
@@ -14,12 +15,11 @@ app.config["SESSION_PERMANENT"] = True
app.config["SESSION_TYPE"] = "memcached"
app.config["PERMANENT_SESSION_LIFETIME"] = 3600
app.config["SECRET_KEY"] = "dsadasda"
app.config["SECRET_KEY"] = environ["SECRET_KEY"] if "SECRET_KEY" in environ else urandom(32).hex()
hosts = {}
def update_hosts(path: str, hosts: dict = {}) -> bool:
try:
hosts_str = ""
@@ -216,7 +216,7 @@ def change_password():
if "pass" not in request.form or "pass-new" not in request.form or "pass-rep" not in request.form:
flash("password change failed")
return reidrect("/dashboard")
return redirect("/dashboard")
if request.form["pass"] == "" or request.form["pass-new"] == "" or request.form["pass-rep"] == "":
flash("password change failed")
return redirect("/dashboard")
@@ -281,4 +281,4 @@ def update_addr():
if __name__ == '__main__':
auth.init_db(DB_PATH)
app.run(host="0.0.0.0", port=8080, debug=True)
app.run(host="0.0.0.0", port=8080, debug=False)