|
20 | 20 | # HICLAW_ADMIN_PASSWORD Admin password (auto-generated if not set, min 8 chars) |
21 | 21 | # HICLAW_MATRIX_DOMAIN Matrix domain (default: matrix-local.hiclaw.io:18080) |
22 | 22 | # HICLAW_MOUNT_SOCKET Mount container runtime socket (default: 1) |
| 23 | +# HICLAW_MATRIX_E2EE Matrix E2EE (default: 0, disabled) |
23 | 24 | # HICLAW_DATA_DIR Docker volume name for persistent data (default: hiclaw-data) |
24 | 25 | # HICLAW_WORKSPACE_DIR Host directory for manager workspace (default: ~/hiclaw-manager) |
25 | 26 | # HICLAW_VERSION Image tag (default: latest) |
@@ -356,6 +357,18 @@ $script:Messages = @{ |
356 | 357 | "worker_runtime.choice" = @{ zh = "请选择 [1/2]"; en = "Enter choice [1/2]" } |
357 | 358 | "worker_runtime.selected" = @{ zh = "默认 Worker 运行时: {0}"; en = "Default Worker runtime: {0}" } |
358 | 359 |
|
| 360 | + # --- Matrix E2EE --- |
| 361 | + "matrix_e2ee.title" = @{ zh = "--- Matrix 端到端加密(E2EE)---"; en = "--- Matrix End-to-End Encryption (E2EE) ---" } |
| 362 | + "matrix_e2ee.desc" = @{ |
| 363 | + zh = "E2EE 会对 Manager 与 Worker 之间的 Matrix 消息进行端到端加密。`n 启用后,即使 Matrix 服务器被入侵,消息内容也无法被窃取。`n 但 E2EE 会增加首次握手耗时,且要求所有 Agent 都支持 matrix-sdk-crypto。`n 如果不确定,建议保持禁用。`n ⚠ 注意:禁用 E2EE 后,请勿在 Element 上创建默认启用加密的 Private 房间,`n 否则 Agent 将无法读取该房间中的加密消息。请改用 Public 房间或关闭房间加密。" |
| 364 | + en = "E2EE encrypts Matrix messages between Manager and Workers end-to-end.`n When enabled, message content stays private even if the Matrix server is compromised.`n However, E2EE adds overhead to the initial handshake and requires all Agents`n to support matrix-sdk-crypto. If unsure, keep it disabled.`n ⚠ Note: When E2EE is disabled, do NOT create Private rooms in Element (which`n enable encryption by default) — Agents cannot read encrypted messages without`n E2EE support. Use Public rooms or turn off room encryption instead." |
| 365 | + } |
| 366 | + "matrix_e2ee.enable" = @{ zh = "启用 E2EE"; en = "Enable E2EE" } |
| 367 | + "matrix_e2ee.disable" = @{ zh = "禁用 E2EE(推荐)"; en = "Disable E2EE (recommended)" } |
| 368 | + "matrix_e2ee.choice" = @{ zh = "请选择 [1/2]"; en = "Enter choice [1/2]" } |
| 369 | + "matrix_e2ee.selected_enabled" = @{ zh = "Matrix E2EE: 已启用"; en = "Matrix E2EE: enabled" } |
| 370 | + "matrix_e2ee.selected_disabled" = @{ zh = "Matrix E2EE: 已禁用(默认)"; en = "Matrix E2EE: disabled (default)" } |
| 371 | + |
359 | 372 | # --- Worker idle timeout --- |
360 | 373 | "idle_timeout.prompt" = @{ zh = "Worker 空闲自动停止超时(分钟)[720]"; en = "Worker idle auto-stop timeout in minutes [720]" } |
361 | 374 | "idle_timeout.selected" = @{ zh = "Worker 空闲超时: {0} 分钟"; en = "Worker idle timeout: {0} minutes" } |
@@ -699,6 +712,9 @@ HICLAW_COPAW_WORKER_IMAGE=$($Config.COPAW_WORKER_IMAGE) |
699 | 712 | # Default Worker runtime (openclaw | copaw) |
700 | 713 | HICLAW_DEFAULT_WORKER_RUNTIME=$($Config.DEFAULT_WORKER_RUNTIME) |
701 | 714 |
|
| 715 | +# Matrix E2EE (0=disabled, 1=enabled; default: 0) |
| 716 | +HICLAW_MATRIX_E2EE=$($Config.MATRIX_E2EE) |
| 717 | +
|
702 | 718 | # Worker idle timeout in minutes (default: 720 = 12 hours) |
703 | 719 | HICLAW_WORKER_IDLE_TIMEOUT=$($Config.WORKER_IDLE_TIMEOUT) |
704 | 720 |
|
@@ -1648,6 +1664,40 @@ function Install-Manager { |
1648 | 1664 | } |
1649 | 1665 | Write-Log (Get-Msg "worker_runtime.selected" -f $config.DEFAULT_WORKER_RUNTIME) |
1650 | 1666 |
|
| 1667 | + # Matrix E2EE (shown in manual mode for fresh install; always shown during upgrade) |
| 1668 | + if (-not $script:HICLAW_NON_INTERACTIVE -and (-not $script:HICLAW_QUICKSTART -or $script:HICLAW_UPGRADE)) { |
| 1669 | + Write-Host "" |
| 1670 | + Write-Log (Get-Msg "matrix_e2ee.title") |
| 1671 | + Write-Host "" |
| 1672 | + Write-Host " $(Get-Msg 'matrix_e2ee.desc')" |
| 1673 | + Write-Host "" |
| 1674 | + Write-Host " 1) $(Get-Msg 'matrix_e2ee.disable')" |
| 1675 | + Write-Host " 2) $(Get-Msg 'matrix_e2ee.enable')" |
| 1676 | + Write-Host "" |
| 1677 | + if ($script:HICLAW_UPGRADE -and $env:HICLAW_MATRIX_E2EE) { |
| 1678 | + Write-Log (Get-Msg "prompt.upgrade_keep" -f "HICLAW_MATRIX_E2EE", $env:HICLAW_MATRIX_E2EE) |
| 1679 | + $e2eeChoice = Read-Host (Get-Msg "matrix_e2ee.choice") |
| 1680 | + if ($e2eeChoice) { |
| 1681 | + $config.MATRIX_E2EE = if ($e2eeChoice -eq "2") { "1" } else { "0" } |
| 1682 | + } else { |
| 1683 | + $config.MATRIX_E2EE = $env:HICLAW_MATRIX_E2EE |
| 1684 | + } |
| 1685 | + } elseif (-not $env:HICLAW_MATRIX_E2EE) { |
| 1686 | + $e2eeChoice = Read-Host (Get-Msg "matrix_e2ee.choice") |
| 1687 | + $e2eeChoice = if ($e2eeChoice) { $e2eeChoice } else { "1" } |
| 1688 | + $config.MATRIX_E2EE = if ($e2eeChoice -eq "2") { "1" } else { "0" } |
| 1689 | + } else { |
| 1690 | + $config.MATRIX_E2EE = $env:HICLAW_MATRIX_E2EE |
| 1691 | + } |
| 1692 | + } else { |
| 1693 | + $config.MATRIX_E2EE = if ($env:HICLAW_MATRIX_E2EE) { $env:HICLAW_MATRIX_E2EE } else { "0" } |
| 1694 | + } |
| 1695 | + if ($config.MATRIX_E2EE -eq "1") { |
| 1696 | + Write-Log (Get-Msg "matrix_e2ee.selected_enabled") |
| 1697 | + } else { |
| 1698 | + Write-Log (Get-Msg "matrix_e2ee.selected_disabled") |
| 1699 | + } |
| 1700 | + |
1651 | 1701 | # Worker idle timeout (minutes, default: 720 = 12 hours) |
1652 | 1702 | if (-not $script:HICLAW_NON_INTERACTIVE -and (-not $script:HICLAW_QUICKSTART -or $script:HICLAW_UPGRADE)) { |
1653 | 1703 | if ($script:HICLAW_UPGRADE -and $env:HICLAW_WORKER_IDLE_TIMEOUT) { |
|
0 commit comments