feat(library): 页面发起封存的最小权限主机侧执行边界
build / build (push) Failing after 16s

- libraryagent:0700 目录内 0600 unix socket + SO_PEERCRED 同 uid,
  固定 binary/归档/日志/项目/写入者声明,请求只能选范围与作业号
- API:POST/GET /api/v1/library/captures(入队 library.capture + 读队列状态)
- worker:library.capture handler 走 socket;启动先 recover;不挂 Docker socket、
  不持有来源凭据
- web:整库版本页显示真实作业状态并可发起封存(未接线/无权限给出原因)
- scripts/library-agent-install.sh:构建、安装 systemd user 服务并读回权限
This commit is contained in:
姚章浩
2026-10-28 12:10:58 +08:00
parent c5e033dd0e
commit 910c0fcd76
22 changed files with 1282 additions and 9 deletions
+66
View File
@@ -832,6 +832,72 @@
}
}
},
"/api/v1/library/captures": {
"get": {
"tags": [
"Runtime"
],
"operationId": "listLibraryCaptures",
"summary": "列出最近的整库封存作业(读队列,不是归档;页面据此显示真实状态)",
"responses": {
"200": {
"$ref": "#/components/responses/Envelope"
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"500": {
"$ref": "#/components/responses/InternalError"
}
}
},
"post": {
"tags": [
"Runtime"
],
"operationId": "enqueueLibraryCapture",
"summary": "投递一次整库封存作业(需要工程师及以上;执行在主机侧 agent,容器没有 Docker/来源凭据)",
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"scope": {
"type": "string",
"enum": [
"internal",
"external"
]
},
"job": {
"type": "string"
}
},
"required": [
"scope"
]
}
}
}
},
"responses": {
"202": {
"description": "已入队封存作业(同一 scope+job 复用同一作业)"
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"500": {
"$ref": "#/components/responses/InternalError"
},
"503": {
"description": "主机侧封存 agent 未接线"
}
}
}
},
"/api/v1/library/snapshots/{id}": {
"get": {
"tags": [