Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
api.get('/sys/model', function(req, res) { // Device Model (sys/model)
si.system()
.then(data => res.send('\"' + data.model.toString() + '\"'))
.catch(error => res.status(404).send(siError))
})
api.get('/sys/os', function(req, res) { // Device OS (sys/os)
(async () => {
system = await SI.system();
cpu = await SI.cpu();
os = await SI.osInfo();
setInterval(poll, argv.i);
app.listen(argv.p);
console.log(`Doppler running on port ${argv.p}`);
})();
export const getSystemInformation = async () => {
return {
system: await systemInfo.system(),
time: systemInfo.time(),
cpu: await systemInfo.cpu(),
osInfo: await systemInfo.osInfo(),
package: {
name: pkg.name,
version: pkg.version,
repository: pkg.repository,
author: pkg.author,
"staart-version": pkg["staart-version"]
}
};
};
private async getEncryptionKey(): Promise {
const s = await system();
const c = await cpu();
const m = await mem();
const o = await osInfo();
return s.manufacturer + ';' + s.uuid + ';' + String(c.processors) + ';'
+ c.vendor + ';' + m.total + ';' + o.platform + ';' + o.release;
}
const getSystemInformation = async () => {
return {
system: await systemInfo.system(),
time: systemInfo.time(),
cpu: await systemInfo.cpu(),
osInfo: await systemInfo.osInfo(),
package: {
name: pkg.name,
version: pkg.version,
repository: pkg.repository,
author: pkg.author,
"staart-version": pkg["staart-version"]
}
};
};