Skip to content

Commit a327e79

Browse files
authored
fix(kasmvnc): change installed check and bump default version (#505)
## Description This PR makes the following changes to the `coder/modules/kasmvnc`: - Change the installation check from checking `vncserver` to `kasmvncserver`. - Bump the default KasmVNC installation version to [1.4.0](https://docs.kasmvnc.com/docs/release_notes/1.4.0). In images where there is already TightVNC installed, the current installation check will erroneously report that KasmVNC is already installed. By checking `kasmvncserver` instead, it ensures KasmVNC is installed. Tested on Debian, Kali and Alpine-based images. ## Type of Change - [ ] New module - [ ] New template - [X] Bug fix - [ ] Feature/enhancement - [ ] Documentation - [ ] Other ## Module Information **Path:** `registry/coder/modules/kasmvnc` **New version:** `v1.2.5` **Breaking change:** [ ] Yes [X] No ## Testing & Validation - [X] Tests pass (`bun test`) - [X] Code formatted (`bun fmt`) - [X] Changes tested locally ## Related Issues None
1 parent bc39c2e commit a327e79

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

registry/coder/modules/kasmvnc/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Automatically install [KasmVNC](https://kasmweb.com/kasmvnc) in a workspace, and
1414
module "kasmvnc" {
1515
count = data.coder_workspace.me.start_count
1616
source = "registry.coder.com/coder/kasmvnc/coder"
17-
version = "1.2.4"
17+
version = "1.2.5"
1818
agent_id = coder_agent.example.id
1919
desktop_environment = "xfce"
2020
subdomain = true

registry/coder/modules/kasmvnc/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ variable "port" {
2323
variable "kasm_version" {
2424
type = string
2525
description = "Version of KasmVNC to install."
26-
default = "1.3.2"
26+
default = "1.4.0"
2727
}
2828

2929
variable "desktop_environment" {

registry/coder/modules/kasmvnc/run.sh

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ error() {
88
exit 1
99
}
1010

11-
# Function to check if vncserver is already installed
11+
# Function to check if KasmVNC is already installed
1212
check_installed() {
13-
if command -v vncserver &> /dev/null; then
14-
echo "vncserver is already installed."
13+
if command -v kasmvncserver &> /dev/null; then
14+
echo "KasmVNC is already installed."
1515
return 0 # Don't exit, just indicate it's installed
1616
else
1717
return 1 # Indicates not installed
@@ -158,7 +158,7 @@ case "$arch" in
158158
;;
159159
esac
160160

161-
# Check if vncserver is installed, and install if not
161+
# Check if KasmVNC is installed, and install if not
162162
if ! check_installed; then
163163
# Check for NOPASSWD sudo (required)
164164
if ! command -v sudo &> /dev/null || ! sudo -n true 2> /dev/null; then
@@ -188,7 +188,7 @@ if ! check_installed; then
188188
;;
189189
esac
190190
else
191-
echo "vncserver already installed. Skipping installation."
191+
echo "KasmVNC already installed. Skipping installation."
192192
fi
193193

194194
if command -v sudo &> /dev/null && sudo -n true 2> /dev/null; then
@@ -227,7 +227,7 @@ EOF
227227
# This password is not used since we start the server without auth.
228228
# The server is protected via the Coder session token / tunnel
229229
# and does not listen publicly
230-
echo -e "password\npassword\n" | vncpasswd -wo -u "$USER"
230+
echo -e "password\npassword\n" | kasmvncpasswd -wo -u "$USER"
231231

232232
get_http_dir() {
233233
# determine the served file path
@@ -290,7 +290,7 @@ VNC_LOG="/tmp/kasmvncserver.log"
290290
printf "🚀 Starting KasmVNC server...\n"
291291

292292
set +e
293-
vncserver -select-de "${DESKTOP_ENVIRONMENT}" -disableBasicAuth > "$VNC_LOG" 2>&1
293+
kasmvncserver -select-de "${DESKTOP_ENVIRONMENT}" -disableBasicAuth > "$VNC_LOG" 2>&1
294294
RETVAL=$?
295295
set -e
296296

0 commit comments

Comments
 (0)