Skip to content

Commit b219fc6

Browse files
authored
Adding VNC_PASSWORD to configure VNC password (#1840)
1 parent 59a29ee commit b219fc6

File tree

2 files changed

+8
-21
lines changed

2 files changed

+8
-21
lines changed

NodeBase/start-vnc.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,12 @@ if [ "${START_XVFB:-$SE_START_XVFB}" = true ] ; then
2828
X11VNC_OPTS="${X11VNC_OPTS} -viewonly"
2929
fi
3030

31+
VNC_PASSWORD=${VNC_PASSWORD:-$SE_VNC_PASSWORD}
32+
if [ ! -z $VNC_PASSWORD ]; then
33+
echo "Starting VNC server with custom password"
34+
x11vnc -storepasswd ${VNC_PASSWORD} ${HOME}/.vnc/passwd
35+
fi
36+
3137
for i in $(seq 1 10)
3238
do
3339
sleep 1

README.md

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1092,27 +1092,8 @@ Then, you would use in your VNC client:
10921092
- Port 5901 to connect to the Edge container
10931093
- Port 5902 to connect to the Firefox container
10941094

1095-
If you get a prompt asking for a password, it is: `secret`. If you wish to change this, you should either change
1096-
it in the `/NodeBase/Dockerfile` and build the images yourself, or you can define a Docker image that derives from
1097-
the posted ones which reconfigures it:
1098-
1099-
Dockerfile example that extends the `node-chrome:4.9.0-20230421`. You can choose another browser image or a Standalone
1100-
browser image.
1101-
1102-
``` dockerfile
1103-
FROM selenium/node-chrome:4.9.0-20230421
1104-
1105-
RUN x11vnc -storepasswd <your-password-here> /home/seluser/.vnc/passwd
1106-
```
1107-
1108-
Save the `Dockerfile` as `DockerfileVNCPasswordChanged`, open a terminal and on the same directory run:
1109-
1110-
```shell
1111-
docker build -t selenium/node-chrome-vnc-password-changed:4.9.0-20230421 -f DockerfileVNCPasswordChanged .
1112-
```
1113-
1114-
And from now on, instead of using `node-chrome:4.9.0-20230421` in your scripts or docker-compose files, use
1115-
`selenium/node-chrome-vnc-password-changed:4.9.0-20230421`.
1095+
If you get a prompt asking for a password, it is: `secret`. If you wish to change this,
1096+
you can set the environment variable `SE_VNC_PASSWORD`.
11161097

11171098
If you want to run VNC without password authentication you can set the environment variable `SE_VNC_NO_PASSWORD=1`.
11181099

0 commit comments

Comments
 (0)