Skip to content

Commit fb4dd67

Browse files
authored
Merge pull request #31 from bytebot-ai/codex/remove-port-5900-and-6081-exposure
Proxy noVNC through bytebotd
2 parents 0152e36 + 96c2cba commit fb4dd67

File tree

15 files changed

+117
-340
lines changed

15 files changed

+117
-340
lines changed

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,6 @@ More details in the [**Quickstart Guide**](https://docs.bytebot.ai/quickstart).
103103
| 💬 Chat UI | `http://localhost:9992` | Agent UI |
104104
| 🤖 Agent API | `http://localhost:9991` | REST API |
105105
| 🌐 noVNC | `http://localhost:9990/vnc` | open in any browser |
106-
| 🖥️ VNC Client | `localhost:5900` | password‑less by default |
107106

108107

109108

docs/core-concepts/desktop-environment.mdx

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,6 @@ The desktop environment is configured with automation in mind:
4747

4848
## Remote Access
4949

50-
### VNC Server
51-
52-
The container runs a VNC server that allows direct access to the desktop:
53-
54-
- Accessible on port 5900 (default VNC port)
55-
- Compatible with standard VNC clients (RealVNC, TightVNC, etc.)
56-
- Supports standard VNC authentication
57-
5850
### noVNC
5951

6052
For browser-based access, noVNC is included:
@@ -76,10 +68,9 @@ Bytebot uses Xvfb (X Virtual Framebuffer) as its display server:
7668

7769
### Manual Interaction
7870

79-
You can directly interact with the desktop environment using:
71+
You can interact with the desktop environment using your web browser:
8072

81-
1. **VNC client** connected to `localhost:5900`
82-
2. **Web browser** navigated to `http://localhost:9990/vnc`
73+
1. Navigate to `http://localhost:9990/vnc`
8374

8475
### Programmatic Interaction
8576

docs/quickstart.mdx

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,8 @@ Getting started with Bytebot is simple and straightforward. You can run it as a
2626
docker-compose -f infrastructure/docker/docker-compose.core.yml up -d --no-build # start container
2727
```
2828

29-
This will start Bytebot with default settings. The container exposes several ports:
29+
This will start Bytebot with default settings. The container exposes one port:
3030
- `9990`: REST API and noVNC web access
31-
- `5900`: VNC server
32-
- `6080`: noVNC direct
33-
- `6081`: noVNC HTTP proxy
3431
</Accordion>
3532

3633
<Accordion icon="cube" title="Building the Docker Image (Alternative)">
@@ -52,10 +49,6 @@ Getting started with Bytebot is simple and straightforward. You can run it as a
5249
<Accordion icon="display" title="Accessing the Desktop">
5350
You can access the Bytebot desktop environment in two ways:
5451

55-
**Using a VNC Client**:
56-
Connect to `localhost:5900` with any VNC client.
57-
58-
**Using a Web Browser**:
5952
Navigate to `http://localhost:9990/vnc` in your web browser for noVNC access.
6053
</Accordion>
6154
</AccordionGroup>

infrastructure/docker/Dockerfile

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -398,11 +398,8 @@ WORKDIR /home/bytebot
398398
# -----------------------------------------------------------------------------
399399
# 8. Port configuration and runtime
400400
# -----------------------------------------------------------------------------
401-
# - Port 9990: bytebotd
402-
# - Port 5900: VNC display for the Ubuntu VM
403-
# - Port 6080: noVNC client
404-
# - Port 6081: noVNC HTTP proxy
405-
EXPOSE 9990 5900 6080 6081
401+
# - Port 9990: bytebotd and external noVNC websocket
402+
EXPOSE 9990
406403

407404
# Start supervisor to manage all services
408405
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/conf.d/supervisord.conf", "-n"]

infrastructure/docker/docker-compose.core.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,6 @@ services:
1414
hostname: computer
1515
privileged: true
1616
ports:
17-
- "9990:9990" # bytebotd service
18-
- "5900:5900" # VNC display
19-
- "6080:6080" # noVNC client
20-
- "6081:6081" # noVNC HTTP proxy
17+
- "9990:9990" # bytebotd service & noVNC
2118
environment:
2219
- DISPLAY=:0

infrastructure/docker/docker-compose.yml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,7 @@ services:
1414
hostname: computer
1515
privileged: true
1616
ports:
17-
- "9990:9990" # bytebotd service
18-
- "5900:5900" # VNC display
19-
- "6080:6080" # noVNC client
20-
- "6081:6081" # noVNC HTTP proxy
17+
- "9990:9990" # bytebotd service & noVNC
2118
environment:
2219
- DISPLAY=:0
2320
networks:
@@ -61,7 +58,7 @@ services:
6158
dockerfile: bytebot-ui/Dockerfile
6259
args:
6360
- NEXT_PUBLIC_BYTEBOT_AGENT_BASE_URL=${BYTEBOT_AGENT_BASE_URL:-http://localhost:9991}
64-
- NEXT_PUBLIC_BYTEBOT_DESKTOP_VNC_URL=${BYTEBOT_DESKTOP_VNC_URL:-ws://localhost:6080}
61+
- NEXT_PUBLIC_BYTEBOT_DESKTOP_VNC_URL=${BYTEBOT_DESKTOP_VNC_URL:-ws://localhost:9990/websockify}
6562
container_name: bytebot-ui
6663
restart: unless-stopped
6764
ports:

infrastructure/docker/supervisord.conf

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -68,17 +68,6 @@ stdout_logfile_maxbytes=0
6868
redirect_stderr=true
6969
depends_on=x11vnc
7070

71-
[program:novnc-http]
72-
command=python3 -m http.server 6081 --directory /opt/noVNC
73-
autostart=true
74-
autorestart=true
75-
startsecs=5
76-
priority=50
77-
stdout_logfile=/dev/stdout
78-
stdout_logfile_maxbytes=0
79-
redirect_stderr=true
80-
depends_on=websockify
81-
8271
[program:bytebotd]
8372
command=node /bytebotd/dist/main.js
8473
directory=/bytebotd
@@ -90,7 +79,7 @@ environment=DISPLAY=":0"
9079
stdout_logfile=/dev/stdout
9180
stdout_logfile_maxbytes=0
9281
redirect_stderr=true
93-
depends_on=novnc-http
82+
depends_on=websockify
9483

9584
[eventlistener:startup]
9685
command=echo "All services started successfully"

packages/bytebotd/package-lock.json

Lines changed: 90 additions & 19 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/bytebotd/package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,12 @@
3131
"@nestjs/core": "^11.0.1",
3232
"@nestjs/platform-express": "^11.1.2",
3333
"@nestjs/platform-socket.io": "^11.1.2",
34+
"@nestjs/serve-static": "^5.0.3",
3435
"@nestjs/websockets": "^11.1.2",
3536
"@nut-tree-fork/nut-js": "^4.2.6",
3637
"class-transformer": "^0.5.1",
3738
"class-validator": "^0.14.2",
39+
"http-proxy-middleware": "^3.0.5",
3840
"reflect-metadata": "^0.2.2",
3941
"rxjs": "^7.8.1",
4042
"socket.io": "^4.8.1",

packages/bytebotd/src/app.controller.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,7 @@ export class AppController {
88
// When a client makes a GET request to /vnc,
99
// this method will automatically redirect them to the noVNC URL.
1010
@Get('vnc')
11-
@Redirect(
12-
'http://localhost:6081/vnc.html?host=localhost&port=6080&resize=scale',
13-
302,
14-
)
11+
@Redirect('/novnc/vnc.html?path=websockify&resize=scale', 302)
1512
redirectToVnc(): void {
1613
// This method is intentionally left empty.
1714
// The @Redirect decorator will automatically redirect the client.

0 commit comments

Comments
 (0)