1.0.2 • Published 2 years ago

picgo-plugin-s3-lls v1.0.2

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

picgo-plugin-s3

github-action license npm

PicGo Amazon S3 上传插件。

  • 支持 Amazon S3 与其他如 backblaze b2 等兼容 S3 API 的云存储
  • 支持 PicGO GUI

安装 Installation

GUI 直接搜索 S3 下载即可,Core 版执行 picgo add s3 安装。

配置 Configuration

picgo set uploader aws-s3
Key说明例子
accessKeyIDAWS 凭证 ID
secretAccessKeyAWS 凭证密钥
bucketNameS3 桶名称gallery
uploadPath上传路径{year}/{month}/{fullName}
urlPrefix最终生成图片 URL 的自定义前缀https://img.example.com/my-blog/
endpoint指定自定义终端节点s3.us-west-2.amazonaws.com
region指定执行服务请求的区域us-west-1
pathStyleAccess是否启用 S3 Path style默认为 false,使用 minio 请设置为 true
rejectUnauthorized是否拒绝无效TLS证书连接默认为 true,如上传失败日志显示证书问题可设置为false
acl访问控制列表,上传资源的访问策略默认为 public-read

上传路径支持 payload:

payload描述
{year}当前日期 - 年
{month}当前日期 - 月
{day}当前日期 - 日
{fullName}完整文件名(含扩展名)
{fileName}文件名(不含扩展名)
{extName}扩展名(不含.
{md5}图片 MD5 计算值
{sha1}图片 SHA1 计算值
{sha256}图片 SHA256 计算值

示例 Example

    "aws-s3": {
      "accessKeyID": "xxx",
      "secretAccessKey": "xxxxx",
      "bucketName": "my-bucket",
      "uploadPath": "{year}/{md5}.{extName}",
      "endpoint": "s3.us-west-000.backblazeb2.com",
      "urlPrefix": "https://img.example.com/"
    }

如果 PicGo 像以上配置,执行上传:picgo upload sample.png,则最终得到图片地址为:https://img.example.com/2021/4aa4f41e38817e5fd38ac870f40dbc70.jpg

发布 Publish

With the following command, a versioned commit which modifies the version of package.json would be genereated and pushed to the origin. Github Action will automatically compile this pacakage and publish it to NPM.

npm run patch
npm run minor
npm run major

贡献 Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

许可证 License

Released under the MIT License.