loveuer c22845f83d 重构 K8s 资源管理页面
1. 拆分原有的巨型 K8sResourceList.tsx 文件(1001行)为多个独立页面组件
2. 为每种 K8s 资源类型创建专门的页面:
   - Namespace: 简单名称输入创建
   - Deployment/StatefulSet: YAML 文件上传创建
   - Service: 显示"功能开发中"提示
   - ConfigMap: Key-Value 编辑器创建(支持文件上传)
   - Pod: 无创建功能
   - PV/PVC: YAML 文件上传创建
3. 创建共享组件和 Hooks 提高代码复用
4. 更新路由配置使用嵌套路由结构
5. 修复 PV/PVC 页面缺少组件导入的问题

优化了代码结构,使每个文件控制在合理大小范围内,便于维护和扩展。
2025-12-08 19:06:40 +08:00
2025-12-08 19:06:40 +08:00
2025-12-08 19:06:40 +08:00

Cluster - OCI Registry

A lightweight OCI (Open Container Initiative) registry implementation written in Go using Fiber v3.

Features

  • OCI Registry API v2 compliant
  • Blob upload/download with chunked upload support
  • Manifest handling (Docker and OCI formats)
  • Tag management and catalog listing
  • SQLite database for metadata storage
  • File system storage for blobs and manifests
  • RESTful API v1 for image management

Architecture

  • main.go: Application entry point
  • api/: API route definitions
  • handler/: HTTP request handlers
  • controller/: Business logic controllers
  • internal/: Internal packages (config, database, middleware, model, rerr, storage)

Development

Backend (Go)

# Build
go mod tidy
go build -o cluster .

# Run
./cluster -debug -address 0.0.0.0:8080 -data-dir ./x-storage

# Or use Makefile
make build
make run

Frontend (React/TypeScript)

cd frontend

# Install dependencies (requires pnpm)
pnpm install

# Approve build scripts (required for esbuild)
pnpm approve-builds

# Development server
pnpm dev

# Build for production
pnpm run build

Note: This project uses pnpm as the package manager. Install it if needed:

npm install -g pnpm
# or
curl -fsSL https://get.pnpm.io/install.sh | sh -

API Endpoints

OCI Registry API v2

  • GET /v2/ - Version check
  • POST /v2/{repo}/blobs/uploads/ - Start blob upload
  • PATCH /v2/{repo}/blobs/uploads/{uuid} - Upload blob chunk
  • PUT /v2/{repo}/blobs/uploads/{uuid}?digest={digest} - Complete blob upload
  • GET /v2/{repo}/blobs/{digest} - Get blob
  • HEAD /v2/{repo}/blobs/{digest} - Check blob existence
  • PUT /v2/{repo}/manifests/{tag} - Put manifest
  • GET /v2/{repo}/manifests/{tag} - Get manifest
  • DELETE /v2/{repo}/manifests/{tag} - Delete manifest
  • GET /v2/{repo}/tags/list - List tags
  • GET /v2/_catalog - List repositories

API v1

  • GET /api/v1/registry/image/list - List images

Configuration

  • -debug: Enable debug logging
  • -address: Server address (default: 0.0.0.0:8080)
  • -data-dir: Data directory for storage (default: ./x-storage)

License

[Add your license here]

Description
No description provided
Readme 9.5 MiB
Languages
Go 53.1%
TypeScript 45.7%
Shell 0.6%
Dockerfile 0.4%
HTML 0.1%