From c8f37c00e71ce9405dd0ed47efdfcd5ed5aaf043 Mon Sep 17 00:00:00 2001 From: Kristjan Komlosi Date: Wed, 1 Jul 2020 15:49:57 +0200 Subject: [PATCH] basic layout finished --- .htaccess | 11 ++++++++++ README.md | 12 +++++++++++ ifconfig-dynamic.php | 10 --------- ifconfig.php | 11 ---------- index.php | 11 ++++++++++ ifconfig-simple.php => ipinfo-console.php | 0 ipinfo-pretty.css | 17 +++++++++++++++ ipinfo-pretty.php | 25 +++++++++++++++++++++++ 8 files changed, 76 insertions(+), 21 deletions(-) create mode 100644 .htaccess create mode 100644 README.md delete mode 100644 ifconfig-dynamic.php delete mode 100644 ifconfig.php create mode 100644 index.php rename ifconfig-simple.php => ipinfo-console.php (100%) create mode 100644 ipinfo-pretty.css create mode 100644 ipinfo-pretty.php diff --git a/.htaccess b/.htaccess new file mode 100644 index 0000000..d997e69 --- /dev/null +++ b/.htaccess @@ -0,0 +1,11 @@ + +SetEnvIf X-Forwarded-Proto https HTTPS +# BEGIN WordPress +# The directives (lines) between `BEGIN WordPress` and `END WordPress` are +# dynamically generated, and should only be modified via WordPress filters. +# Any changes to the directives between these markers will be overwritten. + +# END WordPress +Options FollowSymLinks +RewriteEngine On +RewriteRule ^/ipinfo$ /ipinfo/index.php [L] diff --git a/README.md b/README.md new file mode 100644 index 0000000..2f79511 --- /dev/null +++ b/README.md @@ -0,0 +1,12 @@ +# ipinfo-lite +ipinfo-lite is a tiny IP information site written in PHP as my first PHP project. + +Visiting an ipinfo-lite instance provides you with your IP address, its DNS hostname and the user agent string. +It's also compatible with console tools, supporting cURL and GNU Wget. +The goal of this tool is to be fast and dead-simple. Design is adapted from the +[better moterfucking website](http://bettermotherfuckingwebsite.com/). + +It is free software, available under ISC License. + +# Usage +Extract all but this readme file into a directory on your webserver. The webapp is then available from it's directory name. \ No newline at end of file diff --git a/ifconfig-dynamic.php b/ifconfig-dynamic.php deleted file mode 100644 index 58039e5..0000000 --- a/ifconfig-dynamic.php +++ /dev/null @@ -1,10 +0,0 @@ - - - - - ifconfig.si - test - - -

ifconfig.si

-

- - diff --git a/index.php b/index.php new file mode 100644 index 0000000..fbb5768 --- /dev/null +++ b/index.php @@ -0,0 +1,11 @@ + diff --git a/ifconfig-simple.php b/ipinfo-console.php similarity index 100% rename from ifconfig-simple.php rename to ipinfo-console.php diff --git a/ipinfo-pretty.css b/ipinfo-pretty.css new file mode 100644 index 0000000..e218b93 --- /dev/null +++ b/ipinfo-pretty.css @@ -0,0 +1,17 @@ +body { + margin: 40px auto; + max-width: 65vw; + line-height: 1.6; + font-size: 18px; + color: #444; + padding: 0 10px +} + +h1,h2,h3 { + line-height: 1.2; +} + +td:first-child { + font-weight: bold; + padding-right: 3em; +} \ No newline at end of file diff --git a/ipinfo-pretty.php b/ipinfo-pretty.php new file mode 100644 index 0000000..8814fee --- /dev/null +++ b/ipinfo-pretty.php @@ -0,0 +1,25 @@ + + + + + <?php echo "$_SERVER[HTTP_HOST]"; ?> + + + +

- IP info

+ + + + + + + + + + +
Your IP:
Your hostname:
Your user agent:
+ + +