Skip to content

Commit

Permalink
Release 22.04
Browse files Browse the repository at this point in the history
  • Loading branch information
accetto committed Apr 29, 2022
2 parents dcad70f + ba17817 commit bc4860e
Show file tree
Hide file tree
Showing 9 changed files with 78 additions and 36 deletions.
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,24 @@

***

### Release 22.04

- **noVNC** improvements

- **noVNC** got a new optional argument, which is passed through a new environment variable **NOVNC_HEARTBEAT**

- set the variable by creating the container, like `docker run -e NOVNC_HEARTBEAT=30` for the ping interval 30 seconds
- it should prevent disconnections because of inactivity, if the container is used behind load-balancers or reverse proxies ([issue #23](https://github.com/accetto/ubuntu-vnc-xfce-g3/issues/23))

- script `vnc_startup.rc` has been adjusted and improved
- script `version_of.sh` has been adjusted
- **numpy** module has been added to make the HyBi protocol faster

- following variables related to **noVNC** has been renamed in all related files
- `ARG_NO_VNC_PORT` renamed to `ARG_NOVNC_PORT`
- `NO_VNC_HOME` renamed to `NOVNC_HOME`
- `NO_VNC_PORT` renamed to `NOVNC_PORT`

### Release 22.02

- Updated components:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ Support for overriding the user group by `docker run` has been introduced in the

Several ways of overriding the VNC/noVNC parameters are supported. The password, display, resolution, color depth, view mode and the ports can be overridden at the image build-time, the container startup-time and the VNC startup-time. Using of empty VNC/noVNC password is also supported because it is independent from the container user password.

If your session disconnnects, it might be related to a network equipment (load-balancer, reverse proxy, ...) dropping the websocket session for inactivity (more info [here](https://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_read_timeout) and [here](https://nginx.org/en/docs/http/websocket.html) for nginx). In such case, try defining the NO_VNC_HEARTBEAT=<xx environment variable at startup-time, where <xx> is the number of seconds between each [websocket ping/pong](https://github.com/websockets/ws/issues/977) packet.
If your session disconnects, it might be related to a network equipment (load-balancer, reverse proxy, ...) dropping the websocket session for inactivity (more info [here](https://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_read_timeout) and [here](https://nginx.org/en/docs/http/websocket.html) for nginx). In such case, try defining the **NOVNC_HEARTBEAT=XX** environment variable at startup-time, where **XX** is the number of seconds between [websocket ping/pong](https://github.com/websockets/ws/issues/977) packets.

#### Different use of version sticker

Expand Down
22 changes: 13 additions & 9 deletions docker/Dockerfile.xfce
Original file line number Diff line number Diff line change
Expand Up @@ -138,19 +138,23 @@ EXPOSE ${VNC_PORT}

FROM stage_vnc as stage_novnc
ARG ARG_APT_NO_RECOMMENDS
ARG ARG_NO_VNC_PORT
ARG ARG_NOVNC_PORT

ENV \
FEATURES_BUILD_SLIM_NOVNC=${ARG_APT_NO_RECOMMENDS:+1} \
FEATURES_NOVNC=1 \
NO_VNC_HOME=/usr/libexec/noVNCdim \
NO_VNC_PORT=${ARG_NO_VNC_PORT:-6901}
NOVNC_HOME=/usr/libexec/noVNCdim \
NOVNC_PORT=${ARG_NOVNC_PORT:-6901}

RUN \
mkdir -p "${NO_VNC_HOME}"/utils/websockify \
&& wget -qO- https://github.com/novnc/noVNC/archive/v1.3.0.tar.gz | tar xz --strip 1 -C "${NO_VNC_HOME}" \
&& wget -qO- https://github.com/novnc/websockify/archive/v0.10.0.tar.gz | tar xz --strip 1 -C "${NO_VNC_HOME}"/utils/websockify \
&& chmod +x -v "${NO_VNC_HOME}"/utils/novnc_proxy
--mount=type=cache,target=/var/cache/apt,from=stage_cache,source=/var/cache/apt \
--mount=type=cache,target=/var/lib/apt,from=stage_cache,source=/var/lib/apt \
DEBIAN_FRONTEND=noninteractive apt-get install -y ${ARG_APT_NO_RECOMMENDS:+--no-install-recommends} \
python3-numpy \
&& mkdir -p "${NOVNC_HOME}"/utils/websockify \
&& wget -qO- https://github.com/novnc/noVNC/archive/v1.3.0.tar.gz | tar xz --strip 1 -C "${NOVNC_HOME}" \
&& wget -qO- https://github.com/novnc/websockify/archive/v0.10.0.tar.gz | tar xz --strip 1 -C "${NOVNC_HOME}"/utils/websockify \
&& chmod +x -v "${NOVNC_HOME}"/utils/novnc_proxy

### add 'index.html' for choosing noVNC client
RUN echo -e \
Expand All @@ -165,9 +169,9 @@ RUN echo -e \
" <p><a href=\"vnc.html\">noVNC Full Client</a></p>\n" \
" </body>\n" \
"</html>" \
> "${NO_VNC_HOME}"/index.html
> "${NOVNC_HOME}"/index.html

EXPOSE ${NO_VNC_PORT}
EXPOSE ${NOVNC_PORT}


###################
Expand Down
3 changes: 2 additions & 1 deletion docker/src/examples/example-vnc-override.rc
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@
export VNC_RESOLUTION=1024x768
export DISPLAY=:2
export VNC_PORT=5902
export NO_VNC_PORT=6902
export NOVNC_PORT=6902
;export NOVNC_HEARTBEAT=25
6 changes: 3 additions & 3 deletions docker/src/xfce-startup/version_of.sh
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ case "$1" in
;;
novnc | no-vnc )
### source example: 1.1.0
#echo $(cat "${NO_VNC_HOME}"/VERSION 2>/dev/null | grep -Po '^[0-9.]+$')
echo $(cat "${NO_VNC_HOME}"/package.json 2>/dev/null | grep -Po -m1 '(?<=\s"version":\s")[0-9.]+')
#echo $(cat "${NOVNC_HOME}"/VERSION 2>/dev/null | grep -Po '^[0-9.]+$')
echo $(cat "${NOVNC_HOME}"/package.json 2>/dev/null | grep -Po -m1 '(?<=\s"version":\s")[0-9.]+')
;;
npm )
### source example: 6.9.0
Expand Down Expand Up @@ -111,7 +111,7 @@ case "$1" in
;;
websockify )
### source example: 0.8.0
echo $(cat "${NO_VNC_HOME}"/utils/websockify/CHANGES.txt 2>/dev/null | grep -Po -m1 '^[0-9.]+')
echo $(cat "${NOVNC_HOME}"/utils/websockify/CHANGES.txt 2>/dev/null | grep -Po -m1 '^[0-9.]+')
;;
xfce4-screenshooter | screenshooter | screenshot )
### source example: xfce4-screenshooter 1.8.2
Expand Down
24 changes: 17 additions & 7 deletions docker/src/xfce-startup/vnc_startup.rc
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,11 @@ start_vnc () {
rm -rfv /tmp/.X*-lock /tmp/.X11-unix &> "${_vnc_log}"
fi

if [ -n "${_verbose}" ] ; then
echo "Starting VNC"
echo "vncserver ${DISPLAY} &> ${_vnc_log}"
fi

### VNC startup (in the background)
vncserver "${DISPLAY}" &> "${_vnc_log}" &

Expand All @@ -89,24 +94,29 @@ start_vnc () {
if [ "${_arg_skip_novnc}" == "off" ] ; then

### noVNC is not necessarily installed
if [ -n "${NO_VNC_HOME}" ] || [ -d "${NO_VNC_HOME}/utils/websockify" ] ; then
if [ -n "${NOVNC_HOME}" ] || [ -d "${NOVNC_HOME}/utils/websockify" ] ; then

### noVNC requirements
if [ -n "${NO_VNC_PORT}" ] ; then
if [ -n "${NOVNC_PORT}" ] ; then

if [ -n "${NO_VNC_HEARTBEAT}" ]; then
HEARTBEAT_OPT="--heartbeat ${NO_VNC_HEARTBEAT}"
if [ -n "${_verbose}" ] ; then
echo "Starting noVNC"
echo "${NOVNC_HOME}/utils/novnc_proxy --vnc localhost:${VNC_PORT} --listen ${NOVNC_PORT} ${NOVNC_HEARTBEAT:+--heartbeat ${NOVNC_HEARTBEAT}} &> ${_novnc_log}"
fi

### noVNC startup (in the background)
"${NO_VNC_HOME}"/utils/novnc_proxy --vnc localhost:${VNC_PORT} --listen ${NO_VNC_PORT} ${HEARTBEAT_OPT} &> "${_novnc_log}" &
"${NOVNC_HOME}"/utils/novnc_proxy \
--vnc localhost:${VNC_PORT} \
--listen ${NOVNC_PORT} \
${NOVNC_HEARTBEAT:+--heartbeat ${NOVNC_HEARTBEAT}} \
&> "${_novnc_log}" &

if [ -n "${_verbose}" ] ; then
echo "noVNC started on TCP port '${NO_VNC_PORT}'"
echo "noVNC started on TCP port '${NOVNC_PORT}' ${NOVNC_HEARTBEAT:+with heartbeat ${NOVNC_HEARTBEAT} seconds}"
echo "Connect via web browser"
fi
else
cleanup "ERROR: Environment variable 'NO_VNC_PORT' is not set."
cleanup "ERROR: Environment variable 'NOVNC_PORT' is not set."
fi
else
if [ -n "${_verbose}" ] ; then echo "WARNING: noVNC is not available." ; fi
Expand Down
13 changes: 8 additions & 5 deletions docker/xfce-chromium/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ The default `VNC_PORT` value is `5901`. The default `DISPLAY` value is `:1`. The

The containers that are created from the images built with the **noVNC feature** can be also accessed over [noVNC][noVNC] by any web browser supporting HTML5.

The default `NO_VNC_PORT` value is `6901`. The noVNC password is always identical to the VNC password.
The default `NOVNC_PORT` value is `6901`. The noVNC password is always identical to the VNC password.

There are several ways of connecting to headless containers and the possibilities also differ between the Linux and Windows environments, but usually it is done by mapping the VNC/noVNC ports exposed by the container to some free TCP ports on its host system.

Expand Down Expand Up @@ -171,7 +171,7 @@ They have the following default values:

```shell
DISPLAY=:1
NO_VNC_PORT=6901
NOVNC_PORT=6901
VNC_COL_DEPTH=24
VNC_PORT=5901
VNC_PW=headless
Expand All @@ -189,7 +189,7 @@ These environment variables can be overridden several ways.
- `ARG_VNC_RESOLUTION` sets the variable `VNC_RESOLUTION`
- `ARG_VNC_COL_DEPTH` sets the variable `VNC_COL_DEPTH`
- `ARG_VNC_VIEW_ONLY` set the variable `VNC_VIEW_ONLY`
- `ARG_NO_VNC_PORT` sets the variable `NO_VNC_PORT`
- `ARG_NOVNC_PORT` sets the variable `NOVNC_PORT`

For example:

Expand Down Expand Up @@ -223,7 +223,8 @@ The content of the file should be similar to the provided example file `example-
export VNC_RESOLUTION=1024x768
export DISPLAY=:2
export VNC_PORT=5902
export NO_VNC_PORT=6902
export NOVNC_PORT=6902
;export NOVNC_HEARTBEAT=25
```

Please note that only the lines beginning with `export` at the first position will be imported.
Expand All @@ -250,12 +251,14 @@ You should be aware, that overriding the VNC/noVNC parameters incorrectly could

This feature assumes some preliminary knowledge and it is provided for advanced users that already know what they want to achieve.

For example, by default there is a relation between the `DISPLAY` and `VNC_PORT` values. Generally the convention `VNC_PORT = 5900 + DISPLAY` is followed (similarly `NO_VNC_PORT = 6900 + DISPLAY`).
For example, by default there is a relation between the `DISPLAY` and `VNC_PORT` values. Generally the convention `VNC_PORT = 5900 + DISPLAY` is followed (similarly `NOVNC_PORT = 6900 + DISPLAY`).

You may decide not to follow the conventions. This image allows you to set the parameters differently, but again, you should know, what you are doing.

Be also aware, that there are differences between the Linux and Windows environments.

If your session disconnects, it might be related to a network equipment (load-balancer, reverse proxy, ...) dropping the websocket session for inactivity (more info [here](https://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_read_timeout) and [here](https://nginx.org/en/docs/http/websocket.html) for nginx). In such case, try defining the **NOVNC_HEARTBEAT=XX** environment variable at startup-time, where **XX** is the number of seconds between [websocket ping/pong](https://github.com/websockets/ws/issues/977) packets.

## Container user accounts

Containers created from this image run under the **application user** (by default **headless**, **1001:0**), which is a **non-root** user account.
Expand Down
13 changes: 8 additions & 5 deletions docker/xfce-firefox/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ The default `VNC_PORT` value is `5901`. The default `DISPLAY` value is `:1`. The

The containers that are created from the images built with the **noVNC feature** can be also accessed over [noVNC][noVNC] by any web browser supporting HTML5.

The default `NO_VNC_PORT` value is `6901`. The noVNC password is always identical to the VNC password.
The default `NOVNC_PORT` value is `6901`. The noVNC password is always identical to the VNC password.

There are several ways of connecting to headless containers and the possibilities also differ between the Linux and Windows environments, but usually it is done by mapping the VNC/noVNC ports exposed by the container to some free TCP ports on its host system.

Expand Down Expand Up @@ -172,7 +172,7 @@ They have the following default values:

```shell
DISPLAY=:1
NO_VNC_PORT=6901
NOVNC_PORT=6901
VNC_COL_DEPTH=24
VNC_PORT=5901
VNC_PW=headless
Expand All @@ -190,7 +190,7 @@ These environment variables can be overridden several ways.
- `ARG_VNC_RESOLUTION` sets the variable `VNC_RESOLUTION`
- `ARG_VNC_COL_DEPTH` sets the variable `VNC_COL_DEPTH`
- `ARG_VNC_VIEW_ONLY` set the variable `VNC_VIEW_ONLY`
- `ARG_NO_VNC_PORT` sets the variable `NO_VNC_PORT`
- `ARG_NOVNC_PORT` sets the variable `NOVNC_PORT`

For example:

Expand Down Expand Up @@ -224,7 +224,8 @@ The content of the file should be similar to the provided example file `example-
export VNC_RESOLUTION=1024x768
export DISPLAY=:2
export VNC_PORT=5902
export NO_VNC_PORT=6902
export NOVNC_PORT=6902
;export NOVNC_HEARTBEAT=25
```

Please note that only the lines beginning with `export` at the first position will be imported.
Expand All @@ -251,12 +252,14 @@ You should be aware, that overriding the VNC/noVNC parameters incorrectly could

This feature assumes some preliminary knowledge and it is provided for advanced users that already know what they want to achieve.

For example, by default there is a relation between the `DISPLAY` and `VNC_PORT` values. Generally the convention `VNC_PORT = 5900 + DISPLAY` is followed (similarly `NO_VNC_PORT = 6900 + DISPLAY`).
For example, by default there is a relation between the `DISPLAY` and `VNC_PORT` values. Generally the convention `VNC_PORT = 5900 + DISPLAY` is followed (similarly `NOVNC_PORT = 6900 + DISPLAY`).

You may decide not to follow the conventions. This image allows you to set the parameters differently, but again, you should know, what you are doing.

Be also aware, that there are differences between the Linux and Windows environments.

If your session disconnects, it might be related to a network equipment (load-balancer, reverse proxy, ...) dropping the websocket session for inactivity (more info [here](https://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_read_timeout) and [here](https://nginx.org/en/docs/http/websocket.html) for nginx). In such case, try defining the **NOVNC_HEARTBEAT=XX** environment variable at startup-time, where **XX** is the number of seconds between [websocket ping/pong](https://github.com/websockets/ws/issues/977) packets.

## Container user accounts

Containers created from this image run under the **application user** (by default **headless**, **1001:0**), which is a **non-root** user account.
Expand Down
13 changes: 8 additions & 5 deletions docker/xfce/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ The default `VNC_PORT` value is `5901`. The default `DISPLAY` value is `:1`. The

The containers that are created from the images built with the **noVNC feature** can be also accessed over [noVNC][noVNC] by any web browser supporting HTML5.

The default `NO_VNC_PORT` value is `6901`. The noVNC password is always identical to the VNC password.
The default `NOVNC_PORT` value is `6901`. The noVNC password is always identical to the VNC password.

There are several ways of connecting to headless containers and the possibilities also differ between the Linux and Windows environments, but usually it is done by mapping the VNC/noVNC ports exposed by the container to some free TCP ports on its host system.

Expand Down Expand Up @@ -160,7 +160,7 @@ They have the following default values:

```shell
DISPLAY=:1
NO_VNC_PORT=6901
NOVNC_PORT=6901
VNC_COL_DEPTH=24
VNC_PORT=5901
VNC_PW=headless
Expand All @@ -178,7 +178,7 @@ These environment variables can be overridden several ways.
- `ARG_VNC_RESOLUTION` sets the variable `VNC_RESOLUTION`
- `ARG_VNC_COL_DEPTH` sets the variable `VNC_COL_DEPTH`
- `ARG_VNC_VIEW_ONLY` set the variable `VNC_VIEW_ONLY`
- `ARG_NO_VNC_PORT` sets the variable `NO_VNC_PORT`
- `ARG_NOVNC_PORT` sets the variable `NOVNC_PORT`

For example:

Expand Down Expand Up @@ -212,7 +212,8 @@ The content of the file should be similar to the provided example file `example-
export VNC_RESOLUTION=1024x768
export DISPLAY=:2
export VNC_PORT=5902
export NO_VNC_PORT=6902
export NOVNC_PORT=6902
;export NOVNC_HEARTBEAT=25
```

Please note that only the lines beginning with `export` at the first position will be imported.
Expand All @@ -239,12 +240,14 @@ You should be aware, that overriding the VNC/noVNC parameters incorrectly could

This feature assumes some preliminary knowledge and it is provided for advanced users that already know what they want to achieve.

For example, by default there is a relation between the `DISPLAY` and `VNC_PORT` values. Generally the convention `VNC_PORT = 5900 + DISPLAY` is followed (similarly `NO_VNC_PORT = 6900 + DISPLAY`).
For example, by default there is a relation between the `DISPLAY` and `VNC_PORT` values. Generally the convention `VNC_PORT = 5900 + DISPLAY` is followed (similarly `NOVNC_PORT = 6900 + DISPLAY`).

You may decide not to follow the conventions. This image allows you to set the parameters differently, but again, you should know, what you are doing.

Be also aware, that there are differences between the Linux and Windows environments.

If your session disconnects, it might be related to a network equipment (load-balancer, reverse proxy, ...) dropping the websocket session for inactivity (more info [here](https://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_read_timeout) and [here](https://nginx.org/en/docs/http/websocket.html) for nginx). In such case, try defining the **NOVNC_HEARTBEAT=XX** environment variable at startup-time, where **XX** is the number of seconds between [websocket ping/pong](https://github.com/websockets/ws/issues/977) packets.

## Container user accounts

Containers created from this image run under the **application user** (by default **headless**, **1001:0**), which is a **non-root** user account.
Expand Down

0 comments on commit bc4860e

Please sign in to comment.