Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

S3 doesn't generate latest-mac.json if the bucket has a dot in its name and the region isn't specified #1469

Closed
ariporad opened this issue Apr 14, 2017 · 4 comments

Comments

@ariporad
Copy link

  • electron-builder version: 16.8.3
  • Target: macOS

S3 doesn't generate latest-mac.json for buckets with a dot in their name if the region is not manually specified. If you specify a region or don't have a dot in your bucket name, then it all works fine. Uploading other artifacts also works.

@develar
Copy link
Member

develar commented Apr 14, 2017

What region do you use?

@ariporad
Copy link
Author

us-east-1 (N. Virginia)

@fernetmatt
Copy link

Is it just a problem only on upload? Do you find latest-mac.json file into "dist/" folder?
I've found relevant code into electron-publisher-s3 package:

File s3Publisher.js

static checkAndResolveOptions(options, channelFromAppVersion) {
        return (0, (_bluebirdLst || _load_bluebirdLst()).coroutine)(function* () {
            const bucket = options.bucket;
            if (bucket == null) {
                throw new Error(`Please specify "bucket" for "s3" update server`);
            }
            if (bucket.indexOf(".") !== -1 && options.region == null) {
                // on dotted bucket names, we need to use a path-based endpoint URL. Path-based endpoint URLs need to include the region.  
                const s3 = new (_awsSdk || _load_awsSdk()).S3({ signatureVersion: "v4" });
                options.region = (yield s3.getBucketLocation({ Bucket: bucket }).promise()).LocationConstraint;
            }
            if (options.channel == null && channelFromAppVersion != null) {
                options.channel = channelFromAppVersion;
            }
        })();
    }

@develar
Copy link
Member

develar commented Jan 30, 2018

Reopen if still actual.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants
@develar @fernetmatt @ariporad and others