Compare commits

...

2 commits

Author SHA1 Message Date
Nick Guy
ed2d89e5ec Add ability to exclude servers from port-forwarding 2025-03-02 14:58:01 +00:00
Nick Guy
ca5d03676a Add initial run on startup 2025-03-02 14:57:49 +00:00

View file

@ -69,6 +69,8 @@ def apply_port_changes():
label = "Allocation " + str(alloc["id"]) + " for " + node_internal_name label = "Allocation " + str(alloc["id"]) + " for " + node_internal_name
if alloc["id"] in allocation_server_lookup.keys(): if alloc["id"] in allocation_server_lookup.keys():
svr = allocation_server_lookup[alloc["id"]] svr = allocation_server_lookup[alloc["id"]]
if "pf_exclude" in svr.description:
continue
label = svr["name"] + "(" + svr["identifier"] + ") allocation" label = svr["name"] + "(" + svr["identifier"] + ") allocation"
rules.append(create_rule(label, node_internal_ip, alloc["port"])) rules.append(create_rule(label, node_internal_ip, alloc["port"]))
@ -101,4 +103,6 @@ if __name__ == '__main__':
port = int(cfg["app"]["port"]) port = int(cfg["app"]["port"])
print("Applying initial port forwarding")
apply_port_changes()
app.run(host="0.0.0.0", port=port) app.run(host="0.0.0.0", port=port)