Privacy: Add an option to disable IP logging

pull/1950/head
Grant Woodford 2013-10-19 21:37:11 +02:00
parent a120d78b7e
commit fbe4e43c3d
3 changed files with 18 additions and 0 deletions

View File

@ -82,6 +82,9 @@
/*when you use NginX or another proxy/ load-balancer set this to true*/
"trustProxy": false,
/* Privacy: disable IP logging */
"disableIPlogging": false,
/* Users for basic authentication. is_admin = true gives access to /admin.
If you do not uncomment this, /admin will not be available! */
/*

View File

@ -130,6 +130,11 @@ exports.handleDisconnect = function(client)
}
client.get('remoteAddress', function(er, ip) {
//Anonymize the IP address if IP logging is disabled
if(settings.disableIPlogging) {
ip = 'ANONYMOUS';
}
accessLogger.info('[LEAVE] Pad "'+session.padId+'": Author "'+session.author+'" on client '+client.id+' with IP "'+ip+'" left the pad')
})
@ -995,6 +1000,11 @@ function handleClientReady(client, message)
//Log creation/(re-)entering of a pad
client.get('remoteAddress', function(er, ip) {
//Anonymize the IP address if IP logging is disabled
if(settings.disableIPlogging) {
ip = 'ANONYMOUS';
}
if(pad.head > 0) {
accessLogger.info('[ENTER] Pad "'+padIds.padId+'": Client '+client.id+' with IP "'+ip+'" entered the pad');
}

View File

@ -109,6 +109,11 @@ exports.abiword = null;
*/
exports.loglevel = "INFO";
/**
* Disable IP logging
*/
exports.disableIPlogging = false;
/*
* log4js appender configuration
*/