mirror of
https://github.com/bunkerity/bunkerweb
synced 2026-05-24 09:28:37 +00:00
Implement SERVER_NAME handling in raw mode for services_service_page
This commit is contained in:
parent
57080e4637
commit
855ddaf9f3
1 changed files with 10 additions and 6 deletions
|
|
@ -195,6 +195,16 @@ def services_service_page(service: str):
|
|||
del variables["csrf_token"]
|
||||
|
||||
mode = request.args.get("mode", "easy")
|
||||
|
||||
if mode == "raw":
|
||||
server_name = variables.get("SERVER_NAME", variables.get("OLD_SERVER_NAME", "")).split(" ")[0]
|
||||
for variable, value in variables.copy().items():
|
||||
if variable.endswith("_SERVER_NAME") and variable != "OLD_SERVER_NAME":
|
||||
server_name = value.split(" ")[0]
|
||||
for variable in variables.copy():
|
||||
if variable.startswith(f"{server_name}_"):
|
||||
variables[variable.replace(f"{server_name}_", "", 1)] = variables.pop(variable)
|
||||
|
||||
is_draft = variables.pop("IS_DRAFT", "no") == "yes"
|
||||
|
||||
def update_service(service: str, variables: Dict[str, str], is_draft: bool, mode: str):
|
||||
|
|
@ -267,12 +277,6 @@ def services_service_page(service: str):
|
|||
if "checksum" in data:
|
||||
db_custom_configs[db_custom_config]["checksum"] = data["checksum"]
|
||||
|
||||
if mode == "raw":
|
||||
server_name = variables.get("SERVER_NAME", old_server_name).split(" ")[0]
|
||||
for variable, value in variables.copy().items():
|
||||
if variable.startswith(f"{server_name}_"):
|
||||
variables[variable.replace(f"{server_name}_", "", 1)] = value
|
||||
|
||||
if mode != "easy" or service != "new":
|
||||
# Remove already existing fields
|
||||
for variable, value in variables.copy().items():
|
||||
|
|
|
|||
Loading…
Reference in a new issue