This is a Dockerised vnc viewer application that can be used to easily connect to and create an overview of multiple containers running VNC servers. (e.g. pixnyb/dockerised-vscode). It is based on Next.JS and noVNC and automatically translates WebSocket connections to TCP socket connections.
docker build -t vnc-viewer .
docker run -d -p 3000:3000 \
-v /var/run/docker.sock:/var/run/docker.sock \
pixnyb/vnc-viewer
Warning
The container in itself doesn't have any security measures implemented. It is recommended to run the container in a secure environment. (e.g. behind traefik with authentication middleware such as pixnyb/authentication-proxy)
The following environment variables can be set to configure the application:
Variable | Description | Default |
---|---|---|
NEXT_PUBLIC_DISABLE_CREDITS |
Whether the credits should be disabled or not | false |
The application is capable of discovering VNC servers running in other containers. To enable this feature, you need to add the following labels to the container running the VNC server:
labels:
- "vnc-viewer.enable=true"
- "vnc-viewer.label=My VNC Server" # Optional
- "vnc-viewer.port=5900" # Optional, defaults to 5900
Note
The containers must both exist in the same network. Otherwise no connection to the VNC server can be established.
Note
The container offers Docker Swarm support. When running in a Docker Swarm, make sure to constrain the service to manager nodes only. Otherwise, the application won't be able to discover the VNC servers.
deploy:
placement:
constraints:
- node.role == manager
Note
When authentication is necessary to connect to a vnc server, a login form will be displayed. Not all vnc servers accept a username, so the username field is optional.
Warning
The application doesn't currently check if a socket should be connected to. The WebSocket connection can be used to connect to any host and port, this makes the application vulnerable to attacks. It is recommended to run the application in a secure environment with an isolated network.
This feature currently isn't implemented. The container is designed to be used as an interface for managing other containers running VNC servers.
Contributions are welcome, please read the CONTRIBUTING.md file for more information.