Deb: provide an easy way to start KasmVNC with default options

...via kasmvncserver-start.
This commit is contained in:
Dmitry Maksyoma 2021-03-03 23:27:02 +13:00
parent e61885a448
commit 43658a27f7
2 changed files with 25 additions and 1 deletions

View File

@ -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 "

View File

@ -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 <user> 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