From 4529c5799560bdf97323a5ecafe0d1678b6c3df6 Mon Sep 17 00:00:00 2001 From: Menno van Leeuwen Date: Wed, 26 Mar 2025 16:33:54 +0100 Subject: [PATCH] feat: update external IP services and enhance Caddyfile redirection rules --- config/ansible/tasks/global/utils/ipaddr | 2 +- config/ansible/tasks/servers/services/caddy/Caddyfile.j2 | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/config/ansible/tasks/global/utils/ipaddr b/config/ansible/tasks/global/utils/ipaddr index 8817a54..ae043e6 100755 --- a/config/ansible/tasks/global/utils/ipaddr +++ b/config/ansible/tasks/global/utils/ipaddr @@ -117,7 +117,7 @@ def get_external_ips(): tuple: A tuple containing the IPv4 and IPv6 addresses as strings. If either address cannot be fetched, it will be set to "Unavailable". """ - services = ["https://ifconfig.co", "https://api.ipify.org", "https://myexternalip.com/raw", "https://ifconfig.io", "https://ifconfig.me"] + services = ["https://ip.mvl.sh", "https://ifconfig.co", "https://api.ipify.org", "https://myexternalip.com/raw", "https://ifconfig.io", "https://ifconfig.me"] headers = {"User-Agent": "curl"} ipv4, ipv6 = "Unavailable", "Unavailable" diff --git a/config/ansible/tasks/servers/services/caddy/Caddyfile.j2 b/config/ansible/tasks/servers/services/caddy/Caddyfile.j2 index ec6ce26..932755f 100644 --- a/config/ansible/tasks/servers/services/caddy/Caddyfile.j2 +++ b/config/ansible/tasks/servers/services/caddy/Caddyfile.j2 @@ -64,6 +64,11 @@ fladder.mvl.sh { } ip.mvl.sh { + @http { + protocol http + } + redir @http https://{host}{uri} + reverse_proxy echoip:8080 { header_up X-Real-IP {http.request.remote.host} header_up X-Forwarded-For {http.request.remote.host}