Commit ae3335e433
Unsigned
Layout: unified · split
.!33817!GeoLite2-City.mmdb added
README.md +5 −5
| @@ -8,10 +8,10 @@ Available all basic features such as output in HTML, plain text, XML and JSON. | |||
| 8 | By default it will be in HTML. Also it is possible to request single values. | 8 | By default it will be in HTML. Also it is possible to request single values. |
| 9 | 9 | ||
| 10 | Visit some of the links below to view it in action: | 10 | Visit some of the links below to view it in action: |
| 11 | * [all in plain text](http://ip.cleberg.net?q=text) | 11 | * [all in plain text](http://ip.cmc.pub?q=text) |
| 12 | * [all in xml](http://ip.cleberg.net?q=xml) | 12 | * [all in xml](http://ip.cmc.pub?q=xml) |
| 13 | * [ip address only](http://ip.cleberg.net?q=ip) | 13 | * [ip address only](http://ip.cmc.pub?q=ip) |
| 14 | * [useragent only](http://ip.cleberg.net?q=ua) | 14 | * [useragent only](http://ip.cmc.pub?q=ua) |
| 15 | 15 | ||
| 16 | If you're using the Apache web server, you can use the .htaccess rules below to make this site more user friendly: | 16 | If you're using the Apache web server, you can use the .htaccess rules below to make this site more user friendly: |
| 17 | 17 | ||
| @@ -25,7 +25,7 @@ If you're using the Apache web server, you can use the .htaccess rules below to | |||
| 25 | With this code in the .htaccess file there is no need to type out the full URL, i.e. 'ifconfig.php?q='. | 25 | With this code in the .htaccess file there is no need to type out the full URL, i.e. 'ifconfig.php?q='. |
| 26 | Instead, you can just open 'ifconfig/xml' to get XML output or 'ifconfig/ua' to determine useragent. | 26 | Instead, you can just open 'ifconfig/xml' to get XML output or 'ifconfig/ua' to determine useragent. |
| 27 | 27 | ||
| 28 | Run `curl -L -X GET https://ip.cleberg.net/\?q\=text` in Linux terminal to get some info. | 28 | Run `curl -L -X GET https://ip.cmc.pub/\?q\=text` in Linux terminal to get some info. |
| 29 | 29 | ||
| 30 | ## Development | 30 | ## Development |
| 31 | 31 | ||
ifconfig.php +7 −7
| @@ -14,9 +14,9 @@ function loadGeo(string $ipAddress): ?array | |||
| 14 | } | 14 | } |
| 15 | 15 | ||
| 16 | // Set top-level variables for HTML | 16 | // Set top-level variables for HTML |
| 17 | $site_title = 'ip.cleberg.net'; | 17 | $site_title = 'ip.cmc.pub'; |
| 18 | $site_owner_name = 'Christian Cleberg'; | 18 | $site_owner_name = 'Christian Cleberg'; |
| 19 | $site_owner_url = 'https://cleberg.net'; | 19 | $site_owner_url = 'https://cmc.pub'; |
| 20 | $source_repository = 'https://git.sr.ht/~cmc/ifconfig.php'; | 20 | $source_repository = 'https://git.sr.ht/~cmc/ifconfig.php'; |
| 21 | 21 | ||
| 22 | // Extract geolocation | 22 | // Extract geolocation |
| @@ -116,11 +116,11 @@ elseif (isset($query) && (($query=="text") || ($query=="all"))) { | |||
| 116 | 116 | ||
| 117 | echo <<<EOD | 117 | echo <<<EOD |
| 118 | <pre><code># Curl Commands: | 118 | <pre><code># Curl Commands: |
| 119 | curl -L -X GET https://ip.cleberg.net | 119 | curl -L -X GET https://ip.cmc.pub |
| 120 | curl -L -X GET https://ip.cleberg.net/\?q\=text | 120 | curl -L -X GET https://ip.cmc.pub/\?q\=text |
| 121 | curl -L -X GET https://ip.cleberg.net/\?q\=xml | 121 | curl -L -X GET https://ip.cmc.pub/\?q\=xml |
| 122 | curl -L -X GET https://ip.cleberg.net/\?q\=ip | 122 | curl -L -X GET https://ip.cmc.pub/\?q\=ip |
| 123 | curl -L -X GET https://ip.cleberg.net/\?q\=ua | 123 | curl -L -X GET https://ip.cmc.pub/\?q\=ua |
| 124 | </code></pre> | 124 | </code></pre> |
| 125 | EOD; | 125 | EOD; |
| 126 | 126 | ||