Skip to content

armgit / strix

Public Imported from GitHub
0

Open-source AI penetration testing tool to find and fix your app’s vulnerabilities.

fix: allow clearing saved config by setting empty env var

0xallam61c94189c68c
diff --git a/strix/config/config.py b/strix/config/config.py
index 63c2dc44..0e0d16f0 100644
--- a/strix/config/config.py
+++ b/strix/config/config.py
@@ -109,8 +109,17 @@ class Config:
@classmethod
def save_current(cls) -> bool:
existing = cls.load().get("env", {})
- current = cls.capture_current().get("env", {})
- merged = {**existing, **current}
+ merged = dict(existing)
+
+ for var_name in cls.tracked_vars():
+ value = os.getenv(var_name)
+ if value is None:
+ pass
+ elif value == "":
+ merged.pop(var_name, None)
+ else:
+ merged[var_name] = value
+
return cls.save({"env": merged})