8000 kasm VNC by matifali · Pull Request #250 · coder/modules · GitHub
[go: up one dir, main page]

Skip to content
This repository was archived by the owner on May 15, 2025. It is now read-only.

kasm VNC #250

Merged
merged 48 commits into from
Oct 17, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
9b9dd76
wip
matifali Sep 21, 2023
f68b31b
add kasmVNC
matifali Sep 21, 2023
aabf35c
TODO
matifali Sep 21, 2023
dec64c7
fixup!
matifali Sep 21, 2023
bf90b16
update tags
matifali Sep 21, 2023
92794a2
Delete .icons/kasm.png
matifali Sep 22, 2023
d44bd60
Update README.md
matifali Sep 22, 2023
1ac4840
Update main.tf
matifali Sep 22, 2023
805f692
merge `main`
matifali May 17, 2024
0fa43a7
`bun fmt`
matifali May 17, 2024
048cffb
bump version and fix typo
matifali May 17, 2024
2318f31
update KasmVNC version to 1.0.15 in README.md files
matifali May 17, 2024
6009778
rename version to kasm_version
matifali May 17, 2024
3333d3a
improve compatibility and cleanup
matifali May 17, 2024
d6e6cb3
update README.md
matifali May 17, 2024
b308ea5
fixup!
matifali May 17, 2024
41ef969
fixup!
matifali May 17, 2024
6698cb8
Install libdatetime-perl
matifali May 17, 2024
c8cdc95
fixup!
matifali May 17, 2024
c8db45e
fixup!
matifali May 17, 2024
a6c449e
add healtcheck
matifali May 17, 2024
b697e72
Merge branch 'main' into kasmVNC
matifali May 17, 2024
d5b49c2
Merge branch 'main' into kasmVNC
matifali May 21, 2024
f00f8de
chore: Update KasmVNC to use XFCE desktop environment
matifali May 30, 2024
a76095f
Merge branch 'main' into kasmVNC
matifali May 30, 2024
a254fd3
remove options
matifali May 30, 2024
71a2e6c
add wait for script
matifali May 30, 2024
39bc745
fixup!
matifali May 30, 2024
c2698be
fixup!
matifali May 30, 2024
d61f14d
fixup!
matifali May 30, 2024
12e4d35
`bun fmt`
matifali May 30, 2024
eda0e5d
Merge branch 'main' into kasmVNC
matifali Jun 21, 2024
de525a3
Merge branch 'main' into kasmVNC
matifali Sep 20, 2024
6017b05
Refactor KasmVNC installation script logic
matifali Sep 20, 2024
2ee02a3
fix: remove duplicate validation value
Parkreiner Sep 20, 2024
59041b3
chore: get basic tests in place
Parkreiner Sep 20, 2024
3ce7ef5
fix: update test text for more clarity
Parkreiner Sep 20, 2024
382c76b
Merge branch 'main' into kasmVNC
matifali Sep 30, 2024
c10a2ba
Bump KasmVNC module version to 1.0.20
matifali Sep 30, 2024
cf3159c
Update README.md
matifali Oct 2, 2024
c6895b5
Update KasmVNC to version 1.3.2 and add support
matifali Oct 4, 2024
4020ec0
Refine architecture mapping for specific distros
matifali Oct 4, 2024
f4cdb15
fix(kasmvnc): correct .deb file installation path
matifali Oct 4, 2024
18570aa
Improve Debian package installation command
matifali Oct 4, 2024
a63c365
Fix RPM installation path in kasmvnc script
matifali Oct 4, 2024
43a353c
Update README.md
matifali Oct 17, 2024
05135af
Merge branch 'main' into kasmVNC
matifali Oct 17, 2024
457621c
update version
matifali Oct 17, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
wip
  • Loading branch information
matifali committed Sep 21, 2023
commit 9b9dd76e1e3a4f9aa6c0b4f575a0564bd82c6c16
82 changes: 82 additions & 0 deletions kasmvnc/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
terraform {
required_version = ">= 1.0"

required_providers {
coder = {
source = "coder/coder"
version = ">= 0.12"
}
}
}

variable "agent_id" {
type = string
description = "The ID of a Coder agent."
}

variable "extensions" {
type = list(string)
description = "A list of extensions to install."
default = []
}

variable "port" {
type = number
description = "The port to run code-server on."
default = 13337
}

variable "settings" {
type = map(string)
description = "A map of settings to apply to code-server."
default = {}
}

variable "folder" {
type = string
description = "The folder to open in code-server."
default = ""
}

variable "install_prefix" {
type = string
description = "The prefix to install code-server to."
default = "/tmp/code-server"
}

variable "log_path" {
type = string
description = "The path to log code-server to."
default = "/tmp/code-server.log"
}

resource "coder_script" "code-server" {
agent_id = var.agent_id
display_name = "code-server"
icon = "/icon/code.svg"
script = templatefile("${path.module}/run.sh", {
EXTENSIONS : join(",", var.extensions),
PORT : var.port,
LOG_PATH : var.log_path,
INSTALL_PREFIX : var.install_prefix,
// This is necessary otherwise the quotes are stripped!
SETTINGS : replace(jsonencode(var.settings), "\"", "\\\""),
})
run_on_start = true
}

resource "coder_app" "kasm_vnc" {
agent_id = var.agent_id
slug = "kasm-vnc"
display_name = "kasmVNC"
url = "http://localhost:${var.port}"
icon = "/icon/vnc.svg"
subdomain = false
share = "owner"

healthcheck {
url = "http://localhost:${var.port}/healthz"
interval = 5
threshold = 6
}
}
38 changes: 38 additions & 0 deletions kasmvnc/run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/usr/bin/env bash

# Check if LXDE is installed
if ! dpkg -s lxde &>/dev/null; then
sudo apt-get update
DEBIAN_FRONTEND=noninteractive sudo apt-get install -y lxde
else
echo "LXDE is already installed."
fi

# Check if vncserver is installed
if ! dpkg -s kasmvncserver &>/dev/null; then
cd /tmp
wget https://github.com/kasmtech/KasmVNC/releases/download/v1.1.0/kasmvncserver_focal_1.1.0_amd64.deb
sudo apt install -y ./kasmvncserver_focal_1.1.0_amd64.deb
else
echo "VNC Server is already installed."
fi

sudo addgroup $USER ssl-cert

# Coder port-forwarding from dashboard only supports HTTP
sudo bash -c 'cat > /etc/kasmvnc/kasmvnc.yaml <<EOF
network:
protocol: http
ssl:
require_ssl: false
udp:
public_ip: 127.0.0.1
EOF'

# This password is not used since we start the server without auth.
# The server is protected via the Coder session token / tunnel
# and does not listen publicly on the VM
echo -e "password\npassword\n" | vncpasswd -wo -u $USER

# Start the server :)
sudo su -u $USER bash -c 'vncserver -select-de "lxde" -disableBasicAuth'
0