imlinhanchao/vsc-markdown-image

请求对S3上传文件增加 forcePathStyle 配置项

Closed this issue · 4 comments

对于自建的 S3 兼容存储比如说 minio,需要设置 forcePathStyle=true

https://github.com/imlinhanchao/vsc-markdown-image/blob/master/src/lib/s3.ts#L20

this.s3Client = new S3Client({
    forcePathStyle: !!this.config.s3.forcePathStyle,
    endpoint: endpoint,
    region: region || "auto",
    credentials: {
      accessKeyId: accessKeyId,
      secretAccessKey: secretAccessKey,
    },
});

markdown-image-pre-1.1.40.zip
试试这个,用 markdown-image.s3.config,你可以配置为

"markdown-image.s3.config": {
    "forcePathStyle": false,
}

@imlinhanchao 感谢支持。

经测试可以使用。

不过发现一个Bug: https://github.com/imlinhanchao/vsc-markdown-image/blob/master/src/lib/s3.ts#L73

.replace(/\${bucket}/g, this.config.s3.bucket) // 应该是this.config.s3.bucketName

OK~昨晚修改忘记提上仓库了。晚上回去再发布。

已发布