mirror of
https://github.com/pi-hole/web.git
synced 2026-05-02 14:42:23 +01:00
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:
@@ -59,6 +59,6 @@
|
||||
<!-- ./wrapper -->
|
||||
<script src="<?=pihole.fileversion('scripts/pi-hole/js/footer.js')?>"></script>
|
||||
|
||||
<div id="advanced-info-data" style="display: none;" data-starttime="<?=starttime?>" data-endtime="<?=mg.time(true)?>" data-client-ip="<?=mg.request_info.remote_addr?>" data-tls="<?=tostring(mg.request_info.https)?>"></div>
|
||||
<div id="advanced-info-data" style="display: none;" data-starttime="<?=starttime?>" data-endtime="<?=mg.time(true)?>" data-client-ip="<?=mg.request_info.remote_addr?>" data-tls="<?=tostring(is_secure)?>"></div>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user