RustFS 对象存储

车库自建的 S3 兼容对象存储。上传走现有 upload.S3Client,不另写后端。完整运维说明以仓库 docs/architecture/rustfs.md 为准。

密钥不进文档站。 Access / Secret、SSH 密码只放本机 .env 与 VPS /etc/default/rustfs

当前实例

公网 IPv472.62.87.247
S3 APIhttp://72.62.87.247:9000
控制台http://72.62.87.247:9001/rustfs/console/
版本1.0.0 · systemd rustfs · 数据 /data/rustfs0
已有桶images · motorpoo · videos
上传建议桶motorpoo
TLS / 域名未接(motorpool.cc 仍在 Cloudflare)
curl -fsS http://72.62.87.247:9000/health
curl -fsS http://72.62.87.247:9001/rustfs/console/health

本仓怎么接

配置中心有激活的存储档案则用档案;否则回退 .envMEDIA_DELIVERY_MODE + S3_*。切后端不搬旧文件。

MEDIA_DELIVERY_MODE=s3
MEDIA_SIGN_MODE=s3
S3_ENDPOINT=72.62.87.247:9000
S3_PUBLIC_ENDPOINT=72.62.87.247:9000
S3_REGION=us-east-1
S3_BUCKET_MEDIA=motorpoo
S3_USE_SSL=false
S3_ACCESS_KEY=
S3_SECRET_KEY=
  • Endpoint 只写 host:port,不要带 bucket 路径;自定义端点强制 path-style。
  • 本机 API + 公网 RustFS 时,S3_PUBLIC_ENDPOINT 必须是浏览器能访问的地址。
  • 改 env 后重启 Go API。更干净的做法:Admin → 配置中心 → 存储,建 S3 兼容档案并激活。

实现:platform/server/internal/catalog/upload/s3client.go

CORS

Admin 预签名 PUT 从浏览器直打 :9000。VPS /etc/default/rustfs 已设 RUSTFS_CORS_ALLOWED_ORIGINS

http://127.0.0.1:5175 · http://localhost:5175 · http://127.0.0.1:28082 · http://localhost:28082 · http://127.0.0.1:8088 · http://localhost:8088

curl -sS -D - -o /dev/null -X OPTIONS \
  -H "Origin: http://127.0.0.1:5175" \
  -H "Access-Control-Request-Method: PUT" \
  -H "Access-Control-Request-Headers: content-type" \
  http://72.62.87.247:9000/motorpoo

期望 200 且带回 access-control-allow-origin

Cursor MCP

用官方镜像 rustfs/mcp(文档里的 rustfs/rustfs-mcp 已失效)。本机 ~/.cursor/mcp.json

{
  "rustfs-mcp": {
    "command": "docker",
    "args": [
      "run", "--rm", "-i",
      "-e", "AWS_ACCESS_KEY_ID",
      "-e", "AWS_SECRET_ACCESS_KEY",
      "-e", "AWS_REGION",
      "-e", "AWS_ENDPOINT_URL",
      "rustfs/mcp"
    ],
    "env": {
      "AWS_ACCESS_KEY_ID": "<from-local-env>",
      "AWS_SECRET_ACCESS_KEY": "<from-local-env>",
      "AWS_REGION": "us-east-1",
      "AWS_ENDPOINT_URL": "http://72.62.87.247:9000"
    }
  }
}

工具:list_buckets · list_objects · create_bucket · delete_bucket · upload_file · get_object。Settings → MCP 等到绿点即可在对话里操作存储。

官方:MCP 指南

相关页面