mirror of
https://github.com/TheBinaryNinja/tvapp2.git
synced 2026-06-04 06:45:41 -04:00
feat: report client ip in logs for any connections made to server
This commit is contained in:
@@ -1284,7 +1284,7 @@ const server = http.createServer( ( request, response ) =>
|
|||||||
'Content-Type': 'application/json'
|
'Content-Type': 'application/json'
|
||||||
});
|
});
|
||||||
|
|
||||||
Log.error( `www`, chalk.yellow( `[req]` ), chalk.white( `→` ), chalk.blueBright( `<message>` ), chalk.redBright( `unauthorized (401): restart attempt did not specify api key using ?key=XXX parameter` ), chalk.blueBright( `<type>` ), chalk.gray( `api/restart` ), chalk.blueBright( `<file>` ), chalk.gray( `${ loadFile }` ), chalk.blueBright( `<method>` ), chalk.gray( `${ method }` ) );
|
Log.error( `www`, chalk.yellow( `[req]` ), chalk.white( `→` ), chalk.blueBright( `<message>` ), chalk.redBright( `unauthorized (401): restart attempt did not specify api key using ?key=XXX parameter` ), chalk.blueBright( `<client>` ), chalk.gray( `${ clientIp( request ) }` ), chalk.blueBright( `<type>` ), chalk.gray( `api/restart` ), chalk.blueBright( `<file>` ), chalk.gray( `${ loadFile }` ), chalk.blueBright( `<method>` ), chalk.gray( `${ method }` ) );
|
||||||
response.end( JSON.stringify( statusCheck ) );
|
response.end( JSON.stringify( statusCheck ) );
|
||||||
|
|
||||||
return;
|
return;
|
||||||
@@ -1318,7 +1318,7 @@ const server = http.createServer( ( request, response ) =>
|
|||||||
{
|
{
|
||||||
ip: envIpContainer,
|
ip: envIpContainer,
|
||||||
gateway: envIpGateway,
|
gateway: envIpGateway,
|
||||||
client: clientIp( response ),
|
client: clientIp( request ),
|
||||||
message: 'Restart command received',
|
message: 'Restart command received',
|
||||||
status: 'ok',
|
status: 'ok',
|
||||||
ref: request.url,
|
ref: request.url,
|
||||||
@@ -1451,7 +1451,7 @@ const server = http.createServer( ( request, response ) =>
|
|||||||
response.setHeader( 'Content-type', fileMime );
|
response.setHeader( 'Content-type', fileMime );
|
||||||
response.end( data );
|
response.end( data );
|
||||||
|
|
||||||
Log.ok( `www`, chalk.yellow( `[load]` ), chalk.white( `→` ), chalk.blueBright( `<file>` ), chalk.gray( `${ loadFile }` ), chalk.blueBright( `<mime>` ), chalk.gray( `${ fileMime }` ) );
|
Log.ok( `www`, chalk.yellow( `[load]` ), chalk.white( `→` ), chalk.blueBright( `<client>` ), chalk.gray( `${ clientIp( request ) }` ), chalk.blueBright( `<file>` ), chalk.gray( `${ loadFile }` ), chalk.blueBright( `<mime>` ), chalk.gray( `${ fileMime }` ) );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -1464,7 +1464,7 @@ const server = http.createServer( ( request, response ) =>
|
|||||||
{
|
{
|
||||||
ip: envIpContainer,
|
ip: envIpContainer,
|
||||||
gateway: envIpGateway,
|
gateway: envIpGateway,
|
||||||
client: clientIp( response ),
|
client: clientIp( request ),
|
||||||
message: 'Page not found',
|
message: 'Page not found',
|
||||||
status: 'healthy',
|
status: 'healthy',
|
||||||
ref: request.url,
|
ref: request.url,
|
||||||
|
|||||||
Reference in New Issue
Block a user