Show warning on login page when connection is not end-to-end encrypted

Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
DL6ER
2023-05-28 14:16:38 +02:00
parent e0fad7c020
commit a85f0b3518
4 changed files with 26 additions and 3 deletions

View File

@@ -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()
?>
<html lang="en">
<head>