mirror of
https://github.com/qingchencloud/clawpanel.git
synced 2026-08-06 13:43:50 +08:00
fix(ci): restore macos gateway uid helper
This commit is contained in:
@@ -62,7 +62,7 @@
|
||||
|
||||
### 测试与验证 (Testing)
|
||||
|
||||
- Node.js `22.22.3` 下 `node --test tests/*.test.js`:503 passed
|
||||
- Node.js `22.22.3` 下 `node --test tests/*.test.js`:504 passed
|
||||
- Node.js `22.22.3` 下 `npm run build`:通过
|
||||
- `cargo fmt --all -- --check`:通过
|
||||
- `cargo check --locked`:通过
|
||||
|
||||
@@ -6026,6 +6026,26 @@ pub fn delete_backup(name: String) -> Result<(), String> {
|
||||
fs::remove_file(&path).map_err(|e| format!("删除失败: {e}"))
|
||||
}
|
||||
|
||||
/// 获取当前用户 UID,供 macOS launchctl 的 gui/<uid> 服务域使用。
|
||||
#[allow(dead_code)]
|
||||
fn get_uid() -> Result<u32, String> {
|
||||
#[cfg(target_os = "windows")]
|
||||
{
|
||||
Ok(0)
|
||||
}
|
||||
#[cfg(not(target_os = "windows"))]
|
||||
{
|
||||
let output = Command::new("id")
|
||||
.arg("-u")
|
||||
.output()
|
||||
.map_err(|e| format!("获取 UID 失败: {e}"))?;
|
||||
String::from_utf8_lossy(&output.stdout)
|
||||
.trim()
|
||||
.parse::<u32>()
|
||||
.map_err(|e| format!("解析 UID 失败: {e}"))
|
||||
}
|
||||
}
|
||||
|
||||
const OPENCLAW_NATIVE_CONFIG_RELOAD_VERSION_FLOOR: &str = "2026.7.1";
|
||||
|
||||
fn supports_native_config_reload(version: &str) -> bool {
|
||||
|
||||
@@ -50,6 +50,13 @@ test('OpenClaw 7.1 发布与容器基线不低于 Node.js 22.22.3', () => {
|
||||
assert.match(read('Dockerfile'), /FROM node:22\.22\.3-alpine AS production/)
|
||||
})
|
||||
|
||||
test('macOS Gateway 服务操作保留 launchctl 所需的用户 UID helper', () => {
|
||||
const config = read('src-tauri/src/commands/config.rs')
|
||||
assert.match(config, /fn get_uid\(\) -> Result<u32, String>/)
|
||||
assert.match(config, /Command::new\("id"\)[\s\S]*?\.arg\("-u"\)/)
|
||||
assert.match(config, /format!\("gui\/\{uid\}\/ai\.openclaw\.gateway"\)/)
|
||||
})
|
||||
|
||||
test('Hermes Rust 与 Web 关键 Provider 注册表保持一致', () => {
|
||||
const rust = read('src-tauri/src/commands/hermes_providers.rs')
|
||||
const web = read('scripts/dev-api.js')
|
||||
|
||||
Reference in New Issue
Block a user