Commit dd426fa
feat: serve local web UI in dev mode, suppress auth dialog
- Use Bearer WWW-Authenticate scheme so browsers don't pop a native
credentials dialog on 401 (Chrome/Firefox do this for Basic but not Bearer).
The server still accepts Authorization: Basic from the desktop app.
- Add OPENCODE_DEV_UI_DIR flag: when set, the server serves static files
from that directory (SPA fallback to index.html) instead of proxying
to app.opencode.ai.
- In desktop dev mode (!app.isPackaged), automatically set OPENCODE_DEV_UI_DIR
to packages/app/dist so remote browsers see the local build.
- Add OPENCODE_DEV_UI_URL flag to override the upstream proxy base URL.
- Fix variable shadowing: rename path→requestPath in serveUIEffect to avoid
conflict with the `import path from "node:path"` added in a prior commit.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent 02416fa commit dd426fa
4 files changed
Lines changed: 32 additions & 5 deletions
File tree
- packages
- core/src/flag
- desktop/src/main
- opencode/src/server
- routes/instance/httpapi/middleware
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
| 80 | + | |
| 81 | + | |
80 | 82 | | |
81 | 83 | | |
82 | 84 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
100 | 100 | | |
101 | 101 | | |
102 | 102 | | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
103 | 106 | | |
104 | 107 | | |
105 | 108 | | |
| |||
Lines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
11 | 13 | | |
12 | 14 | | |
13 | 15 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
| 20 | + | |
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| |||
95 | 95 | | |
96 | 96 | | |
97 | 97 | | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
98 | 115 | | |
99 | 116 | | |
100 | 117 | | |
101 | 118 | | |
102 | 119 | | |
103 | 120 | | |
104 | | - | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
105 | 124 | | |
106 | | - | |
| 125 | + | |
| 126 | + | |
107 | 127 | | |
108 | 128 | | |
109 | | - | |
| 129 | + | |
110 | 130 | | |
111 | 131 | | |
112 | 132 | | |
| |||
0 commit comments