Skip to content

Commit dda73e5

Browse files
committed
Release 0.1.2: ignore unknown keys in CWD .env to prevent startup crash
A target repo's .env containing keys openhack doesn't define (e.g. gemini_sandbox_proxy_command) crashed the CLI at startup, because pydantic-settings defaults to extra=forbid and validates every key in a CWD .env file. Set extra=ignore so unrelated keys are skipped, matching how unknown os.environ vars were already handled.
1 parent 16907fe commit dda73e5

4 files changed

Lines changed: 8 additions & 3 deletions

File tree

‎openhack/__init__.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
"""OpenHack Agent - Interactive TUI for vulnerability scanning."""
2-
__version__ = "0.1.1"
2+
__version__ = "0.1.2"

‎openhack/config.py‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,11 @@ class Settings(BaseSettings):
158158
env_file=".env",
159159
env_file_encoding="utf-8",
160160
case_sensitive=False,
161+
# Ignore unrelated keys in a CWD .env / environment. The scanner runs
162+
# inside arbitrary target repos whose .env files contain keys we don't
163+
# own; without this, pydantic-settings' default extra="forbid" crashes
164+
# the CLI on any unknown key (e.g. a target's gemini_sandbox_proxy_command).
165+
extra="ignore",
161166
)
162167

163168
def model_post_init(self, __context) -> None:

‎pyproject.toml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "openhack"
3-
version = "0.1.1"
3+
version = "0.1.2"
44
description = "AI-powered security scanner for your codebase. Find SQL injection, XSS, IDOR, auth bypass, and more — straight from your terminal."
55
readme = "README.md"
66
requires-python = ">=3.11"

‎uv.lock‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)