Use snakeoil certificate if available

This commit is contained in:
Dmitry Maksyoma 2021-01-20 23:56:50 +13:00
parent c32137fa17
commit a479b2fcd4
3 changed files with 6 additions and 7 deletions

View File

@ -47,7 +47,7 @@ RUN dpkg -i /tmp/*.deb; apt-get -yf install
### END CUSTOM STUFF ### ### END CUSTOM STUFF ###
RUN chown -R 1000:0 $HOME RUN chown -R 1000:0 $HOME
USER 1000:kasmvnc USER 1000:ssl-cert
WORKDIR $HOME WORKDIR $HOME
ENTRYPOINT [ "/dockerstartup/vnc_startup.sh" ] ENTRYPOINT [ "/dockerstartup/vnc_startup.sh" ]

View File

@ -47,7 +47,7 @@ RUN dpkg -i /tmp/*.deb; apt-get -yf install
### END CUSTOM STUFF ### ### END CUSTOM STUFF ###
RUN chown -R 1000:0 $HOME RUN chown -R 1000:0 $HOME
USER 1000:kasmvnc USER 1000:ssl-cert
WORKDIR $HOME WORKDIR $HOME
ENTRYPOINT [ "/dockerstartup/vnc_startup.sh" ] ENTRYPOINT [ "/dockerstartup/vnc_startup.sh" ]

View File

@ -21,16 +21,15 @@ detect_www_dir() {
detect_cert_location() { detect_cert_location() {
local tarball_cert="$HOME/.vnc/self.pem" local tarball_cert="$HOME/.vnc/self.pem"
local package_cert="/etc/kasmvnc/server.pem" local package_cert="/etc/ssl/certs/ssl-cert-snakeoil.pem"
local package_key="/etc/ssl/private/ssl-cert-snakeoil.key"
local use_cert= local use_cert=
if [[ -f "$package_cert" ]]; then if [[ -f "$package_cert" ]]; then
use_cert="$package_cert" cert_option="-cert $package_cert -key $package_key"
else else
use_cert="$tarball_cert" cert_option="-cert $tarball_cert"
fi fi
cert_option="-cert $use_cert"
} }
## resolve_vnc_connection ## resolve_vnc_connection