Commit be0b6b2
fix: Strip section prefix from env-var keys so WEB_* settings actually load
_load_from_env stored env-var keys lowercased verbatim, so WEB_HOST
became {"web": {"web_host": ...}} while Web.__init__ reads
web_config.get("host", ...). Result: WEB_ENABLED, WEB_HOST, WEB_PORT,
WEB_DB_PATH all silently no-op'd when configured via environment
variables — the values were loaded into the dict but under keys
nothing actually reads. PROXY_PREFIX was the only web env var that
worked, because its name doesn't start with the WEB_ prefix.
Practical impact: env-var deployments could not change the listen
address, port, database path, or even disable the web UI — every
WEB_ENABLED=false ran the UI anyway. Verified empirically before fix.
Strip the section-name prefix from env-var keys when storing in
_load_from_env so they match the YAML schema. This is surgical:
no other section uses an env-var prefix matching its name, so the
behavior of general/jobs/instances/download_clients is unchanged.
Add a parametrized regression test covering all five web env vars,
including a value (WEB_ENABLED=false) that differs from the default
so a no-op fix would be caught.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>1 parent 4faf5cf commit be0b6b2
2 files changed
Lines changed: 19 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
84 | 89 | | |
85 | 90 | | |
86 | 91 | | |
| |||
96 | 101 | | |
97 | 102 | | |
98 | 103 | | |
99 | | - | |
| 104 | + | |
| 105 | + | |
100 | 106 | | |
101 | 107 | | |
102 | 108 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
87 | 87 | | |
88 | 88 | | |
89 | 89 | | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
90 | 95 | | |
91 | 96 | | |
92 | 97 | | |
| |||
119 | 124 | | |
120 | 125 | | |
121 | 126 | | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
122 | 134 | | |
123 | 135 | | |
124 | 136 | | |
| |||
0 commit comments