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.
This commit is contained in:
@@ -21,3 +21,22 @@ module "kasmvnc" {
|
||||
```
|
||||
|
||||
> **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
|
||||
```
|
||||
|
||||
@@ -158,9 +158,22 @@ else
|
||||
echo "Skipping installation."
|
||||
fi
|
||||
|
||||
# create the config file as the current user .vnc/kasmvnc.yaml
|
||||
# There is already a config file in the image at /etc/kasmvnc/kasmvnc.yaml, but we need to set the websocket port
|
||||
mkdir -p "$HOME/.vnc" # Ensure the directory exists
|
||||
# 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
|
||||
websocket_port: ${PORT}
|
||||
ssl:
|
||||
require_ssl: false
|
||||
udp:
|
||||
public_ip: 127.0.0.1
|
||||
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:
|
||||
websocket_port: ${PORT}
|
||||
|
||||
Reference in New Issue
Block a user