自动更新程序不适用于 Amazon S3 私有存储桶
Auto Updater does not work for Amazon S3 private Bucket
- 版本:
22.9.1
- 电子版:
- 电子类型(当前、测试版、夜间):
11.1.0(稳定)
目标:
mac OS 11.1
电子更新程序版本:
4.3.5
我将我的 S3 设置为私有 (),然后将以下内容放入我的更新脚本中:
.......
autoUpdater.on('checking-for-update', () => {
if (w !== undefined) {
w.get('settings').content().send('check-for-updates-begin');
}
let opts = {
service: 's3',
region: 'eu-central-1',
host: s3_bucket + '.s3.eu-central-1.amazonaws.com',
path: '/latest-mac.yml' // For example....
};
aws4.sign(opts, {
accessKeyId: "XXXXX",
secretAccessKey: "XXXXXXXX"
});
autoUpdater.requestHeaders = opts.headers;
});
........
不幸的是,我收到以下错误:
Error: HttpError: 403 Forbidden
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Error><Code>SignatureDoesNotMatch</Code><Message>The request signature we calculated does not match the signature you provided. Check your key and signing method.</Message>
.....
有人能帮我解决吗?
我的解决方案:
我为自动更新程序设置了 FeedUrl autoUpdater.setFeedURL('https://[BUCKET].s3.[REGION].amazonaws.com');
- 版本: 22.9.1
- 电子版:
- 电子类型(当前、测试版、夜间): 11.1.0(稳定)
目标: mac OS 11.1
电子更新程序版本: 4.3.5
我将我的 S3 设置为私有 (
.......
autoUpdater.on('checking-for-update', () => {
if (w !== undefined) {
w.get('settings').content().send('check-for-updates-begin');
}
let opts = {
service: 's3',
region: 'eu-central-1',
host: s3_bucket + '.s3.eu-central-1.amazonaws.com',
path: '/latest-mac.yml' // For example....
};
aws4.sign(opts, {
accessKeyId: "XXXXX",
secretAccessKey: "XXXXXXXX"
});
autoUpdater.requestHeaders = opts.headers;
});
........
不幸的是,我收到以下错误:
Error: HttpError: 403 Forbidden
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Error><Code>SignatureDoesNotMatch</Code><Message>The request signature we calculated does not match the signature you provided. Check your key and signing method.</Message>
.....
有人能帮我解决吗?
我的解决方案:
我为自动更新程序设置了 FeedUrl autoUpdater.setFeedURL('https://[BUCKET].s3.[REGION].amazonaws.com');