cloudflare-r2-s3

Cloudflare R2 S3 兼容存储工具,支持配置 API 密钥、上传文件并获取公开访问地址。使用当需要上传文件到 Cloudflare R2 获取公开链接时。

Safety Notice

This listing is from the official public ClawHub registry. Review SKILL.md and referenced scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "cloudflare-r2-s3" with this command: npx skills add cloudflare-r2-s3

Cloudflare R2 S3 存储工具

Cloudflare R2 提供 10GB 免费存储额度,兼容 S3 API,可以用来存储文件并生成公开访问地址。

功能特性

  • ✅ 支持配置 S3 API 端点、访问密钥和存储桶
  • ✅ 上传本地文件到 R2 存储桶
  • ✅ 自动生成公开访问 URL
  • ✅ 支持列出存储桶中的文件
  • ✅ 支持删除文件
  • ✅ 兼容其他 S3 兼容存储服务(如 MinIO)

配置方式

在使用前需要配置以下环境变量或配置文件:

# ~/.openclaw/config/cloudflare-r2.env
CLOUDFLARE_R2_ACCOUNT_ID=your-account-id
CLOUDFLARE_R2_ACCESS_KEY_ID=your-access-key
CLOUDFLARE_R2_SECRET_ACCESS_KEY=your-secret-key
CLOUDFLARE_R2_BUCKET_NAME=your-bucket-name
CLOUDFLARE_R2_PUBLIC_DOMAIN=your-public-domain  # 可选,自定义公开域名

或者在调用时传入参数。

使用方法

上传文件

from scripts.r2_uploader import R2Uploader

uploader = R2Uploader()
result = uploader.upload_file(local_path, object_name=None, public=True)
print(result['public_url'])  # 获取公开访问地址

命令行使用

# 上传文件
python skills/cloudflare-r2-s3/scripts/r2_uploader.py upload /path/to/file.jpg [object-name]

# 列出文件
python skills/cloudflare-r2-s3/scripts/r2_uploader.py list

# 删除文件
python skills/cloudflare-r2-s3/scripts/r2_uploader.py delete object-name

Cloudflare R2 配置步骤

  1. 创建 R2 存储桶

    • 登录 Cloudflare 控制台 → R2 → 创建存储桶
    • 记住存储桶名称
  2. 创建 API 令牌

    • R2 → 管理 R2 API 令牌 → 创建 API 令牌
    • 授予 Object Read + Write 权限
    • 保存 Access Key ID 和 Secret Access Key
  3. 配置公开访问(可选但推荐)

    • 在存储桶设置 → "Public Access" → 启用
    • 可以使用 Cloudflare 提供的 pub-${bucket-name}.r2.dev 域名
    • 或者绑定自定义域名

依赖

需要安装 boto3:

pip install boto3

脚本说明

  • scripts/r2_uploader.py - 主上传工具,支持命令行和 API 调用
  • references/config_example.env - 配置文件示例

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

Huo15 Openclaw Enhance

火一五·克劳德·龙虾增强插件 v5.7.8 — 全面适配 openclaw 2026.4.24:peerDep ^4.24 + build/compat 同步到 4.24 + 14 处 api.on 全部去掉 as any 改成 typed hook(hookName 联合类型 + handler 自动推断 Pl...

Registry SourceRecently Updated
General

Content Trend Analyzer

Aggregates and analyzes content trends across platforms to identify hot topics, user intent, content gaps, and generates data-driven article outlines.

Registry SourceRecently Updated
General

Prompt Debugger

Debug prompts that produce unexpected AI outputs — diagnose failure modes, identify ambiguity and conflicting instructions, test variations, compare model re...

Registry SourceRecently Updated
General

Indie Maker News

独行者 Daily - 变现雷达。读对一条新闻,少走一年弯路。每天5分钟,给创业者装上商业雷达。聚焦一人公司、副业、创业变现资讯,智能分类,行动导向。用户下载即能用,无需本地部署!

Registry SourceRecently Updated