Implemented Check for updates which removs the last shell exec from web ui, and reimplemented db_update switch to update_cli.php

This commit is contained in:
johnnyq
2026-08-26 23:38:23 -04:00
parent 14c38b9814
commit 069f587c1d
13 changed files with 573 additions and 132 deletions

View File

@@ -754,27 +754,17 @@ if (isset($_POST['add_telemetry'])) {
// Section: Shell Commands
$shellCommands = [];
if ($shell_exec_enabled) {
$commands = ['git'];
foreach ($commands as $command) {
$which = trim(shell_exec("which $command 2>/dev/null"));
$exists = !empty($which);
$shellCommands[] = [
'name' => "Command '$command' available",
'passed' => $exists,
'value' => $exists ? $which : 'Not Found',
];
}
} else {
// If shell_exec is disabled, mark commands as unavailable
foreach (['whois', 'dig', 'git'] as $command) {
$shellCommands[] = [
'name' => "Command '$command' available",
'passed' => false,
'value' => 'shell_exec Disabled',
];
}
// Located by walking PATH rather than by running `which`, so this reports
// the truth on a host with shell_exec disabled. The no-shell branch this
// replaces also still listed whois and dig, which ITFlow stopped shelling
// out to when domain lookups moved to RDAP and native DNS
foreach (['git'] as $command) {
$path = commandPath($command);
$shellCommands[] = [
'name' => "Command '$command' available",
'passed' => $path !== '',
'value' => $path !== '' ? $path : 'Not Found',
];
}
// Section: SSL Checks