You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* fix: harden log server web boundaries
* style: sort log server imports
* style: format DS trace link
* fix: avoid exposing server exception details
* docs: document secure log server configuration
* fix: authenticate internal web storage updates
After that, open `http://127.0.0.1:19899` in your browser.
401
401
402
+
##### Web UI security and remote access
403
+
404
+
The Flask backend listens on `127.0.0.1` by default. This keeps its process-control, upload, and trace APIs accessible only from the local machine. No authentication token is required while the server is bound to localhost.
405
+
406
+
To access the Web UI from another machine, explicitly bind it to a non-local address and configure an authentication token:
The server removes the token from the address bar by redirecting to `/` and stores it in an HTTP-only, same-site cookie. API clients can instead send it in the request header:
420
+
421
+
```text
422
+
Authorization: Bearer <a-long-random-token>
423
+
```
424
+
425
+
The server refuses to bind to a non-local address unless `UI_SERVER_AUTH_TOKEN` is set. When exposing it outside a trusted development machine, put it behind an HTTPS reverse proxy and avoid recording token-bearing query strings in proxy logs. The `--host` option controls the address when the server is started through the CLI; `UI_SERVER_HOST` is the corresponding default for direct use of the backend entry point.
426
+
427
+
Cross-origin browser access is disabled by default. If the frontend and backend are served from different origins, configure an explicit JSON allowlist rather than enabling every origin:
The Flask backend uses the following environment variables. Uploaded input files are deliberately kept outside the trace directory so that they cannot be discovered and deserialized as persisted traces.
436
+
437
+
| Environment variable | Default | Description |
438
+
| --- | --- | --- |
439
+
| `UI_STATIC_PATH` | `./git_ignore_folder/static` | Directory containing the built Web UI assets. |
440
+
| `UI_TRACE_FOLDER` | `./git_ignore_folder/traces` | Directory containing generated trace data and process logs. |
441
+
| `UI_UPLOAD_FOLDER` | `./git_ignore_folder/uploads` | Isolated directory for uploaded input files. Mount, back up, and clean it separately from the trace directory. |
442
+
| `UI_SERVER_HOST` | `127.0.0.1` | Default host used by the backend entry point. Use `server_ui --host` when starting it through the CLI. |
443
+
| `UI_SERVER_AUTH_TOKEN` | empty | Bearer/cookie authentication token. Required for any non-localhost binding. |
444
+
| `UI_CORS_ALLOWED_ORIGINS` | `[]` | JSON list of allowed browser origins. CORS is disabled when the list is empty. |
445
+
| `UI_MAX_UPLOAD_MB` | `20` | Maximum size in MiB of an entire HTTP request, including all uploaded files and form data. |
446
+
| `UI_LOAD_LEGACY_PICKLE_TRACES` | `false` | Whether to deserialize persisted pickle traces when the server starts. Enable only for a fully trusted trace directory. |
447
+
448
+
Uploads whose filenames end in `.dill`, `.pickle`, `.pkl`, `.py`, `.pyc`, or `.pyo` are rejected. Existing workflows that use these formats as uploaded inputs must convert them to a non-executable data format or provide them through another trusted mechanism.
449
+
450
+
Legacy pickle trace loading is disabled by default because pickle deserialization can execute code. Consequently, after a server restart, an existing trace may still appear in the history list but its saved messages will not be loaded into the Web UI. If compatibility with trusted historical traces is required, opt in explicitly:
451
+
452
+
```sh
453
+
export UI_LOAD_LEGACY_PICKLE_TRACES=true
454
+
rdagent server_ui --port 19899
455
+
```
456
+
457
+
Only enable this setting when every file under `UI_TRACE_FOLDER` is trusted and the directory is not writable by untrusted users or services.
458
+
459
+
Data-science trace share links no longer accept a URL-controlled `log_folder`. A link can preserve the selected trace, but the recipient must have the corresponding log folder configured or select it in the UI.
460
+
402
461
#### Common Notes
403
462
404
463
Port `19899` is used in the examples above. Before starting either UI, check whether this port is already occupied. If it is, please change it to another available port.
Copy file name to clipboardExpand all lines: docs/ui.rst
+140-1Lines changed: 140 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@ Introduction
8
8
9
9
RD-Agent will generate some logs during the R&D process. These logs are very useful for debugging and understanding the R&D process. However, just viewing the terminal log is not intuitive enough. RD-Agent provides a web app as UI to visualize the R&D process. You can easily view the R&D process and understand the R&D process better.
10
10
11
-
A Quick Demo
11
+
Streamlit UI
12
12
============
13
13
14
14
Start Web App
@@ -47,3 +47,142 @@ Use Web App
47
47
- Next Loop: Show one success **R&D Loop**.
48
48
- One Evolving: Show one **evolving** step of **development** part.
49
49
- refresh logs: clear shown logs.
50
+
51
+
52
+
Flask Web UI
53
+
============
54
+
55
+
RD-Agent also provides a separate frontend in ``web/`` backed by the Flask log
56
+
server started with ``rdagent server_ui``. This UI provides real-time trace,
57
+
upload, process-control, and user-interaction APIs.
58
+
59
+
Build and start
60
+
---------------
61
+
62
+
Install the frontend dependencies and build the static assets:
63
+
64
+
.. code-block:: bash
65
+
66
+
cd web
67
+
npm install
68
+
npm run build:flask
69
+
cd ..
70
+
71
+
The generated assets are served from ``./git_ignore_folder/static`` by default.
72
+
Set ``UI_STATIC_PATH`` before starting the server to use another directory.
73
+
74
+
Start the server locally:
75
+
76
+
.. code-block:: bash
77
+
78
+
rdagent server_ui --port 19899
79
+
80
+
Then open ``http://127.0.0.1:19899``. The server listens on localhost by
81
+
default, so its process-control, upload, and trace APIs are not exposed to
82
+
other machines.
83
+
84
+
Remote access and authentication
85
+
--------------------------------
86
+
87
+
To access the Flask Web UI remotely, explicitly select a non-local address and
0 commit comments