mirror of
https://github.com/fergalmoran/DnsServer.git
synced 2026-01-03 07:15:34 +00:00
webapp: added quad9 unsecure entries to dns client. Added quad9 and opendns family shield options in forwarders list. Refactoring done.
This commit is contained in:
@@ -448,7 +448,7 @@
|
||||
<input type="text" class="form-control" style="width: inherit;" id="txtBlockZone" placeholder="example.com">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<button id="btnCustomBlockZone" type="submit" class="btn btn-primary" data-loading-text="Block" onclick="return customBlockZone();">Block</button>
|
||||
<button id="btnBlockZone" type="submit" class="btn btn-primary" data-loading-text="Block" onclick="return blockZone();">Block</button>
|
||||
<button id="btnBrowseBlockZone" type="button" class="btn btn-default" data-loading-text="Browse" onclick="return refreshBlockedZonesList($('#txtBlockZone').val());">Browse</button>
|
||||
</div>
|
||||
</form>
|
||||
@@ -463,9 +463,9 @@
|
||||
<div class="panel-heading" style="height: 36px; padding: 4px 6px;">
|
||||
<div id="txtBlockedZoneViewerTitle" style="float: left; padding: 4px;">technitium.com</div>
|
||||
<div style="float: right;">
|
||||
<button id="btnImportBlockedZone" type="button" class="btn btn-default" data-loading-text="Import" onclick="return resetImportCustomBlockedZonesModal();" data-toggle="modal" data-target="#modalImportCustomBlockedZones" style="font-size: 12px; padding: 4px 6px;">Import</button>
|
||||
<button id="btnExportBlockedZone" type="button" class="btn btn-default" data-loading-text="Export" onclick="return exportCustomBlockedZones();" style="font-size: 12px; padding: 4px 6px;">Export</button>
|
||||
<button id="btnDeleteCustomBlockedZone" type="button" class="btn btn-danger" data-loading-text="Delete" onclick="return deleteCustomBlockedZone();" style="font-size: 12px; padding: 4px 6px;">Delete</button>
|
||||
<button id="btnImportBlockedZone" type="button" class="btn btn-default" data-loading-text="Import" onclick="return resetImportBlockedZonesModal();" data-toggle="modal" data-target="#modalImportBlockedZones" style="font-size: 12px; padding: 4px 6px;">Import</button>
|
||||
<button id="btnExportBlockedZone" type="button" class="btn btn-default" data-loading-text="Export" onclick="return exportBlockedZones();" style="font-size: 12px; padding: 4px 6px;">Export</button>
|
||||
<button id="btnDeleteBlockedZone" type="button" class="btn btn-danger" data-loading-text="Delete" onclick="return deleteBlockedZone();" style="font-size: 12px; padding: 4px 6px;">Delete</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -516,11 +516,15 @@
|
||||
<li><a href="#">Quad9 Secure HTTPS (https://dns.quad9.net/dns-query (9.9.9.9))</a></li>
|
||||
<li><a href="#">Quad9 Unsecure (9.9.9.10)</a></li>
|
||||
<li><a href="#">Quad9 Unsecure ([2620:fe::10])</a></li>
|
||||
<li><a href="#">Quad9 Unsecure TLS (dns10.quad9.net (9.9.9.10:853))</a></li>
|
||||
<li><a href="#">Quad9 Unsecure TLS (dns10.quad9.net ([2620:fe::10]:853))</a></li>
|
||||
<li><a href="#">Quad9 Unsecure HTTPS (https://dns10.quad9.net/dns-query (9.9.9.10))</a></li>
|
||||
<li><a href="#">OpenDNS (208.67.222.222)</a></li>
|
||||
<li><a href="#">OpenDNS (208.67.220.220)</a></li>
|
||||
<li><a href="#">OpenDNS ([2620:0:ccc::2])</a></li>
|
||||
<li><a href="#">OpenDNS ([2620:0:ccd::2])</a></li>
|
||||
<li><a href="#">OpenDNS FamilyShield (208.67.222.123)</a></li>
|
||||
<li><a href="#">OpenDNS FamilyShield (208.67.220.123)</a></li>
|
||||
<li><a href="#">Level3 (4.2.2.1)</a></li>
|
||||
<li><a href="#">Level3 (4.2.2.2)</a></li>
|
||||
<li><a href="#">Ultra (156.154.70.1)</a></li>
|
||||
@@ -918,10 +922,20 @@
|
||||
<option value="quad9-tls-ipv6">Quad9 Secure (DNS-over-TLS IPv6)</option>
|
||||
<option value="quad9-https">Quad9 Secure (DNS-over-HTTPS)</option>
|
||||
|
||||
<option value="quad9-unsecure-udp">Quad9 Unsecure (DNS-over-UDP)</option>
|
||||
<option value="quad9-unsecure-udp-ipv6">Quad9 Unsecure (DNS-over-UDP IPv6)</option>
|
||||
<option value="quad9-unsecure-tcp">Quad9 Unsecure (DNS-over-TCP)</option>
|
||||
<option value="quad9-unsecure-tcp-ipv6">Quad9 Unsecure (DNS-over-TCP IPv6)</option>
|
||||
<option value="quad9-unsecure-tls">Quad9 Unsecure (DNS-over-TLS)</option>
|
||||
<option value="quad9-unsecure-tls-ipv6">Quad9 Unsecure (DNS-over-TLS IPv6)</option>
|
||||
<option value="quad9-unsecure-https">Quad9 Unsecure (DNS-over-HTTPS)</option>
|
||||
|
||||
<option value="opendns-udp">OpenDNS (DNS-over-UDP)</option>
|
||||
<option value="opendns-udp-ipv6">OpenDNS (DNS-over-UDP IPv6)</option>
|
||||
<option value="opendns-tcp">OpenDNS (DNS-over-TCP)</option>
|
||||
<option value="opendns-tcp-ipv6">OpenDNS (DNS-over-TCP IPv6)</option>
|
||||
|
||||
<option value="opendns-fs-udp">OpenDNS FamilyShield (DNS-over-UDP)</option>
|
||||
</select>
|
||||
|
||||
<div style="margin-top: 10px;">Enter forwarder DNS Server IP addresses or URLs one below another in above text field or use the Quick Select list to select desired forwarder.</div>
|
||||
@@ -973,8 +987,6 @@
|
||||
<div class="form-group" style="margin-bottom: 0px;">
|
||||
<button id="btnSaveDnsSettings" type="button" class="btn btn-primary" data-loading-text="Saving..." onclick="return saveDnsSettings();">Save Settings</button>
|
||||
<button id="btnFlushDnsCache" type="button" class="btn btn-warning" data-loading-text="Flushing..." onclick="return flushDnsCache();" style="margin-left: 6px;">Flush Cache</button>
|
||||
<button id="btnFlushAllowedZone" type="button" class="btn btn-warning" data-loading-text="Flushing..." onclick="return flushAllowedZone();" style="margin-left: 6px;">Flush Allowed Zone</button>
|
||||
<button id="btnFlushCustomBlockedZone" type="button" class="btn btn-warning" data-loading-text="Flushing..." onclick="return flushCustomBlockedZone();" style="margin-left: 6px;">Flush Custom Blocked Zone</button>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
@@ -1613,25 +1625,25 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="modalImportCustomBlockedZones" class="modal fade" tabindex="-1" role="dialog">
|
||||
<div id="modalImportBlockedZones" class="modal fade" tabindex="-1" role="dialog">
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">Import Custom Blocked Zones</h4>
|
||||
<h4 class="modal-title">Import Blocked Zones</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div id="divImportCustomBlockedZonesAlert"></div>
|
||||
<div id="divImportBlockedZonesAlert"></div>
|
||||
|
||||
<p>Enter domain names one below other to import into custom blocked zone:</p>
|
||||
<p>Enter domain names one below other to import into blocked zone:</p>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="txtImportCustomBlockedZones" class="control-label">Blocked Zones</label>
|
||||
<textarea id="txtImportCustomBlockedZones" class="form-control" rows="15"></textarea>
|
||||
<label for="txtImportBlockedZones" class="control-label">Blocked Zones</label>
|
||||
<textarea id="txtImportBlockedZones" class="form-control" rows="15"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button id="btnImportCustomBlockedZones" type="submit" class="btn btn-primary" data-loading-text="Importing..." onclick="return importCustomBlockedZones();">Import</button>
|
||||
<button id="btnImportBlockedZones" type="submit" class="btn btn-primary" data-loading-text="Importing..." onclick="return importBlockedZones();">Import</button>
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -325,6 +325,42 @@ $(function () {
|
||||
break;
|
||||
|
||||
|
||||
case "quad9-unsecure-udp":
|
||||
$("#txtForwarders").val("9.9.9.10");
|
||||
$("#rdForwarderProtocolUdp").prop("checked", true);
|
||||
break;
|
||||
|
||||
case "quad9-unsecure-udp-ipv6":
|
||||
$("#txtForwarders").val("[2620:fe::10]");
|
||||
$("#rdForwarderProtocolUdp").prop("checked", true);
|
||||
break;
|
||||
|
||||
case "quad9-unsecure-tcp":
|
||||
$("#txtForwarders").val("9.9.9.10");
|
||||
$("#rdForwarderProtocolTcp").prop("checked", true);
|
||||
break;
|
||||
|
||||
case "quad9-unsecure-tcp-ipv6":
|
||||
$("#txtForwarders").val("[2620:fe::10]");
|
||||
$("#rdForwarderProtocolTcp").prop("checked", true);
|
||||
break;
|
||||
|
||||
case "quad9-unsecure-tls":
|
||||
$("#txtForwarders").val("dns10.quad9.net (9.9.9.10:853)");
|
||||
$("#rdForwarderProtocolTls").prop("checked", true);
|
||||
break;
|
||||
|
||||
case "quad9-unsecure-tls-ipv6":
|
||||
$("#txtForwarders").val("dns10.quad9.net ([2620:fe::10]:853)");
|
||||
$("#rdForwarderProtocolTls").prop("checked", true);
|
||||
break;
|
||||
|
||||
case "quad9-unsecure-https":
|
||||
$("#txtForwarders").val("https://dns10.quad9.net/dns-query (9.9.9.10)");
|
||||
$("#rdForwarderProtocolHttps").prop("checked", true);
|
||||
break;
|
||||
|
||||
|
||||
case "opendns-udp":
|
||||
$("#txtForwarders").val("208.67.222.222\r\n208.67.220.220");
|
||||
$("#rdForwarderProtocolUdp").prop("checked", true);
|
||||
@@ -346,6 +382,12 @@ $(function () {
|
||||
break;
|
||||
|
||||
|
||||
case "opendns-fs-udp":
|
||||
$("#txtForwarders").val("208.67.222.123\r\n208.67.220.123");
|
||||
$("#rdForwarderProtocolUdp").prop("checked", true);
|
||||
break;
|
||||
|
||||
|
||||
case "none":
|
||||
$("#txtForwarders").val("");
|
||||
$("#rdForwarderProtocolUdp").prop("checked", true);
|
||||
@@ -1217,31 +1259,6 @@ function allowZone() {
|
||||
return false;
|
||||
}
|
||||
|
||||
function flushAllowedZone() {
|
||||
|
||||
if (!confirm("Are you sure to flush the DNS Server allowed zone?"))
|
||||
return false;
|
||||
|
||||
var btn = $("#btnFlushAllowedZone").button('loading');
|
||||
|
||||
HTTPRequest({
|
||||
url: "/api/flushAllowedZone?token=" + token,
|
||||
success: function (responseJSON) {
|
||||
btn.button('reset');
|
||||
showAlert("success", "Allowed Zone Flushed!", "DNS Server allowed zone was flushed successfully.");
|
||||
},
|
||||
error: function () {
|
||||
btn.button('reset');
|
||||
},
|
||||
invalidToken: function () {
|
||||
btn.button('reset');
|
||||
showPageLogin();
|
||||
}
|
||||
});
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
function deleteAllowedZone() {
|
||||
|
||||
var domain = $("#txtAllowedZoneViewerTitle").text();
|
||||
@@ -1338,7 +1355,7 @@ function refreshAllowedZonesList(domain, direction) {
|
||||
return false;
|
||||
}
|
||||
|
||||
function customBlockZone() {
|
||||
function blockZone() {
|
||||
|
||||
var domain = $("#txtBlockZone").val();
|
||||
|
||||
@@ -1351,14 +1368,14 @@ function customBlockZone() {
|
||||
var btn = $("#btnBlockZone").button('loading');
|
||||
|
||||
HTTPRequest({
|
||||
url: "/api/customBlockZone?token=" + token + "&domain=" + domain,
|
||||
url: "/api/blockZone?token=" + token + "&domain=" + domain,
|
||||
success: function (responseJSON) {
|
||||
refreshBlockedZonesList(domain);
|
||||
|
||||
$("#txtBlockZone").val("");
|
||||
btn.button('reset');
|
||||
|
||||
showAlert("success", "Zone Blocked!", "Domain was added to Custom Blocked Zone successfully.");
|
||||
showAlert("success", "Zone Blocked!", "Domain was added to Blocked Zone successfully.");
|
||||
},
|
||||
error: function () {
|
||||
btn.button('reset');
|
||||
@@ -1372,47 +1389,22 @@ function customBlockZone() {
|
||||
return false;
|
||||
}
|
||||
|
||||
function flushCustomBlockedZone() {
|
||||
|
||||
if (!confirm("Are you sure to flush the DNS Server blocked zone?"))
|
||||
return false;
|
||||
|
||||
var btn = $("#btnFlushCustomBlockedZone").button('loading');
|
||||
|
||||
HTTPRequest({
|
||||
url: "/api/flushCustomBlockedZone?token=" + token,
|
||||
success: function (responseJSON) {
|
||||
btn.button('reset');
|
||||
showAlert("success", "Custom Blocked Zone Flushed!", "DNS Server custom blocked zone was flushed successfully.");
|
||||
},
|
||||
error: function () {
|
||||
btn.button('reset');
|
||||
},
|
||||
invalidToken: function () {
|
||||
btn.button('reset');
|
||||
showPageLogin();
|
||||
}
|
||||
});
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
function deleteCustomBlockedZone() {
|
||||
function deleteBlockedZone() {
|
||||
|
||||
var domain = $("#txtBlockedZoneViewerTitle").text();
|
||||
|
||||
if (!confirm("Are you sure you want to delete the blocked zone '" + domain + "'?"))
|
||||
return false;
|
||||
|
||||
var btn = $("#btnDeleteCustomBlockedZone").button('loading');
|
||||
var btn = $("#btnDeleteBlockedZone").button('loading');
|
||||
|
||||
HTTPRequest({
|
||||
url: "/api/deleteCustomBlockedZone?token=" + token + "&domain=" + domain,
|
||||
url: "/api/deleteBlockedZone?token=" + token + "&domain=" + domain,
|
||||
success: function (responseJSON) {
|
||||
refreshBlockedZonesList(getParentDomain(domain), "up");
|
||||
|
||||
btn.button('reset');
|
||||
showAlert("success", "Custom Blocked Zone Deleted!", "Custom blocked zone was deleted successfully.");
|
||||
showAlert("success", "Blocked Zone Deleted!", "Blocked zone was deleted successfully.");
|
||||
},
|
||||
error: function () {
|
||||
btn.button('reset');
|
||||
@@ -1463,15 +1455,15 @@ function refreshBlockedZonesList(domain, direction) {
|
||||
|
||||
if (newDomain == "") {
|
||||
$("#txtBlockedZoneViewerTitle").text("<ROOT>");
|
||||
$("#btnDeleteCustomBlockedZone").hide();
|
||||
$("#btnDeleteBlockedZone").hide();
|
||||
}
|
||||
else {
|
||||
$("#txtBlockedZoneViewerTitle").text(newDomain);
|
||||
|
||||
if ((newDomain == "root-servers.net") || newDomain.endsWith(".root-servers.net"))
|
||||
$("#btnDeleteCustomBlockedZone").hide();
|
||||
$("#btnDeleteBlockedZone").hide();
|
||||
else
|
||||
$("#btnDeleteCustomBlockedZone").show();
|
||||
$("#btnDeleteBlockedZone").show();
|
||||
}
|
||||
|
||||
if (responseJSON.response.records.length > 0) {
|
||||
@@ -1752,34 +1744,34 @@ function exportAllowedZones() {
|
||||
return false;
|
||||
}
|
||||
|
||||
function resetImportCustomBlockedZonesModal() {
|
||||
function resetImportBlockedZonesModal() {
|
||||
|
||||
$("#divImportCustomBlockedZonesAlert").html("");
|
||||
$("#txtImportCustomBlockedZones").val("");
|
||||
$("#divImportBlockedZonesAlert").html("");
|
||||
$("#txtImportBlockedZones").val("");
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
function importCustomBlockedZones() {
|
||||
var divImportCustomBlockedZonesAlert = $("#divImportCustomBlockedZonesAlert");
|
||||
var blockedZones = cleanTextList($("#txtImportCustomBlockedZones").val());
|
||||
function importBlockedZones() {
|
||||
var divImportBlockedZonesAlert = $("#divImportBlockedZonesAlert");
|
||||
var blockedZones = cleanTextList($("#txtImportBlockedZones").val());
|
||||
|
||||
if ((blockedZones.length === 0) || (blockedZones === ",")) {
|
||||
showAlert("warning", "Missing!", "Please enter custom blocked zones to import.", divImportCustomBlockedZonesAlert);
|
||||
$("#txtImportCustomBlockedZones").focus();
|
||||
showAlert("warning", "Missing!", "Please enter blocked zones to import.", divImportBlockedZonesAlert);
|
||||
$("#txtImportBlockedZones").focus();
|
||||
return false;
|
||||
}
|
||||
|
||||
var btn = $("#btnImportCustomBlockedZones").button('loading');
|
||||
var btn = $("#btnImportBlockedZones").button('loading');
|
||||
|
||||
HTTPRequest({
|
||||
url: "/api/importCustomBlockedZones?token=" + token,
|
||||
url: "/api/importBlockedZones?token=" + token,
|
||||
data: "blockedZones=" + blockedZones,
|
||||
success: function (responseJSON) {
|
||||
$("#modalImportCustomBlockedZones").modal("hide");
|
||||
$("#modalImportBlockedZones").modal("hide");
|
||||
btn.button('reset');
|
||||
|
||||
showAlert("success", "Imported!", "Domain names were imported to custom blocked zone successfully.");
|
||||
showAlert("success", "Imported!", "Domain names were imported to blocked zone successfully.");
|
||||
},
|
||||
error: function () {
|
||||
btn.button('reset');
|
||||
@@ -1788,17 +1780,17 @@ function importCustomBlockedZones() {
|
||||
btn.button('reset');
|
||||
showPageLogin();
|
||||
},
|
||||
objAlertPlaceholder: divImportCustomBlockedZonesAlert
|
||||
objAlertPlaceholder: divImportBlockedZonesAlert
|
||||
});
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
function exportCustomBlockedZones() {
|
||||
function exportBlockedZones() {
|
||||
|
||||
window.open("/api/exportCustomBlockedZones?token=" + token, "_blank");
|
||||
window.open("/api/exportBlockedZones?token=" + token, "_blank");
|
||||
|
||||
showAlert("success", "Exported!", "Custom blocked zones were exported successfully.");
|
||||
showAlert("success", "Exported!", "Blocked zones were exported successfully.");
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user