Compare commits

..

4 Commits

Author SHA1 Message Date
fd57c7a9f2 Make domain replacement command shorter 2020-10-19 11:23:41 +02:00
79eed79546 Add example curl command 2020-10-19 11:21:59 +02:00
4defbe5c31 Describe how to replace all domains. 2020-10-18 21:31:56 +02:00
9a67f67f08 Fix sending multiple different content type headers 2020-10-18 17:48:50 +02:00
2 changed files with 12 additions and 2 deletions

View File

@@ -3,6 +3,7 @@ Because any other "Whats my IP?"-tool sucks.
Try it here: https://ip.clerie.de
## About this software
It's just one nginx site config. Feel free to host it yourself. It's open-source.
ip.clerie.de is the HTML page with some JavaScript. This page needs an A and AAAA record in DNS.
@@ -10,3 +11,11 @@ ip.clerie.de is the HTML page with some JavaScript. This page needs an A and AAA
ip4.clerie.de and ip6.clerie.de just returns the remote addr.
ip4.clerie.de has only an A record. ip6.clerie.de has only an AAAA record.
If you want host this yourself you have to replace all hardcoded domains. You can use the following sed command. Don't forget to change `.EXAMPLE.COM` to your own.
```
sed -e '/git.clerie.de/!s/.clerie.de/.EXAMPLE.COM/g;' ip.clerie.de
```
The first match is to exclude the line with the link to the git repo from replacing.

View File

@@ -19,7 +19,7 @@ server {
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
location / {
add_header Content-Type text/html;
types { } default_type "text/html; charset=utf-8";
return 200 '
<html>
<head>
@@ -58,6 +58,7 @@ server {
<li><b>IPv6:</b> <span id="ip6">Loading...</span></li>
<li><b>IPv4:</b> <span id="ip4">Loading...</span></li>
</ul>
<p>Use bash and curl: <code>curl ip{4,6}.clerie.de</code></p>
<p><small>Because any other "Whats my IP?"-tool sucks. <a href="https://git.clerie.de/clerie/ip.clerie.de">Host yourself :3</a></small></p>
</body>
</html>
@@ -79,7 +80,7 @@ server {
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
location / {
add_header Content-Type text/plain;
types { } default_type "text/plain; charset=utf-8";
add_header Access-Control-Allow-Origin *;
return 200 '$remote_addr\n';
}