Skip to content

Commit

Permalink
Change KasmVNC
Browse files Browse the repository at this point in the history
  • Loading branch information
ehfd authored Jun 24, 2024
1 parent 4d205dc commit 76cbd0a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ RUN apt-get clean && apt-get update && apt-get dist-upgrade -y && apt-get instal
usermod -a -G adm,audio,cdrom,dialout,dip,fax,floppy,games,input,lp,plugdev,render,ssl-cert,sudo,tape,tty,video,voice ubuntu && \
echo "ubuntu ALL=(ALL:ALL) NOPASSWD: ALL" >> /etc/sudoers && \
echo "ubuntu:${PASSWD}" | chpasswd && \
chown -R -f --no-preserve-root ubuntu:ubuntu / || echo 'Failed to set filesystem ownership to ubuntu user'
chown -R -f --no-preserve-root ubuntu:ubuntu / || echo 'Failed to set filesystem ownership in some paths to ubuntu user'

# Set locales
ENV LANG="en_US.UTF-8"
Expand Down Expand Up @@ -584,9 +584,9 @@ SHELL ["/bin/sh", "-c"]

USER 0
# Enable sudo through sudo-root with uid 0
RUN if [ -d "/usr/libexec/sudo" ]; then SUDO_LIB="/usr/libexec/sudo"; else SUDO_LIB="/usr/lib/sudo"; fi && \
RUN if [ -d /usr/libexec/sudo ]; then SUDO_LIB="/usr/libexec/sudo"; else SUDO_LIB="/usr/lib/sudo"; fi && \
chown -R -f --no-preserve-root root:root /usr/bin/sudo-root /etc/sudo.conf /etc/sudoers /etc/sudoers.d /etc/sudo_logsrvd.conf "${SUDO_LIB}" || echo 'Failed to provide root permissions to sudo' && \
chmod -f 4755 /usr/bin/sudo-root || echo 'Failed to set chmod to sudo-root'
chmod -f 4755 /usr/bin/sudo-root || echo 'Failed to set chmod in some paths with sudo-root'
USER 1000

ENV PIPEWIRE_LATENCY="32/48000"
Expand Down
2 changes: 1 addition & 1 deletion entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ echo 'Waiting for X Socket' && until [ -S "/tmp/.X11-unix/X${DISPLAY#*:}" ]; do
if [ "${KASMVNC_ENABLE,,}" = "true" ]; then
export KASM_DISPLAY=":50"
yq -i '
.command_line.prompt = false |
.desktop.allow_resize = '${SELKIES_ENABLE_RESIZE,,:-false}' |
.logging.log_dest = /tmp/kasmvnc.log
.network.ssl.require_ssl = '${SELKIES_ENABLE_HTTPS,,:-false}' |
Expand All @@ -158,7 +159,6 @@ if [ "${KASMVNC_ENABLE,,}" = "true" ]; then
(echo "${SELKIES_BASIC_AUTH_PASSWORD:-${PASSWD}}"; echo "${SELKIES_BASIC_AUTH_PASSWORD:-${PASSWD}}";) | kasmvncpasswd -u "${SELKIES_BASIC_AUTH_USER:-${USER}}" -o "${XDG_RUNTIME_DIR}/.kasmpasswd"
if [ "${SELKIES_ENABLE_BASIC_AUTH,,}" = "false" ]; then export NO_KASM_AUTH_FLAG="-disableBasicAuth"; fi
if [ -n "$KASMVNC_VIEWPASS" ]; then (echo "${KASMVNC_VIEWPASS}"; echo "${KASMVNC_VIEWPASS}";) | kasmvncpasswd -u "view" "${XDG_RUNTIME_DIR}/.kasmpasswd"; fi
mkdir -pm700 ~/.vnc && touch ~/.vnc/.de-was-selected
kasmvncserver "${KASM_DISPLAY}" -websocketPort 8080 -geometry "${DISPLAY_SIZEW}x${DISPLAY_SIZEH}" -depth "${DISPLAY_CDEPTH}" -FrameRate "${DISPLAY_REFRESH}" -fg -noxstartup -AlwaysShared ${NO_KASM_AUTH_FLAG}
until [ -S "/tmp/.X11-unix/X${KASM_DISPLAY#*:}" ]; do sleep 0.5; done;
kasmxproxy -a "${DISPLAY}" -v "${KASM_DISPLAY}" -f "${DISPLAY_REFRESH}" ${KASM_RESIZE_FLAG} &
Expand Down

0 comments on commit 76cbd0a

Please sign in to comment.