@exagone313/dsh-podman 0.2.0-rc.3 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (191) hide show
  1. package/README.md +14 -2
  2. package/README.zh.md +14 -2
  3. package/cordis.patch.yml +58 -0
  4. package/dist/approval-reasons.d.ts +3 -4
  5. package/dist/approval-reasons.js +40 -49
  6. package/dist/approval-reasons.test.js +43 -15
  7. package/dist/approval.js +27 -10
  8. package/dist/approval.test.js +165 -34
  9. package/dist/card-route.d.ts +3 -2
  10. package/dist/card-route.js +154 -42
  11. package/dist/card-route.test.js +85 -43
  12. package/dist/card-test-support.js +39 -66
  13. package/dist/client/ContainerCard.d.ts +1 -1
  14. package/dist/client/ContainerCard.js +92 -50
  15. package/dist/client/card-protocol.d.ts +6 -3
  16. package/dist/client/container-card-caches.js +11 -6
  17. package/dist/client/container-card-controller.d.ts +16 -18
  18. package/dist/client/container-card-controller.js +92 -40
  19. package/dist/client/container-card-create-modal.d.ts +2 -2
  20. package/dist/client/container-card-create-modal.js +13 -5
  21. package/dist/client/container-card-default-env.d.ts +10 -0
  22. package/dist/client/container-card-default-env.js +69 -0
  23. package/dist/client/container-card-directory.d.ts +2 -2
  24. package/dist/client/container-card-directory.js +12 -4
  25. package/dist/client/container-card-editors.d.ts +3 -3
  26. package/dist/client/container-card-editors.js +104 -32
  27. package/dist/client/container-card-images.d.ts +4 -4
  28. package/dist/client/container-card-images.js +19 -6
  29. package/dist/client/container-card-paths.d.ts +3 -3
  30. package/dist/client/container-card-paths.js +18 -11
  31. package/dist/client/container-card-row.d.ts +10 -6
  32. package/dist/client/container-card-row.js +82 -13
  33. package/dist/client/container-card-secrets.d.ts +3 -3
  34. package/dist/client/container-card-secrets.js +8 -6
  35. package/dist/client/container-card-shared.d.ts +4 -17
  36. package/dist/client/container-card-shared.js +9 -25
  37. package/dist/client/container-card-styles.d.ts +2 -8
  38. package/dist/client/container-card-styles.js +14 -52
  39. package/dist/client/container-card-volumes.d.ts +2 -2
  40. package/dist/client/container-card-volumes.js +9 -5
  41. package/dist/client/container-card-workspace.d.ts +8 -6
  42. package/dist/client/container-card-workspace.js +9 -3
  43. package/dist/client/directory-picker.js +2 -1
  44. package/dist/client/index.js +13141 -2036
  45. package/dist/client/locales.d.ts +6 -1
  46. package/dist/client/locales.js +106 -38
  47. package/dist/client/podman-terminal-guide.d.ts +11 -0
  48. package/dist/client/podman-terminal-guide.js +208 -0
  49. package/dist/client/podman-terminal-title.d.ts +7 -0
  50. package/dist/client/podman-terminal-title.js +30 -0
  51. package/dist/client/podman-terminal.d.ts +26 -0
  52. package/dist/client/podman-terminal.js +412 -0
  53. package/dist/client/read-only-approval.d.ts +2 -2
  54. package/dist/client/read-only-approval.js +13 -3
  55. package/dist/client/slot-contract.d.ts +0 -11
  56. package/dist/client/terminal-preference.d.ts +26 -0
  57. package/dist/client/terminal-preference.js +67 -0
  58. package/dist/client/terminal-protocol.d.ts +85 -0
  59. package/dist/client/terminal-protocol.js +14 -0
  60. package/dist/client/terminal-tab.d.ts +60 -0
  61. package/dist/client/terminal-tab.js +35 -0
  62. package/dist/client/terminal-targets.d.ts +33 -0
  63. package/dist/client/terminal-targets.js +65 -0
  64. package/dist/client/terminal-titles.d.ts +23 -0
  65. package/dist/client/terminal-titles.js +52 -0
  66. package/dist/client/terminal-transport.d.ts +63 -0
  67. package/dist/client/terminal-transport.js +207 -0
  68. package/dist/client/tool-views.js +215 -49
  69. package/dist/container-env.d.ts +11 -0
  70. package/dist/container-env.js +96 -0
  71. package/dist/container-env.test.d.ts +1 -0
  72. package/dist/container-env.test.js +93 -0
  73. package/dist/containers.test.js +196 -18
  74. package/dist/daemons.test.js +18 -4
  75. package/dist/dsh-version.d.ts +1 -0
  76. package/dist/dsh-version.js +46 -0
  77. package/dist/env-rows.d.ts +14 -0
  78. package/dist/env-rows.js +52 -0
  79. package/dist/env-rows.test.d.ts +1 -0
  80. package/dist/env-rows.test.js +43 -0
  81. package/dist/fs-provider.d.ts +1 -0
  82. package/dist/fs-provider.js +26 -12
  83. package/dist/fs-provider.test.js +51 -10
  84. package/dist/generated/version.d.ts +2 -2
  85. package/dist/generated/version.js +2 -2
  86. package/dist/grpc/proto/dshctl/v1/control.proto +11 -1
  87. package/dist/grpc/proto/dshguest/v1/guest.proto +5 -0
  88. package/dist/grpc/runtime-client.d.ts +3 -1
  89. package/dist/grpc/runtime-client.js +90 -17
  90. package/dist/guest-rpc.d.ts +15 -19
  91. package/dist/guest-rpc.js +289 -70
  92. package/dist/guest-rpc.test.d.ts +1 -0
  93. package/dist/guest-rpc.test.js +241 -0
  94. package/dist/guest-terminal.d.ts +30 -0
  95. package/dist/guest-terminal.js +196 -0
  96. package/dist/images.test.js +10 -3
  97. package/dist/index.d.ts +11 -16
  98. package/dist/index.js +42 -36
  99. package/dist/locales.test.d.ts +1 -0
  100. package/dist/locales.test.js +34 -0
  101. package/dist/misc.test.js +38 -10
  102. package/dist/mount-enums.js +2 -1
  103. package/dist/mount-input.d.ts +2 -0
  104. package/dist/mount-input.js +38 -22
  105. package/dist/mounts.test.js +81 -11
  106. package/dist/naming.test.d.ts +1 -0
  107. package/dist/naming.test.js +28 -0
  108. package/dist/output-reader.js +36 -4
  109. package/dist/package-deps.test.d.ts +1 -0
  110. package/dist/package-deps.test.js +49 -0
  111. package/dist/paths.test.js +4 -2
  112. package/dist/plugin-meta.test.d.ts +1 -0
  113. package/dist/plugin-meta.test.js +29 -0
  114. package/dist/project-path.js +33 -7
  115. package/dist/project-path.test.js +14 -0
  116. package/dist/prompts.d.ts +0 -4
  117. package/dist/prompts.js +15 -84
  118. package/dist/read-only-shell.js +3 -1
  119. package/dist/read-only-shell.test.js +80 -25
  120. package/dist/runtime-client.test.d.ts +1 -0
  121. package/dist/runtime-client.test.js +53 -0
  122. package/dist/secrets.test.js +21 -6
  123. package/dist/settings-commands.test.js +61 -14
  124. package/dist/settings-create.test.js +32 -10
  125. package/dist/settings-default-env.test.d.ts +1 -0
  126. package/dist/settings-default-env.test.js +175 -0
  127. package/dist/settings-mounts.test.js +46 -7
  128. package/dist/settings-schema.d.ts +6 -11
  129. package/dist/settings-schema.js +4 -8
  130. package/dist/settings-schema.test.d.ts +1 -0
  131. package/dist/settings-schema.test.js +35 -0
  132. package/dist/settings-workspaces.test.js +38 -63
  133. package/dist/spill-store.d.ts +1 -0
  134. package/dist/spill-store.js +17 -4
  135. package/dist/spill-store.test.js +31 -8
  136. package/dist/subprocess.d.ts +4 -0
  137. package/dist/subprocess.js +148 -162
  138. package/dist/subprocess.test.js +118 -8
  139. package/dist/terminal-preference.test.d.ts +1 -0
  140. package/dist/terminal-preference.test.js +62 -0
  141. package/dist/terminal-route.d.ts +10 -0
  142. package/dist/terminal-route.js +270 -0
  143. package/dist/terminal-route.test.d.ts +1 -0
  144. package/dist/terminal-route.test.js +265 -0
  145. package/dist/terminal-sessions.d.ts +69 -0
  146. package/dist/terminal-sessions.js +252 -0
  147. package/dist/terminal-shells.d.ts +22 -0
  148. package/dist/terminal-shells.js +99 -0
  149. package/dist/terminal-tab.test.d.ts +1 -0
  150. package/dist/terminal-tab.test.js +58 -0
  151. package/dist/terminal-targets.test.d.ts +1 -0
  152. package/dist/terminal-targets.test.js +43 -0
  153. package/dist/terminal-titles.test.d.ts +1 -0
  154. package/dist/terminal-titles.test.js +36 -0
  155. package/dist/test-support.d.ts +35 -5
  156. package/dist/test-support.js +91 -29
  157. package/dist/tool-defs.js +19 -4
  158. package/dist/tool-handlers.js +80 -28
  159. package/dist/tool-params.js +19 -5
  160. package/dist/version-compat.d.ts +4 -0
  161. package/dist/version-compat.js +29 -0
  162. package/dist/version-compat.test.d.ts +1 -0
  163. package/dist/version-compat.test.js +27 -0
  164. package/dist/volumes.test.js +1 -1
  165. package/dist/workspace-binding.d.ts +19 -10
  166. package/dist/workspace-binding.js +252 -78
  167. package/dist/workspace-binding.test.js +202 -27
  168. package/docs/architecture.md +71 -20
  169. package/docs/architecture.zh.md +62 -12
  170. package/docs/configuration.md +61 -20
  171. package/docs/configuration.zh.md +53 -19
  172. package/docs/development-prompt.md +72 -0
  173. package/docs/development-prompt.zh.md +69 -0
  174. package/docs/development.md +184 -29
  175. package/docs/development.zh.md +165 -26
  176. package/docs/install-dsh-and-dsh-podman.md +24 -21
  177. package/docs/install-dsh-and-dsh-podman.zh.md +20 -21
  178. package/docs/uninstall.md +83 -0
  179. package/docs/uninstall.zh.md +79 -0
  180. package/docs/update.md +120 -0
  181. package/docs/update.zh.md +114 -0
  182. package/docs/usage.md +108 -61
  183. package/docs/usage.zh.md +76 -38
  184. package/locale/en.json +6 -0
  185. package/locale/zh.json +6 -0
  186. package/package.json +58 -25
  187. package/quadlet/dsh-podman-orchestrator.container +46 -0
  188. package/quadlet/dsh.container +35 -0
  189. package/LICENSE.pkg +0 -17103
  190. package/dist/preferences.d.ts +0 -6
  191. package/dist/preferences.js +0 -27
@@ -10,10 +10,13 @@ SPDX-License-Identifier: MIT
10
10
 
11
11
  本指南的目标是安装:
12
12
 
13
- - [DeepSeek Harness](https://deepseek.com/harness),下文简称 _dsh_
13
+ - [DeepSeek Harness](https://deepseek.com/harness),下文简称 _dsh_,在它自己的
14
+ Podman 容器中运行
14
15
  - dsh 中的 dsh-podman 插件,它取代了宿主的文件系统和 shell 访问
15
16
  - dsh-podman 编排器,一个与 Podman 集成的独立 Podman 容器
16
17
 
18
+ 请注意,如果 `~/.dsh` 中已有安装数据,它将被复用。
19
+
17
20
  将 dsh 插件和编排器作为独立的容器运行,是 dsh-podman 安全设计的重要一环: dsh
18
21
  本身不能直接访问 Podman,只有编排器可以,并且受到限制。dsh
19
22
  不应能通过这条路径提权,因为提供给 dsh 的权限能力是受限的:
@@ -77,12 +80,12 @@ SPDX-License-Identifier: MIT
77
80
 
78
81
  ## 安装
79
82
 
80
- ### dsh 配置
81
-
82
83
  本次安装使用
83
84
  [Podman Quadlet](https://docs.podman.io/en/latest/markdown/podman-systemd.unit.5.html),
84
85
  它为 systemd 增加了 Podman 集成。
85
86
 
87
+ 注意,dsh-podman 插件会在 dsh 容器启动时安装,这需要联网。
88
+
86
89
  1. 为你的用户创建 Quadlet 目录:
87
90
  ```bash
88
91
  mkdir -p ~/.config/containers/systemd
@@ -90,6 +93,9 @@ SPDX-License-Identifier: MIT
90
93
  2. 将文件 [dsh.container](../quadlet/dsh.container) 和
91
94
  [dsh-podman-orchestrator.container](../quadlet/dsh-podman-orchestrator.container)
92
95
  复制到 `~/.config/containers/systemd/`。
96
+ ```bash
97
+ cp quadlet/* ~/.config/containers/systemd/
98
+ ```
93
99
  - 如果你希望更改项目目录,可相应调整这些文件。
94
100
  3. 重新加载 systemd 会话配置:
95
101
  ```bash
@@ -118,28 +124,21 @@ SPDX-License-Identifier: MIT
118
124
  9. 浏览器保存该令牌后,即可通过 [http://127.0.0.1:3080/](http://127.0.0.1:3080/)
119
125
  访问 dsh。
120
126
 
121
- ### dsh-podman 插件安装
122
-
123
- 1. 运行以下命令安装 dsh-podman 插件:
124
- ```bash
125
- podman exec dsh dsh plugin --profile web add @exagone313/dsh-podman --allow-build=protobufjs
126
- ```
127
- 2. 重启 dsh 以完成安装:
128
- ```bash
129
- systemctl --user restart dsh
130
- ```
131
-
132
127
  ## 验证
133
128
 
134
- - 打开 **Settings → Plugins →
135
- dsh-podman**:卡片应列出基础镜像,并针对工作区提供创建其默认容器的选项。
129
+ - 打开侧边栏的 **插件** 面板 → **已安装** →
130
+ **dsh-podman**:页面应列出基础镜像,并针对工作区提供创建其默认容器的选项。
136
131
  - 在 dsh 会话中运行一条 shell 命令。它应在当前工作区的 Podman
137
132
  容器内执行(插件会在首次使用时自动创建工作区的默认容器)。
138
133
 
139
- ## 启用每日自动更新(可选)
134
+ ## 配置 Git 身份(推荐)
135
+
136
+ - 打开侧边栏的 **插件** 面板 → **已安装** → **dsh-podman**
137
+ - 向下滚动到 **默认环境**
138
+ - 点击 **Git 身份**
139
+ - 输入用于 Git 的名称和邮箱,然后点击 **应用**
140
+ - 点击 **应用默认环境变量**,然后点击 **确认**
140
141
 
141
- 这需要为你的用户启用 lingering。
142
+ ## 更新 dsh 与 dsh-podman
142
143
 
143
- ```bash
144
- systemctl --user enable --now podman-auto-update.timer
145
- ```
144
+ 请阅读[更新文档](./update.zh.md),了解如何手动更新或设置自动更新。
@@ -0,0 +1,83 @@
1
+ <!--
2
+ SPDX-FileCopyrightText: 2026 Elouan Martinet <exa@elou.world>
3
+
4
+ SPDX-License-Identifier: MIT
5
+ -->
6
+
7
+ # Uninstall
8
+
9
+ This page undoes the [installation guide](install-dsh-and-dsh-podman.md): it
10
+ assumes dsh runs from the dsh-podman image with the orchestrator, both started
11
+ from Quadlet units.
12
+
13
+ The dsh image installs the dsh-podman plugin at container start, and the
14
+ plugin's bundle layer is what disables dsh's own `subprocess`, `fs-sandbox`,
15
+ `spill-local` and built-in Terminal UI (`ui-sidebar-terminal`) plugins.
16
+ Uninstalling therefore also means running dsh without dsh-podman: its built-in
17
+ shell and filesystem tools are active again, and they run **on the host** as the
18
+ dsh user, with no container isolation.
19
+
20
+ ## Stop the containers and remove the Quadlet units
21
+
22
+ ```bash
23
+ systemctl --user stop dsh dsh-podman-orchestrator
24
+ rm ~/.config/containers/systemd/dsh.container
25
+ rm ~/.config/containers/systemd/dsh-podman-orchestrator.container
26
+ systemctl --user daemon-reload
27
+ ```
28
+
29
+ ## Then choose one of the two following options
30
+
31
+ These are alternatives, not steps: pick the one that matches what you want to
32
+ keep.
33
+
34
+ ### Remove dsh entirely
35
+
36
+ ```bash
37
+ podman unshare rm -rf ~/.dsh
38
+ ```
39
+
40
+ `~/.dsh` is the whole harness home: the profiles (including the installed
41
+ plugin), the settings, and the orchestrator's state and package caches. The
42
+ orchestrator runs as root, so parts of that directory belong to the container's
43
+ root and only `podman unshare` can remove them, from the user namespace.
44
+
45
+ ### Keep dsh without dsh-podman
46
+
47
+ Run dsh directly instead of from the image — as the harness documents, with
48
+ `npx @deepseek-ai/dsh web` — after removing the plugin from the profile, so dsh
49
+ stops loading it and its built-in plugins are active again:
50
+
51
+ ```bash
52
+ npx @deepseek-ai/dsh plugin --profile web remove @exagone313/dsh-podman
53
+ npx @deepseek-ai/dsh web
54
+ ```
55
+
56
+ Then archive the sessions that used the podman tools, from the session's menu
57
+ (**Archive session**): those tools no longer exist without dsh-podman, so
58
+ resuming such a session would leave the model calling tools that are gone.
59
+
60
+ The orchestrator's leftover state and package caches can be removed too. They
61
+ belong to the container's root, so remove them from the user namespace:
62
+
63
+ ```bash
64
+ podman unshare rm -rf ~/.dsh/dsh-podman
65
+ ```
66
+
67
+ ## Remove the Podman resources (optional)
68
+
69
+ The orchestrator creates one pod per dsh workspace, plus named volumes and
70
+ secrets, and builds images. Removing them only reclaims disk space; project
71
+ directories are bind mounts and are never touched.
72
+
73
+ ```bash
74
+ # Workspace pods and their containers, one per dsh workspace
75
+ podman pod ls --format '{{.Name}}' | grep '^dsh-podman-' | xargs -r podman pod rm -f
76
+
77
+ # Named volumes and secrets the orchestrator created
78
+ podman volume ls --format '{{.Name}}' | grep '^dsh-podman-' | xargs -r podman volume rm
79
+ podman secret ls --format '{{.Name}}' | grep '^dsh-podman-' | xargs -r podman secret rm
80
+
81
+ # Built workspace images, the base images, and the dsh-podman images themselves
82
+ podman images --format '{{.Repository}}:{{.Tag}}' | grep 'dsh-podman/' | xargs -r podman rmi
83
+ ```
@@ -0,0 +1,79 @@
1
+ <!--
2
+ SPDX-FileCopyrightText: 2026 Elouan Martinet <exa@elou.world>
3
+
4
+ SPDX-License-Identifier: MIT
5
+ -->
6
+
7
+ # 卸载
8
+
9
+ 本页用于撤销[安装指南](install-dsh-and-dsh-podman.zh.md)中的操作:其中假设 dsh
10
+ 运行在 dsh-podman 镜像中,并与编排器一同由 Quadlet 单元启动。
11
+
12
+ dsh 镜像会在容器启动时安装 dsh-podman 插件,而该插件的 bundle 层正是禁用 dsh
13
+ 自带的 `subprocess`、`fs-sandbox`、`spill-local`
14
+ 与内置终端界面(`ui-sidebar-terminal`) 插件的原因。因此,卸载也意味着不再使用
15
+ dsh-podman 运行 dsh:其内置的 shell 与文件系统工具会重新启用,并以 dsh
16
+ 用户的身份**在主机上**运行,不再有容器隔离。
17
+
18
+ ## 停止容器并移除 Quadlet 单元
19
+
20
+ ```bash
21
+ systemctl --user stop dsh dsh-podman-orchestrator
22
+ rm ~/.config/containers/systemd/dsh.container
23
+ rm ~/.config/containers/systemd/dsh-podman-orchestrator.container
24
+ systemctl --user daemon-reload
25
+ ```
26
+
27
+ ## 然后在以下两个选项中选择一个
28
+
29
+ 这两个选项是并列的,而不是先后步骤:请根据你想保留的内容选择其一。
30
+
31
+ ### 完全删除 dsh
32
+
33
+ ```bash
34
+ podman unshare rm -rf ~/.dsh
35
+ ```
36
+
37
+ `~/.dsh` 是整个 harness 主目录:包含各个
38
+ profile(其中有已安装的插件)、设置,以及编排器的状态与软件包缓存。编排器以 root
39
+ 运行,因此该目录中部分文件属于容器内的 root,只能在用户命名空间(user
40
+ namespace)中用 `podman unshare` 删除。
41
+
42
+ ### 保留 dsh 但不使用 dsh-podman
43
+
44
+ 改为直接运行 dsh,而不是从镜像运行——如 harness 文档所述,使用
45
+ `npx @deepseek-ai/dsh web`——在此之前先从 profile 中移除插件,这样 dsh
46
+ 便不再加载它,其内置插件也会重新启用:
47
+
48
+ ```bash
49
+ npx @deepseek-ai/dsh plugin --profile web remove @exagone313/dsh-podman
50
+ npx @deepseek-ai/dsh web
51
+ ```
52
+
53
+ 然后归档曾使用 podman 工具的会话,从会话菜单中选择**归档会话**(Archive
54
+ session):没有 dsh-podman
55
+ 之后这些工具已不存在,继续恢复此类会话会让模型调用已消失的工具。
56
+
57
+ 编排器残留的状态与软件包缓存也可以删除。它们属于容器内的
58
+ root,因此请在用户命名空间中删除:
59
+
60
+ ```bash
61
+ podman unshare rm -rf ~/.dsh/dsh-podman
62
+ ```
63
+
64
+ ## 删除 Podman 资源(可选)
65
+
66
+ 编排器会为每个 dsh 工作区创建一个
67
+ pod,并创建命名卷与机密,还会构建镜像。删除它们只是回收磁盘空间;项目目录是绑定挂载,绝不会被改动。
68
+
69
+ ```bash
70
+ # 工作区 pod 及其容器,每个 dsh 工作区一个
71
+ podman pod ls --format '{{.Name}}' | grep '^dsh-podman-' | xargs -r podman pod rm -f
72
+
73
+ # 编排器创建的命名卷与机密
74
+ podman volume ls --format '{{.Name}}' | grep '^dsh-podman-' | xargs -r podman volume rm
75
+ podman secret ls --format '{{.Name}}' | grep '^dsh-podman-' | xargs -r podman secret rm
76
+
77
+ # 构建的工作区镜像、基础镜像,以及 dsh-podman 自身的镜像
78
+ podman images --format '{{.Repository}}:{{.Tag}}' | grep 'dsh-podman/' | xargs -r podman rmi
79
+ ```
package/docs/update.md ADDED
@@ -0,0 +1,120 @@
1
+ <!--
2
+ SPDX-FileCopyrightText: 2026 Elouan Martinet <exa@elou.world>
3
+
4
+ SPDX-License-Identifier: MIT
5
+ -->
6
+
7
+ # Update
8
+
9
+ You should run updates only when no agents are running.
10
+
11
+ Existing guest containers will be recreated afterwards, so running processes and
12
+ daemons will be killed.
13
+
14
+ Note that the corresponding dsh-podman plugin will be installed from npm at
15
+ startup.
16
+
17
+ When enabling auto-updates, it is possible to skip updates while an agent is
18
+ running. Read further to set this up.
19
+
20
+ ## Update manually
21
+
22
+ Pull the new images:
23
+
24
+ ```bash
25
+ podman pull ghcr.io/exagone313/dsh-podman/dsh:1 ghcr.io/exagone313/dsh-podman/orchestrator:1
26
+ ```
27
+
28
+ Restart dsh and dsh-podman-orchestrator:
29
+
30
+ ```bash
31
+ systemctl --user restart dsh dsh-podman-orchestrator
32
+ ```
33
+
34
+ ## Upgrade to a new major version
35
+
36
+ Currently, dsh-podman major version is 1. To upgrade to major version 2 and
37
+ above, check the
38
+ [release notes](https://github.com/Exagone313/dsh-podman/releases).
39
+
40
+ ## Enable auto-updates
41
+
42
+ The quadlet configuration for dsh and dsh-podman-orchestrator enables
43
+ auto-update of images (`AutoUpdate=registry`). The `podman-auto-update` systemd
44
+ timer needs to be enabled for this to work:
45
+
46
+ ```bash
47
+ systemctl --user enable --now podman-auto-update.timer
48
+ ```
49
+
50
+ Also, make sure user lingering is enabled for your user (as root):
51
+
52
+ ```bash
53
+ loginctl enable-linger your-username
54
+ ```
55
+
56
+ Each time the timer runs, the Podman auto-update tool tries to pull newer
57
+ versions of the images. If new versions are pulled, the corresponding containers
58
+ will be recreated.
59
+
60
+ By default, this timer runs once per day, around midnight.
61
+
62
+ ## Change when auto-updates happen
63
+
64
+ You can override the time when the timer runs.
65
+
66
+ Create the directory that contains user overrides for the `podman-auto-update`
67
+ systemd timer:
68
+
69
+ ```bash
70
+ mkdir -p ~/.config/systemd/user/podman-auto-update.timer.d
71
+ ```
72
+
73
+ Copy the drop-in
74
+ [`podman-auto-update.timer.conf`](../systemd-dropins/podman-auto-update.timer.conf)
75
+ into the directory and edit its content according to your needs.
76
+
77
+ ```bash
78
+ cp systemd-dropins/podman-auto-update.timer.conf ~/.config/systemd/user/podman-auto-update.timer.d/
79
+ ```
80
+
81
+ Reload systemd configuration and restart the timer:
82
+
83
+ ```bash
84
+ systemctl --user daemon-reload
85
+ systemctl --user restart podman-auto-update.timer
86
+ ```
87
+
88
+ You can verify when the timer will run next with:
89
+
90
+ ```bash
91
+ systemctl --user list-timers
92
+ ```
93
+
94
+ The same drop-in file can be edited to run updates multiple times a day.
95
+
96
+ ## Skip updates while an agent is running
97
+
98
+ An update restarts the dsh container, which interrupts any agent turn in flight.
99
+ It is possible to skip updates when an agent is running.
100
+
101
+ Create the directory that contains user overrides for the `podman-auto-update`
102
+ systemd service (it is not the same directory as the timer):
103
+
104
+ ```bash
105
+ mkdir -p ~/.config/systemd/user/podman-auto-update.service.d
106
+ ```
107
+
108
+ Copy the drop-in
109
+ [`podman-auto-update-skip-when-busy.conf`](../systemd-dropins/podman-auto-update-skip-when-busy.conf)
110
+ into the directory.
111
+
112
+ ```bash
113
+ cp systemd-dropins/podman-auto-update-skip-when-busy.conf ~/.config/systemd/user/podman-auto-update.service.d/
114
+ ```
115
+
116
+ Reload systemd configuration:
117
+
118
+ ```bash
119
+ systemctl --user daemon-reload
120
+ ```
@@ -0,0 +1,114 @@
1
+ <!--
2
+ SPDX-FileCopyrightText: 2026 Elouan Martinet <exa@elou.world>
3
+
4
+ SPDX-License-Identifier: MIT
5
+ -->
6
+
7
+ # 更新
8
+
9
+ 只应在没有 agent 运行时进行更新。
10
+
11
+ 现有的 guest 容器随后会被重建,因此运行中的进程和守护进程会被终止。
12
+
13
+ 请注意,对应的 dsh-podman 插件会在启动时从 npm 安装。
14
+
15
+ 启用自动更新后,也可以在 agent 运行时跳过更新。请继续阅读以了解如何设置。
16
+
17
+ ## 手动更新
18
+
19
+ 拉取新镜像:
20
+
21
+ ```bash
22
+ podman pull ghcr.io/exagone313/dsh-podman/dsh:1 ghcr.io/exagone313/dsh-podman/orchestrator:1
23
+ ```
24
+
25
+ 重启 dsh 和 dsh-podman-orchestrator:
26
+
27
+ ```bash
28
+ systemctl --user restart dsh dsh-podman-orchestrator
29
+ ```
30
+
31
+ ## 升级到新的主版本
32
+
33
+ 目前,dsh-podman 的主版本是 1。要升级到主版本 2 及以上,请查看
34
+ [发布说明](https://github.com/Exagone313/dsh-podman/releases)。
35
+
36
+ ## 启用自动更新
37
+
38
+ dsh 和 dsh-podman-orchestrator 的 quadlet 配置启用了镜像自动更新
39
+ (`AutoUpdate=registry`)。要使其生效,需要启用 `podman-auto-update` systemd
40
+ 计时器:
41
+
42
+ ```bash
43
+ systemctl --user enable --now podman-auto-update.timer
44
+ ```
45
+
46
+ 另外,请确保已为你的用户启用 user lingering(常驻)(以 root 身份):
47
+
48
+ ```bash
49
+ loginctl enable-linger your-username
50
+ ```
51
+
52
+ 每次计时器运行时,Podman 自动更新工具都会尝试拉取镜像的新版本。如果拉取到了
53
+ 新版本,相应的容器将被重建。
54
+
55
+ 默认情况下,该计时器每天运行一次,大约在午夜。
56
+
57
+ ## 更改自动更新的时间
58
+
59
+ 你可以覆盖计时器的运行时间。
60
+
61
+ 创建包含 `podman-auto-update` systemd 计时器用户覆盖文件的目录:
62
+
63
+ ```bash
64
+ mkdir -p ~/.config/systemd/user/podman-auto-update.timer.d
65
+ ```
66
+
67
+ 把
68
+ [`podman-auto-update.timer.conf`](../systemd-dropins/podman-auto-update.timer.conf)
69
+ 这个 drop-in(覆盖)文件复制到该目录中,并根据需要编辑其内容。
70
+
71
+ ```bash
72
+ cp systemd-dropins/podman-auto-update.timer.conf ~/.config/systemd/user/podman-auto-update.timer.d/
73
+ ```
74
+
75
+ 重新加载 systemd 配置并重启计时器:
76
+
77
+ ```bash
78
+ systemctl --user daemon-reload
79
+ systemctl --user restart podman-auto-update.timer
80
+ ```
81
+
82
+ 你可以用以下命令验证计时器下次运行的时间:
83
+
84
+ ```bash
85
+ systemctl --user list-timers
86
+ ```
87
+
88
+ 同一个 drop-in 文件也可以编辑成每天多次运行更新。
89
+
90
+ ## 在 agent 运行时跳过更新
91
+
92
+ 更新会重启 dsh 容器,这会中断任何正在进行的 agent 回合。可以在 agent 运行时
93
+ 跳过更新。
94
+
95
+ 创建包含 `podman-auto-update` systemd 服务用户覆盖文件的目录(注意:它和
96
+ 计时器的目录不是同一个):
97
+
98
+ ```bash
99
+ mkdir -p ~/.config/systemd/user/podman-auto-update.service.d
100
+ ```
101
+
102
+ 把
103
+ [`podman-auto-update-skip-when-busy.conf`](../systemd-dropins/podman-auto-update-skip-when-busy.conf)
104
+ 这个 drop-in(覆盖)文件复制到该目录中。
105
+
106
+ ```bash
107
+ cp systemd-dropins/podman-auto-update-skip-when-busy.conf ~/.config/systemd/user/podman-auto-update.service.d/
108
+ ```
109
+
110
+ 重新加载 systemd 配置:
111
+
112
+ ```bash
113
+ systemctl --user daemon-reload
114
+ ```