diff --git a/login.lp b/login.lp index 5e7d72de..d1040b10 100644 --- a/login.lp +++ b/login.lp @@ -9,6 +9,14 @@ mg.include('scripts/pi-hole/lua/header.lp','r') +-- Build HTTPS upgrade link if HTTP is used +https_link = "" +if not is_secure then + https_link = "https://pi.hole" .. mg.request_info.request_uri + if mg.request_info.query_string then + https_link = https_link .. "?" .. mg.request_info.query_string + end +end ?>
@@ -27,6 +35,16 @@ mg.include('scripts/pi-hole/lua/header.lp','r') +
+
+
+

  Insecure network connection  

+
+
+

Consider upgrading to HTTPS (end-to-end encryption)

+
+
+
diff --git a/scripts/pi-hole/lua/footer.lp b/scripts/pi-hole/lua/footer.lp index c3d8dda3..3be0b1d9 100644 --- a/scripts/pi-hole/lua/footer.lp +++ b/scripts/pi-hole/lua/footer.lp @@ -59,6 +59,6 @@ - + diff --git a/scripts/pi-hole/lua/header.lp b/scripts/pi-hole/lua/header.lp index 8b5d1b23..2000641b 100644 --- a/scripts/pi-hole/lua/header.lp +++ b/scripts/pi-hole/lua/header.lp @@ -11,8 +11,9 @@ starttime = mg.time(true) hostname = pihole.hostname() webhome = pihole.webhome() + -- Get name of script by matching whatever is after the last "/" in the URI -scriptname = mg.request_info.request_uri:match(pihole.webhome().."(.*)$") +scriptname = mg.request_info.request_uri:match(webhome.."(.*)$") -- Fall back to "index.lp" if no match is found (e.g. when accessing the root) if scriptname == nil or string.len(scriptname) == 0 then scriptname = "index.lp" end @@ -38,6 +39,10 @@ function in_array (val, tab) return false end +-- Connection is considered secure if either running natively on HTTPS or behind +-- a reverse proxy (e.g. Traefik) +is_secure = mg.request_info.https or pihole.rev_proxy() + ?> diff --git a/settings-teleporter.lp b/settings-teleporter.lp index 6d572c02..059a396f 100644 --- a/settings-teleporter.lp +++ b/settings-teleporter.lp @@ -17,7 +17,7 @@ mg.include('scripts/pi-hole/lua/header_authenticated.lp','r')

Warning: This archive contains sensitive information about your Pi-hole installation, e.g. the API token and the 2FA-TOTP secret (if enabled). Please be careful with this file and do not share it with anyone even if they claim to help you.

-

Warning: You are currently not using an end-to-end encryption. This means that your API token and 2FA-TOTP secret will be transmitted in plain text. We recommend to use HTTPS when exporting your configuration.

+

Warning: You are currently not using an end-to-end encryption. This means that your API token and 2FA-TOTP secret will be transmitted in plain text. We recommend to use HTTPS when exporting your configuration.


Export