From a5e2c627a4bf2c37425cf7acf26eb8fff6ce4d1b Mon Sep 17 00:00:00 2001 From: DL6ER Date: Thu, 6 Mar 2025 17:49:29 +0100 Subject: [PATCH] Move the decision whether we are showing the no-HTTPS warning from server-side (where no https may be used when a reverse proxy is used) to user-side where this is more definite Signed-off-by: DL6ER --- scripts/js/settings-teleporter.js | 7 +++++++ scripts/lua/footer.lp | 2 +- scripts/lua/header.lp | 3 --- settings-teleporter.lp | 2 +- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/scripts/js/settings-teleporter.js b/scripts/js/settings-teleporter.js index b337fa90..bae997b0 100644 --- a/scripts/js/settings-teleporter.js +++ b/scripts/js/settings-teleporter.js @@ -105,3 +105,10 @@ $("#GETTeleporter").on("click", function () { }, }); }); + +$(function () { + // Show warning if not accessed over HTTPS + if (location.protocol !== "https:") { + $("#encryption-warning").show(); + } +}); diff --git a/scripts/lua/footer.lp b/scripts/lua/footer.lp index 6dcb5640..34885011 100644 --- a/scripts/lua/footer.lp +++ b/scripts/lua/footer.lp @@ -68,6 +68,6 @@ end - + diff --git a/scripts/lua/header.lp b/scripts/lua/header.lp index 3b5379c8..08c69c3c 100644 --- a/scripts/lua/header.lp +++ b/scripts/lua/header.lp @@ -39,9 +39,6 @@ function in_array (val, tab) return false end --- Connection is considered secure if running natively on HTTPS -is_secure = mg.request_info.https - -- Variable to check if user is already authenticated is_authenticated = mg.request_info.is_authenticated diff --git a/settings-teleporter.lp b/settings-teleporter.lp index 359ac2e1..fbcc8484 100644 --- a/settings-teleporter.lp +++ b/settings-teleporter.lp @@ -21,7 +21,7 @@ mg.include('scripts/lua/settings_header.lp','r')

Warning:
This archive contains sensitive information about your Pi-hole installation, e.g. your 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 secrets like your 2FA-TOTP secret will be transmitted in plain text. We recommend to use HTTPS when exporting your configuration.

+