From 026da2dfa01cd7565e9e73e1ee4547874d3bdc7e Mon Sep 17 00:00:00 2001 From: randogoth Date: Sat, 18 Oct 2025 23:29:41 +0300 Subject: [PATCH] xauth --- Dockerfile | 2 +- config/sshd_config | 4 +++- scripts/dos-shell | 30 +++++++++++++++++++++++++++++- 3 files changed, 33 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 276b22a..26e2afe 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,7 +5,6 @@ ENV DEBIAN_FRONTEND=noninteractive # Install base packages and enable the dosemu2 PPA RUN apt-get update && \ apt-get install -y --no-install-recommends \ - software-properties-common \ gnupg \ openssh-server \ busybox-static \ @@ -15,6 +14,7 @@ RUN apt-get update && \ mtools \ unzip \ file \ + xauth \ && add-apt-repository -y ppa:dosemu2/ppa && \ apt-get install -y --no-install-recommends \ dosemu2 \ diff --git a/config/sshd_config b/config/sshd_config index 4c76899..95a58c6 100644 --- a/config/sshd_config +++ b/config/sshd_config @@ -6,7 +6,9 @@ PermitRootLogin no PasswordAuthentication yes ChallengeResponseAuthentication no UsePAM yes -X11Forwarding no +X11Forwarding yes +X11DisplayOffset 10 +X11UseLocalhost no PrintMotd no AcceptEnv LANG LC_* Subsystem sftp /usr/lib/openssh/sftp-server diff --git a/scripts/dos-shell b/scripts/dos-shell index 8d7a8b9..dde0d49 100755 --- a/scripts/dos-shell +++ b/scripts/dos-shell @@ -31,7 +31,32 @@ fi DOSEMU_DIR="${DOS_HOME}/.dosemu" C_DRIVE="${DOSEMU_DIR}/drive_c" INSTALL_MARKER="${DOSEMU_DIR}/${INSTALL_SENTINEL}" -DOSEMU_ARGS=(-dumb -K "${C_DRIVE}") +detect_dosemu_args() { + local mode="${DOS_TERMINAL_MODE:-auto}" + if [ "${mode}" = "auto" ]; then + if [ -n "${DISPLAY:-}" ]; then + mode="x" + else + mode="terminal" + fi + fi + + case "${mode,,}" in + x|sdl|window|gui) + DOSEMU_ARGS=(-X -K "${C_DRIVE}") + ;; + terminal|tty|text) + DOSEMU_ARGS=(-td -K "${C_DRIVE}") + ;; + dumb) + DOSEMU_ARGS=(-dumb -K "${C_DRIVE}") + ;; + *) + echo "Unknown DOS_TERMINAL_MODE '${mode}', defaulting to terminal mode." >&2 + DOSEMU_ARGS=(-td -K "${C_DRIVE}") + ;; + esac +} allowed_entries=() mkdir -p "${DOSEMU_DIR}" "${C_DRIVE}" @@ -180,11 +205,14 @@ if needs_install; then if run_headless_install; then set_install_marker echo "SvarDOS provisioning complete." + echo "Disconnecting. Reconnect via SSH to start the SvarDOS shell." + exit 0 else exit 1 fi fi +detect_dosemu_args sync_allowed_content apply_templates