Compare commits

...
2 Commits
Author SHA1 Message Date
VallierDevandClaude Opus 5.5 1054af0950 Release v0.2.1
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-17 16:31:41 +08:00
VallierDevandClaude Opus 5.5 94fd3c2fa7 fix(actions): never wait for a polkit prompt on remote reboot/shutdown
Without polkit permission (for example no active local session)
systemctl reboot/poweroff waited for an authentication dialog on the
controlled screen. Pass --no-ask-password so the action fails and is
logged instead. README: the viewer's terminal session list, reboot and
shutdown, and its Wayland window/clipboard were tested in a VM.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-17 16:31:41 +08:00
6 changed files with 36 additions and 9 deletions

No files matched your search

Generated
+1 -1
View File
@@ -2741,7 +2741,7 @@ checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821"
[[package]] [[package]]
name = "uu-remote-linux" name = "uu-remote-linux"
version = "0.2.0" version = "0.2.1"
dependencies = [ dependencies = [
"async-trait", "async-trait",
"base64 0.22.1", "base64 0.22.1",
+1 -1
View File
@@ -1,6 +1,6 @@
[package] [package]
name = "uu-remote-linux" name = "uu-remote-linux"
version = "0.2.0" version = "0.2.1"
edition = "2021" edition = "2021"
default-run = "uuremote-server" default-run = "uuremote-server"
authors = ["uu-remote-linux contributors"] authors = ["uu-remote-linux contributors"]
+5 -3
View File
@@ -45,7 +45,7 @@
| Lock state and auto unlock | Lock state is reported to the viewer; with "auto unlock" enabled in the client, the password is verified with PAM and the session is unlocked | | Lock state and auto unlock | Lock state is reported to the viewer; with "auto unlock" enabled in the client, the password is verified with PAM and the session is unlocked |
| Lock after remote session | Stored on the host, so it still applies after reconnecting | | Lock after remote session | Stored on the host, so it still applies after reconnecting |
| Mute host while controlled | Host speakers are muted while the viewer still hears the sound; the previous mute state is restored afterwards | | Mute host while controlled | Host speakers are muted while the viewer still hears the sound; the previous mute state is restored afterwards |
| System actions | Lock, show desktop, task manager (system monitor), reboot, shut down | | System actions | Lock, show desktop, task manager (system monitor), reboot, shut down (via `systemctl`; needs polkit permission for the user, usually an active local graphical session; without it the action fails and is logged, no password dialog appears on the host) |
| Port mapping | The official "port mapping" tool: forwards a local port on the viewer to an address reachable from the Linux host (e.g. 127.0.0.1:22); `UU_PORT_MAPPING=0` disables it | | Port mapping | The official "port mapping" tool: forwards a local port on the viewer to an address reachable from the Linux host (e.g. 127.0.0.1:22); `UU_PORT_MAPPING=0` disables it |
| Reconnects | Every tool window has its own connection; they do not disturb each other | | Reconnects | Every tool window has its own connection; they do not disturb each other |
| Headless servers | Goes online without a monitor with terminal, file transfer and port mapping; an Xvfb virtual desktop gives a full remote desktop (see below) | | Headless servers | Goes online without a monitor with terminal, file transfer and port mapping; an Xvfb virtual desktop gives a full remote desktop (see below) |
@@ -435,7 +435,9 @@ terminal emulator (`TERMINAL` selects one). From source: `sudo apt install libsd
| Port mapping, terminal | — | — | ✅ | | Port mapping, terminal | — | — | ✅ |
| Clipboard (text, both ways), sound | — | — | ✅ (VM) | | Clipboard (text, both ways), sound | — | — | ✅ (VM) |
| Remote assistance (ID + code) | — | — | ✅ (VM, guest host) | | Remote assistance (ID + code) | — | — | ✅ (VM, guest host) |
| Terminal session list (create, double-click reattach, end) | — | — | ✅ (VM) |
| Reboot, shutdown | — | — | ✅ (VM) |
| Wayland desktop window and clipboard (Hyprland) | — | — | ✅ (VM) |
"—" = not tested yet. **Not tested live**: reboot/shutdown (only try on a machine you can restart), terminal session list "—" = not tested yet. Only use reboot/shutdown on machines you can restart. **Not tested live**: GNOME/KDE Wayland windows and clipboard, H.265 and 4:4:4 (only H.264 4:2:0 is decoded), multiple monitors. Logs carry field
create/reattach, Wayland windows and clipboard, H.265 and 4:4:4 (only H.264 4:2:0 is decoded), multiple monitors. Logs carry field
numbers, sizes and states only, never keystrokes, clipboard or file contents, codes or credentials. numbers, sizes and states only, never keystrokes, clipboard or file contents, codes or credentials.
+5 -2
View File
@@ -41,7 +41,7 @@
| 锁屏与自动解锁 | 向控制端上报锁屏状态;开启「自动解锁被控端」后,通过 PAM 校验密码并解锁当前会话 | | 锁屏与自动解锁 | 向控制端上报锁屏状态;开启「自动解锁被控端」后,通过 PAM 校验密码并解锁当前会话 |
| 远程结束后自动锁屏 | 设置保存在本机,重连后依然生效 | | 远程结束后自动锁屏 | 设置保存在本机,重连后依然生效 |
| 被控端静音运行 | 主机扬声器静音,控制端照常能听到声音;结束后恢复原来的音量设置 | | 被控端静音运行 | 主机扬声器静音,控制端照常能听到声音;结束后恢复原来的音量设置 |
| 系统操作 | 锁屏、显示桌面、任务管理器(系统监视器)、重启、关机 | | 系统操作 | 锁屏、显示桌面、任务管理器(系统监视器)、重启、关机(通过 `systemctl`,需要当前用户有 polkit 权限:通常本机有活动的图形会话即可;没有权限时直接失败并记日志,不会在被控端弹出密码框) |
| 端口映射 | 官方「端口映射」工具:把控制端本地端口转发到 Linux 能访问到的地址(如 127.0.0.1:22);`UU_PORT_MAPPING=0` 可关闭 | | 端口映射 | 官方「端口映射」工具:把控制端本地端口转发到 Linux 能访问到的地址(如 127.0.0.1:22);`UU_PORT_MAPPING=0` 可关闭 |
| 多次重连 | 每个工具窗口独立连接,互不影响 | | 多次重连 | 每个工具窗口独立连接,互不影响 |
| 无头服务器 | 没有显示器也能上线,提供终端、文件传输和端口映射;也可以用 Xvfb 虚拟桌面提供完整远程桌面(见下文) | | 无头服务器 | 没有显示器也能上线,提供终端、文件传输和端口映射;也可以用 Xvfb 虚拟桌面提供完整远程桌面(见下文) |
@@ -399,6 +399,9 @@ xfce4-session xfce4-panel xfdesktop xfwm4 gnome-terminal`。
| 端口映射、终端 | — | — | ✅ | | 端口映射、终端 | — | — | ✅ |
| 剪贴板(文本,双向)、声音 | — | — | ✅(虚拟机) | | 剪贴板(文本,双向)、声音 | — | — | ✅(虚拟机) |
| 远程协助(ID + 验证码) | — | — | ✅(虚拟机,访客主机) | | 远程协助(ID + 验证码) | — | — | ✅(虚拟机,访客主机) |
| 终端会话列表(新建、双击接回、结束) | — | — | ✅(虚拟机) |
| 重启、关机 | — | — | ✅(虚拟机) |
| Wayland 下的桌面窗口与剪贴板(Hyprland) | — | — | ✅(虚拟机) |
「—」表示尚未测试。**未实测**:重启/关机(只应在可以重启的测试机上尝试)、终端会话列表的新建与接回、Wayland 下的窗口与剪贴板、 「—」表示尚未测试。重启/关机只应在可以重启的机器上使用。**未实测**:GNOME/KDE Wayland 下的窗口与剪贴板、
H.265 与 4:4:4(目前只解码 H.264 4:2:0)、多显示器。日志只记录字段号、大小和状态,不记录键盘、剪贴板、文件内容、验证码或凭据。 H.265 与 4:4:4(目前只解码 H.264 4:2:0)、多显示器。日志只记录字段号、大小和状态,不记录键盘、剪贴板、文件内容、验证码或凭据。
+20
View File
@@ -0,0 +1,20 @@
控制端补测:重启/关机、终端会话列表、Wayland;主机远程关机不再等待授权弹窗。/ Viewer power, terminal list and Wayland tested; host power actions never wait for a polkit prompt.
### 修复 / Fixed
- **远程重启/关机不再卡在授权弹窗**:被控端用户没有 polkit 权限时(例如本机没有活动的图形会话),`systemctl reboot/poweroff`
会一直等待,并可能在被控端屏幕上弹出密码框。现在加了 `--no-ask-password`,没有权限时直接失败并在日志记录 `ok=false`。
正常情况下(本机有活动的图形会话)行为不变。
Reboot/shutdown no longer wait for a polkit authentication dialog on the host; without permission they fail and are logged.
### 控制端实测补充 / Viewer testing
在虚拟机中用第二个主机身份实测通过(`uuremote-viewer` 连接本项目主机):
- 远程**重启**、**关机**,以及关机后重新开机上线。
- 终端会话列表:新建、双击接回(重放历史输出、原 shell 环境保留)、确认后结束会话。
- Wayland(Hyprland)下的桌面窗口与剪贴板(`wl-copy`/`wl-paste`,双向)。
⚠️ 仍未实测:GNOME/KDE Wayland 下的窗口与剪贴板、H.265 与 4:4:4(只解码 H.264 4:2:0)、多显示器。
Tested in a VM: reboot, shutdown and power-on, terminal session list, Wayland (Hyprland) window and clipboard.
### 下载 / Download
`uu-remote-linux-v0.2.1-x86_64-linux.tar.gz`:主机 `uuremote-server`(X11 版)与控制端 `uuremote-viewer`(x86_64,glibc ≥ 2.35;控制端需 SDL2、GTK3、ffmpeg),附带 `contrib/`。
**非官方项目,与网易无关。** / **Unofficial, not affiliated with NetEase.**
+4 -2
View File
@@ -61,6 +61,8 @@ fn save(settings: &Settings) {
#[derive(Default)] #[derive(Default)]
pub struct PeerActions { started: AtomicBool } pub struct PeerActions { started: AtomicBool }
/// Power actions pass --no-ask-password: without polkit permission (e.g. no active local session) systemctl
/// would otherwise wait for an authentication dialog on the controlled screen; fail and log instead.
fn quiet(program: &str, args: &[&str]) -> bool { fn quiet(program: &str, args: &[&str]) -> bool {
Command::new(program).args(args).stdin(Stdio::null()).stdout(Stdio::null()).stderr(Stdio::null()) Command::new(program).args(args).stdin(Stdio::null()).stdout(Stdio::null()).stderr(Stdio::null())
.status().map(|s| s.success()).unwrap_or(false) .status().map(|s| s.success()).unwrap_or(false)
@@ -135,8 +137,8 @@ impl PeerActions {
let ok = detached("gnome-system-monitor", &[]) || detached("plasma-systemmonitor", &[]) || detached("xfce4-taskmanager", &[]); let ok = detached("gnome-system-monitor", &[]) || detached("plasma-systemmonitor", &[]) || detached("xfce4-taskmanager", &[]);
log::info!("System action show_taskmgr: ok={}", ok); return false log::info!("System action show_taskmgr: ok={}", ok); return false
} }
REBOOT_SYSTEM => { log::warn!("System action reboot_system requested by viewer"); log::info!("reboot ok={}", quiet("systemctl", &["reboot"])); return false } REBOOT_SYSTEM => { log::warn!("System action reboot_system requested by viewer"); log::info!("reboot ok={}", quiet("systemctl", &["--no-ask-password", "reboot"])); return false }
SHUTDOWN_SYSTEM => { log::warn!("System action shutdown_system requested by viewer"); log::info!("poweroff ok={}", quiet("systemctl", &["poweroff"])); return false } SHUTDOWN_SYSTEM => { log::warn!("System action shutdown_system requested by viewer"); log::info!("poweroff ok={}", quiet("systemctl", &["--no-ask-password", "poweroff"])); return false }
_ => {} _ => {}
} }
let mut state = state().lock().unwrap(); let mut state = state().lock().unwrap();