From 91f964ca27e2063a2312db48943fc4cadef74c99 Mon Sep 17 00:00:00 2001 From: thelamer Date: Thu, 19 Jun 2025 11:42:52 -0400 Subject: [PATCH 1/2] rebase to selkies --- Dockerfile | 4 +-- Dockerfile.aarch64 | 4 +-- README.md | 1 + readme-vars.yml | 1 + root/defaults/autostart | 1 + root/defaults/startwm.sh | 53 ++++++++++++++++++++++++++++++---------- 6 files changed, 47 insertions(+), 17 deletions(-) create mode 100755 root/defaults/autostart diff --git a/Dockerfile b/Dockerfile index 4733737..fbd0f65 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM ghcr.io/linuxserver/baseimage-kasmvnc:kali +FROM ghcr.io/linuxserver/baseimage-selkies:kali # set version label ARG BUILD_DATE @@ -12,7 +12,7 @@ ENV TITLE="Kali Linux" RUN \ echo "**** add icon ****" && \ curl -o \ - /kclient/public/icon.png \ + /usr/share/selkies/www/icon.png \ https://raw.githubusercontent.com/linuxserver/docker-templates/master/linuxserver.io/img/kali-logo.png && \ echo "**** install packages ****" && \ apt-get update && \ diff --git a/Dockerfile.aarch64 b/Dockerfile.aarch64 index c74d0d7..9721dea 100644 --- a/Dockerfile.aarch64 +++ b/Dockerfile.aarch64 @@ -1,4 +1,4 @@ -FROM ghcr.io/linuxserver/baseimage-kasmvnc:arm64v8-kali +FROM ghcr.io/linuxserver/baseimage-selkies:arm64v8-kali # set version label ARG BUILD_DATE @@ -12,7 +12,7 @@ ENV TITLE="Kali Linux" RUN \ echo "**** add icon ****" && \ curl -o \ - /kclient/public/icon.png \ + /usr/share/selkies/www/icon.png \ https://raw.githubusercontent.com/linuxserver/docker-templates/master/linuxserver.io/img/kali-logo.png && \ echo "**** install packages ****" && \ apt-get update && \ diff --git a/README.md b/README.md index 6cbcde3..026128c 100644 --- a/README.md +++ b/README.md @@ -426,5 +426,6 @@ Once registered you can define the dockerfile to use with `-f Dockerfile.aarch64 ## Versions +* **19.06.25:** - Rebase to Selkies baseimage. * **24.01.25:** - Fix SVG icons not rendering. * **18.07.24:** - Initial release. diff --git a/readme-vars.yml b/readme-vars.yml index 4659f81..df24a58 100644 --- a/readme-vars.yml +++ b/readme-vars.yml @@ -119,5 +119,6 @@ init_diagram: | "kali-linux:latest" <- Base Images # changelog changelogs: + - {date: "19.06.25:", desc: "Rebase to Selkies baseimage."} - {date: "24.01.25:", desc: "Fix SVG icons not rendering."} - {date: "18.07.24:", desc: "Initial release."} diff --git a/root/defaults/autostart b/root/defaults/autostart new file mode 100755 index 0000000..ca916d0 --- /dev/null +++ b/root/defaults/autostart @@ -0,0 +1 @@ +exit 0 diff --git a/root/defaults/startwm.sh b/root/defaults/startwm.sh index 2a55693..85eba2e 100755 --- a/root/defaults/startwm.sh +++ b/root/defaults/startwm.sh @@ -1,27 +1,54 @@ #!/bin/bash -# Enable Nvidia GPU support if detected -if which nvidia-smi; then - export LIBGL_KOPPER_DRI2=1 - export MESA_LOADER_DRIVER_OVERRIDE=zink - export GALLIUM_DRIVER=zink -fi - -# Disable compositing and screen lock +# Disable compositing and screen locking if [ ! -f $HOME/.config/kwinrc ]; then kwriteconfig6 --file $HOME/.config/kwinrc --group Compositing --key Enabled false fi if [ ! -f $HOME/.config/kscreenlockerrc ]; then kwriteconfig6 --file $HOME/.config/kscreenlockerrc --group Daemon --key Autolock false fi + +# Power related setterm blank 0 setterm powerdown 0 -# Set default bashrc -if [ ! -f $HOME/.bashlock ]; then - sudo cp /root/.bashrc $HOME/.bashrc - touch $HOME/.bashlock +# Direcotries +sudo rm -f /usr/share/dbus-1/system-services/org.freedesktop.UDisks2.service +mkdir -p "${HOME}/.config/autostart" "${HOME}/.XDG" "${HOME}/.local/share/" +chmod 700 "${HOME}/.XDG" +touch "${HOME}/.local/share/user-places.xbel" + +# Background perm loop +if [ ! -d $HOME/.config/kde.org ]; then + ( + loop_end_time=$((SECONDS + 30)) + while [ $SECONDS -lt $loop_end_time ]; do + find "$HOME/.cache" "$HOME/.config" "$HOME/.local" -type f -perm 000 -exec chmod 644 {} + 2>/dev/null + sleep .1 + done + ) & +fi + +# Create startup script if it does not exist (keep in sync with openbox) +STARTUP_FILE="${HOME}/.config/autostart/autostart.desktop" +if [ ! -f "${STARTUP_FILE}" ]; then + echo "[Desktop Entry]" > $STARTUP_FILE + echo "Exec=bash /config/.config/openbox/autostart" >> $STARTUP_FILE + echo "Icon=dialog-scripts" >> $STARTUP_FILE + echo "Name=autostart" >> $STARTUP_FILE + echo "Path=" >> $STARTUP_FILE + echo "Type=Application" >> $STARTUP_FILE + echo "X-KDE-AutostartScript=true" >> $STARTUP_FILE + chmod +x $STARTUP_FILE +fi + +# Enable Nvidia GPU support if detected +if which nvidia-smi && [ "${DISABLE_ZINK}" == "false" ]; then + export LIBGL_KOPPER_DRI2=1 + export MESA_LOADER_DRIVER_OVERRIDE=zink + export GALLIUM_DRIVER=zink fi -# Launch DE +# Stat DE +unset LD_PRELOAD /usr/bin/startplasma-x11 > /dev/null 2>&1 From 447202761d283135b29718b061c2b4493fccbead Mon Sep 17 00:00:00 2001 From: thelamer Date: Thu, 19 Jun 2025 15:34:03 -0400 Subject: [PATCH 2/2] testing port and readme updates --- Jenkinsfile | 4 +- README.md | 98 +++------------------------------------ jenkins-vars.yml | 4 +- readme-vars.yml | 118 +++++++++++++++++------------------------------ 4 files changed, 54 insertions(+), 170 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 2bd3c08..f458860 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -30,8 +30,8 @@ pipeline { MULTIARCH='true' CI='true' CI_WEB='true' - CI_PORT='3000' - CI_SSL='false' + CI_PORT='3001' + CI_SSL='true' CI_DELAY='120' CI_SBOM_TIMEOUT='1800' CI_DOCKERENV='TZ=US/Pacific' diff --git a/README.md b/README.md index 026128c..3f7f739 100644 --- a/README.md +++ b/README.md @@ -59,12 +59,10 @@ The architectures supported by this image are: ## Application Setup -The Kali Linux image can be accessed at: +The application can be accessed at: -* http://yourhost:3000/ * https://yourhost:3001/ -**Modern GUI desktop apps have issues with the latest Docker and syscall compatibility, you can use Docker with the `--security-opt seccomp=unconfined` setting to allow these syscalls on hosts with older Kernels or libseccomp** ### Security @@ -73,68 +71,7 @@ The Kali Linux image can be accessed at: By default this container has no authentication and the optional environment variables `CUSTOM_USER` and `PASSWORD` to enable basic http auth via the embedded NGINX server should only be used to locally secure the container from unwanted access on a local network. If exposing this to the Internet we recommend putting it behind a reverse proxy, such as [SWAG](https://github.com/linuxserver/docker-swag), and ensuring a secure authentication solution is in place. From the web interface a terminal can be launched and it is configured for passwordless sudo, so anyone with access to it can install and run whatever they want along with probing your local network. -### Options in all KasmVNC based GUI containers - -This container is based on [Docker Baseimage KasmVNC](https://github.com/linuxserver/docker-baseimage-kasmvnc) which means there are additional environment variables and run configurations to enable or disable specific functionality. - -#### Optional environment variables - -| Variable | Description | -| :----: | --- | -| CUSTOM_PORT | Internal port the container listens on for http if it needs to be swapped from the default 3000. | -| CUSTOM_HTTPS_PORT | Internal port the container listens on for https if it needs to be swapped from the default 3001. | -| CUSTOM_USER | HTTP Basic auth username, abc is default. | -| PASSWORD | HTTP Basic auth password, abc is default. If unset there will be no auth | -| SUBFOLDER | Subfolder for the application if running a subfolder reverse proxy, need both slashes IE `/subfolder/` | -| TITLE | The page title displayed on the web browser, default "KasmVNC Client". | -| FM_HOME | This is the home directory (landing) for the file manager, default "/config". | -| START_DOCKER | If set to false a container with privilege will not automatically start the DinD Docker setup. | -| DRINODE | If mounting in /dev/dri for [DRI3 GPU Acceleration](https://www.kasmweb.com/kasmvnc/docs/master/gpu_acceleration.html) allows you to specify the device to use IE `/dev/dri/renderD128` | -| DISABLE_IPV6 | If set to true or any value this will disable IPv6 | -| LC_ALL | Set the Language for the container to run as IE `fr_FR.UTF-8` `ar_AE.UTF-8` | -| NO_DECOR | If set the application will run without window borders in openbox for use as a PWA. | -| NO_FULL | Do not autmatically fullscreen applications when using openbox. | - -#### Optional run configurations - -| Variable | Description | -| :----: | --- | -| `--privileged` | Will start a Docker in Docker (DinD) setup inside the container to use docker in an isolated environment. For increased performance mount the Docker directory inside the container to the host IE `-v /home/user/docker-data:/var/lib/docker`. | -| `-v /var/run/docker.sock:/var/run/docker.sock` | Mount in the host level Docker socket to either interact with it via CLI or use Docker enabled applications. | -| `--device /dev/dri:/dev/dri` | Mount a GPU into the container, this can be used in conjunction with the `DRINODE` environment variable to leverage a host video card for GPU accelerated applications. Only **Open Source** drivers are supported IE (Intel,AMDGPU,Radeon,ATI,Nouveau) | - -### Language Support - Internationalization - -The environment variable `LC_ALL` can be used to start this container in a different language than English simply pass for example to launch the Desktop session in French `LC_ALL=fr_FR.UTF-8`. Some languages like Chinese, Japanese, or Korean will be missing fonts needed to render properly known as cjk fonts, but others may exist and not be installed inside the container depending on what underlying distribution you are running. We only ensure fonts for Latin characters are present. Fonts can be installed with a mod on startup. - -To install cjk fonts on startup as an example pass the environment variables (Alpine base): - -``` --e DOCKER_MODS=linuxserver/mods:universal-package-install --e INSTALL_PACKAGES=fonts-noto-cjk --e LC_ALL=zh_CN.UTF-8 -``` - -The web interface has the option for "IME Input Mode" in Settings which will allow non english characters to be used from a non en_US keyboard on the client. Once enabled it will perform the same as a local Linux installation set to your locale. - -### DRI3 GPU Acceleration (KasmVNC interface) - -For accelerated apps or games, render devices can be mounted into the container and leveraged by applications using: - -`--device /dev/dri:/dev/dri` - -This feature only supports **Open Source** GPU drivers: - -| Driver | Description | -| :----: | --- | -| Intel | i965 and i915 drivers for Intel iGPU chipsets | -| AMD | AMDGPU, Radeon, and ATI drivers for AMD dedicated or APU chipsets | -| NVIDIA | nouveau2 drivers only, closed source NVIDIA drivers lack DRI3 support | - -The `DRINODE` environment variable can be used to point to a specific GPU. -Up to date information can be found [here](https://www.kasmweb.com/kasmvnc/docs/master/gpu_acceleration.html) - -### Nvidia GPU Support (KasmVNC interface) +### Nvidia GPU Support **Nvidia support is not compatible with Alpine based images as Alpine lacks Nvidia drivers** @@ -156,8 +93,8 @@ And to assign the GPU in compose: ``` services: - kali-linux: - image: lscr.io/linuxserver/kali-linux:latest + webtop: + image: lscr.io/linuxserver/suyu:latest deploy: resources: reservations: @@ -167,27 +104,10 @@ services: capabilities: [compute,video,graphics,utility] ``` -### Application management - -#### PRoot Apps - -If you run system native installations of software IE `sudo apt-get install filezilla` and then upgrade or destroy/re-create the container that software will be removed and the container will be at a clean state. For some users that will be acceptable and they can update their system packages as well using system native commands like `apt-get upgrade`. If you want Docker to handle upgrading the container and retain your applications and settings we have created [proot-apps](https://github.com/linuxserver/proot-apps) which allow portable applications to be installed to persistent storage in the user's `$HOME` directory and they will work in a confined Docker environment out of the box. These applications and their settings will persist upgrades of the base container and can be mounted into different flavors of KasmVNC based containers on the fly. This can be achieved from the command line with: +### Strict reverse proxies -``` -proot-apps install filezilla -``` - -PRoot Apps is included in all KasmVNC based containers, a list of linuxserver.io supported applications is located [HERE](https://github.com/linuxserver/proot-apps?tab=readme-ov-file#supported-apps). - -#### Native Apps - -It is possible to install extra packages during container start using [universal-package-install](https://github.com/linuxserver/docker-mods/tree/universal-package-install). It might increase starting time significantly. PRoot is preferred. - -```yaml - environment: - - DOCKER_MODS=linuxserver/mods:universal-package-install - - INSTALL_PACKAGES=libfuse2|git|gdb -``` +This image uses a self-signed certificate by default. This naturally means the scheme is `https`. +If you are using a reverse proxy which validates certificates, you need to [disable this check for the container](https://docs.linuxserver.io/faq#strict-proxy). ## Usage @@ -218,8 +138,6 @@ services: ports: - 3000:3000 - 3001:3001 - devices: - - /dev/dri:/dev/dri #optional shm_size: "1gb" #optional restart: unless-stopped ``` @@ -239,7 +157,6 @@ docker run -d \ -p 3001:3001 \ -v /path/to/data:/config \ -v /var/run/docker.sock:/var/run/docker.sock `#optional` \ - --device /dev/dri:/dev/dri `#optional` \ --shm-size="1gb" `#optional` \ --restart unless-stopped \ lscr.io/linuxserver/kali-linux:latest @@ -260,7 +177,6 @@ Containers are configured using parameters passed at runtime (such as those abov | `-e TITLE=Kali Linux` | String which will be used as page/tab title in the web browser. | | `-v /config` | abc users home directory | | `-v /var/run/docker.sock` | Docker Socket on the system, if you want to use Docker in the container | -| `--device /dev/dri` | Add this for GL support (Linux hosts only) | | `--shm-size=` | We set this to 1 gig to prevent modern web browsers from crashing | | `--security-opt seccomp=unconfined` | For Docker Engine only, many modern gui apps need this to function on older hosts as syscalls are unknown to Docker. | diff --git a/jenkins-vars.yml b/jenkins-vars.yml index 0d25bce..bdc69ca 100644 --- a/jenkins-vars.yml +++ b/jenkins-vars.yml @@ -19,8 +19,8 @@ repo_vars: - MULTIARCH='true' - CI='true' - CI_WEB='true' - - CI_PORT='3000' - - CI_SSL='false' + - CI_PORT='3001' + - CI_SSL='true' - CI_DELAY='120' - CI_SBOM_TIMEOUT='1800' - CI_DOCKERENV='TZ=US/Pacific' diff --git a/readme-vars.yml b/readme-vars.yml index df24a58..5fa2608 100644 --- a/readme-vars.yml +++ b/readme-vars.yml @@ -37,86 +37,54 @@ opt_custom_params: opt_security_opt_param: true opt_security_opt_param_vars: - {run_var: "seccomp=unconfined", compose_var: "seccomp:unconfined", desc: "For Docker Engine only, many modern gui apps need this to function on older hosts as syscalls are unknown to Docker."} -opt_param_device_map: true -opt_param_devices: - - {device_path: "/dev/dri", device_host_path: "/dev/dri", desc: "Add this for GL support (Linux hosts only)"} -# Kasm blurb settings -kasm_blurb: true -show_nvidia: true -external_http_port: "3000" -external_https_port: "3001" -noto_fonts: "fonts-noto-cjk" # application setup block app_setup_block_enabled: true app_setup_block: | - The Kali Linux image can be accessed at: + The application can be accessed at: - * http://yourhost:3000/ * https://yourhost:3001/ -# init diagram -init_diagram: | - "kali-linux:latest": { - docker-mods - base { - fix-attr +\nlegacy cont-init - } - docker-mods -> base - legacy-services - custom services - init-services -> legacy-services - init-services -> custom services - custom services -> legacy-services - legacy-services -> ci-service-check - init-migrations -> init-adduser - init-kasmvnc-end -> init-config - init-os-end -> init-config - init-config -> init-config-end - init-os-end -> init-crontab-config - init-mods-end -> init-custom-files - init-adduser -> init-device-perms - base -> init-envfile - init-os-end -> init-kasmvnc - init-nginx -> init-kasmvnc-config - init-video -> init-kasmvnc-end - base -> init-migrations - base -> init-mods - init-config-end -> init-mods - init-mods -> init-mods-end - init-mods-package-install -> init-mods-end - init-mods -> init-mods-package-install - init-kasmvnc -> init-nginx - base -> init-os-end - init-adduser -> init-os-end - init-device-perms -> init-os-end - init-envfile -> init-os-end - init-migrations -> init-os-end - init-custom-files -> init-services - init-mods-end -> init-services - init-kasmvnc-config -> init-video - init-services -> svc-cron - svc-cron -> legacy-services - init-services -> svc-de - svc-nginx -> svc-de - svc-de -> legacy-services - init-services -> svc-docker - svc-de -> svc-docker - svc-docker -> legacy-services - init-services -> svc-kasmvnc - svc-pulseaudio -> svc-kasmvnc - svc-kasmvnc -> legacy-services - init-services -> svc-kclient - svc-kasmvnc -> svc-kclient - svc-kclient -> legacy-services - init-services -> svc-nginx - svc-kclient -> svc-nginx - svc-nginx -> legacy-services - init-services -> svc-pulseaudio - svc-pulseaudio -> legacy-services - } - Base Images: { - "baseimage-kasmvnc:kali" <- "baseimage-debian:kali" - } - "kali-linux:latest" <- Base Images + + + ### Security + + >[!WARNING] + >Do not put this on the Internet if you do not know what you are doing. + + By default this container has no authentication and the optional environment variables `CUSTOM_USER` and `PASSWORD` to enable basic http auth via the embedded NGINX server should only be used to locally secure the container from unwanted access on a local network. If exposing this to the Internet we recommend putting it behind a reverse proxy, such as [SWAG](https://github.com/linuxserver/docker-swag), and ensuring a secure authentication solution is in place. From the web interface a terminal can be launched and it is configured for passwordless sudo, so anyone with access to it can install and run whatever they want along with probing your local network. + + ### Nvidia GPU Support + + **Nvidia support is not compatible with Alpine based images as Alpine lacks Nvidia drivers** + + Nvidia support is available by leveraging Zink for OpenGL support. This can be enabled with the following run flags: + + | Variable | Description | + | :----: | --- | + | --gpus all | This can be filtered down but for most setups this will pass the one Nvidia GPU on the system | + | --runtime nvidia | Specify the Nvidia runtime which mounts drivers and tools in from the host | + + The compose syntax is slightly different for this as you will need to set nvidia as the default runtime: + + ``` + sudo nvidia-ctk runtime configure --runtime=docker --set-as-default + sudo service docker restart + ``` + + And to assign the GPU in compose: + + ``` + services: + webtop: + image: lscr.io/linuxserver/suyu:latest + deploy: + resources: + reservations: + devices: + - driver: nvidia + count: 1 + capabilities: [compute,video,graphics,utility] + ``` + # changelog changelogs: - {date: "19.06.25:", desc: "Rebase to Selkies baseimage."}