amazon-s3electronelectron-builderelectron-updater

Auto Updater does not work for Amazon S3 private Bucket


I set my S3 to private (see screen) and then put the following in my update script:

.......
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;
        });
........

Unfortunately, I then get the following error:

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>

.....

Someone a solution for me?


Solution

  • My solution:

    I set the FeedUrl for autoUpdater autoUpdater.setFeedURL('https://[BUCKET].s3.[REGION].amazonaws.com');