diff --git a/builder/dockerfile.debian_buster.barebones.deb.test b/builder/dockerfile.debian_buster.barebones.deb.test index 74e65bf..428328f 100644 --- a/builder/dockerfile.debian_buster.barebones.deb.test +++ b/builder/dockerfile.debian_buster.barebones.deb.test @@ -5,6 +5,8 @@ COPY $KASMVNC_PACKAGE_DIR/kasmvncserver_*.deb /tmp RUN apt-get update && dpkg -i /tmp/*.deb; apt-get -yf install RUN apt-get update && apt-get -y install xterm +COPY startup/deb/kasmvncserver-start /usr/local/bin + RUN useradd -m foo USER foo:ssl-cert @@ -12,4 +14,4 @@ USER foo:ssl-cert RUN mkdir ~/.vnc && echo '/usr/bin/xterm &' >> ~/.vnc/xstartup && \ chmod +x ~/.vnc/xstartup -ENTRYPOINT bash -c "echo -e \"$VNC_PW\n$VNC_PW\n\" | kasmvncpasswd -w -u $VNC_USER $HOME/.kasmpasswd && vncserver :1 -interface 0.0.0.0 && vncserver -kill :1 && vncserver :1 -depth 24 -geometry 1280x1050 -websocketPort 8443 -cert /etc/ssl/certs/ssl-cert-snakeoil.pem -key /etc/ssl/private/ssl-cert-snakeoil.key -sslOnly -FrameRate=24 -interface 0.0.0.0 -httpd /usr/share/kasmvnc/www && tail -f $HOME/.vnc/*.log " +ENTRYPOINT bash -c "echo -e \"$VNC_PW\n$VNC_PW\n\" | kasmvncpasswd -w -u $VNC_USER $HOME/.kasmpasswd && kasmvncserver-start && tail -f $HOME/.vnc/*.log " diff --git a/builder/startup/deb/kasmvncserver-start b/builder/startup/deb/kasmvncserver-start new file mode 100755 index 0000000..64dab08 --- /dev/null +++ b/builder/startup/deb/kasmvncserver-start @@ -0,0 +1,22 @@ +#!/bin/bash + +set -e + +display=:1 +interface=0.0.0.0 +cert_group=ssl-cert + +if groups | grep -qvw ssl-cert; then + cat <<-EOF + Can't access TLS certificate. + Please add your user to $cert_group via 'addgroup ssl-cert' +EOF + exit 1 +fi + +vncserver $display -interface $interface +vncserver -kill $display +vncserver $display -depth 24 -geometry 1280x1050 -websocketPort 8443 \ + -cert /etc/ssl/certs/ssl-cert-snakeoil.pem \ + -key /etc/ssl/private/ssl-cert-snakeoil.key -sslOnly -FrameRate=24 \ + -interface $interface -httpd /usr/share/kasmvnc/www