Skip to content

Commit

Permalink
chore: format
Browse files Browse the repository at this point in the history
  • Loading branch information
dkaser committed Sep 6, 2024
1 parent 3b0e0ad commit d55f198
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 13 deletions.
7 changes: 3 additions & 4 deletions src/usr/local/emhttp/plugins/tailscale/include/daily/ping.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ function send_usage($url, $content)

$prefs = getTailscalePrefs();

$exit = false;
$subnet = false;
$exit = false;
$subnet = false;
$headscale = false;

foreach (($prefs->AdvertiseRoutes ?? array()) as $net) {
Expand All @@ -53,8 +53,7 @@ function send_usage($url, $content)
}
}

if($prefs->ControlURL != "https://controlplane.tailscale.com")
{
if ($prefs->ControlURL != "https://controlplane.tailscale.com") {
$headscale = true;
}

Expand Down
16 changes: 8 additions & 8 deletions src/usr/local/emhttp/plugins/tailscale/include/get_log.php
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
<?php
ini_set('memory_limit', '512M'); /* Increase memory limit */

ini_set('memory_limit', '512M'); // Increase memory limit

$allowed_files = ["/var/log/tailscale.log", "/var/log/tailscale-utils.log"];

$log = $_POST['log'];
if (!in_array($log, $allowed_files)) {
return;
if ( ! in_array($log, $allowed_files)) {
return;
}

$max = intval($_POST['max']);
$max = intval($_POST['max']);
$lines = array_reverse(array_slice(file($log), -$max));

foreach($lines as $line) {
echo '<span class="text">', htmlspecialchars($line), "</span>";
foreach ($lines as $line) {
echo '<span class="text">', htmlspecialchars($line), "</span>";
}

ini_restore('memory_limit'); /* Restore original memory limit */
?>
ini_restore('memory_limit'); // Restore original memory limit
2 changes: 1 addition & 1 deletion src/usr/local/emhttp/plugins/tailscale/interface.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

// Load the session state into the environment for the CGI calls
foreach ($_SERVER as $key => $value) {
if(is_array($value)) {
if (is_array($value)) {
$out = implode($value);
putenv("{$key}={$out}");
} else {
Expand Down

0 comments on commit d55f198

Please sign in to comment.