Compare commits

..

7 Commits

Author SHA1 Message Date
Muhammad Atif Ali
92097e398d Update KasmVNC user group and config settings
- Use `usermod` to add user to ssl-cert group for compatibility.
- Simplify KasmVNC config with protocol and SSL parameters.
- Ensure UDP communication is confined to localhost for security.
2024-10-24 19:49:11 +05:00
Muhammad Atif Ali
e4a57f4a6a Update KasmVNC with custom image config steps
Add instructions for extending kasmtech custom images and modify the
run script to attempt system-wide config creation, ensuring flexibility
for environments without sudo access.
2024-10-24 12:58:20 +05:00
Muhammad Atif Ali
66b0bf6d27 Fix user group command in KasmVNC installation script 2024-10-24 12:00:48 +05:00
Muhammad Atif Ali
f6ebe73aea Simplify VNC server installation and config setup
- Streamlined the installation script's messaging for clarity.
- Added default SSL certificate path in the config.
2024-10-24 10:20:07 +05:00
Muhammad Atif Ali
2e0f3eddc0 Simplify config file creation in kasmvnc script 2024-10-23 21:18:56 +05:00
Muhammad Atif Ali
f63b460971 Enhance kasmvnc to simplify user permissions management 2024-10-23 21:07:33 +05:00
Muhammad Atif Ali
df507ca559 feat(kasmvnc): support images without sudo access
- Allow KasmVNC to be installed and run on systems where `sudo` is not available.
- Automatically adjust config file location and server start method based on `sudo` availability.
- Enhance portability for broader usage across various environments.
2024-10-23 20:12:08 +05:00
17 changed files with 144 additions and 274 deletions

View File

@@ -14,7 +14,7 @@ A file browser for your workspace.
```tf
module "filebrowser" {
source = "registry.coder.com/modules/filebrowser/coder"
version = "1.0.23"
version = "1.0.22"
agent_id = coder_agent.example.id
}
```
@@ -28,7 +28,7 @@ module "filebrowser" {
```tf
module "filebrowser" {
source = "registry.coder.com/modules/filebrowser/coder"
version = "1.0.23"
version = "1.0.22"
agent_id = coder_agent.example.id
folder = "/home/coder/project"
}
@@ -39,29 +39,17 @@ module "filebrowser" {
```tf
module "filebrowser" {
source = "registry.coder.com/modules/filebrowser/coder"
version = "1.0.23"
version = "1.0.22"
agent_id = coder_agent.example.id
database_path = ".config/filebrowser.db"
}
```
### Serve on a subpath (no wildcard subdomain)
```tf
module "filebrowser" {
source = "registry.coder.com/modules/filebrowser/coder"
version = "1.0.23"
agent_id = coder_agent.example.id
subdomain = false
}
```
### Serve on a subpath with a specific agent name (multiple agents)
### Serve from the same domain (no subdomain)
```tf
module "filebrowser" {
source = "registry.coder.com/modules/filebrowser/coder"
version = "1.0.23"
agent_id = coder_agent.example.id
agent_name = "main"
subdomain = false

View File

@@ -20,8 +20,13 @@ data "coder_workspace_owner" "me" {}
variable "agent_name" {
type = string
description = "The name of the coder_agent resource. (Only required if subdomain is false and the template uses multiple agents.)"
default = null
description = "The name of the main deployment. (Used to build the subpath for coder_app.)"
default = ""
validation {
# If subdomain is false, then agent_name must be set.
condition = var.subdomain || var.agent_name != ""
error_message = "The agent_name must be set."
}
}
variable "database_path" {
@@ -68,12 +73,6 @@ variable "order" {
default = null
}
variable "slug" {
type = string
description = "The slug of the coder_app resource."
default = "filebrowser"
}
variable "subdomain" {
type = bool
description = <<-EOT
@@ -86,7 +85,7 @@ variable "subdomain" {
resource "coder_script" "filebrowser" {
agent_id = var.agent_id
display_name = "File Browser"
icon = "/icon/filebrowser.svg"
icon = "https://raw.githubusercontent.com/filebrowser/logo/master/icon_raw.svg"
script = templatefile("${path.module}/run.sh", {
LOG_PATH : var.log_path,
PORT : var.port,
@@ -94,30 +93,18 @@ resource "coder_script" "filebrowser" {
LOG_PATH : var.log_path,
DB_PATH : var.database_path,
SUBDOMAIN : var.subdomain,
SERVER_BASE_PATH : local.server_base_path
SERVER_BASE_PATH : var.subdomain ? "" : format("/@%s/%s.%s/apps/filebrowser", data.coder_workspace_owner.me.name, data.coder_workspace.me.name, var.agent_name),
})
run_on_start = true
}
resource "coder_app" "filebrowser" {
agent_id = var.agent_id
slug = var.slug
slug = "filebrowser"
display_name = "File Browser"
url = local.url
icon = "/icon/filebrowser.svg"
url = "http://localhost:${var.port}"
icon = "https://raw.githubusercontent.com/filebrowser/logo/master/icon_raw.svg"
subdomain = var.subdomain
share = var.share
order = var.order
healthcheck {
url = local.healthcheck_url
interval = 5
threshold = 6
}
}
locals {
server_base_path = var.subdomain ? "" : format("/@%s/%s%s/apps/%s", data.coder_workspace_owner.me.name, data.coder_workspace.me.name, var.agent_name != null ? ".${var.agent_name}" : "", var.slug)
url = "http://localhost:${var.port}${local.server_base_path}"
healthcheck_url = "http://localhost:${var.port}${local.server_base_path}/health"
}

View File

@@ -14,7 +14,7 @@ This module adds a JetBrains Gateway Button to open any workspace with a single
```tf
module "jetbrains_gateway" {
source = "registry.coder.com/modules/jetbrains-gateway/coder"
version = "1.0.23"
version = "1.0.21"
agent_id = coder_agent.example.id
agent_name = "example"
folder = "/home/coder/example"
@@ -32,7 +32,7 @@ module "jetbrains_gateway" {
```tf
module "jetbrains_gateway" {
source = "registry.coder.com/modules/jetbrains-gateway/coder"
version = "1.0.23"
version = "1.0.21"
agent_id = coder_agent.example.id
agent_name = "example"
folder = "/home/coder/example"
@@ -46,7 +46,7 @@ module "jetbrains_gateway" {
```tf
module "jetbrains_gateway" {
source = "registry.coder.com/modules/jetbrains-gateway/coder"
version = "1.0.23"
version = "1.0.21"
agent_id = coder_agent.example.id
agent_name = "example"
folder = "/home/coder/example"
@@ -61,7 +61,7 @@ module "jetbrains_gateway" {
```tf
module "jetbrains_gateway" {
source = "registry.coder.com/modules/jetbrains-gateway/coder"
version = "1.0.23"
version = "1.0.21"
agent_id = coder_agent.example.id
agent_name = "example"
folder = "/home/coder/example"

View File

@@ -20,13 +20,13 @@ variable "agent_id" {
variable "slug" {
type = string
description = "The slug for the coder_app resource."
description = "The slug for the coder_app. Allows resuing the module with the same template."
default = "gateway"
}
variable "agent_name" {
type = string
description = "The name of the coder_agent resource."
description = "Agent name."
}
variable "folder" {
@@ -258,18 +258,26 @@ resource "coder_app" "gateway" {
icon = local.icon
external = true
order = var.order
url = format(
"jetbrains-gateway://connect#type=coder&workspace=%s&owner=%s&agent=%s&folder=%s&url=%s&token=%s&ide_product_code=%s&ide_build_number=%s&ide_download_link=%s",
url = join("", [
"jetbrains-gateway://connect#type=coder&workspace=",
data.coder_workspace.me.name,
"&owner=",
data.coder_workspace_owner.me.name,
"&agent=",
var.agent_name,
"&folder=",
var.folder,
"&url=",
data.coder_workspace.me.access_url,
"&token=",
"$SESSION_TOKEN",
"&ide_product_code=",
data.coder_parameter.jetbrains_ide.value,
"&ide_build_number=",
local.build_number,
local.download_link
)
"&ide_download_link=",
local.download_link,
])
}
output "identifier" {

View File

@@ -11,36 +11,12 @@ tags: [jupyter, helper, ide, web]
A module that adds Jupyter Notebook in your Coder template.
![Jupyter Notebook](../.images/jupyter-notebook.png)
```tf
module "jupyter-notebook" {
source = "registry.coder.com/modules/jupyter-notebook/coder"
version = "1.0.23"
version = "1.0.19"
agent_id = coder_agent.example.id
}
```
![Jupyter Notebook](../.images/jupyter-notebook.png)
## Examples
### Serve on a subpath (no wildcard subdomain)
```tf
module "jupyter-notebook" {
source = "registry.coder.com/modules/jupyter-notebook/coder"
version = "1.0.23"
agent_id = coder_agent.example.id
subdomain = false
}
```
### Serve on a subpath with a specific agent name (multiple agents)
```tf
module "jupyter-notebook" {
source = "registry.coder.com/modules/jupyter-notebook/coder"
version = "1.0.23"
agent_id = coder_agent.example.id
agent_name = "main"
}
```

View File

@@ -42,30 +42,9 @@ variable "order" {
default = null
}
variable "agent_name" {
type = string
description = "The name of the coder_agent resource. (Only required if subdomain is false and the template uses multiple agents.)"
default = null
}
variable "slug" {
type = string
description = "The slug of the coder_app resource."
default = "jupyter-notebook"
}
variable "subdomain" {
type = bool
description = <<-EOT
Determines whether the app will be accessed via it's own subdomain or whether it will be accessed via a path on Coder.
If wildcards have not been setup by the administrator then apps with "subdomain" set to true will not be accessible.
EOT
default = true
}
resource "coder_script" "jupyter-notebook" {
agent_id = var.agent_id
display_name = "Jupyter Notebook"
display_name = "jupyter-notebook"
icon = "/icon/jupyter.svg"
script = templatefile("${path.module}/run.sh", {
LOG_PATH : var.log_path,
@@ -76,26 +55,11 @@ resource "coder_script" "jupyter-notebook" {
resource "coder_app" "jupyter-notebook" {
agent_id = var.agent_id
slug = var.slug
slug = "jupyter-notebook"
display_name = "Jupyter Notebook"
url = local.url
url = "http://localhost:${var.port}"
icon = "/icon/jupyter.svg"
subdomain = true
share = var.share
order = var.order
healthcheck {
url = local.healthcheck_url
interval = 5
threshold = 6
}
}
data "coder_workspace_owner" "me" {}
data "coder_workspace" "me" {}
locals {
server_base_path = var.subdomain ? "" : format("/@%s/%s%s/apps/%s", data.coder_workspace_owner.me.name, data.coder_workspace.me.name, var.agent_name != null ? ".${var.agent_name}" : "", var.slug)
url = "http://localhost:${var.port}${local.server_base_path}"
healthcheck_url = "http://localhost:${var.port}${local.server_base_path}/api"
}

View File

@@ -11,36 +11,12 @@ tags: [jupyter, helper, ide, web]
A module that adds JupyterLab in your Coder template.
![JupyterLab](../.images/jupyterlab.png)
```tf
module "jupyterlab" {
source = "registry.coder.com/modules/jupyterlab/coder"
version = "1.0.23"
version = "1.0.22"
agent_id = coder_agent.example.id
}
```
![JupyterLab](../.images/jupyterlab.png)
## Examples
### Serve on a subpath (no wildcard subdomain)
```tf
module "jupyterlab" {
source = "registry.coder.com/modules/jupyterlab/coder"
version = "1.0.23"
agent_id = coder_agent.example.id
subdomain = false
}
```
### Serve on a subpath with a specific agent name (multiple agents)
```tf
module "jupyterlab" {
source = "registry.coder.com/modules/jupyterlab/coder"
version = "1.0.23"
agent_id = coder_agent.example.id
agent_name = "main"
}
```

View File

@@ -41,10 +41,7 @@ variable "share" {
variable "subdomain" {
type = bool
description = <<-EOT
Determines whether the app will be accessed via it's own subdomain or whether it will be accessed via a path on Coder.
If wildcards have not been setup by the administrator then apps with "subdomain" set to true will not be accessible.
EOT
description = "Determines whether JupyterLab will be accessed via its own subdomain or whether it will be accessed via a path on Coder."
default = true
}
@@ -54,18 +51,6 @@ variable "order" {
default = null
}
variable "agent_name" {
type = string
description = "The name of the coder_agent resource. (Only required if subdomain is false and the template uses multiple agents.)"
default = null
}
variable "slug" {
type = string
description = "The slug of the coder_app resource."
default = "jupyterlab"
}
resource "coder_script" "jupyterlab" {
agent_id = var.agent_id
display_name = "jupyterlab"
@@ -73,24 +58,18 @@ resource "coder_script" "jupyterlab" {
script = templatefile("${path.module}/run.sh", {
LOG_PATH : var.log_path,
PORT : var.port
BASE_URL : local.server_base_path
BASE_URL : var.subdomain ? "" : "/@${data.coder_workspace_owner.me.name}/${data.coder_workspace.me.name}/apps/jupyterlab"
})
run_on_start = true
}
resource "coder_app" "jupyterlab" {
agent_id = var.agent_id
slug = var.slug
slug = "jupyterlab" # sync with the usage in URL
display_name = "JupyterLab"
url = local.url
url = var.subdomain ? "http://localhost:${var.port}" : "http://localhost:${var.port}/@${data.coder_workspace_owner.me.name}/${data.coder_workspace.me.name}/apps/jupyterlab"
icon = "/icon/jupyter.svg"
subdomain = var.subdomain
share = var.share
order = var.order
}
locals {
server_base_path = var.subdomain ? "" : format("/@%s/%s%s/apps/%s", data.coder_workspace_owner.me.name, data.coder_workspace.me.name, var.agent_name != null ? ".${var.agent_name}" : "", var.slug)
url = "http://localhost:${var.port}${local.server_base_path}"
healthcheck_url = "http://localhost:${var.port}${local.server_base_path}/api"
}

View File

@@ -14,10 +14,29 @@ Automatically install [KasmVNC](https://kasmweb.com/kasmvnc) in a workspace, and
```tf
module "kasmvnc" {
source = "registry.coder.com/modules/kasmvnc/coder"
version = "1.0.22"
version = "1.0.23"
agent_id = coder_agent.example.id
desktop_environment = "xfce"
}
```
> **Note:** This module only works on workspaces with a pre-installed desktop environment. As an example base image you can use `codercom/enterprise-desktop` image.
> **Note:** You can also use the kasmtech [custom images](https://kasmweb.com/docs/latest/guide/custom_images.html) by extending them as following:
```Dockerfile
FROM kasmweb/postman:1.16.0
ARG USER=kasm-user
USER root
# Overwrite the existing config file to disable ssl
RUN cat <<EOF > /etc/kasmvnc/kasmvnc.yaml
network:
protocol: http
ssl:
require_ssl: false
udp:
public_ip: 127.0.0.1
EOF
RUN addgroup $USER ssl-cert
USER $USER
```

View File

@@ -5,7 +5,7 @@
# Function to check if vncserver is already installed
check_installed() {
if command -v vncserver &> /dev/null; then
echo "vncserver is already installed."
echo "A binary with name vncserver already installed."
return 0 # Don't exit, just indicate it's installed
else
return 1 # Indicates not installed
@@ -34,7 +34,7 @@ install_deb() {
download_file $url /tmp/kasmvncserver.deb
sudo apt-get update
DEBIAN_FRONTEND=noninteractive sudo apt-get install --yes -qq --no-install-recommends --no-install-suggests /tmp/kasmvncserver.deb
sudo adduser $USER ssl-cert
sudo usermod -aG ssl-cert $USER
rm /tmp/kasmvncserver.deb
}
@@ -75,35 +75,35 @@ install_alpine() {
rm /tmp/kasmvncserver.tgz
}
# Detect system information
distro=$(grep "^ID=" /etc/os-release | awk -F= '{print $2}')
version=$(grep "^VERSION_ID=" /etc/os-release | awk -F= '{print $2}' | tr -d '"')
arch=$(uname -m)
echo "Detected Distribution: $distro"
echo "Detected Version: $version"
echo "Detected Architecture: $arch"
# Map arch to package arch
if [[ "$arch" == "x86_64" ]]; then
if [[ "$distro" == "ubuntu" || "$distro" == "debian" || "$distro" == "kali" ]]; then
arch="amd64"
else
arch="x86_64"
fi
elif [[ "$arch" == "aarch64" || "$arch" == "arm64" ]]; then
if [[ "$distro" == "ubuntu" || "$distro" == "debian" || "$distro" == "kali" ]]; then
arch="arm64"
else
arch="aarch64"
fi
else
echo "Unsupported architecture: $arch"
exit 1
fi
# Check if vncserver is installed, and install if not
if ! check_installed; then
# Detect system information
distro=$(grep "^ID=" /etc/os-release | awk -F= '{print $2}')
version=$(grep "^VERSION_ID=" /etc/os-release | awk -F= '{print $2}' | tr -d '"')
arch=$(uname -m)
echo "Detected Distribution: $distro"
echo "Detected Version: $version"
echo "Detected Architecture: $arch"
# Map arch to package arch
if [[ "$arch" == "x86_64" ]]; then
if [[ "$distro" == "ubuntu" || "$distro" == "debian" || "$distro" == "kali" ]]; then
arch="amd64"
else
arch="x86_64"
fi
elif [[ "$arch" == "aarch64" || "$arch" == "arm64" ]]; then
if [[ "$distro" == "ubuntu" || "$distro" == "debian" || "$distro" == "kali" ]]; then
arch="arm64"
else
arch="aarch64"
fi
else
echo "Unsupported architecture: $arch"
exit 1
fi
echo "Installing KASM version: ${VERSION}"
case $distro in
ubuntu | debian | kali)
@@ -155,10 +155,12 @@ if ! check_installed; then
;;
esac
else
echo "vncserver already installed. Skipping installation."
echo "Skipping installation."
fi
# Coder port-forwarding from dashboard only supports HTTP
# Try to create /etc/kasmvnc/kasmvnc.yaml system-wide
# we don't fail as some images might be missing sudo permissions
sudo mkdir -p /etc/kasmvnc || true
sudo bash -c "cat > /etc/kasmvnc/kasmvnc.yaml <<EOF
network:
protocol: http
@@ -167,7 +169,22 @@ network:
require_ssl: false
udp:
public_ip: 127.0.0.1
EOF"
EOF" || true
# There could already be a config file in the image at /etc/kasmvnc/kasmvnc.yaml, but we need to set the websocket port
mkdir -p "$HOME/.vnc"
cat > "$HOME/.vnc/kasmvnc.yaml" <<EOF
network:
protocol: http
websocket_port: ${PORT}
ssl:
require_ssl: false
pem_certificate:
pem_key:
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
@@ -176,4 +193,4 @@ echo -e "password\npassword\n" | vncpasswd -wo -u $USER
# Start the server
printf "🚀 Starting KasmVNC server...\n"
sudo -u $USER bash -c "vncserver -select-de ${DESKTOP_ENVIRONMENT} -disableBasicAuth" > /tmp/kasmvncserver.log 2>&1 &
vncserver -select-de ${DESKTOP_ENVIRONMENT} -disableBasicAuth > /tmp/kasmvncserver.log 2>&1 &

View File

@@ -16,7 +16,7 @@ Uses the [Coder Remote VS Code Extension](https://github.com/coder/vscode-coder)
```tf
module "vscode" {
source = "registry.coder.com/modules/vscode-desktop/coder"
version = "1.0.23"
version = "1.0.15"
agent_id = coder_agent.example.id
}
```
@@ -28,7 +28,7 @@ module "vscode" {
```tf
module "vscode" {
source = "registry.coder.com/modules/vscode-desktop/coder"
version = "1.0.23"
version = "1.0.15"
agent_id = coder_agent.example.id
folder = "/home/coder/project"
}

View File

@@ -20,12 +20,6 @@ variable "folder" {
default = ""
}
variable "slug" {
type = string
description = "The slug of the coder_app resource."
default = "vscode-desktop"
}
variable "open_recent" {
type = bool
description = "Open the most recent workspace or folder. Falls back to the folder if there is no recent workspace or folder to open."
@@ -45,17 +39,21 @@ resource "coder_app" "vscode" {
agent_id = var.agent_id
external = true
icon = "/icon/code.svg"
slug = var.slug
slug = "vscode"
display_name = "VS Code Desktop"
order = var.order
url = format(
"vscode://coder.coder-remote/open?owner=%s&workspace=%s%s%s&url=%s&token=$SESSION_TOKEN",
url = join("", [
"vscode://coder.coder-remote/open",
"?owner=",
data.coder_workspace_owner.me.name,
"&workspace=",
data.coder_workspace.me.name,
var.folder != "" ? "&folder=${var.folder}" : "",
var.folder != "" ? join("", ["&folder=", var.folder]) : "",
var.open_recent ? "&openRecent" : "",
data.coder_workspace.me.access_url
)
"&url=",
data.coder_workspace.me.access_url,
"&token=$SESSION_TOKEN",
])
}
output "vscode_url" {

View File

@@ -14,7 +14,7 @@ Automatically install [Visual Studio Code Server](https://code.visualstudio.com/
```tf
module "vscode-web" {
source = "registry.coder.com/modules/vscode-web/coder"
version = "1.0.23"
version = "1.0.22"
agent_id = coder_agent.example.id
accept_license = true
}
@@ -29,7 +29,7 @@ module "vscode-web" {
```tf
module "vscode-web" {
source = "registry.coder.com/modules/vscode-web/coder"
version = "1.0.23"
version = "1.0.22"
agent_id = coder_agent.example.id
install_prefix = "/home/coder/.vscode-web"
folder = "/home/coder"
@@ -42,7 +42,7 @@ module "vscode-web" {
```tf
module "vscode-web" {
source = "registry.coder.com/modules/vscode-web/coder"
version = "1.0.23"
version = "1.0.22"
agent_id = coder_agent.example.id
extensions = ["github.copilot", "ms-python.python", "ms-toolsai.jupyter"]
accept_license = true
@@ -56,7 +56,7 @@ Configure VS Code's [settings.json](https://code.visualstudio.com/docs/getstarte
```tf
module "vscode-web" {
source = "registry.coder.com/modules/vscode-web/coder"
version = "1.0.23"
version = "1.0.22"
agent_id = coder_agent.example.id
extensions = ["dracula-theme.theme-dracula"]
settings = {
@@ -65,26 +65,3 @@ module "vscode-web" {
accept_license = true
}
```
### Serve on a subpath (no wildcard subdomain)
```tf
module "vscode-web" {
source = "registry.coder.com/modules/vscode-web/coder"
version = "1.0.23"
agent_id = coder_agent.example.id
subdomain = false
}
```
### Serve on a subpath with a specific agent name (multiple agents)
```tf
module "vscode-web" {
source = "registry.coder.com/modules/vscode-web/coder"
version = "1.0.23"
agent_id = coder_agent.example.id
agent_name = "main"
subdomain = false
}
```

View File

@@ -130,12 +130,6 @@ variable "subdomain" {
default = true
}
variable "agent_name" {
type = string
description = "The name of the coder_agent resource. (Only required if subdomain is false and the template uses multiple agents.)"
default = null
}
data "coder_workspace_owner" "me" {}
data "coder_workspace" "me" {}
@@ -191,7 +185,7 @@ resource "coder_app" "vscode-web" {
}
locals {
server_base_path = var.subdomain ? "" : format("/@%s/%s%s/apps/%s", data.coder_workspace_owner.me.name, data.coder_workspace.me.name, var.agent_name != null ? ".${var.agent_name}" : "", var.slug)
server_base_path = var.subdomain ? "" : format("/@%s/%s/apps/%s/", data.coder_workspace_owner.me.name, data.coder_workspace.me.name, var.slug)
url = var.folder == "" ? "http://localhost:${var.port}${local.server_base_path}" : "http://localhost:${var.port}${local.server_base_path}?folder=${var.folder}"
healthcheck_url = "http://localhost:${var.port}${local.server_base_path}/healthz"
healthcheck_url = var.subdomain ? "http://localhost:${var.port}/healthz" : "http://localhost:${var.port}${local.server_base_path}/healthz"
}

View File

@@ -15,7 +15,7 @@ Enable Remote Desktop + a web based client on Windows workspaces, powered by [de
# AWS example. See below for examples of using this module with other providers
module "windows_rdp" {
source = "registry.coder.com/modules/windows-rdp/coder"
version = "1.0.23"
version = "1.0.18"
count = data.coder_workspace.me.start_count
agent_id = resource.coder_agent.main.id
resource_id = resource.aws_instance.dev.id
@@ -33,7 +33,7 @@ module "windows_rdp" {
```tf
module "windows_rdp" {
source = "registry.coder.com/modules/windows-rdp/coder"
version = "1.0.23"
version = "1.0.18"
count = data.coder_workspace.me.start_count
agent_id = resource.coder_agent.main.id
resource_id = resource.aws_instance.dev.id
@@ -45,7 +45,7 @@ module "windows_rdp" {
```tf
module "windows_rdp" {
source = "registry.coder.com/modules/windows-rdp/coder"
version = "1.0.23"
version = "1.0.18"
count = data.coder_workspace.me.start_count
agent_id = resource.coder_agent.main.id
resource_id = resource.google_compute_instance.dev[0].id

View File

@@ -39,18 +39,6 @@ variable "admin_password" {
sensitive = true
}
variable "port" {
type = number
description = "The port to run the Devolutions Gateway on."
default = 7171
}
variable "slug" {
type = string
description = "The slug of the coder_app resource."
default = "web-rdp"
}
resource "coder_script" "windows-rdp" {
agent_id = var.agent_id
display_name = "windows-rdp"
@@ -59,7 +47,6 @@ resource "coder_script" "windows-rdp" {
script = templatefile("${path.module}/powershell-installation-script.tftpl", {
admin_username = var.admin_username
admin_password = var.admin_password
port = var.port
# Wanted to have this be in the powershell template file, but Terraform
# doesn't allow recursive calls to the templatefile function. Have to feed
@@ -76,14 +63,14 @@ resource "coder_script" "windows-rdp" {
resource "coder_app" "windows-rdp" {
agent_id = var.agent_id
share = var.share
slug = var.slug
slug = "web-rdp"
display_name = "Web RDP"
url = "http://localhost:${var.port}"
url = "http://localhost:7171"
icon = "/icon/desktop.svg"
subdomain = true
healthcheck {
url = "http://localhost:${var.port}"
url = "http://localhost:7171"
interval = 5
threshold = 15
}
@@ -93,7 +80,7 @@ resource "coder_app" "rdp-docs" {
agent_id = var.agent_id
display_name = "Local RDP"
slug = "rdp-docs"
icon = "/icon/windows.svg"
url = "https://coder.com/docs/user-guides/workspace-access/remote-desktops#rdp-desktop"
icon = "https://raw.githubusercontent.com/matifali/logos/main/windows.svg"
url = "https://coder.com/docs/ides/remote-desktops#rdp-desktop"
external = true
}

View File

@@ -47,7 +47,7 @@ Install-DGatewayPackage
# Configure Devolutions Gateway
$Hostname = "localhost"
$HttpListener = New-DGatewayListener "http://*:${port}" "http://*:${port}"
$HttpListener = New-DGatewayListener 'http://*:7171' 'http://*:7171'
$WebApp = New-DGatewayWebAppConfig -Enabled $true -Authentication None
$ConfigParams = @{
Hostname = $Hostname