, (marked [html] below):
// everything is escaped, then only exactly those tags are turned back into tags.
function i18nEnglish()
{
return [
'_name' => 'English',
'_code' => 'en-US',
// language switcher
'lang.label' => 'Language',
'lang.apply' => 'Apply',
// admin page: general
'admin.title' => 'MyTools bridge admin',
'admin.off.title' => 'Admin page is off',
'admin.off.body' => 'Set admin_token in bridge.config.php (next to this file) or at the top of this file, then reload.', // [html]
'login.placeholder' => 'Admin password',
'login.button' => 'Sign in',
'login.wrong' => 'Wrong password.',
'admin.signout' => 'Sign out',
'table.nothing' => 'Nothing.',
'period.1' => 'today (UTC day)',
'period.7' => '7 days',
'period.30' => '30 days',
// blocking
'kind.ip' => 'address',
'kind.room' => 'room',
'block.button' => 'Block',
'block.confirm.ip' => 'Block this address?',
'block.confirm.room' => 'Block this room?',
'unblock.button' => 'Unblock',
// summary
'summary.title' => 'Summary',
'summary.line' => '%1$s requests from %2$s addresses for %3$s rooms · %4$s messages stored (%5$s) · traffic %6$s · %7$s messages waiting now',
'summary.events' => 'Events:',
// worth a look
'look.title' => 'Worth a look',
'look.rooms' => 'Addresses that used %1$s or more rooms (scanning or guessing):',
'look.addresses' => 'Rooms used from %1$s or more addresses (a leaked group password, or a very large group):',
'look.failed' => 'Addresses with failed requests:',
// busiest
'busiest.addresses' => 'Busiest addresses',
'busiest.rooms' => 'Busiest rooms',
// blocked list
'blocked.title' => 'Blocked',
'blocked.placeholder' => 'address or room',
'blocked.reason' => 'reason',
'blocked.note' => 'Blocked requests get status 403 and are logged with the event blocked.', // [html]
// log
'log.title' => 'Log',
'log.ip' => 'address starts with',
'log.room' => 'room',
'log.event' => 'event',
'log.anyAction' => 'any action',
'log.failuresOnly' => 'failures only',
'log.filter' => 'Filter',
'log.csv' => 'Download CSV',
'log.note' => 'Newest 200 of the selection. Polls are logged once per address and room per hour, and when they fail; all requests are counted above. Rows are deleted after %1$s days, and addresses are blanked after %2$s days.',
// table column headings
'th.address' => 'Address',
'th.addresses' => 'Addresses',
'th.rooms' => 'Rooms',
'th.room' => 'Room',
'th.requests' => 'Requests',
'th.traffic' => 'Traffic',
'th.failures' => 'Failures',
'th.latest' => 'Latest',
'th.event' => 'Event',
'th.lastSeen' => 'Last seen',
'th.kind' => 'Kind',
'th.value' => 'Value',
'th.reason' => 'Reason',
'th.since' => 'Since',
'th.timeUtc' => 'Time (UTC)',
'th.action' => 'Action',
'th.status' => 'Status',
'th.bytes' => 'Bytes',
'th.seq' => 'Seq',
'th.time' => 'Time',
'th.note' => 'Note',
'th.userAgent' => 'User agent',
// status page (the page people see)
'page.title' => 'MyTools bridge',
'page.intro' => 'This server relays encrypted Intercom and notification sync messages between your devices when they are not on the same network.',
'page.scan' => 'In MyTools open Intercom settings or Sync settings, go to Bridge and scan this code, or type the address.', // [html]
'page.keep' => 'Messages are encrypted by the apps; this server cannot read them, and keeps them for %1$s hours at most (the newest message of a device\'s location slot, too).',
'page.logs' => 'It logs metadata about requests (time, address, room, size) for security and abuse prevention.',
'check.php' => 'PHP %1$s',
'check.db' => 'Database: %1$s (%2$s messages waiting)',
'check.db.one' => 'Database: %1$s (%2$s message waiting)',
'check.db.fail' => 'Database: %1$s - %2$s',
'check.token.open' => 'Open to anyone who knows a group (set a token to restrict)',
'check.token.on' => 'Access token required',
'check.log.on' => 'Audit log on: metadata kept %1$s days, addresses blanked after %2$s',
'check.log.off' => 'Audit log off',
'check.admin.off' => 'Admin page off (set admin_token)',
'check.admin.on' => 'Admin page on',
];
}
// Language files found next to this file: code (de-DE) => ['name' => ..., 'strings' => [...]]. Broken files are skipped.
function i18nFiles()
{
static $files = null;
if ($files !== null) return $files;
$files = [];
foreach ((array)@scandir(__DIR__) as $f) {
if (!is_string($f) || !preg_match('/^bridge-([a-z]{2})([A-Z]{2})\.json$/', $f, $m)) continue;
$code = $m[1] . '-' . $m[2];
if ($code === 'en-US') continue; // English is baked in
$path = __DIR__ . '/' . $f; // $f matched the strict pattern above: never user input
if (!is_file($path) || (int)@filesize($path) > 400000) continue;
$raw = @file_get_contents($path);
if (!is_string($raw)) continue;
if (substr($raw, 0, 3) === "\xEF\xBB\xBF") $raw = substr($raw, 3);
$data = json_decode($raw, true);
if (!is_array($data) || !isset($data['_name']) || !is_string($data['_name'])) continue;
$name = trim(preg_replace('/[\x00-\x1F\x7F]+/', ' ', $data['_name']));
if ($name === '' || !preg_match('//u', $name)) continue;
$strings = [];
foreach ($data as $k => $v) {
if (is_string($k) && $k !== '' && $k[0] !== '_' && is_string($v) && $v !== '') $strings[$k] = $v;
}
$files[$code] = ['name' => preg_match('/^.{1,60}/su', $name, $nm) ? $nm[0] : $name, 'strings' => $strings];
}
ksort($files);
return $files;
}
// code => display name, English first.
function i18nLanguages()
{
$list = ['en-US' => 'English'];
foreach (i18nFiles() as $code => $file) $list[$code] = $file['name'];
return $list;
}
// The Accept-Language header, best match among the available languages, else null.
function i18nFromBrowser()
{
$header = (string)($_SERVER['HTTP_ACCEPT_LANGUAGE'] ?? '');
if ($header === '') return null;
$wanted = [];
foreach (explode(',', substr($header, 0, 500)) as $i => $part) {
$bits = explode(';', trim($part));
$tag = strtolower(str_replace('_', '-', trim($bits[0])));
if (!preg_match('/^[a-z]{2,3}(-[a-z0-9]{2,8})*$/', $tag)) continue;
$q = 1.0;
foreach (array_slice($bits, 1) as $param) {
if (preg_match('/^\s*q\s*=\s*([0-9.]+)\s*$/i', $param, $m)) $q = (float)$m[1];
}
if ($q > 0) $wanted[] = [$q, $i, $tag];
}
usort($wanted, function ($a, $b) { return $b[0] <=> $a[0] ?: $a[1] <=> $b[1]; });
$available = array_keys(i18nLanguages());
foreach ($wanted as $w) {
$tag = $w[2];
foreach ($available as $code) { // exact: de-de
if (strtolower($code) === $tag) return $code;
}
$lang = explode('-', $tag)[0];
foreach ($available as $code) { // same language, any country: de-at -> de-DE
if (substr($code, 0, 2) === $lang) return $code;
}
}
return null;
}
// The language of this request: the bridge_lang cookie if it names a known language, else the browser's, else English.
function i18nCode()
{
static $code = null;
if ($code !== null) return $code;
$known = i18nLanguages();
$c = $_COOKIE['bridge_lang'] ?? '';
if (is_string($c) && isset($known[$c])) return $code = $c;
return $code = (i18nFromBrowser() ?? 'en-US');
}
// A POST from the language form: remember the choice in a cookie and go back to the same page.
function i18nHandlePost()
{
if (($_SERVER['REQUEST_METHOD'] ?? '') !== 'POST' || !isset($_POST['bridge_lang'])) return;
$code = (string)$_POST['bridge_lang'];
if (isset(i18nLanguages()[$code])) {
setcookie('bridge_lang', $code, ['expires' => time() + 365 * 86400, 'path' => cookiePath(), 'secure' => isHttps(), 'httponly' => false, 'samesite' => 'Lax']);
}
$to = preg_replace('#^/+#', '/', strtok($_SERVER['REQUEST_URI'] ?? '/', '?'));
$query = preg_replace('/[\x00-\x20]+/', '', (string)($_SERVER['QUERY_STRING'] ?? ''));
header('Location: ' . $to . ($query !== '' ? '?' . $query : ''));
exit;
}
function i18nTemplate($key, $english = false)
{
$en = i18nEnglish();
if (!$english) {
$files = i18nFiles();
$code = i18nCode();
if (isset($files[$code]['strings'][$key]) && isset($en[$key])) return $files[$code]['strings'][$key];
}
return $en[$key] ?? $key;
}
// sprintf that returns null instead of throwing/warning when a (translated) text has bad placeholders.
function i18nFormat($template, $args)
{
try {
$out = @vsprintf($template, $args);
} catch (Throwable $e) {
return null;
}
return is_string($out) ? $out : null;
}
function t($key, ...$args)
{
foreach ([false, true] as $english) { // the chosen language, then English if its text is broken
$out = i18nFormat(i18nTemplate($key, $english), $args);
if ($out !== null) return $out;
}
return $key;
}
// Same as t() but returns HTML: arguments and text are escaped, and only , , , are kept as tags.
function th($key, ...$args)
{
$esc = array_map('h', $args);
foreach ([false, true] as $english) {
$tpl = i18nTemplate($key, $english);
if (substr_count($tpl, '') !== substr_count($tpl, '') || substr_count($tpl, '') !== substr_count($tpl, '')) continue;
$html = str_replace(['<code>', '</code>', '<b>', '</b>'], ['', '', '', ''], h($tpl));
$out = i18nFormat($html, $esc);
if ($out !== null) return $out;
}
return h($key);
}
function i18nDir()
{
return in_array(substr(i18nCode(), 0, 2), ['ar', 'fa', 'he', 'ur'], true) ? 'rtl' : 'ltr';
}
// The language picker, shown at the top of every human page. Works without JavaScript (the button).
function langSwitcher()
{
$cur = i18nCode();
$out = '';
}
function fmtBytes($n)
{
$n = (float)$n;
foreach (['B', 'KB', 'MB', 'GB'] as $u) {
if ($n < 1024 || $u === 'GB') return ($u === 'B' ? (int)$n : round($n, 1)) . ' ' . $u;
$n /= 1024;
}
}
function fmtTime($t)
{
return $t ? gmdate('Y-m-d H:i:s', (int)$t) : '';
}
function isHttps()
{
return (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') || (($_SERVER['HTTP_X_FORWARDED_PROTO'] ?? '') === 'https');
}
function cookiePath()
{
return rtrim(str_replace("\\", '/', dirname(strtok($_SERVER['REQUEST_URI'] ?? '/', '?'))), '/') . '/';
}
function adminCookie()
{
global $cfg;
return hash_hmac('sha256', 'mytools-bridge-admin', (string)$cfg['admin_token']);
}
function adminHead($title)
{
echo ''
. '' . h($title) . ' ' . langSwitcher();
}
function adminFoot()
{
echo ' ';
}
function adminTable($headers, $rows)
{
if (!$rows) {
echo '' . h(t('table.nothing')) . '
';
return;
}
echo '';
foreach ($headers as $head) echo '' . h($head) . ' ';
echo ' ';
foreach ($rows as $row) {
echo '';
foreach ($row as $cell) echo '' . $cell . ' '; // cells are already escaped HTML
echo ' ';
}
echo '
';
}
function blockButton($kind, $value)
{
return '';
}
function kindLabel($kind)
{
return in_array($kind, ['ip', 'room'], true) ? t('kind.' . $kind) : $kind;
}
function adminPage()
{
global $cfg;
i18nHandlePost();
header('Content-Type: text/html; charset=utf-8');
header('Cache-Control: no-store');
header('X-Robots-Tag: noindex');
header('Vary: Accept-Language, Cookie');
if ($cfg['admin_token'] === '') {
adminHead(t('admin.title'));
echo '' . h(t('admin.off.title')) . '
' . th('admin.off.body') . '
';
adminFoot();
return;
}
$pdo = database();
$self = strtok($_SERVER['REQUEST_URI'] ?? '', '?') . '?a=admin';
$post = ($_SERVER['REQUEST_METHOD'] ?? '') === 'POST';
$in = isset($_COOKIE['mtadmin']) && hash_equals(adminCookie(), (string)$_COOKIE['mtadmin']);
if (!$in) {
$error = '';
if ($post && isset($_POST['token'])) {
limit('a', 10);
if (hash_equals($cfg['admin_token'], (string)$_POST['token'])) {
setcookie('mtadmin', adminCookie(), ['expires' => time() + 8 * 3600, 'path' => cookiePath(), 'secure' => isHttps(), 'httponly' => true, 'samesite' => 'Strict']);
ctx('event', 'adminlogin');
header('Location: ' . $self);
return;
}
http_response_code(403);
ctx('event', 'adminfail');
$error = t('login.wrong');
}
adminHead(t('admin.title'));
echo '' . h(t('admin.title')) . '
'
. ($error ? '' . h($error) . '
' : '') . '';
adminFoot();
return;
}
if ($post) {
$do = $_POST['do'] ?? '';
if ($do === 'logout') {
setcookie('mtadmin', '', ['expires' => time() - 3600, 'path' => cookiePath(), 'secure' => isHttps(), 'httponly' => true, 'samesite' => 'Strict']);
} elseif ($do === 'block' || $do === 'unblock') {
$kind = $_POST['kind'] ?? '';
$value = trim((string)($_POST['value'] ?? ''));
$valid = $kind === 'room' ? validRoom($value) : ($kind === 'ip' && preg_match('/^[0-9a-fA-F:.x]{3,45}$/', $value) === 1);
if ($valid) {
$pdo->prepare('DELETE FROM ' . table('block') . ' WHERE kind = ? AND value = ?')->execute([$kind, $value]);
if ($do === 'block') {
$pdo->prepare('INSERT INTO ' . table('block') . ' (kind, value, reason, ts) VALUES (?, ?, ?, ?)')->execute([$kind, $value, substr((string)($_POST['reason'] ?? ''), 0, 200), time()]);
}
ctx('event', 'admin' . $do);
ctx('note', substr($kind . ' ' . $value, 0, 80));
}
}
header('Location: ' . $self);
return;
}
$days = in_array((int)($_GET['p'] ?? 1), [1, 7, 30], true) ? (int)($_GET['p'] ?? 1) : 1;
$since = time() - $days * 86400;
$day0 = (int)gmdate('Ymd', $since);
$st = table('stats');
$lg = table('log');
// Log filters, shared by the table and the CSV export.
$where = ['ts >= ?'];
$args = [$since];
foreach (['ip' => 'ip LIKE ?', 'room' => 'room = ?', 'ev' => 'ev = ?', 'act' => 'act = ?'] as $key => $clause) {
$f = trim((string)($_GET[$key] ?? ''));
if ($f !== '') {
$where[] = $clause;
$args[] = $key === 'ip' ? $f . '%' : $f;
}
}
if (!empty($_GET['bad'])) $where[] = 'status >= 400';
$filterSql = implode(' AND ', $where);
if (!empty($_GET['csv'])) {
header('Content-Type: text/csv; charset=utf-8');
header('Content-Disposition: attachment; filename="bridge-log-' . gmdate('Ymd-His') . '.csv"');
$out = fopen('php://output', 'w');
fputcsv($out, ['time_utc', 'ip', 'user_agent', 'method', 'action', 'room', 'status', 'bytes', 'seq', 'ms', 'event', 'note'], ',', '"', '');
$q = $pdo->prepare("SELECT * FROM $lg WHERE $filterSql ORDER BY id DESC LIMIT 50000");
$q->execute($args);
while ($r = $q->fetch()) {
fputcsv($out, [fmtTime($r['ts']), $r['ip'], $r['ua'], $r['method'], $r['act'], $r['room'], $r['status'], $r['nbytes'], $r['seq'], $r['ms'], $r['ev'], $r['note']], ',', '"', '');
}
return;
}
$one = function ($sql, $params) use ($pdo) {
$q = $pdo->prepare($sql);
$q->execute($params);
return $q->fetch(PDO::FETCH_NUM);
};
$all = function ($sql, $params) use ($pdo) {
$q = $pdo->prepare($sql);
$q->execute($params);
return $q->fetchAll(PDO::FETCH_NUM);
};
adminHead(t('admin.title'));
echo '' . h(t('admin.title')) . '
';
foreach ([1, 7, 30] as $d) {
$label = t('period.' . $d);
echo $d === $days ? '' . h($label) . '' : '' . h($label) . '';
echo ' · ';
}
echo '';
// ---- summary ----
[$ips, $rooms, $req, $bytes] = $one("SELECT COUNT(DISTINCT ip), COUNT(DISTINCT CASE WHEN room <> '' THEN room END), COALESCE(SUM(req), 0), COALESCE(SUM(nbytes), 0) FROM $st WHERE d >= ?", [$day0]);
[$sends, $sendBytes] = $one("SELECT COUNT(*), COALESCE(SUM(nbytes), 0) FROM $lg WHERE act = 'send' AND status = 200 AND ts >= ?", [$since]);
[$stored] = $one('SELECT COUNT(*) FROM ' . table('msgs'), []);
echo '' . h(t('summary.title')) . '
'
. h(t('summary.line', (int)$req, (int)$ips, (int)$rooms, (int)$sends, fmtBytes($sendBytes), fmtBytes($bytes), (int)$stored)) . '
';
$events = $all("SELECT ev, COUNT(*) FROM $lg WHERE ts >= ? AND ev <> '' GROUP BY ev ORDER BY COUNT(*) DESC", [$since]);
if ($events) {
echo '' . h(t('summary.events')) . ' ';
foreach ($events as $e) echo '' . h($e[0]) . ' ' . (int)$e[1] . ' · ';
echo '
';
}
echo '';
// ---- things that look like abuse ----
$thrRooms = (int)$cfg['alert_rooms_per_ip'];
$thrIps = (int)$cfg['alert_ips_per_room'];
echo '' . h(t('look.title')) . '
';
echo '' . h(t('look.rooms', $thrRooms)) . '
';
$rows = [];
foreach ($all("SELECT ip, COUNT(DISTINCT room), SUM(req), SUM(nbytes) FROM $st WHERE d >= ? AND room <> '' GROUP BY ip HAVING COUNT(DISTINCT room) >= $thrRooms ORDER BY COUNT(DISTINCT room) DESC LIMIT 20", [$day0]) as $r) {
$rows[] = ['' . h($r[0]) . '', (int)$r[1], (int)$r[2], h(fmtBytes($r[3])), blockButton('ip', $r[0])];
}
adminTable([t('th.address'), t('th.rooms'), t('th.requests'), t('th.traffic'), ''], $rows);
echo '' . h(t('look.addresses', $thrIps)) . '
';
$rows = [];
foreach ($all("SELECT room, COUNT(DISTINCT ip), SUM(req), SUM(nbytes) FROM $st WHERE d >= ? AND room <> '' GROUP BY room HAVING COUNT(DISTINCT ip) >= $thrIps ORDER BY COUNT(DISTINCT ip) DESC LIMIT 20", [$day0]) as $r) {
$rows[] = ['' . h($r[0]) . '', (int)$r[1], (int)$r[2], h(fmtBytes($r[3])), blockButton('room', $r[0])];
}
adminTable([t('th.room'), t('th.addresses'), t('th.requests'), t('th.traffic'), ''], $rows);
echo '' . h(t('look.failed')) . '
';
$rows = [];
foreach ($all("SELECT ip, COUNT(*), MAX(ts), MAX(ev) FROM $lg WHERE ts >= ? AND status >= 400 GROUP BY ip ORDER BY COUNT(*) DESC LIMIT 20", [$since]) as $r) {
$rows[] = ['' . h($r[0]) . '', (int)$r[1], h(fmtTime($r[2])), '' . h($r[3]) . '', blockButton('ip', $r[0])];
}
adminTable([t('th.address'), t('th.failures'), t('th.latest'), t('th.event'), ''], $rows);
echo '';
// ---- busiest ----
echo '' . h(t('busiest.addresses')) . '
';
$rows = [];
foreach ($all("SELECT ip, SUM(req), SUM(nbytes), COUNT(DISTINCT CASE WHEN room <> '' THEN room END), MAX(t2) FROM $st WHERE d >= ? GROUP BY ip ORDER BY SUM(nbytes) DESC, SUM(req) DESC LIMIT 15", [$day0]) as $r) {
$rows[] = ['' . h($r[0]) . '', (int)$r[1], h(fmtBytes($r[2])), (int)$r[3], h(fmtTime($r[4])), blockButton('ip', $r[0])];
}
adminTable([t('th.address'), t('th.requests'), t('th.traffic'), t('th.rooms'), t('th.lastSeen'), ''], $rows);
echo '' . h(t('busiest.rooms')) . '
';
$rows = [];
foreach ($all("SELECT room, SUM(req), SUM(nbytes), COUNT(DISTINCT ip), MAX(t2) FROM $st WHERE d >= ? AND room <> '' GROUP BY room ORDER BY SUM(nbytes) DESC, SUM(req) DESC LIMIT 15", [$day0]) as $r) {
$rows[] = ['' . h($r[0]) . '', (int)$r[1], h(fmtBytes($r[2])), (int)$r[3], h(fmtTime($r[4])), blockButton('room', $r[0])];
}
adminTable([t('th.room'), t('th.requests'), t('th.traffic'), t('th.addresses'), t('th.lastSeen'), ''], $rows);
echo '';
// ---- blocks ----
echo '' . h(t('blocked.title')) . '
';
$rows = [];
foreach ($all('SELECT kind, value, reason, ts FROM ' . table('block') . ' ORDER BY ts DESC', []) as $r) {
$rows[] = [h(kindLabel($r[0])), '' . h($r[1]) . '', h($r[2]), h(fmtTime($r[3])),
''];
}
adminTable([t('th.kind'), t('th.value'), t('th.reason'), t('th.since'), ''], $rows);
echo ''
. '' . th('blocked.note') . '
';
// ---- the log ----
$q = $pdo->prepare("SELECT ts, ip, ua, act, room, status, nbytes, seq, ms, ev, note FROM $lg WHERE $filterSql ORDER BY id DESC LIMIT 200");
$q->execute($args);
$rows = [];
foreach ($q->fetchAll(PDO::FETCH_NUM) as $r) {
$rows[] = [h(fmtTime($r[0])), '' . h($r[1]) . '', h($r[3]), $r[4] ? '' . h(substr($r[4], 0, 8)) . '…' : '',
'' . (int)$r[5] . '', h(fmtBytes($r[6])), h($r[7]), (int)$r[8] . ' ms', '' . h($r[9]) . '', h($r[10]), '' . h($r[2]) . ''];
}
echo '' . h(t('log.title')) . '
';
adminTable([t('th.timeUtc'), t('th.address'), t('th.action'), t('th.room'), t('th.status'), t('th.bytes'), t('th.seq'), t('th.time'), t('th.event'), t('th.note'), t('th.userAgent')], $rows);
echo '' . h(t('log.note', (int)$cfg['log_keep_days'], (int)$cfg['log_anonymize_days'])) . '
';
adminFoot();
}
if ($action === 'admin') {
adminPage();
exit;
}
// ------------------------------------------------------------------ the page people see
$url = pageUrl();
$checks = [];
i18nHandlePost();
$checks[] = [t('check.php', PHP_VERSION), version_compare(PHP_VERSION, '7.4', '>=')];
$dbName = 'SQLite';
$dbOk = false;
$stored = 0;
$problem = '';
try {
$pdo = database();
$dbName = $pdo->getAttribute(PDO::ATTR_DRIVER_NAME) === 'sqlite' ? 'SQLite' : 'MySQL / MariaDB';
$stored = (int)$pdo->query('SELECT COUNT(*) FROM ' . table('msgs'))->fetchColumn();
$dbOk = true;
} catch (Throwable $e) {
$problem = $e->getMessage();
}
$checks[] = [$dbOk ? t($stored === 1 ? 'check.db.one' : 'check.db', $dbName, $stored) : t('check.db.fail', $dbName, $problem), $dbOk];
$checks[] = [t($cfg['token'] === '' ? 'check.token.open' : 'check.token.on'), true];
$checks[] = [$cfg['log'] ? t('check.log.on', (int)$cfg['log_keep_days'], (int)$cfg['log_anonymize_days']) : t('check.log.off'), true];
$checks[] = [t($cfg['admin_token'] === '' ? 'check.admin.off' : 'check.admin.on'), true];
header('Content-Type: text/html; charset=utf-8');
header('Cache-Control: no-store');
header('Vary: Accept-Language, Cookie');
?>
= h(t('page.title')) ?>
= langSwitcher() ?>
= h(t('page.title')) ?>
= h(t('page.intro')) ?>
= th('page.scan') ?>
= htmlspecialchars($url, ENT_QUOTES) ?>
- = h($c[0]) ?>
= h(t('page.keep', (int)$cfg['keep_hours'])) ?> = h(t('page.logs')) ?>