miolo 0.9.28 → 0.9.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli/miolo.cli.iife.bundle.js +1 -1
- package/dist/cli/miolo.cli.iife.bundle.min.js +1 -1
- package/dist/cli/miolo.cli.iife.js +1 -1
- package/dist/cli/miolo.cli.iife.min.js +1 -1
- package/dist/cli/miolo.cli.min.mjs +1 -1
- package/dist/cli/miolo.cli.mjs +1 -1
- package/dist/cli/miolo.cli.umd.bundle.js +1 -1
- package/dist/cli/miolo.cli.umd.bundle.min.js +1 -1
- package/dist/cli/miolo.cli.umd.js +1 -1
- package/dist/cli/miolo.cli.umd.min.js +1 -1
- package/dist/cli-react/miolo.cli-react.iife.bundle.js +1 -1
- package/dist/cli-react/miolo.cli-react.iife.bundle.min.js +1 -1
- package/dist/cli-react/miolo.cli-react.iife.js +1 -1
- package/dist/cli-react/miolo.cli-react.iife.min.js +1 -1
- package/dist/cli-react/miolo.cli-react.min.mjs +1 -1
- package/dist/cli-react/miolo.cli-react.mjs +1 -1
- package/dist/cli-react/miolo.cli-react.umd.bundle.js +1 -1
- package/dist/cli-react/miolo.cli-react.umd.bundle.min.js +1 -1
- package/dist/cli-react/miolo.cli-react.umd.js +1 -1
- package/dist/cli-react/miolo.cli-react.umd.min.js +1 -1
- package/dist/server/miolo.server.cjs +150 -57
- package/dist/server/miolo.server.min.mjs +2 -2
- package/dist/server/miolo.server.mjs +149 -58
- package/dist/server/miolo.server.mjs.map +1 -1
- package/dist/server/miolo.server.node.mjs +151 -58
- package/package.json +1 -1
package/dist/cli/miolo.cli.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* miolo v0.9.
|
|
2
|
+
* miolo v0.9.30
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Donato Lorenzo <donato@afialapis.com>
|
|
5
5
|
*
|
|
@@ -21,7 +21,6 @@ var nodemailer = require('nodemailer');
|
|
|
21
21
|
var tinguir = require('tinguir');
|
|
22
22
|
var util = require('node:util');
|
|
23
23
|
var winston = require('winston');
|
|
24
|
-
require('winston-daily-rotate-file');
|
|
25
24
|
var koa_body_parser = require('koa-better-body');
|
|
26
25
|
var koa_convert = require('koa-convert');
|
|
27
26
|
var koa_compress = require('koa-compress');
|
|
@@ -593,15 +592,20 @@ var base_config = {
|
|
|
593
592
|
file: {
|
|
594
593
|
enabled: true,
|
|
595
594
|
level: 'silly',
|
|
596
|
-
|
|
597
|
-
|
|
595
|
+
filename: '/var/log/afialapis/%MIOLO%.log',
|
|
596
|
+
//frequency: undefined,
|
|
597
|
+
//datePattern: 'YYYY-MM-DD',
|
|
598
598
|
zippedArchive: true,
|
|
599
|
-
|
|
600
|
-
maxFiles:
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
599
|
+
maxsize: 1024 * 1024 * 20,
|
|
600
|
+
maxFiles: 20
|
|
601
|
+
|
|
602
|
+
//maxSize: '20m',
|
|
603
|
+
///maxFiles: '10d',
|
|
604
|
+
|
|
605
|
+
//filename: '/var/log/afialapis/%MIOLO%.%DATE%.log',
|
|
606
|
+
//auditFile: '/var/log/afialapis/%MIOLO%.audit.json',
|
|
607
|
+
//createSymlink: true,
|
|
608
|
+
//symlinkName: '%MIOLO%.log'
|
|
605
609
|
},
|
|
606
610
|
mail: {
|
|
607
611
|
enabled: false,
|
|
@@ -905,6 +909,12 @@ function init_logger_to_mail(config, emailer) {
|
|
|
905
909
|
return MailerLogger;
|
|
906
910
|
}
|
|
907
911
|
|
|
912
|
+
//import fs from 'fs'
|
|
913
|
+
//import path from 'path'
|
|
914
|
+
// import { reopenTransportOnHupSignal } from './reopenTransportOnHupSignal.mjs'
|
|
915
|
+
// import 'winston-daily-rotate-file'
|
|
916
|
+
//import { intre_to_str, intre_now } from 'intre'
|
|
917
|
+
|
|
908
918
|
var combine = winston.format.combine,
|
|
909
919
|
timestamp = winston.format.timestamp;
|
|
910
920
|
winston.format._label;
|
|
@@ -931,7 +941,7 @@ var init_logger = function init_logger(config, emailer, prefix) {
|
|
|
931
941
|
warn: 'wrn',
|
|
932
942
|
error: 'err'
|
|
933
943
|
};
|
|
934
|
-
var myFormat =
|
|
944
|
+
var myFormat = function myFormat(info) {
|
|
935
945
|
var _config$format;
|
|
936
946
|
var lc = LEVEL_COLORS[info.level];
|
|
937
947
|
var tm = new Date(info.timestamp);
|
|
@@ -939,7 +949,7 @@ var init_logger = function init_logger(config, emailer, prefix) {
|
|
|
939
949
|
//const ts= tm.toString().substr(4, 20)
|
|
940
950
|
var log = "[" + prefix + "] " + lc(ts) + " " + lc(LEVEL_ABBRV[info.level]) + " " + info.message;
|
|
941
951
|
return info.stack ? log + "\n" + info.stack : log;
|
|
942
|
-
}
|
|
952
|
+
};
|
|
943
953
|
var _log_transports = [];
|
|
944
954
|
//
|
|
945
955
|
// Console transport
|
|
@@ -976,26 +986,102 @@ var init_logger = function init_logger(config, emailer, prefix) {
|
|
|
976
986
|
// _log_transports.push(fileTransport)
|
|
977
987
|
// }
|
|
978
988
|
|
|
989
|
+
// if (config?.file?.enabled === true) {
|
|
990
|
+
// const datePattern = config?.file?.datePattern || 'YYYY-MM-DD'
|
|
991
|
+
//
|
|
992
|
+
// const fileTransport = new transports.DailyRotateFile({
|
|
993
|
+
// level : config?.file?.level || config?.level || 'info' ,
|
|
994
|
+
//
|
|
995
|
+
// frequency: config?.file?.frequency,
|
|
996
|
+
// datePattern,
|
|
997
|
+
// zippedArchive: config?.file?.zippedArchive == true,
|
|
998
|
+
// maxSize: config?.file?.maxSize || '20m',
|
|
999
|
+
// maxFiles: config?.file?.maxFiles || '10d',
|
|
1000
|
+
//
|
|
1001
|
+
// filename : config?.file?.filename
|
|
1002
|
+
// ? config.file.filename.replace('%MIOLO%', prefix)
|
|
1003
|
+
// : '/var/log/afialapis/miolo.%DATE%.log',
|
|
1004
|
+
//
|
|
1005
|
+
// auditFile: config?.file?.auditFile
|
|
1006
|
+
// ? config.file.auditFile.replace('%MIOLO%', prefix)
|
|
1007
|
+
// : '/var/log/afialapis/miolo.audit.json',
|
|
1008
|
+
//
|
|
1009
|
+
// symlinkName: config?.file?.symlinkName
|
|
1010
|
+
// ? config.file.symlinkName.replace('%MIOLO%', prefix)
|
|
1011
|
+
// : 'miolo.log',
|
|
1012
|
+
//
|
|
1013
|
+
// createSymlink: config?.file?.createSymlink == true,
|
|
1014
|
+
//
|
|
1015
|
+
// watchLog: true,
|
|
1016
|
+
//
|
|
1017
|
+
// humanReadableUnhandledException: true,
|
|
1018
|
+
// handleExceptions: true
|
|
1019
|
+
// })
|
|
1020
|
+
//
|
|
1021
|
+
// const _file_log = (s) => {
|
|
1022
|
+
// const currentDate = intre_to_str(intre_now(), datePattern)
|
|
1023
|
+
// const filename = path.join(fileTransport.dirname, fileTransport.filename.replace('%DATE%', currentDate))
|
|
1024
|
+
//
|
|
1025
|
+
// const msg = myFormat({
|
|
1026
|
+
// level: 'info',
|
|
1027
|
+
// message: `[logger][file-rotate] ${s}\n`,
|
|
1028
|
+
// timestamp: intre_now()
|
|
1029
|
+
// })
|
|
1030
|
+
// try {
|
|
1031
|
+
// fs.accessSync(filename, fs.constants.F_OK)
|
|
1032
|
+
// fs.appendFileSync(filename, msg)
|
|
1033
|
+
// } catch(_) {
|
|
1034
|
+
// fs.writeFileSync(filename, msg, { encoding: 'utf-8' })
|
|
1035
|
+
// }
|
|
1036
|
+
// if (config?.console?.enabled === true) {
|
|
1037
|
+
// if (fileTransport.levels[config?.console?.level || config?.level || 'error'] >= fileTransport.levels['info']) {
|
|
1038
|
+
// console.log(msg)
|
|
1039
|
+
// }
|
|
1040
|
+
// }
|
|
1041
|
+
// }
|
|
1042
|
+
//
|
|
1043
|
+
// const _fname = (f) => magenta(f.replace(fileTransport.dirname+path.sep, ''))
|
|
1044
|
+
//
|
|
1045
|
+
//
|
|
1046
|
+
// fileTransport.on('new', function(newFilename) {
|
|
1047
|
+
// _file_log(`New log file: ${_fname(newFilename)}`)
|
|
1048
|
+
// });
|
|
1049
|
+
//
|
|
1050
|
+
// fileTransport.on('rotate', function(oldFilename, newFilename) {
|
|
1051
|
+
// _file_log(`Rotating log file: ${_fname(oldFilename)} -- ${_fname(newFilename)}`)
|
|
1052
|
+
// })
|
|
1053
|
+
//
|
|
1054
|
+
// fileTransport.on('archive', function(zipFilename) {
|
|
1055
|
+
// _file_log(`Archived log file: ${_fname(zipFilename)}`)
|
|
1056
|
+
// })
|
|
1057
|
+
//
|
|
1058
|
+
// fileTransport.on('logRemoved', function(removedFilename) {
|
|
1059
|
+
// _file_log(`Removed log file: ${_fname(removedFilename)}`)
|
|
1060
|
+
// })
|
|
1061
|
+
//
|
|
1062
|
+
// fileTransport.on('error', function(error) {
|
|
1063
|
+
// // do something fun
|
|
1064
|
+
// _file_log(red(`Error: ${error}`))
|
|
1065
|
+
// })
|
|
1066
|
+
//
|
|
1067
|
+
// _log_transports.push(fileTransport)
|
|
1068
|
+
// }
|
|
1069
|
+
|
|
979
1070
|
if ((config == null || (_config$file = config.file) == null ? void 0 : _config$file.enabled) === true) {
|
|
980
|
-
var _config$file2, _config$file3, _config$file4, _config$file5, _config$file6
|
|
981
|
-
var fileTransport = new winston.transports.
|
|
1071
|
+
var _config$file2, _config$file3, _config$file4, _config$file5, _config$file6;
|
|
1072
|
+
var fileTransport = new winston.transports.File({
|
|
982
1073
|
level: (config == null || (_config$file2 = config.file) == null ? void 0 : _config$file2.level) || (config == null ? void 0 : config.level) || 'info',
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
symlinkName: config != null && (_config$file10 = config.file) != null && _config$file10.symlinkName ? config.file.symlinkName.replace('%MIOLO%', prefix) : 'miolo.log',
|
|
991
|
-
createSymlink: (config == null || (_config$file11 = config.file) == null ? void 0 : _config$file11.createSymlink) == true,
|
|
992
|
-
watchLog: true,
|
|
1074
|
+
zippedArchive: (config == null || (_config$file3 = config.file) == null ? void 0 : _config$file3.zippedArchive) == true,
|
|
1075
|
+
maxsize: (config == null || (_config$file4 = config.file) == null ? void 0 : _config$file4.maxsize) || 1024 * 1024 * 20,
|
|
1076
|
+
maxFiles: (config == null || (_config$file5 = config.file) == null ? void 0 : _config$file5.maxFiles) || 20,
|
|
1077
|
+
//
|
|
1078
|
+
filename: config != null && (_config$file6 = config.file) != null && _config$file6.filename ? config.file.filename.replace('%MIOLO%', prefix) : '/var/log/afialapis/miolo.log',
|
|
1079
|
+
//
|
|
1080
|
+
|
|
993
1081
|
humanReadableUnhandledException: true,
|
|
994
|
-
handleExceptions: true
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
// do something fun
|
|
998
|
-
console.log("[miolo][file-logger] Rotating log file: " + oldFilename + " -- " + newFilename);
|
|
1082
|
+
handleExceptions: true,
|
|
1083
|
+
lazy: false,
|
|
1084
|
+
tailable: true
|
|
999
1085
|
});
|
|
1000
1086
|
_log_transports.push(fileTransport);
|
|
1001
1087
|
}
|
|
@@ -1019,9 +1105,16 @@ var init_logger = function init_logger(config, emailer, prefix) {
|
|
|
1019
1105
|
level: (config == null ? void 0 : config.level) || 'silly',
|
|
1020
1106
|
format: combine(errors({
|
|
1021
1107
|
stack: true
|
|
1022
|
-
}), timestamp(), myFormat),
|
|
1108
|
+
}), timestamp(), printf(myFormat)),
|
|
1023
1109
|
transports: _log_transports
|
|
1024
1110
|
});
|
|
1111
|
+
|
|
1112
|
+
//console.log(logger.transports[0])
|
|
1113
|
+
try {
|
|
1114
|
+
logger.info("[logger] Inited for " + logger.transports.map(function (t) {
|
|
1115
|
+
return t.name + " (" + t.level + ")" + (t.silent ? tinguir.red(' SILENT!') : '');
|
|
1116
|
+
}).join(', '));
|
|
1117
|
+
} catch (_) {}
|
|
1025
1118
|
return logger;
|
|
1026
1119
|
};
|
|
1027
1120
|
|
|
@@ -1211,7 +1304,7 @@ function ipsum_download_file(callback, remote_file, logger) {
|
|
|
1211
1304
|
callback(content);
|
|
1212
1305
|
});
|
|
1213
1306
|
}).on('error', function (err) {
|
|
1214
|
-
lerr("[
|
|
1307
|
+
lerr("[cron][" + tinguir.cyan('IPsum') + "] Error downloading remote file (" + err.toString() + ")");
|
|
1215
1308
|
callback('');
|
|
1216
1309
|
});
|
|
1217
1310
|
}
|
|
@@ -1234,7 +1327,7 @@ function _ipsum_ips_from_content(content, logger) {
|
|
|
1234
1327
|
});
|
|
1235
1328
|
return ips;
|
|
1236
1329
|
} catch (error) {
|
|
1237
|
-
lerr("[
|
|
1330
|
+
lerr("[cron][" + tinguir.cyan('IPsum') + "] Error getting IPs from content");
|
|
1238
1331
|
return [];
|
|
1239
1332
|
}
|
|
1240
1333
|
}
|
|
@@ -1245,14 +1338,14 @@ function _ipsum_ips_from_file(folder, logger) {
|
|
|
1245
1338
|
var lerr = logger ? logger.error : console.error;
|
|
1246
1339
|
if (!fs.existsSync(folder)) {
|
|
1247
1340
|
if (logger) {
|
|
1248
|
-
lerr("[
|
|
1341
|
+
lerr("[cron][" + tinguir.cyan('IPsum') + "] Folder " + folder + " does not exist");
|
|
1249
1342
|
}
|
|
1250
1343
|
return [];
|
|
1251
1344
|
}
|
|
1252
1345
|
var local_path = path.join(folder, _IPSUM_FILE_NAME);
|
|
1253
1346
|
if (!fs.existsSync(local_path)) {
|
|
1254
1347
|
if (logger) {
|
|
1255
|
-
lerr("[
|
|
1348
|
+
lerr("[cron][" + tinguir.cyan('IPsum') + "] File " + local_path + " does not exist");
|
|
1256
1349
|
}
|
|
1257
1350
|
return [];
|
|
1258
1351
|
}
|
|
@@ -1268,11 +1361,11 @@ function ipsum_update(folder, callback, logger) {
|
|
|
1268
1361
|
var lerr = logger ? logger.error : console.error;
|
|
1269
1362
|
var ldbg = logger ? logger.debug : console.log;
|
|
1270
1363
|
if (!fs.existsSync(folder)) {
|
|
1271
|
-
lerr("[
|
|
1364
|
+
lerr("[cron][" + tinguir.cyan('IPsum') + "] Folder " + folder + " does not exist");
|
|
1272
1365
|
return;
|
|
1273
1366
|
}
|
|
1274
1367
|
try {
|
|
1275
|
-
ldbg("[
|
|
1368
|
+
ldbg("[cron][" + tinguir.cyan('IPsum') + "] Updating file...");
|
|
1276
1369
|
ipsum_download_file(function (content) {
|
|
1277
1370
|
var local_path = path.join(folder, _IPSUM_FILE_NAME);
|
|
1278
1371
|
fs.writeFileSync(local_path, content, {
|
|
@@ -1282,13 +1375,13 @@ function ipsum_update(folder, callback, logger) {
|
|
|
1282
1375
|
var ntot = content.split('\n').length;
|
|
1283
1376
|
var ips = _ipsum_ips_from_content(content, logger);
|
|
1284
1377
|
var nfilt = ips.length;
|
|
1285
|
-
ldbg("[
|
|
1378
|
+
ldbg("[cron][" + tinguir.cyan('IPsum') + "] File downloaded. " + ntot + " ips on the list (" + nfilt + " appearing in " + _IPSUM_NLISTS + " or more lists)");
|
|
1286
1379
|
if (callback) {
|
|
1287
1380
|
callback(ips);
|
|
1288
1381
|
}
|
|
1289
1382
|
});
|
|
1290
1383
|
} catch (error) {
|
|
1291
|
-
lerr("[
|
|
1384
|
+
lerr("[cron][" + tinguir.cyan('IPsum') + "] Error " + error + " updating the file");
|
|
1292
1385
|
}
|
|
1293
1386
|
}
|
|
1294
1387
|
function ipsum_config() {
|
|
@@ -1298,7 +1391,7 @@ function ipsum_config() {
|
|
|
1298
1391
|
onTick: function onTick(miolo, _onCompleted) {
|
|
1299
1392
|
var folder = miolo.config.http.ratelimit.ipsum_folder || _IPSUM_DEF_FOLDER;
|
|
1300
1393
|
ipsum_update(folder, function (ips) {
|
|
1301
|
-
miolo.logger.info("[
|
|
1394
|
+
miolo.logger.info("[cron][" + tinguir.cyan('IPsum') + "] File downloaded. " + tinguir.green(ips.length) + " ips will be " + tinguir.yellow('blacklisted') + "!");
|
|
1302
1395
|
}, miolo.logger);
|
|
1303
1396
|
},
|
|
1304
1397
|
start: true
|
|
@@ -1315,10 +1408,10 @@ function ipsum_read_ips(folder, callback, logger) {
|
|
|
1315
1408
|
if (callback) {
|
|
1316
1409
|
callback(ips);
|
|
1317
1410
|
}
|
|
1318
|
-
ldbg("[
|
|
1411
|
+
ldbg("[cron][" + tinguir.cyan('IPsum') + "] File contains " + ips.length + " ips");
|
|
1319
1412
|
return ips;
|
|
1320
1413
|
} else {
|
|
1321
|
-
lwarn("[
|
|
1414
|
+
lwarn("[cron][" + tinguir.cyan('IPsum') + "] File is empty. Launching update...");
|
|
1322
1415
|
ipsum_update(folder, callback, logger);
|
|
1323
1416
|
return [];
|
|
1324
1417
|
}
|
|
@@ -3155,21 +3248,21 @@ function init_cron_job(miolo, config) {
|
|
|
3155
3248
|
// onTick(miolo, onComplete)
|
|
3156
3249
|
function (onComplete) {
|
|
3157
3250
|
try {
|
|
3158
|
-
logger.silly("[
|
|
3251
|
+
logger.silly("[cron][Custom Job " + tinguir.cyan(name) + "] " + tinguir.green_bold('ticks!'));
|
|
3159
3252
|
config.onTick(miolo, onComplete);
|
|
3160
3253
|
} catch (e) {
|
|
3161
|
-
logger.error("[
|
|
3254
|
+
logger.error("[cron][Custom Job " + tinguir.cyan(name) + "] Error at onTick()");
|
|
3162
3255
|
logger.error(e);
|
|
3163
3256
|
}
|
|
3164
3257
|
},
|
|
3165
3258
|
// onComplete(miolo)
|
|
3166
3259
|
function () {
|
|
3167
|
-
logger.silly("[
|
|
3260
|
+
logger.silly("[cron][Custom Job " + tinguir.cyan(name) + "] " + tinguir.green_bold('completed!'));
|
|
3168
3261
|
if (config != null && config.onComplete) {
|
|
3169
3262
|
try {
|
|
3170
3263
|
config.onComplete(miolo);
|
|
3171
3264
|
} catch (e) {
|
|
3172
|
-
logger.error("[
|
|
3265
|
+
logger.error("[cron][Custom Job " + tinguir.cyan(name) + "] Error at onComplete()");
|
|
3173
3266
|
logger.error(e);
|
|
3174
3267
|
}
|
|
3175
3268
|
}
|
|
@@ -3194,18 +3287,18 @@ function _sys_check_and_log(logger) {
|
|
|
3194
3287
|
var total = Math.round(_toMB(os.totalmem()), 2);
|
|
3195
3288
|
var perc = Math.round(used * 100 / total, 2);
|
|
3196
3289
|
if (perc > 80) {
|
|
3197
|
-
logger.error("[
|
|
3290
|
+
logger.error("[cron][" + tinguir.cyan('SysCheck') + "] RAM " + tinguir.yellow(used) + " MB used of " + tinguir.green(total) + " MB (" + tinguir.yellow(perc) + " %)");
|
|
3198
3291
|
} else {
|
|
3199
|
-
logger.info("[
|
|
3292
|
+
logger.info("[cron][" + tinguir.cyan('SysCheck') + "] RAM " + tinguir.yellow(used) + " MB used of " + tinguir.green(total) + " MB (" + tinguir.yellow(perc) + " %)");
|
|
3200
3293
|
}
|
|
3201
3294
|
diskspace.check('/', function (err, result) {
|
|
3202
3295
|
var used = Math.round(_toGB(result.used), 2);
|
|
3203
3296
|
var total = Math.round(_toGB(result.total), 2);
|
|
3204
3297
|
var free = Math.round(_toGB(result.free), 2);
|
|
3205
3298
|
if (free < 1) {
|
|
3206
|
-
logger.error("[
|
|
3299
|
+
logger.error("[cron][" + tinguir.cyan('SysCheck') + "] DISK " + tinguir.yellow(used) + " GB used of " + tinguir.green(total) + " GB (" + tinguir.yellow(free) + " GB free)");
|
|
3207
3300
|
} else {
|
|
3208
|
-
logger.info("[
|
|
3301
|
+
logger.info("[cron][" + tinguir.cyan('SysCheck') + "] DISK " + tinguir.yellow(used) + " GB used of " + tinguir.green(total) + " GB (" + tinguir.yellow(free) + " GB free)");
|
|
3209
3302
|
}
|
|
3210
3303
|
});
|
|
3211
3304
|
}
|
|
@@ -3248,7 +3341,7 @@ function init_cron(app, custom) {
|
|
|
3248
3341
|
})[0];
|
|
3249
3342
|
}
|
|
3250
3343
|
if (!jobInfo) {
|
|
3251
|
-
logger.error("[
|
|
3344
|
+
logger.error("[cron] Cannot stop job " + tinguir.cyan(idxOrName) + ": Not Found");
|
|
3252
3345
|
}
|
|
3253
3346
|
return jobInfo;
|
|
3254
3347
|
};
|
|
@@ -3256,9 +3349,9 @@ function init_cron(app, custom) {
|
|
|
3256
3349
|
try {
|
|
3257
3350
|
jobInfo.job.stop();
|
|
3258
3351
|
jobInfo.running = true;
|
|
3259
|
-
logger.debug("[
|
|
3352
|
+
logger.debug("[cron][Job " + tinguir.cyan(jobInfo.name) + "] " + tinguir.green_bold('manually started!'));
|
|
3260
3353
|
} catch (e) {
|
|
3261
|
-
logger.error("[
|
|
3354
|
+
logger.error("[cron][Job " + tinguir.cyan(jobInfo.name) + "] Error manually starting it");
|
|
3262
3355
|
logger.error(e);
|
|
3263
3356
|
}
|
|
3264
3357
|
};
|
|
@@ -3266,9 +3359,9 @@ function init_cron(app, custom) {
|
|
|
3266
3359
|
try {
|
|
3267
3360
|
jobInfo.job.stop();
|
|
3268
3361
|
jobInfo.running = false;
|
|
3269
|
-
logger.debug("[
|
|
3362
|
+
logger.debug("[cron][Job " + tinguir.cyan(jobInfo.name) + "] " + tinguir.yellow_bold('manually stopped!'));
|
|
3270
3363
|
} catch (e) {
|
|
3271
|
-
logger.error("[
|
|
3364
|
+
logger.error("[cron][Job " + tinguir.cyan(jobInfo.name) + "] Error manually stopping it");
|
|
3272
3365
|
logger.error(e);
|
|
3273
3366
|
}
|
|
3274
3367
|
};
|
|
@@ -3400,7 +3493,7 @@ function miolo(sconfig, render) {
|
|
|
3400
3493
|
_context2.next = 4;
|
|
3401
3494
|
return listenAsync(server, config.http.port, config.http.hostname);
|
|
3402
3495
|
case 4:
|
|
3403
|
-
app.context.miolo.logger.info("miolo is listening on " + config.http.hostname + ":" + config.http.port);
|
|
3496
|
+
app.context.miolo.logger.info("[http] miolo is listening on " + config.http.hostname + ":" + config.http.port);
|
|
3404
3497
|
|
|
3405
3498
|
// Make server accessible from app object
|
|
3406
3499
|
app.server = server;
|
|
@@ -3414,7 +3507,7 @@ function miolo(sconfig, render) {
|
|
|
3414
3507
|
_context.next = 2;
|
|
3415
3508
|
return httpTerminator$1.terminate();
|
|
3416
3509
|
case 2:
|
|
3417
|
-
app.context.miolo.logger.info("miolo has been shutdowned from " + config.http.hostname + ":" + config.http.port);
|
|
3510
|
+
app.context.miolo.logger.info("[http] miolo has been shutdowned from " + config.http.hostname + ":" + config.http.port);
|
|
3418
3511
|
case 3:
|
|
3419
3512
|
case "end":
|
|
3420
3513
|
return _context.stop();
|
|
@@ -3428,7 +3521,7 @@ function miolo(sconfig, render) {
|
|
|
3428
3521
|
// }
|
|
3429
3522
|
|
|
3430
3523
|
// const server= app.listen(config.http.port, config.http.hostname, function () {
|
|
3431
|
-
// app.context.miolo.logger.info(`miolo is listening on ${config.http.hostname}:${config.http.port}`)
|
|
3524
|
+
// app.context.miolo.logger.info(`[http] miolo is listening on ${config.http.hostname}:${config.http.port}`)
|
|
3432
3525
|
// init_cron(app.context.miolo.logger)
|
|
3433
3526
|
//
|
|
3434
3527
|
// if (callback!=undefined) {
|