coins-deposit-box
Advanced tools
Comparing version 5.1.0 to 5.2.0
33
index.js
@@ -8,2 +8,4 @@ 'use strict'; | ||
const removeMRN = value => value.replace(/\.mrn\.org/g, ''); | ||
/** | ||
@@ -15,21 +17,24 @@ * The hostname should be a string that doesn't contain the domain. Ex: | ||
*/ | ||
const hostname = os.hostname().replace('.mrn.org', ''); | ||
const hostname = removeMRN(os.hostname()); | ||
let apiHostname; | ||
let apiURL; | ||
let env; | ||
let webHostname; | ||
let webURL; | ||
if (COINS_ENV === 'staging') { | ||
apiHostname = 'stage-coins-api.mrn.org'; | ||
apiURL = 'https://stage-coins-api.mrn.org/api/v1.3.0'; | ||
env = 'staging'; | ||
webHostname = 'http://stageprcoin.mrn.org/'; | ||
webURL = 'https://coinstraining.mrn.org/'; | ||
} else if (COINS_ENV === 'production' || NODE_ENV === 'production') { | ||
apiHostname = 'coins-api.mrn.org'; | ||
apiURL = 'https://coins-api.mrn.org/api/v1.3.0'; | ||
env = 'production'; | ||
webHostname = 'coins.mrn.org'; | ||
webURL = 'https://coins.mrn.org/'; | ||
} else { | ||
apiHostname = process.env.STEELPENNY_HOSTNAME && process.env.STEELPENNY_SSL_PORT ? | ||
`${process.env.STEELPENNY_HOSTNAME}.mrn.org:${process.env.STEELPENNY_SSL_PORT}` : | ||
`${hostname}:8800`; | ||
webHostname = `${hostname}.mrn.org`; | ||
if (process.env.STEELPENNY_URL) { | ||
apiURL = process.env.STEELPENNY_URL; | ||
} else { | ||
apiURL = process.env.STEELPENNY_HOSTNAME && process.env.STEELPENNY_SSL_PORT ? | ||
`https://${removeMRN(process.env.STEELPENNY_HOSTNAME)}.mrn.org${process.env.STEELPENNY_SSL_PORT}/api/v1.3.0` : | ||
'http://localhost:8800/api/v1.3.0'; | ||
} | ||
@@ -43,2 +48,4 @@ if (COINS_ENV === 'ops') { | ||
} | ||
webURL = `https://${hostname}.mrn.org/`; | ||
} | ||
@@ -54,3 +61,3 @@ | ||
*/ | ||
apiURL: `https://${apiHostname.toLowerCase()}/api/v1.3.0`, | ||
apiURL, | ||
@@ -83,3 +90,3 @@ /** | ||
*/ | ||
webURL: `https://${webHostname.toLowerCase()}/`, | ||
webURL, | ||
@@ -86,0 +93,0 @@ /** |
@@ -41,3 +41,3 @@ { | ||
}, | ||
"version": "5.1.0" | ||
"version": "5.2.0" | ||
} |
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
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
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
4984
109
8