From 7fd8673a63286d66bae80ba8e86c65e4157a487f Mon Sep 17 00:00:00 2001 From: chgl Date: Fri, 22 Aug 2025 15:02:28 +0200 Subject: [PATCH 1/8] refactor: refactored get_http_dir --- registry/coder/modules/kasmvnc/run.sh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/registry/coder/modules/kasmvnc/run.sh b/registry/coder/modules/kasmvnc/run.sh index 5223fb9f0..1ffefcc0e 100644 --- a/registry/coder/modules/kasmvnc/run.sh +++ b/registry/coder/modules/kasmvnc/run.sh @@ -230,19 +230,19 @@ get_http_dir() { # Check the system configuration path if [[ -e /etc/kasmvnc/kasmvnc.yaml ]]; then - d=($(grep -E "^\s*httpd_directory:.*$" /etc/kasmvnc/kasmvnc.yaml)) - # If this grep is successful, it will return: - # httpd_directory: /usr/share/kasmvnc/www - if [[ $${#d[@]} -eq 2 && -d "$${d[1]}" ]]; then - httpd_directory="$${d[1]}" + d=$(grep -E '^\s*httpd_directory:.*$' "/etc/kasmvnc/kasmvnc.yaml" | awk '{print $2}') + + if [[ -n "$httpd_directory" ]]; then + httpd_directory=$d fi fi # Check the home directory for overriding values if [[ -e "$HOME/.vnc/kasmvnc.yaml" ]]; then - d=($(grep -E "^\s*httpd_directory:.*$" "$HOME/.vnc/kasmvnc.yaml")) - if [[ $${#d[@]} -eq 2 && -d "$${d[1]}" ]]; then - httpd_directory="$${d[1]}" + d=$(grep -E '^\s*httpd_directory:.*$' "$HOME/.vnc/kasmvnc.yaml" | awk '{print $2}') + + if [[ -n "$httpd_directory" ]]; then + httpd_directory=$d fi fi echo $httpd_directory From ec8c6d1f61d6edf529bc39c18f19ff38be5c2bf0 Mon Sep 17 00:00:00 2001 From: chgl Date: Fri, 22 Aug 2025 15:19:47 +0200 Subject: [PATCH 2/8] version bump and variable fix --- registry/coder/modules/kasmvnc/README.md | 2 +- registry/coder/modules/kasmvnc/run.sh | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/registry/coder/modules/kasmvnc/README.md b/registry/coder/modules/kasmvnc/README.md index b9b16b269..9a9092038 100644 --- a/registry/coder/modules/kasmvnc/README.md +++ b/registry/coder/modules/kasmvnc/README.md @@ -14,7 +14,7 @@ Automatically install [KasmVNC](https://kasmweb.com/kasmvnc) in a workspace, and module "kasmvnc" { count = data.coder_workspace.me.start_count source = "registry.coder.com/coder/kasmvnc/coder" - version = "1.2.2" + version = "1.2.3" agent_id = coder_agent.example.id desktop_environment = "xfce" subdomain = true diff --git a/registry/coder/modules/kasmvnc/run.sh b/registry/coder/modules/kasmvnc/run.sh index 1ffefcc0e..83f0fb8fe 100644 --- a/registry/coder/modules/kasmvnc/run.sh +++ b/registry/coder/modules/kasmvnc/run.sh @@ -232,7 +232,7 @@ get_http_dir() { if [[ -e /etc/kasmvnc/kasmvnc.yaml ]]; then d=$(grep -E '^\s*httpd_directory:.*$' "/etc/kasmvnc/kasmvnc.yaml" | awk '{print $2}') - if [[ -n "$httpd_directory" ]]; then + if [[ -n "$d" ]]; then httpd_directory=$d fi fi @@ -241,7 +241,7 @@ get_http_dir() { if [[ -e "$HOME/.vnc/kasmvnc.yaml" ]]; then d=$(grep -E '^\s*httpd_directory:.*$' "$HOME/.vnc/kasmvnc.yaml" | awk '{print $2}') - if [[ -n "$httpd_directory" ]]; then + if [[ -n "$d" ]]; then httpd_directory=$d fi fi From 383ed223571f16c11dc3399dcea15b19c7f1ee92 Mon Sep 17 00:00:00 2001 From: chgl Date: Tue, 26 Aug 2025 19:31:01 +0200 Subject: [PATCH 3/8] check for directory existence Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- registry/coder/modules/kasmvnc/run.sh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/registry/coder/modules/kasmvnc/run.sh b/registry/coder/modules/kasmvnc/run.sh index 83f0fb8fe..52374b9a2 100644 --- a/registry/coder/modules/kasmvnc/run.sh +++ b/registry/coder/modules/kasmvnc/run.sh @@ -230,9 +230,7 @@ get_http_dir() { # Check the system configuration path if [[ -e /etc/kasmvnc/kasmvnc.yaml ]]; then - d=$(grep -E '^\s*httpd_directory:.*$' "/etc/kasmvnc/kasmvnc.yaml" | awk '{print $2}') - - if [[ -n "$d" ]]; then + if [[ -n "$d" && -d "$d" ]]; then httpd_directory=$d fi fi From 1e3a60e1f12d1f8f7753948978fa5e85310a07e7 Mon Sep 17 00:00:00 2001 From: chgl Date: Tue, 26 Aug 2025 19:31:11 +0200 Subject: [PATCH 4/8] check for directory existence Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- registry/coder/modules/kasmvnc/run.sh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/registry/coder/modules/kasmvnc/run.sh b/registry/coder/modules/kasmvnc/run.sh index 52374b9a2..81f150f9d 100644 --- a/registry/coder/modules/kasmvnc/run.sh +++ b/registry/coder/modules/kasmvnc/run.sh @@ -237,9 +237,7 @@ get_http_dir() { # Check the home directory for overriding values if [[ -e "$HOME/.vnc/kasmvnc.yaml" ]]; then - d=$(grep -E '^\s*httpd_directory:.*$' "$HOME/.vnc/kasmvnc.yaml" | awk '{print $2}') - - if [[ -n "$d" ]]; then + if [[ -n "$d" && -d "$d" ]]; then httpd_directory=$d fi fi From 569e21f20a58969e52eda3121159f01d14d9129f Mon Sep 17 00:00:00 2001 From: chgl Date: Tue, 26 Aug 2025 19:32:51 +0200 Subject: [PATCH 5/8] fix missing d --- registry/coder/modules/kasmvnc/run.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/registry/coder/modules/kasmvnc/run.sh b/registry/coder/modules/kasmvnc/run.sh index 81f150f9d..b7fc6fc1a 100644 --- a/registry/coder/modules/kasmvnc/run.sh +++ b/registry/coder/modules/kasmvnc/run.sh @@ -230,6 +230,7 @@ get_http_dir() { # Check the system configuration path if [[ -e /etc/kasmvnc/kasmvnc.yaml ]]; then + d=$(grep -E '^\s*httpd_directory:.*$' "/etc/kasmvnc/kasmvnc.yaml" | awk '{print $2}') if [[ -n "$d" && -d "$d" ]]; then httpd_directory=$d fi @@ -237,6 +238,7 @@ get_http_dir() { # Check the home directory for overriding values if [[ -e "$HOME/.vnc/kasmvnc.yaml" ]]; then + d=$(grep -E '^\s*httpd_directory:.*$' "$HOME/.vnc/kasmvnc.yaml" | awk '{print $2}') if [[ -n "$d" && -d "$d" ]]; then httpd_directory=$d fi From 19c5953b55989f3b54fdb3bb298778e3b52d5f00 Mon Sep 17 00:00:00 2001 From: DevelopmentCats Date: Tue, 30 Sep 2025 12:39:22 -0500 Subject: [PATCH 6/8] chore: bun run fmt --- registry/coder/modules/kasmvnc/run.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/registry/coder/modules/kasmvnc/run.sh b/registry/coder/modules/kasmvnc/run.sh index 170bda24f..a10286709 100644 --- a/registry/coder/modules/kasmvnc/run.sh +++ b/registry/coder/modules/kasmvnc/run.sh @@ -235,7 +235,7 @@ get_http_dir() { if [[ -e /etc/kasmvnc/kasmvnc.yaml ]]; then d=$(grep -E '^\s*httpd_directory:.*$' "/etc/kasmvnc/kasmvnc.yaml" | awk '{print $2}') if [[ -n "$d" && -d "$d" ]]; then - httpd_directory=$d + httpd_directory=$d fi fi @@ -243,7 +243,7 @@ get_http_dir() { if [[ -e "$HOME/.vnc/kasmvnc.yaml" ]]; then d=$(grep -E '^\s*httpd_directory:.*$' "$HOME/.vnc/kasmvnc.yaml" | awk '{print $2}') if [[ -n "$d" && -d "$d" ]]; then - httpd_directory=$d + httpd_directory=$d fi fi echo $httpd_directory From 74abeac101c150a224695cd05768aa7e22d87a1a Mon Sep 17 00:00:00 2001 From: DevelopmentCats Date: Tue, 30 Sep 2025 14:26:35 -0500 Subject: [PATCH 7/8] fix: escape awk field references for Terraform template processing The awk-based YAML parsing improvement needed proper escaping of field references as 2936092 so Terraform's templatefile() function processes them correctly. This resolves template syntax errors that were causing the DateTime.pm installation failures. --- registry/coder/modules/kasmvnc/run.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/registry/coder/modules/kasmvnc/run.sh b/registry/coder/modules/kasmvnc/run.sh index a10286709..f1fc5adf0 100644 --- a/registry/coder/modules/kasmvnc/run.sh +++ b/registry/coder/modules/kasmvnc/run.sh @@ -233,7 +233,7 @@ get_http_dir() { # Check the system configuration path if [[ -e /etc/kasmvnc/kasmvnc.yaml ]]; then - d=$(grep -E '^\s*httpd_directory:.*$' "/etc/kasmvnc/kasmvnc.yaml" | awk '{print $2}') + d=$(grep -E '^\s*httpd_directory:.*$' "/etc/kasmvnc/kasmvnc.yaml" | awk '{print $$2}') if [[ -n "$d" && -d "$d" ]]; then httpd_directory=$d fi @@ -241,7 +241,7 @@ get_http_dir() { # Check the home directory for overriding values if [[ -e "$HOME/.vnc/kasmvnc.yaml" ]]; then - d=$(grep -E '^\s*httpd_directory:.*$' "$HOME/.vnc/kasmvnc.yaml" | awk '{print $2}') + d=$(grep -E '^\s*httpd_directory:.*$' "$HOME/.vnc/kasmvnc.yaml" | awk '{print $$2}') if [[ -n "$d" && -d "$d" ]]; then httpd_directory=$d fi From a53b7d215cb50335138b4db681a74057b4405f44 Mon Sep 17 00:00:00 2001 From: DevelopmentCats Date: Wed, 1 Oct 2025 15:13:09 -0500 Subject: [PATCH 8/8] feat: install required Perl DateTime module in install_deb function for Ubuntu 24.04 bug --- registry/coder/modules/kasmvnc/run.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/registry/coder/modules/kasmvnc/run.sh b/registry/coder/modules/kasmvnc/run.sh index f1fc5adf0..04b8b9eed 100644 --- a/registry/coder/modules/kasmvnc/run.sh +++ b/registry/coder/modules/kasmvnc/run.sh @@ -60,6 +60,9 @@ install_deb() { sudo apt-get -o DPkg::Lock::Timeout=300 -qq update fi + echo "Installing required Perl DateTime module..." + DEBIAN_FRONTEND=noninteractive sudo apt-get -o DPkg::Lock::Timeout=300 install --yes -qq --no-install-recommends --no-install-suggests libdatetime-perl + DEBIAN_FRONTEND=noninteractive sudo apt-get -o DPkg::Lock::Timeout=300 install --yes -qq --no-install-recommends --no-install-suggests "$kasmdeb" rm "$kasmdeb" }