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:** 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."
|
echo "Skipping installation."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# create the config file as the current user .vnc/kasmvnc.yaml
|
# Try to create /etc/kasmvnc/kasmvnc.yaml system-wide
|
||||||
# There is already a config file in the image at /etc/kasmvnc/kasmvnc.yaml, but we need to set the websocket port
|
# we don't fail as some images might be missing sudo permissions
|
||||||
mkdir -p "$HOME/.vnc" # Ensure the directory exists
|
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
|
cat > "$HOME/.vnc/kasmvnc.yaml" <<EOF
|
||||||
network:
|
network:
|
||||||
websocket_port: ${PORT}
|
websocket_port: ${PORT}
|
||||||
|
|||||||
Reference in New Issue
Block a user