Moved hardcoded values to config file

This commit is contained in:
2025-10-23 00:56:56 +01:00
parent 04bf1d358f
commit 187ac702bf
3 changed files with 5 additions and 5 deletions

View File

@@ -17,7 +17,7 @@ if ($cmd === '') {
}
// Restrict dangerous commands for safety
$blacklist = ['rm', 'shutdown', 'reboot', 'passwd', 'dd', ':(){'];
$blacklist = $CONFIG['blacklist_commands'];
foreach ($blacklist as $bad) {
if (stripos($cmd, $bad) !== false) {
echo json_encode(['output' => "⚠️ Command '$bad' not allowed"]);
@@ -30,7 +30,7 @@ $descriptor = [
1 => ['pipe', 'w'],
2 => ['pipe', 'w']
];
$process = proc_open($cmd, $descriptor, $pipes, '/home');
$process = proc_open($cmd, $descriptor, $pipes, $CONFIG['default_dir']);
if (is_resource($process)) {
$output = stream_get_contents($pipes[1]);
$error = stream_get_contents($pipes[2]);