Files
Tosone 187f5c4d97 refactor(server)!: remove the embedded MCP server
Sigma shipped three overlapping ways to operate a remote server: the
embedded MCP server, sigma-cli, and the sigma-api-operator skill. All
three wrapped the same HTTP API, yet each covered a different subset:
user CRUD existed only in the CLI, system-* only in MCP, and builders,
daemons, webhooks, validators, code repositories and tokens were
reachable only through raw HTTP. MCP was disabled by default and still
carried 1246 lines of production code plus 606 lines of tests to
maintain that partially overlapping surface.

Keep two surfaces instead: sigma-cli for execution and the skill for
API discovery.

- delete pkg/server/mcp and its mcp-go dependency, which also drops the
  jsonschema-go, jsonschema/v6 and uritemplate/v3 transitives
- drop ConfigurationMCP, its defaults and the authz/audit skipper
  bypasses that existed only to let the MCP endpoint bypass both
- remove the mcp section from conf/config*.yaml, docs/configuration.md,
  and the Helm chart values and configmap
- replace docs/mcp.md with docs/cli.md covering sigma-cli login, global
  flags, per-resource commands, jq composition and agent usage
- make sigma-cli the preferred path in the sigma-api-operator skill and
  rebuild its examples around the resources the CLI does not wrap yet,
  using the paths and request schemas from swagger.yaml

Lint was already red on dev for an unrelated reason: golangci-lint
v2.13.0 vendors golang.org/x/tools v0.49.0, which only decodes export
data version 4, so every import of a Go 1.27.2 standard library package
failed typecheck with "export data version 5 is greater than maximum
supported version 4". Bump to v2.15.0 (x/tools v0.52.0) and fix the two
modernize findings it reports for Go 1.27's strings.CutLast.

- .github/workflows/lint.yml: golangci-lint v2.13.0 -> v2.15.0, and
  document the export data constraint next to the pin
- pkg/authz/resolver.go, pkg/logger/logger.go: replace LastIndex slicing
  with strings.CutLast
- bump github.com/docker/cli v29.9.0 -> v29.9.1

BREAKING CHANGE: the `mcp` configuration section and the /api/v1/mcp
endpoint are gone. Use sigma-cli or the REST API for automation.

Verification:
- go build -tags "netgo,timetzdata,exclude_graphdriver_btrfs,containers_image_openpgp" ./...
- go vet -tags "netgo,timetzdata,exclude_graphdriver_btrfs,containers_image_openpgp" ./...
- golangci-lint v2.15.0 run --build-tags "netgo,timetzdata,exclude_graphdriver_btrfs,containers_image_openpgp" ./... (0 issues)
- golangci-lint config verify
- go test -tags "netgo,timetzdata,exclude_graphdriver_btrfs,containers_image_openpgp" ./pkg/authz/... ./pkg/logger/... ./cmd/cli/... ./pkg/app/... ./pkg/background/build/...
- go test -run TestConfiguration -tags "netgo,timetzdata,exclude_graphdriver_btrfs,containers_image_openpgp" ./pkg/config/...
- go mod tidy
- make swagen
- helm template sigma ./deploy/sigma
- bun run docs:build
- make build
- make build-cli
2026-10-21 19:33:07 +08:00

3.4 KiB
Raw Permalink Blame History

sigma

sigma

GitHub Workflow Status Coveralls GitHub repo size

Sigma 是一个极容易部署和维护的镜像仓库,并且自主完整实现了 OCI Distribution Specification 1.1 的协议,除了支持 docker 客户端以外,还支持其他类型的各种客户端,例如 oras,apptainer,helm, nerdctl 等。在部署层面上完全可以做到 all-in-one 的部署,启动单个容器即可将整体的镜像仓库的所有服务启动起来,在高可用层面也可以将各个模块分别单独部署。

快速开始

你可以用以下的一个简单的命令来运行起来 Sigma 镜像仓库:

docker run --name sigma -p 3000:3000 --rm tosone/sigma:nightly-alpine

默认的用户名密码是: sigma/Admin@123, 如果你想在启动的时候初始化其他的用户名密码, 请根据这里的配置说明来修改配置文件。

Demo Server

演示服务器部署在一个运行 Debian 12.1 Linux 发行版的 AWS EC2 实例上(2核4G内存, 40G磁盘),使用的 Docker 版本是 25.0.3,演示服务器是参照这里说明搭建的。

访问: https://sigma.tosone.cn, username/password: sigma/Admin@123

Architecture

下图按运行层次展示 Sigma 的主要组件,从客户端入口到请求处理、后台任务,再到它们依赖的基础设施服务。

Sigma architecture

Features

  • 支持 OCI Distribution Specification 1.1 的协议。
  • 支持 OCI Image v1 格式和 OCI Image Index v1 格式。
  • 支持 OCI artifacts,例如:helm charts,apptainer 等等。
  • 支持获取 OCI 制品的 sbom。
  • 支持 OCI 制品的安全扫描。
  • 支持镜像代理。
  • 支持 Namespace 级别的配额限制。
  • 支持镜像的自动垃圾回收。
  • 支持镜像签名。
  • 支持镜像构建,构建的镜像自动签名,构建的驱动支持 Docker,Podman,Kubernetes。
  • 支持镜像复制。

AI 客户端与自动化

Sigma 为 AI 客户端和外部自动化工具提供了两种集成方式:

  • sigma-cli:单个二进制,通过 REST API 操作远程 Sigma 服务端,覆盖命名空间、仓库、Tag、制品、成员和用户。详细说明见 CLI 与 AI Agent。
  • 外部 REST API skill:tools/skill/sigma-api-operator 打包了可复用的 skill 和 swagger.yaml,方便 Claude Code、Copilot CLI 等 CLI agent 发现 Sigma API,并通过 HTTP 请求操作资源,包括 CLI 尚未封装的接口。

Alternatives