From c9e5fec1756dc97a36e4d254910975d3c60aa724 Mon Sep 17 00:00:00 2001 From: VallierDev <24893073+VallierDev@users.noreply.github.com> Date: Sun, 18 Oct 2026 11:43:58 +0800 Subject: [PATCH] docker: headless NAS container (Synology); publish ghcr image on release docker/Dockerfile installs the release binary on Ubuntu 24.04 with the X11/GTK runtime libs, headless (UU_DESKTOP_BACKEND=none), config in /config, data in /data. Verified on Synology DSM 7.3: file transfer (sha256 round trip), terminal and port mapping to the DSM web UI. Release workflow now pushes ghcr.io/vallierdev/uu-remote-linux. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/release.yml | 21 ++++++++++++ README.en.md | 3 ++ README.md | 3 ++ docker/Dockerfile | 18 ++++++++++ docker/README.md | 63 +++++++++++++++++++++++++++++++++++ docker/compose.yaml | 13 ++++++++ 6 files changed, 121 insertions(+) create mode 100644 docker/Dockerfile create mode 100644 docker/README.md create mode 100644 docker/compose.yaml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3bd4270..a00e3d9 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -6,6 +6,7 @@ on: permissions: contents: write + packages: write jobs: release: @@ -37,3 +38,23 @@ jobs: files: | uu-remote-linux-*.tar.gz uu-remote-linux-*.tar.gz.sha256 + + # Headless NAS image (docker/), built from the release tarball published by the job above. + docker: + needs: release + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v4 + - uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - uses: docker/build-push-action@v6 + with: + context: docker + build-args: VERSION=${{ github.ref_name }} + push: true + tags: | + ghcr.io/vallierdev/uu-remote-linux:${{ github.ref_name }} + ghcr.io/vallierdev/uu-remote-linux:latest diff --git a/README.en.md b/README.en.md index e07ccdf..dc34dce 100644 --- a/README.en.md +++ b/README.en.md @@ -236,6 +236,9 @@ service and run `loginctl enable-linger $USER`, so the systemd user manager (wit starts at boot without a login. The viewer's remote desktop keeps showing "connecting" in this mode; that is expected. Log in once with `uuremote-server login --no-gui` (QR in the terminal). +**Synology / NAS (Docker)**: run headless mode in a container on a desktop-less NAS (file transfer, terminal, port +mapping): image `ghcr.io/vallierdev/uu-remote-linux`, see [docker/README.md](docker/README.md). Verified on Synology DSM 7.3 (x86_64). + **Paste files from a Mac terminal**: when using Ghostty over UU's SSH port mapping, the optional [Mac SSH paste companion](contrib/macos-ssh/README.md) uploads files copied in Finder before inserting their remote paths. Text and mouse reports pass diff --git a/README.md b/README.md index 7a3c924..cef04a9 100644 --- a/README.md +++ b/README.md @@ -209,6 +209,9 @@ install -Dm644 contrib/desktop/uu-remote-linux.desktop ~/.local/share/applicatio 再执行 `loginctl enable-linger $USER`,这样开机后不用登录,systemd 用户服务(以及 `XDG_RUNTIME_DIR`、用户 D-Bus)也会自动启动。 无头模式下控制端点「远程桌面」会一直显示正在连接,这是正常的。首次登录用 `uuremote-server login --no-gui` 在终端里扫码。 +**群晖 / NAS(Docker)**:没有桌面的 NAS 可以用容器运行无头模式(文件传输、终端、端口映射), +镜像 `ghcr.io/vallierdev/uu-remote-linux`,步骤见 [docker/README.md](docker/README.md)。已在群晖 DSM 7.3(x86_64)上实测三项功能。 + **Mac 终端粘贴文件**:使用 Ghostty 通过 UU 端口映射连接 SSH 时,可安装 [Mac SSH 粘贴助手](contrib/macos-ssh/README.md)。在 Finder 复制文件后按 Command-V, 助手先通过同一个 SSH 别名上传文件,再插入服务器路径;普通文本和鼠标报告正常透传。 diff --git a/docker/Dockerfile b/docker/Dockerfile new file mode 100644 index 0000000..6ebb0f4 --- /dev/null +++ b/docker/Dockerfile @@ -0,0 +1,18 @@ +# Unofficial UU Remote Linux host in a container, for NAS boxes (Synology DSM, etc.) without a desktop. +# Headless mode: file transfer, terminal and port mapping; no remote desktop. Uses the published release binary. +FROM ubuntu:24.04 +ARG VERSION=v0.2.7 +RUN apt-get update \ + && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ + ca-certificates curl bash libx11-6 libxext6 libxtst6 libxfixes3 libgtk-3-0 \ + && cd /tmp \ + && base="https://github.com/VallierDev/uu-remote-linux/releases/download/${VERSION}/uu-remote-linux-${VERSION}-x86_64-linux.tar.gz" \ + && curl -fsSLO "$base" && curl -fsSLO "$base.sha256" && sha256sum -c "uu-remote-linux-${VERSION}-x86_64-linux.tar.gz.sha256" \ + && tar xzf "uu-remote-linux-${VERSION}-x86_64-linux.tar.gz" \ + && install -m755 "$(find /tmp -name uuremote-server -type f | head -1)" /usr/local/bin/uuremote-server \ + && rm -rf /tmp/* /var/lib/apt/lists/* +# Credentials live in /config (keep it private); /data is what file transfer and the terminal see as home. +ENV UU_CONFIG=/config/config.json UU_DESKTOP_BACKEND=none UU_LOGIN_WINDOW=0 UU_AUDIO=0 RUST_LOG=info HOME=/data +VOLUME ["/config", "/data"] +WORKDIR /data +ENTRYPOINT ["uuremote-server"] diff --git a/docker/README.md b/docker/README.md new file mode 100644 index 0000000..c5e68f1 --- /dev/null +++ b/docker/README.md @@ -0,0 +1,63 @@ +# 群晖 / NAS 容器部署(无桌面) + +**简体中文** | [English](#english) + +在没有桌面的 NAS(群晖 DSM 等,x86_64)上,用容器运行本项目主机,供官方 UU 远程客户端使用: + +- **文件传输**:收发 `/data` 里的文件(把你的共享文件夹挂到 `/data`)。 +- **终端**:进入容器内的 bash,当前目录为 `/data`。 +- **端口映射**:在外网经 UU 访问家里局域网的服务(NAS 管理页、路由器、其他电脑……)。 + +不提供远程桌面(NAS 没有图形界面)。容器里运行的是 GitHub 发布包中的同一个 `uuremote-server`。 + +## 安装 + +在 NAS 上(SSH 登录后用 root 或 `sudo`),进入本目录: + +```sh +mkdir -p config data && chmod 700 config +docker compose build # 或者直接使用 ghcr.io/vallierdev/uu-remote-linux 镜像 +``` + +**首次登录**(只需一次):在你自己的终端里运行,用手机 UU 远程扫描终端里显示的二维码并确认。 +二维码等同于登录凭据,不要截图或发给别人。 + +```sh +docker compose run --rm uu-remote login --no-gui +``` + +登录信息保存在 `config/config.json`(权限 0600),请妥善保管 `config` 目录。然后启动: + +```sh +docker compose up -d +docker compose logs -f # 看到 availability=Some("ready") 即可在客户端设备列表里找到它 +``` + +**群晖 Container Manager**:也可以在「项目」里新建项目,选本目录的 `compose.yaml`;首次登录仍需在 SSH 里执行上面的 `login` 命令。 + +## 说明 + +- `network_mode: host` 让 WebRTC 走直连;改用默认桥接网络也能用,但更常走中转,延迟更高。 +- 把 `compose.yaml` 里的 `./data` 改成要开放的共享文件夹,例如 `/volume1/homes/你的用户名`。只挂需要远程访问的目录。 +- 终端操作的是容器而不是 NAS 系统本身;需要操作 NAS 本机时请用 DSM 自带的 SSH。 +- 升级:重新 `docker compose build --pull`(或拉取新镜像)后 `docker compose up -d`;`config` 保留即可免再登录。 + +--- + +## English + +Run this project's host in a container on a desktop-less NAS (Synology DSM, x86_64) for the official UU Remote clients: +file transfer (`/data`), terminal (bash inside the container) and port mapping into your LAN. No remote desktop. + +```sh +mkdir -p config data && chmod 700 config +docker compose build +docker compose run --rm uu-remote login --no-gui # scan the terminal QR with the UU mobile app (the QR is a credential) +docker compose up -d +docker compose logs -f # wait for availability=Some("ready") +``` + +Credentials are kept in `config/config.json`. Mount only the folders you want to reach as `/data`. +Host networking gives WebRTC direct paths; bridge networking works but relays more often. + +**Unofficial project, not affiliated with NetEase.** diff --git a/docker/compose.yaml b/docker/compose.yaml new file mode 100644 index 0000000..388b698 --- /dev/null +++ b/docker/compose.yaml @@ -0,0 +1,13 @@ +# docker compose up -d (first run: log in once, see README.md in this directory) +services: + uu-remote: + image: ghcr.io/vallierdev/uu-remote-linux:latest + build: . + container_name: uu-remote + # Host networking gives WebRTC direct UDP paths; bridge mode also works but falls back to relays more often. + network_mode: host + restart: unless-stopped + volumes: + - ./config:/config + # Folder offered to file transfer and the terminal (change to your share, e.g. /volume1/homes/you). + - ./data:/data