mirror of
https://github.com/bunkerity/bunkerweb
synced 2026-05-24 09:28:37 +00:00
Merge pull request #1232 from bunkerity/dev
Merge branch "dev" into branch "staging"
This commit is contained in:
commit
a2a50b2cdc
3 changed files with 8 additions and 8 deletions
|
|
@ -74,7 +74,7 @@ try:
|
|||
# Check if we're using let's encrypt
|
||||
use_letsencrypt = False
|
||||
is_multisite = getenv("MULTISITE", "no") == "yes"
|
||||
all_domains = getenv("SERVER_NAME", "")
|
||||
all_domains = getenv("SERVER_NAME", "").lower()
|
||||
server_names = all_domains.split(" ")
|
||||
|
||||
if getenv("AUTO_LETS_ENCRYPT", "no") == "yes":
|
||||
|
|
@ -88,7 +88,7 @@ try:
|
|||
if not use_letsencrypt:
|
||||
LOGGER.info("Let's Encrypt is not activated, skipping generation...")
|
||||
sys_exit(0)
|
||||
elif not getenv("SERVER_NAME"):
|
||||
elif not all_domains:
|
||||
LOGGER.warning("There are no server names, skipping generation...")
|
||||
sys_exit(0)
|
||||
|
||||
|
|
@ -105,7 +105,7 @@ try:
|
|||
for first_server in server_names:
|
||||
if not first_server or getenv(f"{first_server}_AUTO_LETS_ENCRYPT", getenv("AUTO_LETS_ENCRYPT", "no")) != "yes":
|
||||
continue
|
||||
domains_server_names[first_server] = getenv(f"{first_server}_SERVER_NAME", first_server)
|
||||
domains_server_names[first_server] = getenv(f"{first_server}_SERVER_NAME", first_server).lower()
|
||||
# Singlesite case
|
||||
else:
|
||||
domains_server_names = {server_names[0]: all_domains}
|
||||
|
|
@ -172,7 +172,7 @@ try:
|
|||
if getenv("LETS_ENCRYPT_CLEAR_OLD_CERTS", "no") == "yes":
|
||||
LOGGER.info("Clear old certificates is activated, removing old / no longer used certificates...")
|
||||
for elem in chain(DATA_PATH.glob("archive/*"), DATA_PATH.glob("live/*"), DATA_PATH.glob("renewal/*")):
|
||||
if elem.name.replace(".conf", "") not in generated_domains:
|
||||
if elem.name.replace(".conf", "") not in generated_domains and elem.name != "README":
|
||||
LOGGER.warning(f"Removing old certificate {elem}")
|
||||
if elem.is_dir():
|
||||
rmtree(elem, ignore_errors=True)
|
||||
|
|
|
|||
|
|
@ -20,11 +20,11 @@ from jobs import Job # type: ignore
|
|||
|
||||
def check_line(line):
|
||||
with suppress(ValueError):
|
||||
if "/" in line:
|
||||
ip_network(line)
|
||||
if b"/" in line:
|
||||
ip_network(line.decode())
|
||||
return True, line
|
||||
else:
|
||||
ip_address(line)
|
||||
ip_address(line.decode())
|
||||
return True, line
|
||||
return False, b""
|
||||
|
||||
|
|
|
|||
|
|
@ -1132,7 +1132,7 @@ def global_config():
|
|||
del variables["csrf_token"]
|
||||
|
||||
# Edit check fields and remove already existing ones
|
||||
config = app.config["CONFIG"].get_config(global_only=True, methods=True, with_drafts=True)
|
||||
config = app.config["CONFIG"].get_config(methods=True, with_drafts=True)
|
||||
services = config["SERVER_NAME"]["value"].split(" ")
|
||||
for variable, value in variables.copy().items():
|
||||
if variable in ("AUTOCONF_MODE", "SWARM_MODE", "KUBERNETES_MODE", "SERVER_NAME", "IS_LOADING", "IS_DRAFT") or variable.endswith("SCHEMA"):
|
||||
|
|
|
|||
Loading…
Reference in a new issue