|
@@ -18,43 +18,14 @@ export PIPEWIRE_RUNTIME_DIR="${PIPEWIRE_RUNTIME_DIR:-${XDG_RUNTIME_DIR:-/tmp}}"
|
|
|
export PULSE_RUNTIME_PATH="${PULSE_RUNTIME_PATH:-${XDG_RUNTIME_DIR:-/tmp}/pulse}"
|
|
export PULSE_RUNTIME_PATH="${PULSE_RUNTIME_PATH:-${XDG_RUNTIME_DIR:-/tmp}/pulse}"
|
|
|
export PULSE_SERVER="${PULSE_SERVER:-unix:${PULSE_RUNTIME_PATH:-${XDG_RUNTIME_DIR:-/tmp}/pulse}/native}"
|
|
export PULSE_SERVER="${PULSE_SERVER:-unix:${PULSE_RUNTIME_PATH:-${XDG_RUNTIME_DIR:-/tmp}/pulse}/native}"
|
|
|
|
|
|
|
|
-# Configure NGINX
|
|
|
|
|
-if [ "$(echo ${SELKIES_ENABLE_BASIC_AUTH} | tr '[:upper:]' '[:lower:]')" != "false" ]; then htpasswd -bcm "${XDG_RUNTIME_DIR}/.htpasswd" "${SELKIES_BASIC_AUTH_USER:-${USER}}" "${SELKIES_BASIC_AUTH_PASSWORD:-${PASSWD}}"; fi
|
|
|
|
|
-echo "# Selkies KasmVNC NGINX Configuration
|
|
|
|
|
-server {
|
|
|
|
|
- access_log /dev/stdout;
|
|
|
|
|
- error_log /dev/stderr;
|
|
|
|
|
- listen 8080 $(if [ \"$(echo ${SELKIES_ENABLE_HTTPS} | tr '[:upper:]' '[:lower:]')\" = \"true\" ]; then echo -n "ssl"; fi);
|
|
|
|
|
- listen [::]:8080 $(if [ \"$(echo ${SELKIES_ENABLE_HTTPS} | tr '[:upper:]' '[:lower:]')\" = \"true\" ]; then echo -n "ssl"; fi);
|
|
|
|
|
- ssl_certificate ${SELKIES_HTTPS_CERT-/etc/ssl/certs/ssl-cert-snakeoil.pem};
|
|
|
|
|
- ssl_certificate_key ${SELKIES_HTTPS_KEY-/etc/ssl/private/ssl-cert-snakeoil.key};
|
|
|
|
|
- $(if [ \"$(echo ${SELKIES_ENABLE_BASIC_AUTH} | tr '[:upper:]' '[:lower:]')\" != \"false\" ]; then echo "auth_basic \"Selkies\";"; echo -n " auth_basic_user_file ${XDG_RUNTIME_DIR}/.htpasswd;"; fi)
|
|
|
|
|
-
|
|
|
|
|
- location / {
|
|
|
|
|
- proxy_set_header Upgrade \$http_upgrade;
|
|
|
|
|
- proxy_set_header Connection \"upgrade\";
|
|
|
|
|
-
|
|
|
|
|
- proxy_set_header Host \$host;
|
|
|
|
|
- proxy_set_header X-Real-IP \$remote_addr;
|
|
|
|
|
- proxy_set_header X-Forwarded-For \$proxy_add_x_forwarded_for;
|
|
|
|
|
- proxy_set_header X-Forwarded-Proto \$scheme;
|
|
|
|
|
-
|
|
|
|
|
- proxy_http_version 1.1;
|
|
|
|
|
- proxy_read_timeout 3600s;
|
|
|
|
|
- proxy_send_timeout 3600s;
|
|
|
|
|
- proxy_connect_timeout 3600s;
|
|
|
|
|
- proxy_buffering off;
|
|
|
|
|
-
|
|
|
|
|
- client_max_body_size 10M;
|
|
|
|
|
-
|
|
|
|
|
- proxy_pass http$(if [ \"$(echo ${SELKIES_ENABLE_HTTPS} | tr '[:upper:]' '[:lower:]')\" = \"true\" ]; then echo -n "s"; fi)://localhost:8082;
|
|
|
|
|
- }
|
|
|
|
|
-}" | tee /etc/nginx/sites-available/default > /dev/null
|
|
|
|
|
-
|
|
|
|
|
# Configure KasmVNC
|
|
# Configure KasmVNC
|
|
|
export KASM_DISPLAY=":50"
|
|
export KASM_DISPLAY=":50"
|
|
|
yq -i "
|
|
yq -i "
|
|
|
.command_line.prompt = false |
|
|
.command_line.prompt = false |
|
|
|
|
|
+.desktop.resolution.width = ${DISPLAY_SIZEW} |
|
|
|
|
|
+.desktop.resolution.height = ${DISPLAY_SIZEH} |
|
|
|
|
|
+.desktop.allow_resize = $(echo ${SELKIES_ENABLE_RESIZE-false} | tr '[:upper:]' '[:lower:]') |
|
|
|
|
|
+.desktop.pixel_depth = ${DISPLAY_CDEPTH} |
|
|
|
.network.interface = \"0.0.0.0\" |
|
|
.network.interface = \"0.0.0.0\" |
|
|
|
.network.websocket_port = 8082 |
|
|
.network.websocket_port = 8082 |
|
|
|
.network.ssl.require_ssl = $(echo ${SELKIES_ENABLE_HTTPS-false} | tr '[:upper:]' '[:lower:]') |
|
|
.network.ssl.require_ssl = $(echo ${SELKIES_ENABLE_HTTPS-false} | tr '[:upper:]' '[:lower:]') |
|
|
@@ -66,11 +37,13 @@ if [ -n "${SELKIES_HTTPS_KEY}" ]; then yq -i ".network.ssl.pem_key = \"${SELKIES
|
|
|
|
|
|
|
|
if [ "$(echo ${SELKIES_ENABLE_RESIZE} | tr '[:upper:]' '[:lower:]')" = "true" ]; then export KASM_RESIZE_FLAG="-r"; fi
|
|
if [ "$(echo ${SELKIES_ENABLE_RESIZE} | tr '[:upper:]' '[:lower:]')" = "true" ]; then export KASM_RESIZE_FLAG="-r"; fi
|
|
|
|
|
|
|
|
|
|
+(echo "${SELKIES_BASIC_AUTH_PASSWORD:-${PASSWD}}"; echo "${SELKIES_BASIC_AUTH_PASSWORD:-${PASSWD}}";) | kasmvncpasswd -u "${SELKIES_BASIC_AUTH_USER:-${USER}}" -ow
|
|
|
|
|
+
|
|
|
# Wait for X server to start
|
|
# Wait for X server to start
|
|
|
echo 'Waiting for X Socket' && until [ -S "/tmp/.X11-unix/X${DISPLAY#*:}" ]; do sleep 0.5; done && echo 'X Server is ready'
|
|
echo 'Waiting for X Socket' && until [ -S "/tmp/.X11-unix/X${DISPLAY#*:}" ]; do sleep 0.5; done && echo 'X Server is ready'
|
|
|
|
|
|
|
|
# Run KasmVNC
|
|
# Run KasmVNC
|
|
|
-kasmvncserver "${KASM_DISPLAY}" -geometry "${DISPLAY_SIZEW}x${DISPLAY_SIZEH}" -depth "${DISPLAY_CDEPTH}" -noxstartup -FrameRate "${DISPLAY_REFRESH}" -websocketPort 8082 -disableBasicAuth -AlwaysShared -BlacklistTimeout 0 ${NO_KASM_AUTH_FLAG}
|
|
|
|
|
|
|
+kasmvncserver "${KASM_DISPLAY}" -geometry "${DISPLAY_SIZEW}x${DISPLAY_SIZEH}" -depth "${DISPLAY_CDEPTH}" -noxstartup -FrameRate "${DISPLAY_REFRESH}" -localhost -websocketPort 8082 -disableBasicAuth -AlwaysShared -BlacklistTimeout 0 ${NO_KASM_AUTH_FLAG}
|
|
|
|
|
|
|
|
until [ -S "/tmp/.X11-unix/X${KASM_DISPLAY#*:}" ]; do sleep 0.5; done;
|
|
until [ -S "/tmp/.X11-unix/X${KASM_DISPLAY#*:}" ]; do sleep 0.5; done;
|
|
|
|
|
|