feat: install nodes and the backend from a static compose file; remove dead code [CI]
ci/woodpecker/push/main-amd64-build Pipeline was successful

Agent, Probe and Backend now start from one static compose.yaml plus a local
.env: the panel (or the release assets, for the very first Backend) provides
the file, the panel's command writes the public values into .env, checks the
file's SHA-256 and runs compose up. Updating is compose pull && compose up -d.
The image is chosen by the CI channel (:latest, or MOSHIRO_VERSION in .env),
not by the panel; the previous one-line script stays as a fallback.

- packaging/compose/{agent,probe,backend}/compose.yaml are the single source,
  embedded in the Backend and served at /install/compose/{file}; the root
  compose.yaml moved there. Releases also carry them and list them in the
  signed SHA256SUMS.
- The container entrypoint defaults the node name to the host name.
- Join token creation returns a compose block (.env, url, hash, per-platform
  commands); the admin dialog leads with it.
- Remove code with no references (HotLayer members, LiveHub.SubscriberCount,
  QueryService.ParseParams, ReleaseService.Forget, a few constants) and reduce
  the install-code lookup to the role it is for.
This commit is contained in:
justme committed 2026-10-08 20:24:23 +08:00
1 parent e014a19554
commit 12be44645f
31 files changed
+492 -176

No files matched your search

+17 -4
View File
@@ -1,9 +1,15 @@
# Docker 和 rootless/rootful Podman 共用。配置、身份和缓存保存在命名 volume 中。
# docker compose up -d / podman compose up -d(Podman 以普通用户执行即可 rootless)。
# 首次注册、配置导入和自动更新见 docs/ops/deployment.md。
# MoShiro Agent(Linux,需要宿主网络)。Docker 和 rootless/rootful Podman 共用。
#
# 用法(面板「添加 Agent」会给出带好参数的 .env 内容):
# mkdir moshiro-agent && cd moshiro-agent
# 把面板给的 .env 内容存成 .env,再下载本文件为 compose.yaml
# podman compose up -d # Docker 用 docker compose
# 更新:podman compose pull && podman compose up -d (身份和配置在命名卷里,不会动)
# 固定版本:在 .env 里写 MOSHIRO_VERSION=0.3.3;想要更严,写成 MOSHIRO_VERSION=0.3.3@sha256:<digest>。
# 说明见 docs/ops/deployment.md。
services:
agent:
image: ${MOSHIRO_IMAGE:-registry.oeo.one/moshiro/moshiro-agent}:${MOSHIRO_VERSION:-0.1.1}
image: ${MOSHIRO_IMAGE:-registry.oeo.one/moshiro/moshiro-agent}:${MOSHIRO_VERSION:-latest}
container_name: moshiro-agent
restart: unless-stopped
init: true
@@ -18,6 +24,13 @@ services:
- /sys:/host/sys:ro
- /:/host/root:ro
environment:
# 只在第一次启动时用来注册(身份写进 agent-config 卷之后,.env 里的 MOSHIRO_JOIN 就可以删掉)
MOSHIRO_SERVER: ${MOSHIRO_SERVER:-}
MOSHIRO_JOIN: ${MOSHIRO_JOIN:-}
MOSHIRO_NAME: ${MOSHIRO_NAME:-}
MOSHIRO_GENESIS: ${MOSHIRO_GENESIS:-}
MOSHIRO_CONTROLLERS: ${MOSHIRO_CONTROLLERS:-}
MOSHIRO_ALLOW_NO_OWNER: ${MOSHIRO_ALLOW_NO_OWNER:-}
MOSHIRO_NETWORK_SCOPE: host
HOST_PROC: /host/proc
HOST_SYS: /host/sys