@exagone313/dsh-podman 1.0.4 → 1.1.1
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.
- package/README.md +1 -0
- package/README.zh.md +1 -0
- package/dist/approval-reasons.d.ts +12 -0
- package/dist/approval-reasons.js +15 -0
- package/dist/approval.js +21 -0
- package/dist/card-route.js +83 -1
- package/dist/client/ContainerCard.js +14 -2
- package/dist/client/card-protocol.d.ts +16 -1
- package/dist/client/container-card-controller.d.ts +8 -2
- package/dist/client/container-card-controller.js +21 -0
- package/dist/client/container-card-ports.d.ts +13 -0
- package/dist/client/container-card-ports.js +74 -0
- package/dist/client/container-card-row.d.ts +3 -0
- package/dist/client/container-card-row.js +12 -2
- package/dist/client/container-card-workspace.d.ts +3 -0
- package/dist/client/container-card-workspace.js +2 -2
- package/dist/client/index.js +653 -386
- package/dist/client/locales.d.ts +1 -1
- package/dist/client/locales.js +30 -0
- package/dist/client/tool-presentations.d.ts +167 -0
- package/dist/client/tool-presentations.js +167 -0
- package/dist/client/tool-views.d.ts +1 -2
- package/dist/client/tool-views.js +54 -190
- package/dist/generated/version.d.ts +2 -2
- package/dist/generated/version.js +2 -2
- package/dist/grpc/proto/dshctl/v1/control.proto +47 -1
- package/dist/grpc/proto/dshgateway/v1/gateway.proto +89 -0
- package/dist/grpc/proto/dshguest/v1/guest.proto +17 -0
- package/dist/index.d.ts +3 -2
- package/dist/index.js +3 -2
- package/dist/public.d.ts +1 -0
- package/dist/public.js +14 -0
- package/dist/publish-port.d.ts +6 -0
- package/dist/publish-port.js +37 -0
- package/dist/tool-defs.js +15 -1
- package/dist/tool-handlers.js +31 -1
- package/dist/tool-params.d.ts +48 -0
- package/dist/tool-params.js +42 -0
- package/docs/architecture.md +44 -7
- package/docs/architecture.zh.md +38 -6
- package/docs/configuration.md +25 -0
- package/docs/configuration.zh.md +23 -0
- package/docs/development.md +9 -2
- package/docs/development.zh.md +9 -2
- package/docs/install-dsh-and-dsh-podman.md +10 -4
- package/docs/install-dsh-and-dsh-podman.zh.md +9 -3
- package/docs/uninstall.md +4 -3
- package/docs/uninstall.zh.md +3 -2
- package/docs/update.md +23 -6
- package/docs/update.zh.md +23 -6
- package/docs/usage.md +48 -13
- package/docs/usage.zh.md +31 -2
- package/package.json +1 -1
- package/quadlet/dsh-podman-gateway.container +23 -0
- package/quadlet/dsh-podman-orchestrator.container +1 -1
- package/quadlet/dsh.container +1 -1
package/docs/update.zh.md
CHANGED
|
@@ -14,18 +14,35 @@ SPDX-License-Identifier: MIT
|
|
|
14
14
|
|
|
15
15
|
启用自动更新后,也可以在 agent 运行时跳过更新。请继续阅读以了解如何设置。
|
|
16
16
|
|
|
17
|
+
## 从 1.1.0 之前的版本更新
|
|
18
|
+
|
|
19
|
+
`dsh-podman-gateway` 容器是 1.1.0 新增的:更早的版本不会提供它的
|
|
20
|
+
Quadlet。gateway 是可选的,只在发布 pod
|
|
21
|
+
端口时需要(见[用法](usage.zh.md#端口发布));没有它时,`container_publish_port`
|
|
22
|
+
会报错,提示你安装并启动 gateway Quadlet。
|
|
23
|
+
|
|
24
|
+
从 1.1.0 之前的版本更新时,请先把
|
|
25
|
+
[dsh-podman-gateway.container](../quadlet/dsh-podman-gateway.container) 复制到
|
|
26
|
+
`~/.config/containers/systemd/`,并启动它一次,然后再执行后续步骤:
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
cp quadlet/dsh-podman-gateway.container ~/.config/containers/systemd/
|
|
30
|
+
systemctl --user daemon-reload
|
|
31
|
+
systemctl --user start dsh-podman-gateway
|
|
32
|
+
```
|
|
33
|
+
|
|
17
34
|
## 手动更新
|
|
18
35
|
|
|
19
36
|
拉取新镜像:
|
|
20
37
|
|
|
21
38
|
```bash
|
|
22
|
-
podman pull ghcr.io/exagone313/dsh-podman/dsh:1 ghcr.io/exagone313/dsh-podman/orchestrator:1
|
|
39
|
+
podman pull ghcr.io/exagone313/dsh-podman/dsh:1 ghcr.io/exagone313/dsh-podman/orchestrator:1 ghcr.io/exagone313/dsh-podman/gateway:1
|
|
23
40
|
```
|
|
24
41
|
|
|
25
|
-
重启 dsh 和 dsh-podman-
|
|
42
|
+
重启 dsh、dsh-podman-orchestrator 和 dsh-podman-gateway:
|
|
26
43
|
|
|
27
44
|
```bash
|
|
28
|
-
systemctl --user restart dsh dsh-podman-orchestrator
|
|
45
|
+
systemctl --user restart dsh dsh-podman-orchestrator dsh-podman-gateway
|
|
29
46
|
```
|
|
30
47
|
|
|
31
48
|
## 升级到新的主版本
|
|
@@ -35,9 +52,9 @@ systemctl --user restart dsh dsh-podman-orchestrator
|
|
|
35
52
|
|
|
36
53
|
## 启用自动更新
|
|
37
54
|
|
|
38
|
-
dsh 和 dsh-podman-
|
|
39
|
-
(`AutoUpdate=registry`)。要使其生效,需要启用
|
|
40
|
-
计时器:
|
|
55
|
+
dsh、dsh-podman-orchestrator 和 dsh-podman-gateway 的 quadlet
|
|
56
|
+
配置启用了镜像自动更新 (`AutoUpdate=registry`)。要使其生效,需要启用
|
|
57
|
+
`podman-auto-update` systemd 计时器:
|
|
41
58
|
|
|
42
59
|
```bash
|
|
43
60
|
systemctl --user enable --now podman-auto-update.timer
|
package/docs/usage.md
CHANGED
|
@@ -345,6 +345,36 @@ guest agent has, including environment secrets attached with
|
|
|
345
345
|
variables are not visible. `daemon_restart` replays the mode the daemon was
|
|
346
346
|
started with.
|
|
347
347
|
|
|
348
|
+
### Published ports
|
|
349
|
+
|
|
350
|
+
| Tool | Params | Description |
|
|
351
|
+
| -------------------------- | --------------------------------------------------------------------- | ------------------------------------------------------------------------------ |
|
|
352
|
+
| `container_publish_port` | `container`, `port`, optional `protocol` (`tcp`), `suggestedHostPort` | Expose a TCP port of the pod on the host's `127.0.0.1`, and return its address |
|
|
353
|
+
| `container_unpublish_port` | `container`, `port`, optional `protocol` (`tcp`) | Stop exposing a published port |
|
|
354
|
+
|
|
355
|
+
A pod's ports are not reachable from the host by default. Publishing brings one
|
|
356
|
+
TCP port out through the `dsh-podman-gateway` container the standard install
|
|
357
|
+
runs (see [Install](install-dsh-and-dsh-podman.md)): the guest agent forwards to
|
|
358
|
+
the port inside the pod over a Unix socket in the shared socket root, and the
|
|
359
|
+
gateway binds a host address and port to that socket and forwards to it. Only
|
|
360
|
+
`127.0.0.1` is ever bound, so a published port is reachable from this host alone
|
|
361
|
+
— by any local process, which is why the tool asks for approval.
|
|
362
|
+
|
|
363
|
+
`container_publish_port` returns the address to show the user, for example
|
|
364
|
+
`tcp://127.0.0.1:6666`. Pass `suggestedHostPort` (1024-65535) to ask for a
|
|
365
|
+
specific host port; omit it and the gateway chooses a free one, and the returned
|
|
366
|
+
address carries whichever port was bound. Publishing the same port twice is
|
|
367
|
+
idempotent. A published port survives a container recreate on the same host
|
|
368
|
+
port, and is released when it is unpublished, when its container is removed, or
|
|
369
|
+
when its workspace is torn down — the gateway holds no host port of its own
|
|
370
|
+
beyond what the orchestrator keeps a lease for.
|
|
371
|
+
|
|
372
|
+
Only TCP is implemented for now; `protocol` defaults to `tcp`, and the request,
|
|
373
|
+
the stored record and the returned address already carry a protocol, so `udp`
|
|
374
|
+
and `http` can be added without changing the tool's shape. The gateway is
|
|
375
|
+
optional: without it, both tools report that it is not running and every other
|
|
376
|
+
feature keeps working.
|
|
377
|
+
|
|
348
378
|
## Container management UI
|
|
349
379
|
|
|
350
380
|
The plugin ships a browser half that registers its card on the **dsh-podman**
|
|
@@ -362,19 +392,24 @@ rows show their environment and secret-environment variables and their mounts,
|
|
|
362
392
|
let you edit environment variables and add/remove mounts (each removal is
|
|
363
393
|
confirmed), and attach/detach named secrets to a container's environment
|
|
364
394
|
variables; each row also offers **Remove**, **Recreate** (same image), and
|
|
365
|
-
**Recreate with image**.
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
395
|
+
**Recreate with image**. A row's **Ports** section lists the pod ports exposed
|
|
396
|
+
on the host and publishes another: give the pod port and, optionally, the host
|
|
397
|
+
port to prefer (the gateway chooses a free one otherwise, and the notice names
|
|
398
|
+
the endpoint it bound), and unpublish with a confirmation; publishing is
|
|
399
|
+
disabled with a hint while the gateway is not running or the container is
|
|
400
|
+
stopped. Every workspace row also offers **Remove pod**, which removes the
|
|
401
|
+
workspace's pod, all of its containers, and the orchestrator's record for it
|
|
402
|
+
(volumes, secrets, and project data are kept); removing a workspace's last
|
|
403
|
+
container removes its pod as well, so an empty pod is never left behind. The
|
|
404
|
+
page re-reads the live state whenever the Plugins panel opens it, and its footer
|
|
405
|
+
has a **Reload this view** button. The images section can rebuild a single image
|
|
406
|
+
or **rebuild all** in dependency order; **Build image** opens a popup with an
|
|
407
|
+
image-id/base-image form and a chip input for the package list (type a name and
|
|
408
|
+
press space/comma, or paste a list, to add removable chips). Volumes and secrets
|
|
409
|
+
are listed as individual expandable rows, each with its own actions, and
|
|
410
|
+
**Create volume** / **Create secret** open popup forms (the secret form takes an
|
|
411
|
+
optional length; a secret's value can be overwritten, never read). Card actions
|
|
412
|
+
are direct control calls and are not approval-gated.
|
|
378
413
|
|
|
379
414
|
A **Package caches** section reports the size of every configured build cache
|
|
380
415
|
(`DSH_PODMAN_HOST_PACMAN_CACHE`, `DSH_PODMAN_HOST_APT_CACHE`,
|
package/docs/usage.zh.md
CHANGED
|
@@ -289,6 +289,31 @@ UI 使用短名称。`secret_create` 的值由服务端用 `crypto/rand`
|
|
|
289
289
|
`env`,因此容器环境变量和机密环境变量都不可见。`daemon_restart`
|
|
290
290
|
会沿用守护进程启动时的模式。
|
|
291
291
|
|
|
292
|
+
### 端口发布
|
|
293
|
+
|
|
294
|
+
| 工具 | 参数 | 说明 |
|
|
295
|
+
| -------------------------- | ------------------------------------------------------------------ | ----------------------------------------------------------- |
|
|
296
|
+
| `container_publish_port` | `container`、`port`,可选 `protocol`(`tcp`)、`suggestedHostPort` | 在主机 `127.0.0.1` 上暴露 pod 的一个 TCP 端口,并返回其地址 |
|
|
297
|
+
| `container_unpublish_port` | `container`、`port`,可选 `protocol`(`tcp`) | 停止暴露已发布的端口 |
|
|
298
|
+
|
|
299
|
+
默认情况下,主机无法访问 pod 的端口。发布通过标准安装会运行的
|
|
300
|
+
`dsh-podman-gateway` 容器(见[安装](install-dsh-and-dsh-podman.zh.md))把一个
|
|
301
|
+
TCP 端口带出来:guest agent 通过共享套接字根目录中的 UNIX 套接字转发到 pod
|
|
302
|
+
内的端口,gateway
|
|
303
|
+
则把一个主机地址和端口绑定到该套接字并转发过去。绑定地址始终只有
|
|
304
|
+
`127.0.0.1`,因此已发布端口只能从本机访问,而本机上的任何进程都可以访问——这也是该工具需要审批的原因。
|
|
305
|
+
|
|
306
|
+
`container_publish_port` 返回可展示给用户的地址,例如
|
|
307
|
+
`tcp://127.0.0.1:6666`。传入
|
|
308
|
+
`suggestedHostPort`(1024-65535)可指定主机端口;省略时由 gateway
|
|
309
|
+
选择一个空闲端口,返回的地址会带上实际绑定的端口。重复发布同一端口是幂等的。已发布端口在容器重建后仍使用同一主机端口,并在取消发布、移除容器或销毁工作区时释放——除了
|
|
310
|
+
orchestrator 持有租约的部分,gateway 不会自行保留任何主机端口。
|
|
311
|
+
|
|
312
|
+
目前只实现 TCP;`protocol` 默认为
|
|
313
|
+
`tcp`,而请求、存储记录和返回的地址都已能表达协议,因此将来可以加入 `udp` 和
|
|
314
|
+
`http` 而不改变工具形态。gateway
|
|
315
|
+
是可选的:未安装时,这两个工具会报告其未运行,其他功能不受影响。
|
|
316
|
+
|
|
292
317
|
## 容器管理 UI
|
|
293
318
|
|
|
294
319
|
插件附带一个浏览器端,把卡片注册到 **dsh-podman** 页面(侧边栏 **插件** 面板 →
|
|
@@ -300,8 +325,12 @@ secret)、PATH 附加项以及机密环境变量——而已有容器的工作
|
|
|
300
325
|
按钮,用于添加额外的命名容器,模态框标题与打开它的按钮一致。在该模态框中,每个挂载的模式是一个下拉框(read-only/read-write),因此可以在创建时就把工作区项目挂载设为只读;tmpfs
|
|
301
326
|
和 secret 挂载的模式是固定的(分别为 read-write 和
|
|
302
327
|
read-only),显示为不可编辑的下拉框。容器行显示其环境和机密环境变量及其挂载,允许编辑环境变量和添加/移除挂载(每次移除都会确认),以及将命名机密附加/分离到容器的环境变量;每行还提供
|
|
303
|
-
**Remove**、**Recreate**(相同镜像)和 **Recreate with
|
|
304
|
-
|
|
328
|
+
**Remove**、**Recreate**(相同镜像)和 **Recreate with image**。每行的
|
|
329
|
+
**端口**区段会列出已暴露到主机的 pod 端口,并可再发布一个:填写 pod
|
|
330
|
+
端口,以及可选的首选主机端口(未填写时由 gateway
|
|
331
|
+
选择一个空闲端口,通知中会给出实际绑定的地址),取消发布需要确认;当 gateway
|
|
332
|
+
未运行或容器未运行时,发布会显示提示并保持禁用。每个工作区行还提供 **移除
|
|
333
|
+
Pod**,它会移除该工作区的
|
|
305
334
|
Pod、其所有容器以及编排器对应的记录(卷、机密和项目数据会保留);移除工作区的最后一个容器也会一并移除其
|
|
306
335
|
Pod,因此不会留下空的 Pod。每次通过 **插件**
|
|
307
336
|
面板打开该页面时都会重新读取实时状态,其底部还有一个 **Reload this view**
|
package/package.json
CHANGED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
[Unit]
|
|
2
|
+
Description=dsh-podman gateway
|
|
3
|
+
Before=dsh-podman-orchestrator.service
|
|
4
|
+
|
|
5
|
+
[Container]
|
|
6
|
+
Network=host
|
|
7
|
+
Image=ghcr.io/exagone313/dsh-podman/gateway:1
|
|
8
|
+
ContainerName=dsh-podman-gateway
|
|
9
|
+
AutoUpdate=registry
|
|
10
|
+
ReadOnly=true
|
|
11
|
+
|
|
12
|
+
Volume=%t/dsh-podman:/run/dsh-podman
|
|
13
|
+
Environment=DSH_PODMAN_GATEWAY_SOCKET=/run/dsh-podman/gateway.sock
|
|
14
|
+
Environment=DSH_PODMAN_GATEWAY_SOCKETS_ROOT=/run/dsh-podman
|
|
15
|
+
|
|
16
|
+
[Service]
|
|
17
|
+
ExecStartPre=/usr/bin/env mkdir -p -m 0700 %t/dsh-podman ; /usr/bin/env chmod 0700 %t/dsh-podman
|
|
18
|
+
Restart=on-failure
|
|
19
|
+
RestartSec=3
|
|
20
|
+
SuccessExitStatus=0 143
|
|
21
|
+
|
|
22
|
+
[Install]
|
|
23
|
+
WantedBy=dsh-podman-orchestrator.service
|
|
@@ -37,7 +37,7 @@ Environment=DSH_PODMAN_GUEST_AGENT_IMAGE=ghcr.io/exagone313/dsh-podman/guest-age
|
|
|
37
37
|
Environment=DSH_PODMAN_GUEST_AGENT_IMAGE_USE_VERSION_TAG=true
|
|
38
38
|
|
|
39
39
|
[Service]
|
|
40
|
-
ExecStartPre=/usr/bin/mkdir -p -m 0700 %h/project ; /usr/bin/mkdir -p -m 0700 %t/dsh-podman ; /usr/bin/chmod 0700 %t/dsh-podman ; /usr/bin/mkdir -p -m 0700 %h/.dsh/dsh-podman/state ; /usr/bin/mkdir -p -m 0755 %h/.dsh/dsh-podman/apk-cache ; /usr/bin/mkdir -p -m 0755 %h/.dsh/dsh-podman/apt-cache ; /usr/bin/mkdir -p -m 0755 %h/.dsh/dsh-podman/pacman-cache
|
|
40
|
+
ExecStartPre=/usr/bin/env mkdir -p -m 0700 %h/project ; /usr/bin/env mkdir -p -m 0700 %t/dsh-podman ; /usr/bin/env chmod 0700 %t/dsh-podman ; /usr/bin/env mkdir -p -m 0700 %h/.dsh/dsh-podman/state ; /usr/bin/env mkdir -p -m 0755 %h/.dsh/dsh-podman/apk-cache ; /usr/bin/env mkdir -p -m 0755 %h/.dsh/dsh-podman/apt-cache ; /usr/bin/env mkdir -p -m 0755 %h/.dsh/dsh-podman/pacman-cache
|
|
41
41
|
Restart=on-failure
|
|
42
42
|
RestartSec=3
|
|
43
43
|
SuccessExitStatus=0 143
|
package/quadlet/dsh.container
CHANGED
|
@@ -26,7 +26,7 @@ Volume=%t/dsh-podman:/run/dsh-podman
|
|
|
26
26
|
Environment=DSH_PODMAN_SOCKETS_ROOT=/run/dsh-podman
|
|
27
27
|
|
|
28
28
|
[Service]
|
|
29
|
-
ExecStartPre=/usr/bin/mkdir -p -m 0700 %h/project ; /usr/bin/mkdir -p -m 0700 %t/dsh-podman ; /usr/bin/chmod 0700 %t/dsh-podman ; /usr/bin/mkdir -p -m 0700 %h/.dsh
|
|
29
|
+
ExecStartPre=/usr/bin/env mkdir -p -m 0700 %h/project ; /usr/bin/env mkdir -p -m 0700 %t/dsh-podman ; /usr/bin/env chmod 0700 %t/dsh-podman ; /usr/bin/env mkdir -p -m 0700 %h/.dsh
|
|
30
30
|
Restart=on-failure
|
|
31
31
|
RestartSec=3
|
|
32
32
|
SuccessExitStatus=0 143
|