diff --git a/sources/python/main.py b/sources/python/main.py index 4c252d1..282edbb 100644 --- a/sources/python/main.py +++ b/sources/python/main.py @@ -181,25 +181,6 @@ def main(): elif c.lower() == "q": break -def create_config(): - print("\n─── Create Node Config ───") - name = input("Node name: ").strip() - if not name: return - token = input("Wallarm token: ").strip() - cloud = input("Cloud [EU]: ").strip() or "EU" - port = input("Port [8081]: ").strip() or "8081" - upstream_ip = input("Upstream IP [127.0.0.1]: ").strip() or "127.0.0.1" - upstream_port = input("Upstream port [80]: ").strip() or "80" - mode = input("Mode [monitoring]: ").strip() or "monitoring" - - cfg = load_config() - cfg[name] = {"token": token, "cloud": cloud, "port": port, - "upstream_ip": upstream_ip, "upstream_port": upstream_port, - "labels": f"group={name}", "mode": mode} - os.makedirs(APP, exist_ok=True) - with open(CONF, "w") as f: - json.dump(cfg, f, indent=2) - print(f"✅ {name} added to fw.conf") def add_node(): print("\n─── Add New Node ───") @@ -211,7 +192,13 @@ def add_node(): port = input("Port [8081]: ").strip() or "8081" upstream_ip = input("Upstream IP [127.0.0.1]: ").strip() or "127.0.0.1" upstream_port = input("Upstream port [80]: ").strip() or "80" - mode = input("Mode [monitoring]: ").strip() or "monitoring" + print("\nTraffic mode:") + print(" [1] monitoring — detect only") + print(" [2] safe_blocking — block definitely malicious") + print(" [3] block — block all attacks") + print(" [4] off — disable") + m = input("Choose [1]: ").strip() + mode = {"1":"monitoring","2":"safe_blocking","3":"block","4":"off"}.get(m, "monitoring") # Save to fw.conf cfg = load_config()