diff --git a/.gitignore b/.gitignore index b9c4685..92fe3bc 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,5 @@ composer.lock requests.sqlite3 requests.sqlite3-shm -requests.sqlite3-wal \ No newline at end of file +requests.sqlite3-wal +GeoLite2-City.mmdb \ No newline at end of file diff --git a/composer.json b/composer.json index 4f64167..fbf8697 100644 --- a/composer.json +++ b/composer.json @@ -6,7 +6,9 @@ "react/cache": "^1.2", "clue/mq-react": "^1.6", "smarty/smarty": "^5.4", - "react/promise-timer": "^1.11" + "react/promise-timer": "^1.11", + "geoip2/geoip2": "~2.0", + "maxmind-db/reader": "~1.0" }, "autoload": { "psr-4": { diff --git a/composer.lock b/composer.lock index 40be67e..1c4073c 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "8e299b08324c21b9f02c215ffc70c444", + "content-hash": "d6f1f7467007dba97d491d18cbdfc5d6", "packages": [ { "name": "clue/framework-x", @@ -279,6 +279,82 @@ ], "time": "2023-05-12T12:33:20+00:00" }, + { + "name": "composer/ca-bundle", + "version": "1.5.4", + "source": { + "type": "git", + "url": "https://github.com/composer/ca-bundle.git", + "reference": "bc0593537a463e55cadf45fd938d23b75095b7e1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/ca-bundle/zipball/bc0593537a463e55cadf45fd938d23b75095b7e1", + "reference": "bc0593537a463e55cadf45fd938d23b75095b7e1", + "shasum": "" + }, + "require": { + "ext-openssl": "*", + "ext-pcre": "*", + "php": "^7.2 || ^8.0" + }, + "require-dev": { + "phpstan/phpstan": "^1.10", + "phpunit/phpunit": "^8 || ^9", + "psr/log": "^1.0 || ^2.0 || ^3.0", + "symfony/process": "^4.0 || ^5.0 || ^6.0 || ^7.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Composer\\CaBundle\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + } + ], + "description": "Lets you find a path to the system CA bundle, and includes a fallback to the Mozilla CA bundle.", + "keywords": [ + "cabundle", + "cacert", + "certificate", + "ssl", + "tls" + ], + "support": { + "irc": "irc://irc.freenode.org/composer", + "issues": "https://github.com/composer/ca-bundle/issues", + "source": "https://github.com/composer/ca-bundle/tree/1.5.4" + }, + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "time": "2024-11-27T15:35:25+00:00" + }, { "name": "evenement/evenement", "version": "v3.0.2", @@ -382,6 +458,64 @@ }, "time": "2020-11-24T22:02:12+00:00" }, + { + "name": "geoip2/geoip2", + "version": "v2.13.0", + "source": { + "type": "git", + "url": "https://github.com/maxmind/GeoIP2-php.git", + "reference": "6a41d8fbd6b90052bc34dff3b4252d0f88067b23" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/maxmind/GeoIP2-php/zipball/6a41d8fbd6b90052bc34dff3b4252d0f88067b23", + "reference": "6a41d8fbd6b90052bc34dff3b4252d0f88067b23", + "shasum": "" + }, + "require": { + "ext-json": "*", + "maxmind-db/reader": "~1.8", + "maxmind/web-service-common": "~0.8", + "php": ">=7.2" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "3.*", + "phpstan/phpstan": "*", + "phpunit/phpunit": "^8.0 || ^9.0", + "squizlabs/php_codesniffer": "3.*" + }, + "type": "library", + "autoload": { + "psr-4": { + "GeoIp2\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "Gregory J. Oschwald", + "email": "goschwald@maxmind.com", + "homepage": "https://www.maxmind.com/" + } + ], + "description": "MaxMind GeoIP2 PHP API", + "homepage": "https://github.com/maxmind/GeoIP2-php", + "keywords": [ + "IP", + "geoip", + "geoip2", + "geolocation", + "maxmind" + ], + "support": { + "issues": "https://github.com/maxmind/GeoIP2-php/issues", + "source": "https://github.com/maxmind/GeoIP2-php/tree/v2.13.0" + }, + "time": "2022-08-05T20:32:58+00:00" + }, { "name": "graham-campbell/result-type", "version": "v1.1.3", @@ -444,6 +578,120 @@ ], "time": "2024-07-20T21:45:45+00:00" }, + { + "name": "maxmind-db/reader", + "version": "v1.12.0", + "source": { + "type": "git", + "url": "https://github.com/maxmind/MaxMind-DB-Reader-php.git", + "reference": "5b2d7a721dedfaef9dc20822c5fe7d26f9f8eb90" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/maxmind/MaxMind-DB-Reader-php/zipball/5b2d7a721dedfaef9dc20822c5fe7d26f9f8eb90", + "reference": "5b2d7a721dedfaef9dc20822c5fe7d26f9f8eb90", + "shasum": "" + }, + "require": { + "php": ">=7.2" + }, + "conflict": { + "ext-maxminddb": "<1.11.1 || >=2.0.0" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "3.*", + "phpstan/phpstan": "*", + "phpunit/phpunit": ">=8.0.0,<10.0.0", + "squizlabs/php_codesniffer": "3.*" + }, + "suggest": { + "ext-bcmath": "bcmath or gmp is required for decoding larger integers with the pure PHP decoder", + "ext-gmp": "bcmath or gmp is required for decoding larger integers with the pure PHP decoder", + "ext-maxminddb": "A C-based database decoder that provides significantly faster lookups" + }, + "type": "library", + "autoload": { + "psr-4": { + "MaxMind\\Db\\": "src/MaxMind/Db" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "Gregory J. Oschwald", + "email": "goschwald@maxmind.com", + "homepage": "https://www.maxmind.com/" + } + ], + "description": "MaxMind DB Reader API", + "homepage": "https://github.com/maxmind/MaxMind-DB-Reader-php", + "keywords": [ + "database", + "geoip", + "geoip2", + "geolocation", + "maxmind" + ], + "support": { + "issues": "https://github.com/maxmind/MaxMind-DB-Reader-php/issues", + "source": "https://github.com/maxmind/MaxMind-DB-Reader-php/tree/v1.12.0" + }, + "time": "2024-11-14T22:43:47+00:00" + }, + { + "name": "maxmind/web-service-common", + "version": "v0.10.0", + "source": { + "type": "git", + "url": "https://github.com/maxmind/web-service-common-php.git", + "reference": "d7c7c42fc31bff26e0ded73a6e187bcfb193f9c4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/maxmind/web-service-common-php/zipball/d7c7c42fc31bff26e0ded73a6e187bcfb193f9c4", + "reference": "d7c7c42fc31bff26e0ded73a6e187bcfb193f9c4", + "shasum": "" + }, + "require": { + "composer/ca-bundle": "^1.0.3", + "ext-curl": "*", + "ext-json": "*", + "php": ">=8.1" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "3.*", + "phpstan/phpstan": "*", + "phpunit/phpunit": "^8.0 || ^9.0", + "squizlabs/php_codesniffer": "3.*" + }, + "type": "library", + "autoload": { + "psr-4": { + "MaxMind\\Exception\\": "src/Exception", + "MaxMind\\WebService\\": "src/WebService" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "Gregory Oschwald", + "email": "goschwald@maxmind.com" + } + ], + "description": "Internal MaxMind Web Service API", + "homepage": "https://github.com/maxmind/web-service-common-php", + "support": { + "issues": "https://github.com/maxmind/web-service-common-php/issues", + "source": "https://github.com/maxmind/web-service-common-php/tree/v0.10.0" + }, + "time": "2024-11-14T23:14:52+00:00" + }, { "name": "nikic/fast-route", "version": "v1.3.0", diff --git a/smarty/compile/affb24851ed623b62affa076808377b28b01c478_2.file_index.tpl.php b/smarty/compile/affb24851ed623b62affa076808377b28b01c478_2.file_index.tpl.php index 01c48f2..77f3389 100644 --- a/smarty/compile/affb24851ed623b62affa076808377b28b01c478_2.file_index.tpl.php +++ b/smarty/compile/affb24851ed623b62affa076808377b28b01c478_2.file_index.tpl.php @@ -1,18 +1,18 @@ getCompiled()->isFresh($_smarty_tpl, array ( 'version' => '5.4.2', - 'unifunc' => 'content_6761e5219d7cf3_55254235', + 'unifunc' => 'content_6763070bd6f6f3_73946052', 'has_nocache_code' => false, 'file_dependency' => array ( 'affb24851ed623b62affa076808377b28b01c478' => array ( 0 => 'index.tpl', - 1 => 1734468879, + 1 => 1734543111, 2 => 'file', ), ), @@ -20,7 +20,7 @@ if ($_smarty_tpl->getCompiled()->isFresh($_smarty_tpl, array ( array ( ), ))) { -function content_6761e5219d7cf3_55254235 (\Smarty\Template $_smarty_tpl) { +function content_6763070bd6f6f3_73946052 (\Smarty\Template $_smarty_tpl) { $_smarty_current_dir = '/home/l/public_html/xbotcontrol/smarty/template'; ?> @@ -76,26 +76,28 @@ $_smarty_current_dir = '/home/l/public_html/xbotcontrol/smarty/template'; Latest - + @@ -138,7 +140,7 @@ $_smarty_current_dir = '/home/l/public_html/xbotcontrol/smarty/template';
From
- +
@@ -162,7 +164,7 @@ $_smarty_current_dir = '/home/l/public_html/xbotcontrol/smarty/template'; > document.getElementById('date-from').addEventListener('change', refreshTable); - + document.getElementById('limit').addEventListener('change', refreshTable); function refreshTable() { @@ -182,7 +184,7 @@ $_smarty_current_dir = '/home/l/public_html/xbotcontrol/smarty/template'; dateFrom.value = yesterday.toISOString().slice(0, 16); dateTo.value = tomorrow.toISOString().slice(0, 16); }; - document.getElementById('date-to').addEventListener('change', refreshTable); + document.getElementById('date-to').addEventListener('change', refreshTable); function initializeTable(latest_requests) { @@ -297,6 +299,70 @@ $_smarty_current_dir = '/home/l/public_html/xbotcontrol/smarty/template'; } > + + +> + function ipFormatter(value) { + return `${value}`; + } + + document.addEventListener('mouseover', async (event) => { + const target = event.target; + if (target.classList.contains('ip-address')) { + const ipAddress = target.getAttribute('data-ip'); + const popupId = `popup-${ipAddress.replace(/\./g, '-')}`; + let popup = document.getElementById(popupId); + + if (!popup) { + popup = document.createElement('div'); + popup.id = popupId; + popup.style.position = 'absolute'; + popup.style.background = '#f9f9f9'; + popup.style.border = '1px solid #ccc'; + popup.style.padding = '10px'; + popup.style.borderRadius = '5px'; + popup.style.boxShadow = '0 0 10px rgba(0, 0, 0, 0.2)'; + popup.style.zIndex = '1000'; + popup.style.whiteSpace = 'nowrap'; + popup.style.display = 'none'; + document.body.appendChild(popup); + + fetch(location.pathname + `/api/ipinfo/${ipAddress}`) + .then((response) => response.json()) + .then((data) => { + const location = data.geo.continent?.names?.en + ' > ' + data.geo.country + ?.names?.en + ' > ' + data.geo.city?.names?.en || 'Unknown'; + const reverseDns = data.reverse_dns || 'N/A'; + popup.innerHTML = ` +Location: ${location}
+Reverse DNS: ${reverseDns} + `; + }) + .catch(() => { + popup.innerHTML = 'Error fetching data.'; + }); + } + + popup.style.display = 'block'; + popup.style.left = `${event.pageX + 10}px`; + popup.style.top = `${event.pageY + 10}px`; + } + }); + + document.addEventListener('mouseout', (event) => { + const target = event.target; + if (target.classList.contains('ip-address')) { + const ipAddress = target.getAttribute('data-ip'); + const popupId = `popup-${ipAddress.replace(/\./g, '-')}`; + const popup = document.getElementById(popupId); + if (popup) { + popup.style.display = 'none'; + } + } + }); + +> +
@@ -127,7 +129,7 @@
+ {literal} + + {/literal}