diff --git a/debug.php b/debug.php deleted file mode 100644 index 52d9af48..00000000 --- a/debug.php +++ /dev/null @@ -1,43 +0,0 @@ - - -
Once you click this button a debug log will be generated and can automatically be uploaded if we detect a working internet connection.
- - - - - - diff --git a/scripts/pi-hole/js/settings-dhcp.js b/scripts/pi-hole/js/settings-dhcp.js index 4d9a7bdd..56b10ab4 100644 --- a/scripts/pi-hole/js/settings-dhcp.js +++ b/scripts/pi-hole/js/settings-dhcp.js @@ -195,9 +195,6 @@ function delLease(ip) { dhcpLeaesTable.rows().deselect(); utils.changeTableButtonStates(dhcpLeaesTable); }) - .done( - utils.checkleases // Update icon warnings count - ) .fail(function (jqXHR, exception) { utils.enableAll(); utils.showAlert("error", "", "Error while deleting lease: " + ip, jqXHR.responseText); diff --git a/scripts/pi-hole/js/settings-dns-records.js b/scripts/pi-hole/js/settings-dns-records.js index a3535f8a..fb5f611e 100644 --- a/scripts/pi-hole/js/settings-dns-records.js +++ b/scripts/pi-hole/js/settings-dns-records.js @@ -185,9 +185,6 @@ function delRecord(ip) { utils.showAlert("error", "", "Error while deleting DNS record: " + ip, response.record); } }) - .done( - utils.checkrecords // Update icon warnings count - ) .fail(function (jqXHR, exception) { utils.enableAll(); utils.showAlert("error", "", "Error while deleting DNS record: " + ip, jqXHR.responseText); @@ -222,9 +219,6 @@ function delCNAMERecord(ip) { ); } }) - .done( - utils.checkrecords // Update icon warnings count - ) .fail(function (jqXHR, exception) { utils.enableAll(); utils.showAlert( @@ -237,8 +231,51 @@ function delCNAMERecord(ip) { }); } -/* $(document).ready(function () { - processDNSRecordsConfig(); + $("#btnAdd-host").on("click", function () { + const elem = $("#Hip").val() + " " + $("#Hdomain").val(); + const path = "/api/config/dns/hosts/" + elem; + $.ajax({ + url: path, + method: "PUT", + }) + .done(function (response) { + utils.enableAll(); + if (response === undefined) { + utils.showAlert("success", "far fa-trash-alt", "Successfully added DNS record", ""); + dnsRecordsTable.ajax.reload(null, false); + } else { + utils.showAlert("error", "", "Error while adding DNS record", response.record); + } + }) + .fail(function (jqXHR, exception) { + utils.enableAll(); + utils.showAlert("error", "", "Error while deleting DNS record", jqXHR.responseText); + console.log(exception); // eslint-disable-line no-console + }); + }); + $("#btnAdd-cname").on("click", function () { + var elem = $("#Cdomain").val() + "," + $("#Ctarget").val(); + var ttlVal = parseInt($("#Cttl").val(), 10); + if (isFinite(ttlVal) && ttlVal >= 0) elem += "," + ttlVal; + const path = "/api/config/dns/cnameRecords/" + elem; + $.ajax({ + url: path, + method: "PUT", + }) + .done(function (response) { + utils.enableAll(); + if (response === undefined) { + utils.showAlert("success", "far fa-trash-alt", "Successfully added CNAME record", ""); + dnsRecordsTable.ajax.reload(null, false); + } else { + utils.showAlert("error", "", "Error while adding CNAME record", response.record); + } + }) + .fail(function (jqXHR, exception) { + utils.enableAll(); + utils.showAlert("error", "", "Error while deleting CNAME record", jqXHR.responseText); + console.log(exception); // eslint-disable-line no-console + }); + }); }); -*/ diff --git a/scripts/pi-hole/php/sidebar.php b/scripts/pi-hole/php/sidebar.php index 05ca6a6f..7fdfa0a5 100644 --- a/scripts/pi-hole/php/sidebar.php +++ b/scripts/pi-hole/php/sidebar.php @@ -21,13 +21,13 @@The reason for this is that Pi-hole will not send additional queries upstream when serving CNAME replies. As consequence, if you set a target that isn't already known, the reply to the client may be incomplete. Pi-hole just returns the information it knows at the time of the query. This results in certain limitations for CNAME targets,
for instance, only active DHCP leases work as targets - mere DHCP leases aren't sufficient as they aren't (yet) valid DNS records.
Additionally, you can't CNAME external domains (bing.com to google.com) successfully as this could result in invalid SSL certificate errors when the target server does not serve content for the requested domain.