Deb: use /etc/kasmvnc/server.pem cert in builder/test-deb

This commit is contained in:
Dmitry Maksyoma 2021-01-14 23:15:17 +13:00
parent b8c380d17f
commit 1486f3f4c2
2 changed files with 18 additions and 2 deletions

View File

@ -31,6 +31,7 @@ WORKDIR $HOME
RUN apt-get update && apt-get install -y supervisor xfce4 xfce4-terminal xterm libnss-wrapper gettext libjpeg-dev wget
RUN apt-get purge -y pm-utils xscreensaver*
RUN apt-get update && apt-get install -y vim less
RUN echo 'source $STARTUPDIR/generate_container_user' >> $HOME/.bashrc
@ -45,7 +46,7 @@ RUN dpkg -i /tmp/*.deb; apt -yf install
### END CUSTOM STUFF ###
RUN chown -R 1000:0 $HOME
USER 1000
USER 1000:kasmvnc
WORKDIR $HOME
ENTRYPOINT [ "/dockerstartup/vnc_startup.sh" ]

View File

@ -19,6 +19,20 @@ detect_www_dir() {
fi
}
detect_cert_location() {
local tarball_cert="$HOME/.vnc/self.pem"
local package_cert="/etc/kasmvnc/server.pem"
local use_cert=
if [[ -f "$package_cert" ]]; then
use_cert="$package_cert"
else
use_cert="$tarball_cert"
fi
cert_option="-cert $use_cert"
}
## resolve_vnc_connection
VNC_IP=$(hostname -i)
@ -53,9 +67,10 @@ vncserver -kill $DISPLAY &> $HOME/.vnc/vnc_startup.log \
detect_www_dir
detect_cert_location
echo -e "start vncserver with param: VNC_COL_DEPTH=$VNC_COL_DEPTH, VNC_RESOLUTION=$VNC_RESOLUTION\n..."
vncserver $DISPLAY -depth $VNC_COL_DEPTH -geometry $VNC_RESOLUTION -FrameRate=$MAX_FRAME_RATE -websocketPort $VNC_PORT -cert $HOME/.vnc/self.pem -sslOnly -interface 0.0.0.0 $VNCOPTIONS $package_www_dir_option #&> $STARTUPDIR/no_vnc_startup.log
vncserver $DISPLAY -depth $VNC_COL_DEPTH -geometry $VNC_RESOLUTION -FrameRate=$MAX_FRAME_RATE -websocketPort $VNC_PORT $cert_option -sslOnly -interface 0.0.0.0 $VNCOPTIONS $package_www_dir_option #&> $STARTUPDIR/no_vnc_startup.log
PID_SUN=$!