feat(p2p): publish manticore info

This commit is contained in:
Alexey Kasyanchuk 2023-06-03 05:13:45 +03:00
parent 8e7bb74f6b
commit 9d17fd28d1
4 changed files with 11 additions and 3 deletions

View File

@ -300,7 +300,7 @@ app.on("ready", async () => {
}
callback.apply(null, arg)
})
}, app.getPath("userData"), app.getVersion(), env.name)
}, app.getPath("userData"), app.getVersion(), env.name, sphinx)
// load page only after init app
spider.initialized.then(() => {

View File

@ -61,7 +61,7 @@ const start = async () =>
dbPatcher(() => {
spider = new spiderCall((...data) => io.sockets.emit(...data), (message, callback) => {
socketMessages[message] = callback
}, path.resolve(packageJson.serverDataDirectory), packageJson.version, 'production')
}, path.resolve(packageJson.serverDataDirectory), packageJson.version, 'production', sphinx)
}, null, sphinx)
}, path.resolve(packageJson.serverDataDirectory), () => {}))
}

View File

@ -263,6 +263,12 @@ module.exports = async (callback, dataDirectory, onClose, params = {}) => {
{
needConvertation = true;
}
let manticoreVersion;
if (!sphinx.version && (manticoreVersion = /Manticore ([0-9\.]+)/.exec(data))) {
sphinx.version = manticoreVersion[1];
logT('sphinx', 'sphinx version', sphinx.version);
}
if(windowsEncodingFix && data.includes('failed to parse config file'))
{

View File

@ -39,7 +39,7 @@ const mime = require('mime');
//server.listen(config.httpPort);
//console.log('Listening web server on', config.httpPort, 'port')
module.exports = function (send, recive, dataDirectory, version, env)
module.exports = function (send, recive, dataDirectory, version, env, {version: manticoreVersion})
{
this.initialized = (async () =>
{
@ -135,6 +135,8 @@ module.exports = function (send, recive, dataDirectory, version, env)
p2p.info.filesSize = 0;
}
p2p.info.manticoreVersion = manticoreVersion;
if(filesInfo && filesInfo[0])
{
filesInfo = filesInfo[0]