Commit bc38fe7
committed
fix(collab): iframe auth via base64 path + SPA bootstrap allowlist + git safe.directory + preview-port wildcard filter
Four issues collected from the /collab/<id> HAR + 'Open Pull Request' error
+ phantom preview chips screenshot. Single deploy cycle.
P1 — iframe URL was 401'ing → 302 to OAuth → ERR_BLOCKED_BY_CSP.
Iframe URL is /<base64(workspaceDirectory)>/session/<sid>?cs=<csid>
— directory is in the path, not in ?directory= or x-opencode-directory.
cookie-auth's workspaceParamFrom() now decodes the first path segment
as URL-safe base64 (matching packages/app/src/utils/base64.ts) and
falls back to that as the workspace addressing.
P2 — SPA's GlobalSyncProvider hits /global/event, /global/config, /path,
/project, /provider on every route (including /collab/*). None are
workspace-scoped; in collab mode they got 'deny' on fallthrough →
401 thrash. Added them to cookieAllowedWithoutScope as a small
explicit set (not a prefix — guards against accidentally inheriting
the unscoped pass on future per-workspace API groups).
P3 — 'fatal: detected dubious ownership' on git push from the workspace.
EFS access points are configured with posix_user uid=0 (efs.tf)
while the container runs as uid 10001 (ADR-0003). Git 2.35+ refuses
operations on a repo whose .git dir isn't owned by the current uid.
Workaround: 'git config --global --add safe.directory *' in
entrypoint.sh. Single-tenant container, no other repos to worry
about. Proper fix is to align EFS access point uid with the
container uid — tracked as future TF change.
P4 — Phantom preview chips (e.g. :20681, :20959) in the SPA's Repos
column. Those are Bun internals / SSM agent loopback listeners,
not user-facing dev servers. readListeningPorts() in router.ts
now filters to wildcard-bind only (0.0.0.0 / ::), dropping
loopback and per-interface listeners that aren't reachable from
the browser anyway.1 parent eecb97d commit bc38fe7
3 files changed
Lines changed: 81 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
| |||
174 | 175 | | |
175 | 176 | | |
176 | 177 | | |
177 | | - | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
178 | 190 | | |
179 | 191 | | |
180 | 192 | | |
181 | 193 | | |
182 | | - | |
183 | | - | |
184 | | - | |
185 | | - | |
186 | | - | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
187 | 214 | | |
188 | 215 | | |
189 | 216 | | |
| |||
203 | 230 | | |
204 | 231 | | |
205 | 232 | | |
206 | | - | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
207 | 255 | | |
208 | 256 | | |
209 | 257 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
64 | 67 | | |
65 | 68 | | |
66 | 69 | | |
| |||
81 | 84 | | |
82 | 85 | | |
83 | 86 | | |
84 | | - | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
85 | 99 | | |
86 | 100 | | |
87 | 101 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
33 | 44 | | |
34 | 45 | | |
35 | 46 | | |
0 commit comments