Moved hardcoded values to config file
This commit is contained in:
@@ -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]);
|
||||
|
||||
@@ -68,7 +68,7 @@ document.addEventListener('DOMContentLoaded', () => {
|
||||
});
|
||||
|
||||
await checkAdmin();
|
||||
setInterval(checkAdmin, 30000);
|
||||
setInterval(checkAdmin, CONFIG.index_admin_status_update_interval);
|
||||
})();
|
||||
|
||||
// --- Page loader ---
|
||||
|
||||
@@ -60,9 +60,9 @@ document.addEventListener('page-loaded', e => {
|
||||
}
|
||||
|
||||
// Color thresholds
|
||||
if (numVal >= 85) {
|
||||
if (numVal >= CONFIG.home_chart_color_threshold_high) {
|
||||
elements[key].className = 'high';
|
||||
} else if (numVal >= 75) {
|
||||
} else if (numVal >= CONFIG.home_chart_color_threshold_medium) {
|
||||
elements[key].className = 'medium';
|
||||
} else {
|
||||
elements[key].className = 'low';
|
||||
|
||||
Reference in New Issue
Block a user