Commit 30c68c6
fix: friendly unlock page instead of raw 401, and don't mistake Docker for WSL
Running the container surfaced two things that only show up outside loopback:
- Opening http://localhost:8787 from the host returned raw JSON
{"error":"unauthorized"}. The gate is right — Docker's bridge IP isn't loopback,
so the token is required — but that's a hostile first experience. A browser GET
without a token now gets a themed page explaining why and offering a box to paste
the token, which redirects to /?token=…. Non-browser callers still get JSON.
- `aios url` inside the container advertised the WSL instructions and a container
IP. Docker Desktop runs on the WSL2 kernel, so /proc/version contains
"microsoft" and _is_wsl() matched. Added _is_docker() (AIOS_IN_DOCKER or
/.dockerenv), checked first, printing the correct host URL with the token.
Verified in the running container: tokenless browser request renders the unlock
page, ?token=… serves the dashboard, and `aios url` now prints
"Docker → open this on your host: http://localhost:8787/?token=…".
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>1 parent 57085af commit 30c68c6
2 files changed
Lines changed: 59 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2138 | 2138 | | |
2139 | 2139 | | |
2140 | 2140 | | |
| 2141 | + | |
| 2142 | + | |
| 2143 | + | |
| 2144 | + | |
| 2145 | + | |
| 2146 | + | |
2141 | 2147 | | |
| 2148 | + | |
| 2149 | + | |
2142 | 2150 | | |
2143 | 2151 | | |
2144 | 2152 | | |
| |||
2159 | 2167 | | |
2160 | 2168 | | |
2161 | 2169 | | |
2162 | | - | |
| 2170 | + | |
| 2171 | + | |
| 2172 | + | |
| 2173 | + | |
| 2174 | + | |
| 2175 | + | |
| 2176 | + | |
| 2177 | + | |
2163 | 2178 | | |
2164 | 2179 | | |
2165 | 2180 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1326 | 1326 | | |
1327 | 1327 | | |
1328 | 1328 | | |
| 1329 | + | |
| 1330 | + | |
| 1331 | + | |
| 1332 | + | |
| 1333 | + | |
| 1334 | + | |
| 1335 | + | |
| 1336 | + | |
| 1337 | + | |
| 1338 | + | |
| 1339 | + | |
| 1340 | + | |
| 1341 | + | |
| 1342 | + | |
| 1343 | + | |
| 1344 | + | |
| 1345 | + | |
| 1346 | + | |
| 1347 | + | |
| 1348 | + | |
| 1349 | + | |
| 1350 | + | |
| 1351 | + | |
| 1352 | + | |
| 1353 | + | |
| 1354 | + | |
| 1355 | + | |
| 1356 | + | |
| 1357 | + | |
| 1358 | + | |
| 1359 | + | |
| 1360 | + | |
| 1361 | + | |
| 1362 | + | |
| 1363 | + | |
1329 | 1364 | | |
1330 | 1365 | | |
1331 | 1366 | | |
| |||
1355 | 1390 | | |
1356 | 1391 | | |
1357 | 1392 | | |
1358 | | - | |
| 1393 | + | |
| 1394 | + | |
| 1395 | + | |
| 1396 | + | |
| 1397 | + | |
| 1398 | + | |
| 1399 | + | |
| 1400 | + | |
1359 | 1401 | | |
1360 | 1402 | | |
1361 | 1403 | | |
| |||
0 commit comments