From a85f0b35188fe88eb49e3755310e89b0af20f9ce Mon Sep 17 00:00:00 2001 From: DL6ER Date: Sun, 28 May 2023 14:16:38 +0200 Subject: [PATCH] Show warning on login page when connection is not end-to-end encrypted Signed-off-by: DL6ER --- login.lp | 18 ++++++++++++++++++ scripts/pi-hole/lua/footer.lp | 2 +- scripts/pi-hole/lua/header.lp | 7 ++++++- settings-teleporter.lp | 2 +- 4 files changed, 26 insertions(+), 3 deletions(-) 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 ?>

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.