From c101db1de6f53e84b2fdd5eb0d98c789cbb988fc Mon Sep 17 00:00:00 2001 From: hippoz Date: Thu, 21 Oct 2021 22:15:39 +0300 Subject: [PATCH] make logging of accounts creation optional --- api/v1/users.js | 4 ++-- config.js | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/api/v1/users.js b/api/v1/users.js index 975f76d..f2647d9 100755 --- a/api/v1/users.js +++ b/api/v1/users.js @@ -93,7 +93,7 @@ app.post("/account/create", [ const userObject = await user.getPublicObject(); - console.log("[*] [logger] [users] [create] User created", userObject); + if (config.logAccountCreation) console.log("users: user created", userObject); res.status(200).json({ error: false, @@ -152,7 +152,7 @@ app.post("/token/create", [ const userObject = await existingUser.getPublicObject(); - console.log("[*] [logger] [users] [token create] Token created", userObject); + if (config.logAccountCreation) console.log("users: token created", userObject); res.status(200).json({ error: false, diff --git a/config.js b/config.js index 06dd567..8c54939 100755 --- a/config.js +++ b/config.js @@ -18,9 +18,9 @@ module.exports = { allowAccountCreation: true, allowLogin: true, allowGatewayConnection: true, - // The policy below will make all messages sent over the gateway to be in plain text saved to the database. + // The policy below will make all messages sent over the gateway to be saved in plain text in the database. // This is experimental and dangerous, and, as such, should generally not be used. - allowSavingMessages: false, + allowSavingMessages: true, perUserMaxGatewayConnections: 4 }, /* @@ -40,6 +40,8 @@ module.exports = { gatewayMaxPayloadBytes: 4096, clientFacingPingInterval: 14750, bcryptRounds: 10, + // displays a message containing the username, role, etc. of a new created user or token (tokens and passwords should be stripped) + logAccountCreation: false, experiments: { voiceSFUTesting: false },