Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
} // else passthrough
default:
log.error("", er.stack || er.message || er)
log.error("", ["If you need help, you may report this *entire* log,"
,"including the npm and node versions, at:"
," "
].join("\n"))
printStack = false
break
}
var os = require("os")
// just a line break
console.error("")
log.error("System", os.type() + " " + os.release())
log.error("command", process.argv
.map(JSON.stringify).join(" "))
log.error("cwd", process.cwd())
log.error("node -v", process.version)
log.error("npm -v", npm.version)
; [ "file"
, "path"
, "type"
, "syscall"
, "fstream_path"
, "fstream_unc_path"
, "fstream_type"
, "fstream_class"
, "fstream_finish_call"
, "fstream_linkpath"
routes.get('(/api)?/info', async function (req, res, next) {
try {
var info = {
// General info
hostname: os.hostname(),
container: fs.existsSync('/.dockerenv'),
osType: os.type(),
osRelease: os.release(),
cpuArch: os.arch(),
cpuModel: os.cpus()[0].model,
cpuCount: os.cpus().length,
memory: Math.round(os.totalmem() / 1048576),
nodeVer: process.version,
nodeEnv: process.env.NODE_ENV || "NODE_ENV is not set",
appVersion: require('../package.json').version,
appBuildInfo: process.env.BUILD_INFO || "No build info",
appReleaseInfo: process.env.RELEASE_INFO || "No release info",
sentimentAPI: process.env.SENTIMENT_API_ENDPOINT || "Sentiment API not enabled",
}
if(req.app.get('data') && req.app.get('data').db) {
// Some info about the DB
info.mongoDb = {
connected: req.app.get('data').db.serverConfig.isConnected() || 'unknown',
// remember if we're in qa mode
this._qaMode = qaMode;
// if a client-info argument is specified, validate it
var clientVersion;
var clientEnvironment;
if (Util.exists(clientInfo))
{
Errors.assertInternal(Util.isObject(clientInfo));
Errors.assertInternal(Util.isString(clientInfo.version));
Errors.assertInternal(Util.isObject(clientInfo.environment));
clientVersion = clientInfo.version;
clientEnvironment = clientInfo.environment;
clientEnvironment.OS = os.platform();
clientEnvironment.OS_VERSION = os.release();
clientEnvironment.OCSP_MODE = GlobalConfig.getOcspMode();
}
/**
* Returns an object that contains information about the proxy hostname, port,
* etc. for when http requests are made.
*
* @returns {Object}
*/
this.getProxy = function ()
{
return proxy;
};
/**
* Returns the warehouse to automatically use once a connection has been
, Server = require('./server')
, Store = require('./topology_base').Store
, MAX_JS_INT = require('./utils').MAX_JS_INT
, translateOptions = require('./utils').translateOptions
, filterOptions = require('./utils').filterOptions
, mergeOptions = require('./utils').mergeOptions
, getReadPreference = require('./utils').getReadPreference
, os = require('os');
// Get package.json variable
var driverVersion = require('../package.json').version;
var nodejsversion = f('Node.js %s, %s', process.version, os.endianness());
var type = os.type();
var name = process.platform;
var architecture = process.arch;
var release = os.release();
/**
* @fileOverview The **Mongos** class is a class that represents a Mongos Proxy topology and is
* used to construct connections.
*
* **Mongos Should not be used, use MongoClient.connect**
* @example
* var Db = require('mongodb').Db,
* Mongos = require('mongodb').Mongos,
* Server = require('mongodb').Server,
* test = require('assert');
* // Connect using Mongos
* var server = new Server('localhost', 27017);
* var db = new Db('test', new Mongos([server]));
* db.open(function(err, db) {
* // Get an additional db
'use strict';
console.log("Platform info:");
var os = require("os");
var v8 = process.versions.v8;
var node = process.versions.node;
var plat = os.type() + " " + os.release() + " " + os.arch() + "\nNode.JS " + node + "\nV8 " + v8;
var cpus = os.cpus().map(function (cpu) {
return cpu.model;
}).reduce(function (o, model) {
if (!o[model]) o[model] = 0;
o[model]++;
return o;
}, {});
cpus = Object.keys(cpus).map(function (key) {
return key + " \u00d7 " + cpus[key];
}).join("\n");
console.log(plat + "\n" + cpus + "\n");
module.exports = {};
function sysIdentify() {
console.log("node version: " + process.versions.node) ;
var os = require('os') ;
console.log("os type: " + os.type()) ;
console.log("os platform: " + os.platform()) ;
console.log("os architecture: " + os.arch()) ;
console.log("os release: " + os.release()) ;
console.log("os hostname: " + os.hostname()) ;
}
freemem() {
return freemem();
},
platform: '',
release: '',
runtime: 'node',
runtimeVersion: '',
tmpDir: tmpdir(),
totalmem: -1
};
try {
const sysCpus = cpus();
details.cpuModel = sysCpus[0].model;
details.cpus = sysCpus.length;
details.platform = platform();
details.release = release();
details.runtimeVersion = process.version;
details.totalmem = totalmem();
} catch (e) {}
return details;
};
function gatherInfo(hbAPI) {
var os = require('os');
var osInfo = os.type() + " " + os.arch() + ", Release " + os.release();
var bridgeVersion = hbAPI.serverVersion !== undefined ? hbAPI.serverVersion : "unknown";
var out = {
"uptime": process.uptime(),
"heap": process.memoryUsage().heapUsed,
"osInfo": osInfo,
"hbVersion": bridgeVersion
};
return out;
}
function _buildUserAgentStringForWindows() {
return `(Windows NT ${os.release()})`;
}
this.segment = new segmentClient(API_KEY, { flushAt: 1 })
this.garden = garden
this.logger = getLogger()
this.globalConfigStore = garden.globalConfigStore
this.localConfigStore = garden.configStore
this.globalConfig = {
userId: "",
firstRun: true,
optedIn: false,
}
this.localConfig = {
projectId: "",
}
this.systemConfig = {
platform: platform(),
platformVersion: release(),
gardenVersion: getPackageVersion().toString(),
}
this.autoAccept = !!(parsedOpts && parsedOpts.yes)
}