@applitools/execution-grid-tunnel
Advanced tools
Comparing version 1.0.15 to 1.0.16
{ | ||
"name": "@applitools/execution-grid-tunnel", | ||
"version": "1.0.15", | ||
"version": "1.0.16", | ||
"description": "", | ||
@@ -36,2 +36,3 @@ "main": "scripts/run-execution-grid-tunnel.js", | ||
"dependencies": { | ||
"@applitools/eg-frpc": "1.0.1", | ||
"@applitools/eg-socks5-proxy-server": "^0.5.4", | ||
@@ -38,0 +39,0 @@ "@applitools/execution-grid-tunnel": "^1.0.14", |
const fs = require('fs') | ||
const https = require('https') | ||
const crypto = require('crypto') | ||
const {getExpectedBinHash, getBinHash} = require('@applitools/eg-frpc') | ||
const {FrpcDownloadError} = require('../src/utils') | ||
module.exports = {getExpectedHash, downloadFrpc, getBinHash, getFrpcDownloadLink, getManualFrpcInstallingErrorMessage, getFrpcErrorMessage } | ||
module.exports = { downloadFrpc, getFrpcDownloadLink, getManualFrpcInstallingErrorMessage, getFrpcErrorMessage } | ||
const binHashMap = new Map() | ||
binHashMap.set('darwin_x64', '+RP+HSFGWPsH9OOqW+lzxQZwP3kuZz4PUd0m7ZIFfmU=') | ||
binHashMap.set('darwin_arm64', 'DC9PAeRsLMxXfmZ1TlRF/h6q8rWjATByTgMCuRZTe+A=') | ||
binHashMap.set('linux_x64', 'AW+qGA7k6YvR08tPlPMVadq1fwju3206WMaAJUVv1jQ=') | ||
binHashMap.set('win32_x64', 'XJKhP+BxycN8p6ofr7i8esBFY/0gyHvlhZSpwI7MLc8=') | ||
function getExpectedHash({platform, arch}){ | ||
const key = `${platform}_${arch}` | ||
return binHashMap.has(key)? binHashMap.get(key): undefined | ||
} | ||
async function getBinHash(binPath){ | ||
const hash = crypto.createHash('sha256') | ||
const buffer = await fs.promises.readFile(binPath) | ||
const actualHash = hash.update(buffer).digest('base64') | ||
return actualHash | ||
} | ||
async function downloadFrpc({platform, arch, cacheDirectoryPath, frpcPath, shouldUpdate}) { | ||
const expectedHash = getExpectedHash({platform, arch}) | ||
const expectedHash = getExpectedBinHash({platform, arch}) | ||
const url = getFrpcDownloadLink({platform, arch}) | ||
@@ -48,4 +31,3 @@ | ||
function getFrpcDownloadLink({platform, arch}){ | ||
const fileSuffix = platform === 'win32' ? '.exe' : '' | ||
return `https://applitools.jfrog.io/artifactory/execution-grid/frpc/${platform}/${arch}/frpc${fileSuffix}` | ||
return `https://exec-wus.applitools.com/frpc/0.45.0/${platform}/${arch}` | ||
} | ||
@@ -52,0 +34,0 @@ |
@@ -8,4 +8,6 @@ 'use strict' | ||
const { getExpectedBinHash, getBinHash, getSupportedPlatformAndArchList } = require('@applitools/eg-frpc') | ||
const {getCacheDirectoryPath, FrpcDownloadError} = require('../src/utils') | ||
const createApp = require('../src/execution-grid-tunnel') | ||
const { | ||
@@ -19,5 +21,5 @@ createDirectoryIfDoesntExist, | ||
} = require('../src/utils') | ||
const { getExpectedHash, downloadFrpc, getBinHash, getFrpcDownloadLink, getManualFrpcInstallingErrorMessage } = require('./frpc') | ||
const { downloadFrpc, getFrpcDownloadLink, getManualFrpcInstallingErrorMessage } = require('./frpc') | ||
// TODO: Client Should need other logging system | ||
const createApp = require('../src/execution-grid-tunnel') | ||
@@ -82,8 +84,10 @@ let heartbeatIntervalId, deleteOldFilesInterval, cleanupFunction | ||
const expectedHash = getExpectedHash({platform, arch}) | ||
if (!expectedHash) { | ||
const isPlatformAndArchSupported = getSupportedPlatformAndArchList().some(item => item.platform === platform && item.arch === arch) | ||
if (!isPlatformAndArchSupported) { | ||
throw `execution-grid-tunnel doesn't support ${platform} with ${arch} architecture yet` | ||
} | ||
const expectedHash = getExpectedBinHash({platform, arch}) | ||
let isFrpcExist = existsSync(frpcPath) | ||
@@ -90,0 +94,0 @@ let isExpectedFrpc = isFrpcExist && (await getBinHash(frpcPath)) === expectedHash |
@@ -21,6 +21,3 @@ const {makeLogger} = require('@applitools/logger') | ||
// @applitools/logger issue: logger.info doesn't exist so logger.info = logger.log | ||
logger.info = logger.log | ||
return logger | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
46278
14
1290
+ Added@applitools/eg-frpc@1.0.1
+ Added@applitools/eg-frpc@1.0.1(transitive)