Compare commits

...

3 Commits

Author SHA1 Message Date
Kathrin Maurer
e99e729a83 fix: allow targetportoverwrite as L4 param 2025-01-05 19:50:05 +01:00
Kathrin Maurer
84cb2f9fb2 fix: add master-address.txt to gitignore 2025-01-05 17:39:12 +01:00
Kathrin Maurer
f71269d14b fix: check for invalid entries 2025-01-05 17:38:45 +01:00
3 changed files with 13 additions and 0 deletions

1
.gitignore vendored
View File

@@ -8,3 +8,4 @@ password.txt
ssh_config_for_clients ssh_config_for_clients
virsh_backup virsh_backup
.wireguard_keys .wireguard_keys
master-address.txt

View File

@@ -3,6 +3,7 @@ import functools
import os import os
import subprocess import subprocess
import json import json
import sys
environment = jinja2.Environment(loader=jinja2.FileSystemLoader(searchpath="./templates")) environment = jinja2.Environment(loader=jinja2.FileSystemLoader(searchpath="./templates"))
@@ -20,6 +21,15 @@ def createBackupScriptStructure(backupList, baseDomain="", icingaOnly=False, bac
asyncIcingaConf = {} asyncIcingaConf = {}
for backup in backupList: for backup in backupList:
if not backup:
print("Warning: Empty backup mapping in List", file=sys.stderr)
continue
if type(backup) == str:
print(f"Warning: Backup Entry is a stirng instead of a dict-object ({backup})", file=sys.stderr)
continue
if backup.get("disabled"): if backup.get("disabled"):
continue continue

2
vm.py
View File

@@ -69,6 +69,7 @@ class VM:
isUDP = proto == "udp" isUDP = proto == "udp"
proxy_timeout = portStruct.get("proxy_timeout") or "10s" proxy_timeout = portStruct.get("proxy_timeout") or "10s"
extra_content = portStruct.get("extra-content") extra_content = portStruct.get("extra-content")
targetportoverwrite = portStruct.get("targetportoverwrite")
compositeName = "-".join((self.hostname, name, portstring, proto)) compositeName = "-".join((self.hostname, name, portstring, proto))
@@ -78,6 +79,7 @@ class VM:
component = template.render(targetip=self.ip, udp=isUDP, portstring=portstring, component = template.render(targetip=self.ip, udp=isUDP, portstring=portstring,
transparent=transparent, proxy_timeout=proxy_timeout, transparent=transparent, proxy_timeout=proxy_timeout,
comment=compositeName, extra_content=extra_content, comment=compositeName, extra_content=extra_content,
targetportoverwrite=targetportoverwrite,
port_interfaces=port_interfaces) port_interfaces=port_interfaces)
components.append(component) components.append(component)