Commit 2c0ba42
committed
fix(webapp): normalize empty RUNTIME_API_ORIGIN to undefined so '??' fallback works
The docker-compose passthrough `RUNTIME_API_ORIGIN: ${RUNTIME_API_ORIGIN:-}`
resolves to an empty string when the user hasn't set it, which the nullish
coalescing chain (`env.RUNTIME_API_ORIGIN ?? env.API_ORIGIN ?? env.APP_ORIGIN`)
doesn't fall through (`??` only treats null/undefined as missing). Result was
`TRIGGER_API_URL=""` and `TRIGGER_STREAM_URL=""` reaching runner pods,
breaking their webapp connection.
Apply the normalization at the schema level via `.transform(v => v || undefined)`
so any caller (current docker-compose, future templates) is protected without
having to remember to special-case empty strings at each use site.
Also clarify in `.env.example` that this var intentionally feeds both
TRIGGER_API_URL and TRIGGER_STREAM_URL (keep all runner traffic on the same
bypass hop), and tells operators who need a dedicated stream endpoint to use
STREAM_ORIGIN instead.1 parent 3c0455e commit 2c0ba42
2 files changed
Lines changed: 20 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
127 | 127 | | |
128 | 128 | | |
129 | 129 | | |
130 | | - | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | | - | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
138 | 142 | | |
139 | 143 | | |
140 | 144 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
53 | 57 | | |
54 | 58 | | |
55 | 59 | | |
| |||
0 commit comments