mirror of
https://github.com/pi-hole/web.git
synced 2025-12-24 12:48:29 +00:00
Merge branch 'development-v6' into tweak/domain_array
Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
4
.github/ISSUE_TEMPLATE.md
vendored
4
.github/ISSUE_TEMPLATE.md
vendored
@@ -1,8 +1,8 @@
|
||||
**In raising this issue, I confirm the following:** `{please fill the checkboxes, e.g: [X]}`
|
||||
|
||||
- [] I have read and understood the [contributors guide](https://github.com/pi-hole/AdminLTE/blob/master/CONTRIBUTING.md).
|
||||
- [] I have read and understood the [contributors guide](https://github.com/pi-hole/web/blob/master/CONTRIBUTING.md).
|
||||
- [] The issue I am reporting can be _replicated_.
|
||||
- [] The issue I am reporting isn't a duplicate (see [FAQs](https://github.com/pi-hole/pi-hole/wiki/FAQs), [closed issues](https://github.com/pi-hole/AdminLTE/issues?utf8=%E2%9C%93&q=is%3Aissue%20is%3Aclosed%20), and [open issues](https://github.com/pi-hole/AdminLTE/issues)).
|
||||
- [] The issue I am reporting isn't a duplicate (see [FAQs](https://github.com/pi-hole/pi-hole/wiki/FAQs), [closed issues](https://github.com/pi-hole/web/issues?utf8=%E2%9C%93&q=is%3Aissue%20is%3Aclosed%20), and [open issues](https://github.com/pi-hole/web/issues)).
|
||||
|
||||
**How familiar are you with the the source code relevant to this issue?:**
|
||||
|
||||
|
||||
17
login.lp
17
login.lp
@@ -8,15 +8,6 @@
|
||||
--]]
|
||||
|
||||
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
|
||||
?>
|
||||
<body class="hold-transition layout-boxed login-page">
|
||||
<div class="box login-box" id="login-box">
|
||||
@@ -35,13 +26,13 @@ end
|
||||
<div class="text-center form-group has-error" id="dns-failure-label" style="display: none;">
|
||||
<label>DNS Server failure detected, log in to see Pi-hole diagnosis messages</label>
|
||||
</div>
|
||||
<div class="text-center form-group has-error" id="dns-failure-label" style="display: <? if is_secure then ?>none<? else ?>block<? end ?>;">
|
||||
<div class="box box-danger" id="insecure-box">
|
||||
<div class="text-center form-group has-error" id="insecure-box" style="display: none;">
|
||||
<div class="box box-danger">
|
||||
<div class="box-header with-border pointer no-user-select">
|
||||
<h3 class="box-title has-error control-label"><i class="fa fa-fw fa-triangle-exclamation"></i> Insecure network connection <i class="fa fa-fw fa-triangle-exclamation"></i></h3>
|
||||
</div>
|
||||
<div class="box-body">
|
||||
<p>Consider upgrading to <a href="<?=https_link?>">HTTPS</a> (end-to-end encryption)</p>
|
||||
<p>Consider upgrading to <a href="#" id="https-link">HTTPS</a> (end-to-end encryption)</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -89,7 +80,7 @@ end
|
||||
a new password (or explicitly disable the password by setting an empty password)
|
||||
using the command
|
||||
</p>
|
||||
<pre>sudo pihole -a -p</pre>
|
||||
<pre>sudo pihole setpassword</pre>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -5,15 +5,15 @@
|
||||
"description": "",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/pi-hole/AdminLTE.git"
|
||||
"url": "git+https://github.com/pi-hole/web.git"
|
||||
},
|
||||
"keywords": [],
|
||||
"author": "",
|
||||
"license": "EUPL-1.2",
|
||||
"bugs": {
|
||||
"url": "https://github.com/pi-hole/AdminLTE/issues"
|
||||
"url": "https://github.com/pi-hole/web/issues"
|
||||
},
|
||||
"homepage": "https://github.com/pi-hole/AdminLTE#readme",
|
||||
"homepage": "https://github.com/pi-hole/web#readme",
|
||||
"scripts": {
|
||||
"prefix": "postcss \"style/*.css\" \"style/themes/*.css\" --use autoprefixer --no-map --replace",
|
||||
"prettier:check": "prettier -l \"style/*.css\" \"style/themes/*.css\" \"scripts/pi-hole/**/*.js\"",
|
||||
|
||||
@@ -119,6 +119,8 @@ function piholeChange(action, duration) {
|
||||
$.ajax({
|
||||
url: "/api/dns/blocking",
|
||||
method: "POST",
|
||||
dataType: "json",
|
||||
processData: false,
|
||||
data: JSON.stringify({
|
||||
blocking: action === "enable",
|
||||
timer: parseInt(duration, 10) > 0 ? parseInt(duration, 10) : null,
|
||||
@@ -474,6 +476,7 @@ function updateVersionInfo() {
|
||||
remote: version.core.remote.version,
|
||||
branch: version.core.local.branch,
|
||||
hash: version.core.local.hash,
|
||||
hash_remote: version.core.remote.hash,
|
||||
url: "https://github.com/pi-hole/pi-hole/releases",
|
||||
},
|
||||
{
|
||||
@@ -482,6 +485,7 @@ function updateVersionInfo() {
|
||||
remote: version.ftl.remote.version,
|
||||
branch: version.ftl.local.branch,
|
||||
hash: version.ftl.local.hash,
|
||||
hash_remote: version.ftl.remote.hash,
|
||||
url: "https://github.com/pi-hole/FTL/releases",
|
||||
},
|
||||
{
|
||||
@@ -490,7 +494,8 @@ function updateVersionInfo() {
|
||||
remote: version.web.remote.version,
|
||||
branch: version.web.local.branch,
|
||||
hash: version.web.local.hash,
|
||||
url: "https://github.com/pi-hole/AdminLTE/releases",
|
||||
hash_remote: version.web.remote.hash,
|
||||
url: "https://github.com/pi-hole/web/releases",
|
||||
},
|
||||
];
|
||||
|
||||
@@ -508,11 +513,25 @@ function updateVersionInfo() {
|
||||
'" rel="noopener" target="_blank">' +
|
||||
localVersion +
|
||||
"</a>";
|
||||
} else localVersion = "vDev (" + v.branch + ", " + v.hash + ")";
|
||||
|
||||
if (versionCompare(v.local, v.remote) === -1) {
|
||||
if (v.name === "Docker Tag") dockerUpdate = true;
|
||||
else updateAvailable = true;
|
||||
// Update available
|
||||
updateAvailable = true;
|
||||
}
|
||||
} else {
|
||||
// non-master branch
|
||||
localVersion = "vDev (" + v.branch + ", " + v.hash + ")";
|
||||
if (v.hash !== v.hash_remote) {
|
||||
// hash differ > Update available
|
||||
updateAvailable = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (v.name === "Docker Tag" && versionCompare(v.local, v.remote) === -1) {
|
||||
updateAvailable = true;
|
||||
dockerUpdate = true;
|
||||
}
|
||||
|
||||
if (updateAvailable) {
|
||||
$("#versions").append(
|
||||
"<li><strong>" +
|
||||
v.name +
|
||||
|
||||
@@ -38,6 +38,7 @@ function eventsource() {
|
||||
return reader.read().then(({ done, value }) => {
|
||||
// When no more data needs to be consumed, close the stream
|
||||
if (done) {
|
||||
ta.append("Done.");
|
||||
controller.close();
|
||||
alInfo.hide();
|
||||
$("#gravityBtn").prop("disabled", false);
|
||||
@@ -47,9 +48,8 @@ function eventsource() {
|
||||
// Enqueue the next data chunk into our target stream
|
||||
controller.enqueue(value);
|
||||
var string = new TextDecoder().decode(value);
|
||||
// Remove ${OVER} from the string
|
||||
string = string.replaceAll("\r[K", "\n");
|
||||
ta.append(string);
|
||||
parseLines(ta, string);
|
||||
|
||||
if (string.indexOf("Pi-hole blocking is") !== -1) {
|
||||
alSuccess.show();
|
||||
}
|
||||
@@ -84,3 +84,24 @@ $(function () {
|
||||
eventsource();
|
||||
}
|
||||
});
|
||||
|
||||
function parseLines(ta, str) {
|
||||
// str can contain multiple lines.
|
||||
// We want to split the text before an "OVER" escape sequence to allow overwriting previous line when needed
|
||||
|
||||
// Splitting the text on "\r"
|
||||
var lines = str.split(/(?=\r)/g);
|
||||
|
||||
for (let i = 0; i < lines.length; i++) {
|
||||
if (lines[i][0] === "\r") {
|
||||
// This line starts with the "OVER" sequence. Replace them with "\n" before print
|
||||
lines[i] = lines[i].replaceAll("\r[K", "\n").replaceAll("\r", "\n");
|
||||
|
||||
// Last line from the textarea will be overwritten, so we remove it
|
||||
ta.text(ta.text().substring(0, ta.text().lastIndexOf("\n")));
|
||||
}
|
||||
|
||||
// Append the new text to the end of the output
|
||||
ta.append(lines[i]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -524,6 +524,7 @@ function addAdlist(event) {
|
||||
url: "/api/lists",
|
||||
method: "post",
|
||||
dataType: "json",
|
||||
processData: false,
|
||||
data: JSON.stringify({ address: addresses, comment: comment, type: type }),
|
||||
success: function (data) {
|
||||
utils.enableAll();
|
||||
@@ -590,6 +591,7 @@ function editAdlist() {
|
||||
url: "/api/lists/" + encodeURIComponent(addressDecoded),
|
||||
method: "put",
|
||||
dataType: "json",
|
||||
processData: false,
|
||||
data: JSON.stringify({
|
||||
groups: groups,
|
||||
comment: comment,
|
||||
|
||||
@@ -453,6 +453,7 @@ function addClient() {
|
||||
url: "/api/clients",
|
||||
method: "post",
|
||||
dataType: "json",
|
||||
processData: false,
|
||||
data: JSON.stringify({ client: ips, comment: comment }),
|
||||
success: function (data) {
|
||||
utils.enableAll();
|
||||
@@ -508,6 +509,7 @@ function editClient() {
|
||||
url: "/api/clients/" + encodeURIComponent(clientDecoded),
|
||||
method: "put",
|
||||
dataType: "json",
|
||||
processData: false,
|
||||
data: JSON.stringify({
|
||||
client: client,
|
||||
groups: groups,
|
||||
|
||||
@@ -535,6 +535,7 @@ function addDomain() {
|
||||
url: "/api/domains/" + type + "/" + kind,
|
||||
method: "post",
|
||||
dataType: "json",
|
||||
processData: false,
|
||||
data: JSON.stringify({
|
||||
domain: domains,
|
||||
comment: comment,
|
||||
@@ -617,6 +618,7 @@ function editDomain() {
|
||||
url: "/api/domains/" + newTypestr + "/" + encodeURIComponent(domainDecoded),
|
||||
method: "put",
|
||||
dataType: "json",
|
||||
processData: false,
|
||||
data: JSON.stringify({
|
||||
groups: groups,
|
||||
comment: comment,
|
||||
|
||||
@@ -305,6 +305,7 @@ function addGroup() {
|
||||
url: "/api/groups",
|
||||
method: "post",
|
||||
dataType: "json",
|
||||
processData: false,
|
||||
data: JSON.stringify({
|
||||
name: names,
|
||||
comment: comment,
|
||||
@@ -371,6 +372,7 @@ function editGroup() {
|
||||
url: "/api/groups/" + oldName,
|
||||
method: "put",
|
||||
dataType: "json",
|
||||
processData: false,
|
||||
data: JSON.stringify({
|
||||
name: name,
|
||||
comment: comment,
|
||||
|
||||
@@ -60,6 +60,8 @@ function doLogin(password) {
|
||||
$.ajax({
|
||||
url: "/api/auth",
|
||||
method: "POST",
|
||||
dataType: "json",
|
||||
processData: false,
|
||||
data: JSON.stringify({ password: password, totp: parseInt($("#totp").val(), 10) }),
|
||||
})
|
||||
.done(function () {
|
||||
@@ -112,7 +114,23 @@ $(function () {
|
||||
}).done(function (data) {
|
||||
if (data.session.valid === true) redirect();
|
||||
if (data.session.totp === true) $("#totp_input").removeClass("hidden");
|
||||
});
|
||||
|
||||
// Get information about HTTPS port and DNS status
|
||||
$.ajax({
|
||||
url: "/api/info/login",
|
||||
}).done(function (data) {
|
||||
if (data.dns === false) showDNSfailure();
|
||||
|
||||
// Generate HTTPS redirection link (only used if not already HTTPS)
|
||||
if (location.protocol !== "https:" && data.https_port !== 0) {
|
||||
let url = "https://" + location.hostname;
|
||||
if (data.https_port !== 443) url += ":" + data.https_port;
|
||||
url += location.pathname + location.search + location.hash;
|
||||
|
||||
$("#https-link").attr("href", url);
|
||||
$("#insecure-box").show();
|
||||
}
|
||||
});
|
||||
|
||||
// Clear TOTP field
|
||||
|
||||
@@ -318,6 +318,8 @@ function setTOTPSecret(secret) {
|
||||
$.ajax({
|
||||
url: "/api/config",
|
||||
type: "PATCH",
|
||||
dataType: "json",
|
||||
processData: false,
|
||||
data: JSON.stringify({ config: { webserver: { api: { totp_secret: secret } } } }),
|
||||
contentType: "application/json",
|
||||
})
|
||||
|
||||
@@ -290,6 +290,8 @@ $("#loggingButton").confirm({
|
||||
$.ajax({
|
||||
url: "/api/config/dns/queryLogging",
|
||||
type: "PATCH",
|
||||
dataType: "json",
|
||||
processData: false,
|
||||
data: JSON.stringify(data),
|
||||
})
|
||||
.done(function (data) {
|
||||
|
||||
@@ -137,6 +137,8 @@ function saveSettings() {
|
||||
$.ajax({
|
||||
url: "/api/config",
|
||||
method: "PATCH",
|
||||
dataType: "json",
|
||||
processData: false,
|
||||
data: JSON.stringify({ config: settings }),
|
||||
contentType: "application/json; charset=utf-8",
|
||||
})
|
||||
|
||||
@@ -315,6 +315,7 @@ function addFromQueryLog(domain, list) {
|
||||
url: "/api/domains/" + list + "/exact",
|
||||
method: "post",
|
||||
dataType: "json",
|
||||
processData: false,
|
||||
data: JSON.stringify({
|
||||
domain: domain,
|
||||
comment: "Added from Query Log",
|
||||
|
||||
@@ -14,7 +14,7 @@ PageTitle = "Web Interface - API Settings"
|
||||
mg.include('scripts/pi-hole/lua/settings_header.lp','r')
|
||||
?>
|
||||
<div class="row">
|
||||
<div class="col-md-6 settings-level-1">
|
||||
<div class="col-md-6 settings-level-0">
|
||||
<div class="row">
|
||||
<div class="col-md-12 settings-level-1">
|
||||
<div class="box box-warning">
|
||||
@@ -143,7 +143,7 @@ mg.include('scripts/pi-hole/lua/settings_header.lp','r')
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<div class="col-md-12 settings-level-2">
|
||||
<div class="box box-warning">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">Currently active sessions</h3>
|
||||
|
||||
Reference in New Issue
Block a user