Skip to content

Commit

Permalink
Fix 10279: Set updater endpoint at build time
Browse files Browse the repository at this point in the history
  • Loading branch information
jumde committed Jun 22, 2020
1 parent a280f3d commit 272acc7
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions lib/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ const Config = function () {
this.infuraProjectId = getNPMConfig(['brave_infura_project_id']) || ''
this.binanceClientId = getNPMConfig(['binance_client_id']) || ''
this.safeBrowsingApiEndpoint = getNPMConfig(['safebrowsing_api_endpoint']) || ''
this.updaterProdEndpoint = getNPMConfig(['updater_prod_endpoint']) || ''
this.updaterDevEndpoint = getNPMConfig(['updater_dev_endpoint']) || ''
this.webcompatReportApiEndpoint = getNPMConfig(['webcompat_report_api_endpoint']) || 'https://webcompat.brave.com/1/webcompat'
this.buildProjects()
this.braveVersion = getNPMConfig(['version']) || '0.0.0'
Expand Down Expand Up @@ -159,6 +161,8 @@ Config.prototype.buildArgs = function () {
chrome_version_string: this.chromeVersion,
chrome_version_major: chrome_version_parts[0],
safebrowsing_api_endpoint: this.safeBrowsingApiEndpoint,
updater_prod_endpoint: this.updaterProdEndpoint,
updater_dev_endpoint: this.updaterDevEndpoint,
webcompat_report_api_endpoint: this.webcompatReportApiEndpoint,
brave_stats_api_key: this.braveStatsApiKey,
enable_hangout_services_extension: this.enable_hangout_services_extension,
Expand Down Expand Up @@ -295,6 +299,8 @@ Config.prototype.buildArgs = function () {
args.dcheck_always_on = this.isDebug()

delete args.safebrowsing_api_endpoint
delete args.updater_prod_endpoint
delete args.updater_dev_endpoint
delete args.safe_browsing_mode
delete args.proprietary_codecs
delete args.ffmpeg_branding
Expand Down Expand Up @@ -466,6 +472,14 @@ Config.prototype.update = function (options) {
this.safeBrowsingApiEndpoint = options.safebrowsing_api_endpoint
}

if (options.updater_prod_endpoint) {
this.updaterDevEndpoint = options.updater_prod_endpoint
}

if (options.updater_dev_endpoint) {
this.updaterDevEndpoint = options.updater_dev_endpoint
}

if (options.webcompat_report_api_endpoint) {
this.webcompatReportApiEndpoint = options.webcompat_report_api_endpoint
}
Expand Down

0 comments on commit 272acc7

Please sign in to comment.