Change how we save the pid file of the web UI

This commit is contained in:
Théophile Diot 2024-03-19 12:38:20 +00:00
parent 7658e73ef2
commit e257ececf7
No known key found for this signature in database
GPG key ID: 248FEA4BAE400D06
2 changed files with 3 additions and 5 deletions

View file

@ -13,7 +13,6 @@ loglevel = "info"
proc_name = "bunkerweb-ui"
preload_app = True
reuse_port = True
pidfile = join(sep, "var", "run", "bunkerweb", "ui.pid")
worker_tmp_dir = join(sep, "dev", "shm")
tmp_upload_dir = join(sep, "var", "tmp", "bunkerweb", "ui")
worker_class = "gthread"

View file

@ -2,7 +2,7 @@
from contextlib import suppress
from math import floor
from os import _exit, getenv, listdir, sep, urandom
from os import _exit, getenv, getpid, listdir, sep, urandom
from os.path import basename, dirname, join
from secrets import choice
from string import ascii_letters, digits
@ -180,6 +180,7 @@ elif getenv("ADMIN_USERNAME") and getenv("ADMIN_PASSWORD"):
stop(1)
app.logger.info("Database is ready")
Path(sep, "var", "run", "bunkerweb", "ui.pid").write_text(str(getpid()), encoding="utf-8")
Path(sep, "var", "tmp", "bunkerweb", "ui.healthy").write_text("ok", encoding="utf-8")
bw_version = Path(sep, "usr", "share", "bunkerweb", "VERSION").read_text(encoding="utf-8").strip()
@ -1038,11 +1039,9 @@ def global_config():
),
).start()
try:
with suppress(BaseException):
if config["PRO_LICENSE_KEY"]["value"] != variables["PRO_LICENSE_KEY"]:
flash("Checking license key to upgrade.", "success")
except:
pass
return redirect(
url_for(