Skip to content

Commit f64ba50

Browse files
authored
support disable https (#45)
* support disable https * upgrade code server and novnc * update README
1 parent dfa7597 commit f64ba50

File tree

6 files changed

+20
-7
lines changed

6 files changed

+20
-7
lines changed

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,9 @@ configure by setting environment variables when you create container.
127127

128128
* `REMOTE_DESKTOP`: nomachine (default) , kasmvnc, novnc.
129129
* `VNC_THREADS`: RectThread num for vncserver, only used when `REMOTE_DESKTOP` = kasmvnc. default is 2, set 0 for auto.
130-
* `HTTPS_CERT`: SSL pem certificate file path to use for https server(kasmvnc/nonvc)
131-
* `HTTPS_CERT_KEY`: SSL pem key file path to use for https server(kasmvnc/nonvc)
130+
* `HTTPS_CERT`: SSL pem certificate file path to use for https server(kasmvnc/nonvc).
131+
* `HTTPS_CERT_KEY`: SSL pem key file path to use for https server(kasmvnc/nonvc).
132+
* `DISABLE_HTTPS`: set 1 for http server mode, which is useful for reverse proxy.
132133

133134
#### Enable GPU hardware-accelerated rendering
134135

ubuntu-desktop/docker_config/entrypoint.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,11 @@ fi
3434
# start dbus
3535
/etc/init.d/dbus start
3636
# start coder server
37-
su $USER -c "code-server --cert $HTTPS_CERT --cert-key $HTTPS_CERT_KEY --bind-addr=0.0.0.0:5000 &"
37+
if [ ! -z ${DISABLE_HTTPS+x} ]; then
38+
su $USER -c "code-server --bind-addr=0.0.0.0:5000 &"
39+
else
40+
su $USER -c "code-server --cert $HTTPS_CERT --cert-key $HTTPS_CERT_KEY --bind-addr=0.0.0.0:5000 &"
41+
fi
3842
# start remote desktop
3943
if [ "${REMOTE_DESKTOP}" = "nomachine" ]; then
4044
echo "start nomachine"

ubuntu-desktop/docker_config/install_code_server.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/bash
2-
version=4.93.1
2+
version=4.103.2
33
arch=$(dpkg --print-architecture)
44
codename=$(lsb_release --short --codename)
55
if [[ $codename == 'bionic' ]]; then

ubuntu-desktop/docker_config/install_novnc.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/sh
2-
NOVNC_VERSION=1.4.0
2+
NOVNC_VERSION=1.6.0
33
# install turbovnc
44
wget -q -O- https://packagecloud.io/dcommander/turbovnc/gpgkey | gpg --dearmor >/etc/apt/trusted.gpg.d/TurboVNC.gpg
55
wget -O /etc/apt/sources.list.d/TurboVNC.list https://raw.githubusercontent.com/TurboVNC/repo/main/TurboVNC.list

ubuntu-desktop/docker_config/start_kasmvnc.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ if [ ! -f "/home/$USER/.vnc/passwd" ]; then
55
fi
66
rm -rf /tmp/.X1000-lock /tmp/.X11-unix/X1000
77
# start kasmvnc
8-
su $USER -c "kasmvncserver :1000 -select-de xfce -interface 0.0.0.0 -websocketPort 4000 -cert $HTTPS_CERT -key $HTTPS_CERT_KEY -RectThreads $VNC_THREADS"
8+
if [ ! -z ${DISABLE_HTTPS+x} ]; then
9+
su $USER -c "kasmvncserver :1000 -select-de xfce -interface 0.0.0.0 -websocketPort 4000 -sslOnly 0 -RectThreads $VNC_THREADS"
10+
else
11+
su $USER -c "kasmvncserver :1000 -select-de xfce -interface 0.0.0.0 -websocketPort 4000 -cert $HTTPS_CERT -key $HTTPS_CERT_KEY -RectThreads $VNC_THREADS"
12+
fi
913
su $USER -c "pulseaudio --start"
1014
tail -f /home/$USER/.vnc/*.log

ubuntu-desktop/docker_config/start_novnc.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,9 @@ rm -rf /tmp/.X1000-lock /tmp/.X11-unix/X1000
77
# start TurboVNC
88
su $USER -c "/opt/TurboVNC/bin/vncserver :1000 -rfbport 5900"
99
# start NoVNC
10-
su $USER -c "/opt/noVNC/utils/novnc_proxy --vnc localhost:5900 --ssl-only --cert $HTTPS_CERT --key $HTTPS_CERT_KEY --listen 4000 --heartbeat 10 &"
10+
if [ ! -z ${DISABLE_HTTPS+x} ]; then
11+
su $USER -c "/opt/noVNC/utils/novnc_proxy --vnc localhost:5900 --listen 4000 --heartbeat 10 &"
12+
else
13+
su $USER -c "/opt/noVNC/utils/novnc_proxy --vnc localhost:5900 --ssl-only --cert $HTTPS_CERT --key $HTTPS_CERT_KEY --listen 4000 --heartbeat 10 &"
14+
fi
1115
tail -f /home/$USER/.vnc/*.log

0 commit comments

Comments
 (0)