diff --git a/README.en.md b/README.en.md index dc34dce..e36fb53 100644 --- a/README.en.md +++ b/README.en.md @@ -10,6 +10,8 @@ > It now also ships an **experimental Linux viewer**, `uuremote-viewer`, that controls official Windows / Mac hosts or this > project's host from Linux (desktop, file transfer, terminal, port mapping, remote assistance; see > [below](#experimental-native-viewer-uuremote-viewer)). +> Desktop-less **Synology / NAS** boxes can run it in Docker: [deployment guide](docs/deploy-nas-docker.md#english), image +> [`ghcr.io/vallierdev/uu-remote-linux`](https://github.com/VallierDev/uu-remote-linux/pkgs/container/uu-remote-linux). > > This is a personal hobby project. **It is not affiliated with NetEase and is not an official client.** > If NetEase considers this project infringing or inappropriate, please DM me on X @@ -237,7 +239,8 @@ starts at boot without a login. The viewer's remote desktop keeps showing "conne 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). +mapping): image [`ghcr.io/vallierdev/uu-remote-linux`](https://github.com/VallierDev/uu-remote-linux/pkgs/container/uu-remote-linux), +see the [NAS deployment guide](docs/deploy-nas-docker.md#english). 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 diff --git a/README.md b/README.md index cef04a9..02b4b9a 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,7 @@ > 装上之后,就能用官方的 Mac / Windows / 手机客户端远程控制你的 Linux 电脑。 > 现在还附带一个**实验性 Linux 控制端** `uuremote-viewer`:在 Linux 上用 UU 账号远控官方 Windows / Mac 被控端或本项目主机 > (桌面、文件传输、终端、端口映射、远程协助,详见[下文](#实验性原生控制端uuremote-viewer))。 +> 没有桌面的**群晖 / NAS** 也能用 Docker 部署:[部署指南](docs/deploy-nas-docker.md),镜像 [`ghcr.io/vallierdev/uu-remote-linux`](https://github.com/VallierDev/uu-remote-linux/pkgs/container/uu-remote-linux)。 > > 这是个人兴趣项目,**与网易无关,也不是官方客户端**。如果网易认为本项目侵权或有不妥, > 请在推特私信我 **[@ai_fengshou](https://x.com/ai_fengshou)**,我会第一时间自行下架。 @@ -209,8 +210,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)上实测三项功能。 +**群晖 / NAS(Docker)**:没有桌面的 NAS 可以用容器运行无头模式(文件传输、终端、端口映射)。 +镜像 [`ghcr.io/vallierdev/uu-remote-linux`](https://github.com/VallierDev/uu-remote-linux/pkgs/container/uu-remote-linux), +**部署步骤见 [群晖 / NAS 部署指南](docs/deploy-nas-docker.md)**。已在群晖 DSM 7.3(x86_64)上实测三项功能。 **Mac 终端粘贴文件**:使用 Ghostty 通过 UU 端口映射连接 SSH 时,可安装 [Mac SSH 粘贴助手](contrib/macos-ssh/README.md)。在 Finder 复制文件后按 Command-V, diff --git a/docker/README.md b/docker/README.md index c5e68f1..cdf3f72 100644 --- a/docker/README.md +++ b/docker/README.md @@ -1,63 +1,9 @@ -# 群晖 / NAS 容器部署(无桌面) +# Docker(群晖 / NAS,无桌面) -**简体中文** | [English](#english) +本目录是 [`ghcr.io/vallierdev/uu-remote-linux`](https://github.com/VallierDev/uu-remote-linux/pkgs/container/uu-remote-linux) 镜像的构建文件。 +**部署和使用步骤见 [docs/deploy-nas-docker.md](../docs/deploy-nas-docker.md)。** -在没有桌面的 NAS(群晖 DSM 等,x86_64)上,用容器运行本项目主机,供官方 UU 远程客户端使用: +This directory builds the `ghcr.io/vallierdev/uu-remote-linux` image; see +[docs/deploy-nas-docker.md](../docs/deploy-nas-docker.md#english) for deployment. -- **文件传输**:收发 `/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.** +自行构建 / build locally: `docker compose build`(`Dockerfile` 从 GitHub 发布包安装 `uuremote-server`,可用 `--build-arg VERSION=vX.Y.Z` 指定版本)。 diff --git a/docs/deploy-nas-docker.md b/docs/deploy-nas-docker.md new file mode 100644 index 0000000..2e56e21 --- /dev/null +++ b/docs/deploy-nas-docker.md @@ -0,0 +1,133 @@ +# 群晖 / NAS 部署指南(Docker,无桌面) + +**简体中文** | [English](#english) + +镜像:[`ghcr.io/vallierdev/uu-remote-linux`](https://github.com/VallierDev/uu-remote-linux/pkgs/container/uu-remote-linux) +(标签 `latest` 或具体版本如 `v0.2.8`) + +把本项目主机跑在没有桌面的 NAS 上之后,就能在外面用官方 UU 远程客户端(手机 / Mac / Windows): + +| 功能 | 说明 | +|---|---| +| 文件传输 | 收发 NAS 上的文件(只开放你挂进容器的文件夹) | +| 终端 | 打开容器里的命令行(bash) | +| 端口映射 | 经 UU 访问家里局域网的服务:NAS 管理页、路由器、其他电脑的 SSH / 远程桌面等 | + +**不提供远程桌面**(NAS 没有图形界面,点「远程桌面」会一直显示正在连接,属正常)。 + +## 准备 + +- x86_64 的 NAS(群晖 DSM 7.2 及以上已安装「Container Manager」,或任意装了 Docker 的 Linux NAS)。ARM 机型暂不支持。 +- 能 SSH 登录 NAS(群晖:控制面板 → 终端机和 SNMP → 启用 SSH),并有管理员权限(`sudo`)。 +- 手机上的 UU 远程 App,用于扫码登录。 + +## 第一步:建目录和配置 + +SSH 登录 NAS,新建一个目录(下面以 `/volume1/docker/uu-remote` 为例): + +```sh +sudo mkdir -p /volume1/docker/uu-remote/config +sudo chmod 700 /volume1/docker/uu-remote/config +cd /volume1/docker/uu-remote +``` + +新建 `compose.yaml`,内容如下。把 `/volume1/共享文件夹` 改成你想远程访问的文件夹(可以写多行挂多个): + +```yaml +services: + uu-remote: + image: ghcr.io/vallierdev/uu-remote-linux:latest + container_name: uu-remote + network_mode: host # 让远程连接尽量走直连,速度更快 + restart: unless-stopped + volumes: + - ./config:/config # 登录信息,请勿外传 + - /volume1/共享文件夹:/data # 文件传输和终端看到的目录 +``` + +## 第二步:扫码登录(只需一次) + +```sh +sudo docker compose pull +sudo docker compose run --rm uu-remote login --no-gui +``` + +终端里会显示一个二维码:用手机 UU 远程扫码并确认。看到登录成功的提示后,按 `Ctrl+C` 退出(如果没有自动退出)。 + +> 二维码等同于你的登录凭据,**不要截图或发给别人**。登录信息保存在 `config/config.json`。 +> 一定要用上面的 `docker compose run`(主机网络),这样设备在列表里显示的是 NAS 的名字; +> 若用普通 `docker run` 登录,设备名会是一串随机字符。 + +## 第三步:启动 + +```sh +sudo docker compose up -d +sudo docker compose logs -f +``` + +日志里出现 `availability=Some("ready")` 就说明上线了,按 `Ctrl+C` 退出日志查看(容器继续在后台运行)。 +之后 NAS 开机会自动启动它。 + +**用群晖界面管理**:Container Manager → 项目 → 新增,路径选 `/volume1/docker/uu-remote`,会自动读取 `compose.yaml`。 +首次登录仍需在 SSH 里执行第二步。 + +## 使用 + +打开官方 UU 远程客户端,在「我的设备」里找到你的 NAS(显示为 Windows 设备,这是正常的): + +- **文件传输**:浏览、上传、下载 `/data` 里的文件。 +- **终端**:进入容器的命令行,当前目录是 `/data`。注意这是容器而不是 NAS 系统本身。 +- **端口映射**:例如目标填 `127.0.0.1`、端口 `5000`,就能在本地浏览器打开 NAS 的 DSM 管理页; + 填局域网里其他设备的地址和端口(如 `192.168.1.10:22`)即可访问那台设备的服务。 + +## 更新 + +```sh +cd /volume1/docker/uu-remote +sudo docker compose pull && sudo docker compose up -d +``` + +`config` 目录保留即可,不用重新登录。 + +## 停用与移除 + +```sh +sudo docker compose down # 停止并删除容器 +``` + +再在官方客户端的设备列表里删除这台设备;如需彻底清除登录信息,删除 `config` 目录。 + +## 常见问题 + +- **设备名是一串随机字符**:登录时没有用主机网络。删除 `config/config.json`,按第二步用 `docker compose run` 重新登录。 +- **一直不上线**:`sudo docker compose logs --tail 100` 查看日志;确认 NAS 能访问外网。 +- **连接慢、经常卡**:确认 `network_mode: host` 没有被去掉。 +- **想要远程桌面**:NAS 上不支持;请在有桌面的 Linux 电脑上安装主机端(见主 README)。 + +安全提示:只挂需要远程访问的文件夹;端口映射可以访问 NAS 所在局域网,请保管好 UU 账号。 + +--- + +## English + +Image: [`ghcr.io/vallierdev/uu-remote-linux`](https://github.com/VallierDev/uu-remote-linux/pkgs/container/uu-remote-linux) + +Runs this project's host headless on a desktop-less NAS (x86_64, e.g. Synology DSM 7.2+ with Container Manager) for the +official UU Remote clients: **file transfer** (folders you mount at `/data`), **terminal** (bash inside the container) and +**port mapping** into your LAN. No remote desktop. + +```sh +sudo mkdir -p /volume1/docker/uu-remote/config && sudo chmod 700 /volume1/docker/uu-remote/config +cd /volume1/docker/uu-remote +# compose.yaml: image ghcr.io/vallierdev/uu-remote-linux:latest, network_mode: host, +# volumes ./config:/config and /volume1/your-share:/data (see the Chinese section above) +sudo docker compose pull +sudo docker compose run --rm uu-remote login --no-gui # scan the QR with the UU mobile app; the QR is a credential +sudo docker compose up -d +sudo docker compose logs -f # wait for availability=Some("ready") +``` + +Update with `docker compose pull && docker compose up -d` (keep `config/`). Remove with `docker compose down`, then delete +the device in the official client. + +**Unofficial project, not affiliated with NetEase.**