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
1 parent 99a89fd commit 4efd8b5
Show file tree
Hide file tree
Showing 11 changed files with 97 additions and 48 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
22 changes: 13 additions & 9 deletions docker/Dockerfile.xfce
Original file line number Diff line number Diff line change
Expand Up @@ -138,20 +138,24 @@ EXPOSE ${VNC_PORT}

FROM stage_vnc as stage_novnc
ARG ARG_APT_NO_RECOMMENDS
ARG ARG_NO_VNC_PORT
ARG ARG_NOVNC_PORT

### using the same parent path as TigerVNC
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 @@ -166,9 +170,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
22 changes: 13 additions & 9 deletions docker/Dockerfile.xfce.nodejs
Original file line number Diff line number Diff line change
Expand Up @@ -138,20 +138,24 @@ EXPOSE ${VNC_PORT}

FROM stage_vnc as stage_novnc
ARG ARG_APT_NO_RECOMMENDS
ARG ARG_NO_VNC_PORT
ARG ARG_NOVNC_PORT

### using the same parent path as TigerVNC
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 @@ -166,9 +170,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
22 changes: 13 additions & 9 deletions docker/Dockerfile.xfce.postman
Original file line number Diff line number Diff line change
Expand Up @@ -138,20 +138,24 @@ EXPOSE ${VNC_PORT}

FROM stage_vnc as stage_novnc
ARG ARG_APT_NO_RECOMMENDS
ARG ARG_NO_VNC_PORT
ARG ARG_NOVNC_PORT

### using the same parent path as TigerVNC
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 @@ -166,9 +170,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
22 changes: 13 additions & 9 deletions docker/Dockerfile.xfce.python
Original file line number Diff line number Diff line change
Expand Up @@ -138,20 +138,24 @@ EXPOSE ${VNC_PORT}

FROM stage_vnc as stage_novnc
ARG ARG_APT_NO_RECOMMENDS
ARG ARG_NO_VNC_PORT
ARG ARG_NOVNC_PORT

### using the same parent path as TigerVNC
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 @@ -166,9 +170,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 @@ -78,8 +78,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 @@ -141,7 +141,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: 19 additions & 5 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,20 +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 "${_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} &> "${_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
2 changes: 1 addition & 1 deletion docker/xfce-nodejs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,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
2 changes: 1 addition & 1 deletion docker/xfce-postman/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,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
2 changes: 1 addition & 1 deletion docker/xfce-python/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,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

0 comments on commit 4efd8b5

Please sign in to comment.