mirror of
https://github.com/pi-hole/web.git
synced 2026-04-28 04:33:58 +01:00
Merge branch 'devel' into new/group-management
This commit is contained in:
@@ -26,7 +26,7 @@ function sendRequestFTL($requestin)
|
||||
global $socket;
|
||||
|
||||
$request = ">".$requestin;
|
||||
fwrite($socket, $request) or die("Could not send data to server\n");
|
||||
fwrite($socket, $request) or die('{"error":"Could not send data to server"}');
|
||||
}
|
||||
|
||||
function getResponseFTL()
|
||||
@@ -35,9 +35,15 @@ function getResponseFTL()
|
||||
|
||||
$response = [];
|
||||
|
||||
$errCount = 0;
|
||||
while(true)
|
||||
{
|
||||
$out = fgets($socket);
|
||||
if ($out == "") $errCount++;
|
||||
if ($errCount > 100) {
|
||||
// Tried 100 times, but never got proper reply, fail to prevent busy loop
|
||||
die('{"error":"Tried 100 times to connect to FTL server, but never got proper reply. Please check Port and logs!"}');
|
||||
}
|
||||
if(strrpos($out,"---EOM---") !== false)
|
||||
break;
|
||||
|
||||
|
||||
@@ -10,6 +10,14 @@ require_once('func.php');
|
||||
$ERRORLOG = getenv('PHP_ERROR_LOG');
|
||||
if (empty($ERRORLOG)) {
|
||||
$ERRORLOG = '/var/log/lighttpd/error.log';
|
||||
|
||||
if (!file_exists($ERRORLOG) || !is_writable($ERRORLOG)) {
|
||||
$ERRORLOG = '/var/log/apache2/error.log';
|
||||
|
||||
if (!file_exists($ERRORLOG) || !is_writable($ERRORLOG)) {
|
||||
$ERRORLOG = '/tmp/pi-hole-error.log';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function pi_log($message) {
|
||||
|
||||
@@ -270,7 +270,12 @@ if($auth) {
|
||||
</a>
|
||||
<div class="navbar-custom-menu">
|
||||
<ul class="nav navbar-nav">
|
||||
<li><a style="pointer-events:none;">hostname: <code><?php echo gethostname(); ?></code></a></li>
|
||||
<li>
|
||||
<a style="pointer-events:none;">
|
||||
<span class="hidden-xs hidden-sm">hostname:</span>
|
||||
<code><?php echo gethostname(); ?></code>
|
||||
</a>
|
||||
</li>
|
||||
<li class="dropdown user user-menu">
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown" aria-expanded="true">
|
||||
<img src="img/logo.svg" class="user-image" style="border-radius: 0" alt="Pi-hole logo" width="25" height="25">
|
||||
|
||||
Reference in New Issue
Block a user