Logging user id in idstats

This commit is contained in:
mrfry 2020-10-07 11:52:03 +02:00
parent 814d38dc8d
commit 8a47792bde
3 changed files with 4 additions and 8 deletions

View file

@ -724,7 +724,8 @@ function GetApp() {
req.body.datatoadd || req.body, req.body.datatoadd || req.body,
data, data,
{ motd, version }, { motd, version },
dryRun dryRun,
user
) )
.then((result) => { .then((result) => {
res.json({ res.json({

View file

@ -171,9 +171,6 @@ Object.keys(modules).forEach(function(k, i) {
} }
}) })
const locLogFile = './stats/logs'
const allLogFile = '/nlogs/log'
// https://certbot.eff.org/ // https://certbot.eff.org/
const privkeyFile = '/etc/letsencrypt/live/frylabs.net/privkey.pem' const privkeyFile = '/etc/letsencrypt/live/frylabs.net/privkey.pem'
const fullchainFile = '/etc/letsencrypt/live/frylabs.net/fullchain.pem' const fullchainFile = '/etc/letsencrypt/live/frylabs.net/fullchain.pem'
@ -255,8 +252,6 @@ function LogTimerAction() {
'===================================================================================================================================================' '==================================================================================================================================================='
logger.Log(line) logger.Log(line)
logger.setNewLogfileName() logger.setNewLogfileName()
utils.AppendToFile(line, locLogFile)
utils.AppendToFile(line, allLogFile)
} }
logger.Log('Node version: ' + process.version) logger.Log('Node version: ' + process.version)

View file

@ -37,7 +37,7 @@ const { addQuestion, getSubjNameWithoutYear } = require('./classes.js')
const writeAfter = 1 // write after # of adds FIXME: set reasonable save rate const writeAfter = 1 // write after # of adds FIXME: set reasonable save rate
var currWrites = 0 var currWrites = 0
function ProcessIncomingRequest(recievedData, qdb, infos, dryRun) { function ProcessIncomingRequest(recievedData, qdb, infos, dryRun, user) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
logger.DebugLog('Processing incoming request', 'actions', 1) logger.DebugLog('Processing incoming request', 'actions', 1)
if (recievedData === undefined) { if (recievedData === undefined) {
@ -153,7 +153,7 @@ function ProcessIncomingRequest(recievedData, qdb, infos, dryRun) {
let subjRow = '\t' + data.subj let subjRow = '\t' + data.subj
if (data.id) { if (data.id) {
subjRow += ' ( CID: ' + logger.logHashed(data.id) + ')' subjRow += ' ( CID: ' + logger.logHashed(data.id) + ')'
idStats.LogId(data.id, data.subj) idStats.LogId(user.id, data.subj)
} }
logger.Log(subjRow) logger.Log(subjRow)
if (data.version !== undefined) { if (data.version !== undefined) {