{"id":13618420,"url":"https://github.com/wayjam/picgo-plugin-s3","last_synced_at":"2026-02-15T05:06:30.969Z","repository":{"id":37369907,"uuid":"336545959","full_name":"wayjam/picgo-plugin-s3","owner":"wayjam","description":"PicGo S3 插件","archived":false,"fork":false,"pushed_at":"2025-08-31T08:28:43.000Z","size":212,"stargazers_count":192,"open_issues_count":8,"forks_count":24,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-10-01T09:28:59.603Z","etag":null,"topics":["aws","picgo","picgo-plugin","s3"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wayjam.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2021-02-06T13:37:18.000Z","updated_at":"2025-09-26T12:52:10.000Z","dependencies_parsed_at":"2025-05-09T05:11:14.317Z","dependency_job_id":null,"html_url":"https://github.com/wayjam/picgo-plugin-s3","commit_stats":{"total_commits":40,"total_committers":5,"mean_commits":8.0,"dds":"0.19999999999999996","last_synced_commit":"e8230d1e43332c6b5bf211aacdcb23915042a99e"},"previous_names":[],"tags_count":24,"template":false,"template_full_name":null,"purl":"pkg:github/wayjam/picgo-plugin-s3","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wayjam%2Fpicgo-plugin-s3","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wayjam%2Fpicgo-plugin-s3/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wayjam%2Fpicgo-plugin-s3/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wayjam%2Fpicgo-plugin-s3/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wayjam","download_url":"https://codeload.github.com/wayjam/picgo-plugin-s3/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wayjam%2Fpicgo-plugin-s3/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29469938,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-15T04:35:06.950Z","status":"ssl_error","status_checked_at":"2026-02-15T04:33:41.357Z","response_time":118,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws","picgo","picgo-plugin","s3"],"created_at":"2024-08-01T20:02:01.155Z","updated_at":"2026-02-15T05:06:30.963Z","avatar_url":"https://github.com/wayjam.png","language":"TypeScript","funding_links":[],"categories":["TypeScript",":rocket: Plugin for PicGo"],"sub_categories":[],"readme":"## picgo-plugin-s3\n\n[![github-action](https://github.com/wayjam/picgo-plugin-s3/workflows/publish/badge.svg)](https://github.com/wayjam/picgo-plugin-s3/actions/workflows/publish.yaml)\n[![license](https://img.shields.io/github/license/wayjam/picgo-plugin-s3)](https://github.com/wayjam/picgo-plugin-s3/blob/main/LICENSE)\n[![npm](https://img.shields.io/npm/v/picgo-plugin-s3?style=flat)](https://www.npmjs.com/package/picgo-plugin-s3)\n\n[PicGo](https://github.com/PicGo/PicGo-Core) Amazon S3 上传插件。\n\n- 支持 Amazon S3 与其他兼容 S3 API 的云存储 (例如 Backblaze B2)。\n- 支持 PicGo GUI。\n- 支持 MinIO。\n\n### 安装 (Installation)\n\nGUI 用户可直接在插件市场搜索 `s3` 并下载。\n\nCore 用户可执行 `picgo add s3` 命令安装。\n\n### 配置 (Configuration)\n\n```sh\npicgo set uploader s3\n```\n\n| Key | 说明 | 示例 |\n| :--- | :--- | :--- |\n| `accessKeyID` | AWS 凭证 ID。 | |\n| `secretAccessKey` | AWS 凭证密钥。 | |\n| `bucketName` | S3 桶名称。 | `gallery` |\n| `uploadPath` | 上传路径，详细配置请查看以下说明。 | `{year}/{month}/{fullName}` |\n| `endpoint` | 指定自定义终端节点。 | `s3.us-west-2.amazonaws.com` |\n| `proxy` | 代理地址，支持 http 代理。 | `http://127.0.0.1:1080` |\n| `region` | 指定执行服务请求的区域。 | `us-west-1` |\n| `pathStyleAccess` | 是否启用 S3 Path style 访问模式。\u003cbr\u003e例如 `https://s3.amazonaws.com/\u003cbucketName\u003e/\u003ckey\u003e`。\u003cbr\u003e使用 MinIO 时请设置为 `true`。 | 默认为 `false` |\n| `rejectUnauthorized`| 是否拒绝无效的 TLS 证书连接。\u003cbr\u003e如上传失败日志显示证书问题可设置为 `false`。 | 默认为 `true` |\n| `acl` | 访问控制列表 (ACL)，用于设置资源的访问策略。\u003cbr\u003e可选值: `private`, `public-read`, `public-read-write`, `authenticated-read`, `aws-exec-read`, `bucket-owner-read`, `bucket-owner-full-control`。 | 默认为 `public-read` |\n| `outputURLPattern` | 自定义输出 URL 模板，详细配置请查看以下说明。 | `{protocol}://{host}:{port}/{path}` |\n| `urlPrefix` | **[已废弃]** 自定义 URL 前缀。请使用 `outputURLPattern`。 | `https://img.example.com/my-blog/` |\n| `urlSuffix` | **[已废弃]** 自定义 URL 后缀。请使用 `outputURLPattern`。 | `?oxx=xxx` |\n| `disableBucketPrefixToURL` | **[已废弃]** 禁用 URL 中的 bucket 前缀。请使用 `outputURLPattern`。 | 默认为 `false` |\n\n---\n\n#### 通用占位符\n\n`uploadPath` 和 `outputURLPattern` 均支持通用占位符，插件会将其替换为实际变量。\n\n| 占位符 | 描述 |\n| :--- | :--- |\n| `{year}` | 年 |\n| `{month}` | 月 |\n| `{day}` | 日 |\n| `{hour}` | 时 |\n| `{minute}` | 分 |\n| `{second}` | 秒 |\n| `{millisecond}` | 毫秒 |\n| `{timestamp}` | Unix 时间戳 (秒) |\n| `{timestampMS}` | Unix 时间戳 (毫秒) |\n\n#### 上传路径 (`uploadPath`)\n\n除了通用占位符外，还支持以下变量：\n\n| 占位符 | 描述 |\n| :--- | :--- |\n| `{fullName}` | 完整文件名 (含扩展名) |\n| `{fileName}` | 文件名 (不含扩展名) |\n| `{extName}` | 扩展名 (不含 `.`) |\n| `{md5}` | 图片 MD5 |\n| `{sha1}` | 图片 SHA1 |\n| `{sha256}` | 图片 SHA256 |\n\n对于 MD5、SHA1、SHA256，支持这几种截断方式：\n\n- `{sha256:2}`：从第三个字符开始，例如 `abcd -\u003e cd`\n- `{sha256:2,4}`：从第三个字符开始，截取长度为4，例如 `abcdefgh`\n\n---\n\n#### 自定义输出 URL 模板 (`outputURLPattern`)\n\n此配置将替代已废弃的 `urlPrefix`、`urlSuffix` 和 `disableBucketPrefixToURL`。\n\n除了通用占位符外，还支持以下变量：\n\n| 占位符 | 描述 | 示例 |\n| :--- | :--- | :--- |\n| `{protocol}` | URL 协议 | `http` 或 `https` |\n| `{host}` | URL 域名 | `s3.amazonaws.com` |\n| `{port}` | URL 端口 | `80` |\n| `{dir}` | 上传目录 | `xxx/2024/12` |\n| `{uploadedFileName}` | 上传后的文件名 (含扩展名) | `4aa4f41e38817e5fd38ac870f40dbc70.jpg` |\n| `{path}` | 完整路径 (`{dir}/{uploadedFileName}`) | `xxx/2024/12/4aa4f41e38817e5fd38ac870f40dbc70.jpg` |\n| `{fileName}` | **源**文件名 (含扩展名) | `test.jpg` |\n| `{extName}` | **源**文件扩展名 (不含 `.`) | `jpg` |\n| `{query}` | URL 查询参数 (不含 `?`) | `height=100\u0026width=200` |\n| `{hash}` | URL hash (不含 `#`) | `abc` |\n| `{bucket}` | S3 桶名 | `my-bucket` |\n\n##### 正则替换\n\n每个变量都支持通过正则表达式进行替换(正则替换表达式中间不能有空格)。\n\n**语法:**\n```\n{payload:/pattern/flags,'replacement'}\n```\n\n**示例:**\n假设配置为 `{protocol}://example.com/{path:/testBucket/i,'myimage'}`，\n并且原始 URL 为 `https://cluster.s3.example.com/testBucket/image.jpg`，\n则最终生成的 URL 为 `https://example.com/myimage/image.jpg`。\n\n---\n\n#### 完整示例 (Example)\n\n```json\n{\n  \"picgo-plugin-s3\": {\n    \"accessKeyID\": \"xxx\",\n    \"secretAccessKey\": \"xxxxx\",\n    \"bucketName\": \"my-bucket\",\n    \"uploadPath\": \"{year}/{md5}.{extName}\",\n    \"endpoint\": \"s3.us-west-000.backblazeb2.com\",\n    \"outputURLPattern\": \"https://img.example.com/{bucket}/{path}\"\n  }\n}\n```\n如果 PicGo 按以上配置，上传 `sample.png`，最终得到的图片地址可能为：`https://img.example.com/my-bucket/2021/4aa4f41e38817e5fd38ac870f40dbc70.png`。\n\n## 发布 (Publish)\n\n执行以下任一命令，会自动更新 `package.json` 的版本号并生成一个 commit 推送到远程仓库。GitHub Action 将会自动编译、打包并发布到 NPM。\n\n```sh\n# 更新补丁版本 (patch)\nnpm run patch\n\n# 更新次要版本 (minor)\nnpm run minor\n\n# 更新主要版本 (major)\nnpm run major\n```\n\n## 开发 (Development)\n\n1. Clone this repo\n2. `npm i \u0026\u0026 npm run dev`\n3. `cd ~/.picgo \u0026\u0026 npm install ${path_to_the_repo}`\n\n## 贡献 (Contributing)\n\n欢迎提交 Pull Request。对于重大更改，请先开一个 Issue 进行讨论。\n\n## 许可证 (License)\n\nReleased under the [MIT License](https://github.com/wayjam/picgo-plugin-s3/blob/main/LICENSE).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwayjam%2Fpicgo-plugin-s3","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwayjam%2Fpicgo-plugin-s3","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwayjam%2Fpicgo-plugin-s3/lists"}