Skip to content

Commit

Permalink
fix: "status 401: Unauthorized" issue with dl.bintray.com
Browse files Browse the repository at this point in the history
  • Loading branch information
develar committed May 24, 2017
1 parent a2e58c0 commit ee2d4a9
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 14 deletions.
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"ajv": "^5.1.3",
"ajv-keywords": "^2.0.0",
"archiver": "^1.3.0",
"aws-sdk": "^2.55.0",
"aws-sdk": "^2.56.0",
"bluebird-lst": "^1.0.2",
"chalk": "^1.1.3",
"chromium-pickle-js": "^0.2.0",
Expand Down Expand Up @@ -78,7 +78,6 @@
"babel-plugin-transform-es2015-parameters": "^6.24.1",
"babel-plugin-transform-es2015-spread": "^6.22.0",
"babel-plugin-transform-inline-imports-commonjs": "^1.2.0",
"catharsis": "^0.8.8",
"convert-source-map": "^1.5.0",
"decompress-zip": "^0.3.0",
"depcheck": "^0.6.7",
Expand Down
3 changes: 2 additions & 1 deletion packages/electron-builder-http/src/httpExecutor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,8 @@ export function configureRequestOptions(options: RequestOptions, token?: string
headers["Cache-Control"] = "no-cache"
}

if (options.protocol == null) {
// do not specify for node (in any case we use https module)
if (options.protocol == null && process.versions["electron"] != null) {
options.protocol = "https:"
}
return options
Expand Down
5 changes: 5 additions & 0 deletions packages/electron-builder-util/src/binDownload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ export function getBinFromBintray(name: string, version: string, sha2: string):
return getBin(name, dirName, `https://dl.bintray.com/electron-userland/bin/${dirName}.7z`, sha2)
}

export function getBinFromGithub(name: string, version: string, sha2: string): Promise<string> {
const dirName = `${name}-${version}`
return getBin(name, dirName, `https://github.com/electron-userland/electron-builder-binaries/releases/download/${dirName}/${dirName}.7z`, sha2)
}

export function getBin(name: string, dirName: string, url: string, sha2: string): Promise<string> {
let promise = versionToPromise.get(dirName)
// if rejected, we will try to download again
Expand Down
6 changes: 3 additions & 3 deletions packages/electron-builder/src/targets/nsis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import BluebirdPromise from "bluebird-lst"
import _debug from "debug"
import { Arch, Target } from "electron-builder-core"
import { asArray, debug, doSpawn, exec, getPlatformIconFileName, handleProcess, isEmptyOrSpaces, use } from "electron-builder-util"
import { getBinFromBintray } from "electron-builder-util/out/binDownload"
import { getBinFromGithub } from "electron-builder-util/out/binDownload"
import { copyFile } from "electron-builder-util/out/fs"
import { log, subTask, warn } from "electron-builder-util/out/log"
import { asyncAll } from "electron-builder-util/out/promise"
Expand All @@ -24,9 +24,9 @@ const debugLang = _debug("electron-builder:lang")
const ELECTRON_BUILDER_NS_UUID = "50e065bc-3134-11e6-9bab-38c9862bdaf3"

// noinspection SpellCheckingInspection
const nsisPathPromise = getBinFromBintray("nsis", "3.0.1.13", "2921dd404ce9b69679088a6f1409a56dd360da2077fe1019573c0712c9edf057")
const nsisPathPromise = getBinFromGithub("nsis", "3.0.1.13", "2921dd404ce9b69679088a6f1409a56dd360da2077fe1019573c0712c9edf057")
// noinspection SpellCheckingInspection
const nsisResourcePathPromise = getBinFromBintray("nsis-resources", "3.0.0", "cde0e77b249e29d74250bf006aa355d3e02b32226e1c6431fb48facae41d8a7e")
const nsisResourcePathPromise = getBinFromGithub("nsis-resources", "3.0.0", "cde0e77b249e29d74250bf006aa355d3e02b32226e1c6431fb48facae41d8a7e")

const USE_NSIS_BUILT_IN_COMPRESSOR = false

Expand Down
4 changes: 2 additions & 2 deletions packages/electron-builder/src/windowsCodeSign.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { exec } from "electron-builder-util"
import { getBinFromBintray } from "electron-builder-util/out/binDownload"
import { getBinFromGithub } from "electron-builder-util/out/binDownload"
import { rename } from "fs-extra-p"
import isCi from "is-ci"
import { release } from "os"
Expand All @@ -10,7 +10,7 @@ const TOOLS_VERSION = "1.7.0"

export function getSignVendorPath() {
//noinspection SpellCheckingInspection
return getBinFromBintray("winCodeSign", TOOLS_VERSION, "a34a60e74d02b81d0303e498f03c70ce0133f908b671f62ec32896db5cd0a716")
return getBinFromGithub("winCodeSign", TOOLS_VERSION, "a34a60e74d02b81d0303e498f03c70ce0133f908b671f62ec32896db5cd0a716")
}

export interface FileCodeSigningInfo {
Expand Down
12 changes: 6 additions & 6 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ acorn@^3.0.4, acorn@^3.3.0:
resolved "https://registry.yarnpkg.com/acorn/-/acorn-3.3.0.tgz#45e37fb39e8da3f25baee3ff5369e2bb5f22017a"

acorn@^4.0.4:
version "4.0.11"
resolved "https://registry.yarnpkg.com/acorn/-/acorn-4.0.11.tgz#edcda3bd937e7556410d42ed5860f67399c794c0"
version "4.0.13"
resolved "https://registry.yarnpkg.com/acorn/-/acorn-4.0.13.tgz#105495ae5361d697bd195c825192e1ad7f253787"

ajv-keywords@^2.0.0:
version "2.0.0"
Expand Down Expand Up @@ -271,9 +271,9 @@ asynckit@^0.4.0:
version "0.4.0"
resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79"

aws-sdk@^2.55.0:
version "2.55.0"
resolved "https://registry.yarnpkg.com/aws-sdk/-/aws-sdk-2.55.0.tgz#7528f3729ecbc8e5aea42ac89e1ff2537086f7c2"
aws-sdk@^2.56.0:
version "2.56.0"
resolved "https://registry.yarnpkg.com/aws-sdk/-/aws-sdk-2.56.0.tgz#a18c3005c7adb1c6edc86b95f2833aedd4f86493"
dependencies:
buffer "5.0.6"
crypto-browserify "1.0.9"
Expand Down Expand Up @@ -688,7 +688,7 @@ caseless@~0.12.0:
version "0.12.0"
resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc"

catharsis@^0.8.8, catharsis@~0.8.8:
catharsis@~0.8.8:
version "0.8.8"
resolved "https://registry.yarnpkg.com/catharsis/-/catharsis-0.8.8.tgz#693479f43aac549d806bd73e924cd0d944951a06"
dependencies:
Expand Down

0 comments on commit ee2d4a9

Please sign in to comment.