meta/meta.php

87 lines
4.3 KiB
PHP

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Meta</title>
</head>
<body>
<section>
<h1><abbr title="Internet Protocol">IP</abbr></h1>
Client address: <samp><?= htmlspecialchars($_SERVER['REMOTE_ADDR']) ?></samp> (<a href="<?= htmlspecialchars($_SERVER['REMOTE_ADDR']) ?>">informations from database</a>)<br>
Server address: <?php
if (filter_var($_SERVER['SERVER_ADDR'], FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE)) { ?>
<samp><?= htmlspecialchars($_SERVER['SERVER_ADDR']) ?></samp> (<a href="<?= htmlspecialchars($_SERVER['SERVER_ADDR']) ?>">informations from database</a>)
<?php } else
echo "<em>- (require IPv6)</em>";
?>
<br>
</section>
<section>
<h1><abbr title="Transmission Control Protocol">TCP</abbr></h1>
<abbr title="Round Trip Time">RTT</abbr>: <samp><?= htmlspecialchars($_SERVER['TCPINFO_RTT']) ?></samp> μs<br>
<abbr title="Round Trip Time">RTT</abbr> variance: <samp><?= htmlspecialchars($_SERVER['TCPINFO_RTTVAR']) ?></samp> μs<br>
SND <abbr title="Congestion WiNDow">CWND</abbr>: <samp><?= htmlspecialchars($_SERVER['TCPINFO_SND_CWND']) ?></samp><br>
RCV SPACE: <samp><?= htmlspecialchars($_SERVER['TCPINFO_RCV_SPACE']) ?></samp><br>
<section>
<h2>Ports</h2>
Client port: <samp><?= htmlspecialchars($_SERVER['REMOTE_PORT']) ?></samp><br>
Server port: <samp><?= htmlspecialchars($_SERVER['SERVER_PORT']) ?></samp><br>
</section>
</section>
<section>
<h1><abbr title="Transport Layer Security">TLS</abbr></h1>
<abbr title="Server Name Indication">SNI</abbr>: <samp><?= htmlspecialchars($_SERVER['SSL_SERVER_NAME']) ?></samp><br>
TLS session ID: <samp><?= htmlspecialchars($_SERVER['SSL_SESSION_ID']) ?></samp><br>
Offered TLS curves: <samp><?= htmlspecialchars($_SERVER['SSL_CURVES']) ?></samp><br>
Offered TLS ciphers: <samp><?= htmlspecialchars($_SERVER['SSL_CIPHERS']) ?></samp><br>
Negotiated TLS cipher: <samp><?= htmlspecialchars($_SERVER['SSL_CIPHER']) ?></samp><br>
Negotiated TLS version: <samp><?= htmlspecialchars($_SERVER['SSL_PROTOCOL']) ?></samp><br>
</section>
<section>
<h1><abbr title="HyperText Transfert Protocol">HTTP</abbr></h1>
Request line: <samp><?= htmlspecialchars($_SERVER['REQUEST']) ?></samp><br>
<section>
<h2>Headers</h2>
<pre><?php
foreach (getallheaders() as $name => $value) {
if ($name !== "Content-Length" AND $name !== "Content-Type")
echo htmlspecialchars($name) . ": " . htmlspecialchars($value) . "\n";
} ?></pre>
</section>
</section>
<section>
<h1>Server system informations</h1>
<?php
date_default_timezone_set('UTC');
?>
Architecture: <samp><?= htmlspecialchars(php_uname("m")) ?></samp><br>
Distribution: <samp><?php echo htmlspecialchars(shell_exec("/usr/bin/lsb_release -si")); ?></samp><br>
Distribution version: <samp><?php echo htmlspecialchars(shell_exec("/usr/bin/lsb_release -sr")); ?></samp><br>
Distribution version codename: <samp><?php echo htmlspecialchars(shell_exec("/usr/bin/lsb_release -sc")); ?></samp><br>
Distribution description: <samp><?php echo htmlspecialchars(shell_exec("/usr/bin/lsb_release -sd")); ?></samp><br>
Kernel: <samp><?= htmlspecialchars(php_uname("s")) ?></samp><br>
Kernel version: <samp><?= htmlspecialchars(php_uname("r")) ?></samp><br>
Nginx version: <samp><?= htmlspecialchars($_SERVER['NGINX_VERSION']) ?></samp><br>
PHP version: <samp><?= htmlspecialchars(phpversion()) ?></samp><br>
Connection ID since Nginx startup: <samp><?= htmlspecialchars($_SERVER['CONNECTION']) ?></samp><br>
Requests in this connection: <samp><?= htmlspecialchars($_SERVER['CONNECTION_REQUESTS']) ?></samp><br>
<?php
$time = explode(".", $_SERVER['REQUEST_TIME_FLOAT']);
?>
Unix time: <samp title="Number of seconds since January 1 1970 00:00:00.0000 UTC"><?= htmlspecialchars($_SERVER['REQUEST_TIME_FLOAT']) ?></samp> (<span title="year-month-day hour:minute:second.decimal"><?= date("Y-m-d H:i:s", $time[0]) . "." . $time[1] ?></span> UTC)<br>
<br>
</section>
<footer>
<a href="https://code.antopie.org/miraty/meta">Source code</a>
</footer>
</body>
</html>