From: charleswrayjr Date: Mon, 15 Sep 2025 05:02:45 +0000 (-0500) Subject: Removing debug logging. X-Git-Url: https://git.phasecustomsoft.com/static/git-favicon.png?a=commitdiff_plain;h=ddc3b540f0d8621d9a5697995e092dcc270020fc;p=phs-api.git Removing debug logging. --- diff --git a/app.js b/app.js index 0f8f926..fa39c5a 100755 --- a/app.js +++ b/app.js @@ -160,11 +160,6 @@ process.on('unhandledRejection', (err) => { app.use( function ( req, res, next ) { if (req.url === '/.well-known/appspecific/com.chrome.devtools.json' ) next(); else { - logger.warn(req.originalUrl); - logger.warn(req.headers['x-forwarded-for']); - logger.warn(req.headers['X-Real-IP']); - logger.warn(req.headers['x-real-ip']); - logger.warn(req.headers); next( createError( 404 ) ); } diff --git a/src/controllers/vpn.controller.js b/src/controllers/vpn.controller.js index 8655ff9..8b9117d 100644 --- a/src/controllers/vpn.controller.js +++ b/src/controllers/vpn.controller.js @@ -249,14 +249,10 @@ module.exports = { try { // Read from the OpenVPN status log to get the client's real IP const statusContent = fs.readFileSync('/var/log/openvpn/openvpn-status.log', 'utf8'); - logger.warn(statusContent); let clientIp = null; - logger.warn(clientName); - logger.warn(duration); const clientLine = statusContent.split('\n').find(line => line.startsWith(`${clientName},`) && !line.startsWith('Virtual Address') ); - logger.warn(clientLine); if (clientLine) { const [, realAddress] = clientLine.split(','); clientIp = realAddress.split(':')[0]; @@ -264,23 +260,17 @@ module.exports = { return next(new createError(404, `Client ${clientName} not connected`)); } - logger.warn(clientIp); - // Disconnect client via management interface const client = new net.Socket(); let connectionAttempted = false; client.on('connect', () => { - logger.warn('Connected to OpenVPN management interface'); connectionAttempted = true; client.write(`kill ${clientName}\n`); }); client.on('data', async (data) => { const response = data.toString(); - logger.warn(response); if (!response.includes('ERROR:')) { - logger.warn(duration); - logger.warn(clientIp); if (duration && clientIp) { // Add iptables rule to block client IP for duration const conn = new Client();