addMessage('Language setting saved', 'success'); } } if (!RASPI_MONITOR_ENABLED) { if (isset($_POST['SaveServerSettings'])) { $good_input = true; // Validate server port if (isset($_POST['serverPort'])) { if (strlen($_POST['serverPort']) > 4 || !is_numeric($_POST['serverPort'])) { $status->addMessage('Invalid value for port number', 'danger'); $good_input = false; } else { $serverPort = escapeshellarg($_POST['serverPort']); } } // Validate server bind address $serverBind = escapeshellarg(''); if ($_POST['serverBind'] && $_POST['serverBind'] !== null ) { if (!filter_var($_POST['serverBind'], FILTER_VALIDATE_IP)) { $status->addMessage('Invalid value for bind address', 'danger'); $good_input = false; } else { $serverBind = escapeshellarg($_POST['serverBind']); } } // Validate log limit if (isset($_POST['logLimit'])) { if ( strlen($_POST['logLimit']) > 4 || !is_numeric($_POST['logLimit']) ) { $status->addMessage('Invalid value for log size limit', 'danger'); $good_input = false; } else { $_SESSION['log_limit'] = intval($_POST['logLimit']); $status->addMessage(sprintf(_('Changing log limit size to %s KB'), $_SESSION['log_limit']), 'info'); } } // Save settings if ($good_input) { exec("sudo /etc/raspap/lighttpd/configport.sh $serverPort $serverBind " .RASPI_LIGHTTPD_CONFIG. " ".$_SERVER['SERVER_NAME'], $return); foreach ($return as $line) { $status->addMessage($line, 'info'); } } } } if (isset($_POST['RestartLighttpd'])) { $status->addMessage('Restarting lighttpd in 3 seconds...', 'info'); exec('sudo /etc/raspap/lighttpd/configport.sh --restart'); } exec('cat '. RASPI_LIGHTTPD_CONFIG, $return); $conf = ParseConfig($return); $serverPort = $conf['server.port']; if (isset($conf['server.bind'])) { $serverBind = str_replace('"', '',$conf['server.bind']); } else { $serverBind = ''; } // define locales $arrLocales = getLocales(); // fetch system status variables $system = new \RaspAP\System\Sysinfo; $hostname = $system->hostname(); $uptime = $system->uptime(); $cores = $system->processorCount(); $os = $system->operatingSystem(); $kernel = $system->kernelVersion(); $systime = $system->systime(); $revision = $system->rpiRevision(); // memory use $memused = $system->usedMemory(); $memStatus = getMemStatus($memused); $memused_status = $memStatus['status']; $memused_led = $memStatus['led']; // cpu load $cpuload = $system->systemLoadPercentage(); $cpuload_status = getCPULoadStatus($cpuload); // cpu temp $cputemp = $system->systemTemperature(); $cpuStatus = getCPUTempStatus($cputemp); $cputemp_status = $cpuStatus['status']; $cputemp_led = $cpuStatus['led']; // theme options $themes = [ "default" => "RaspAP (default)", "hackernews" => "HackerNews", ]; $themeFiles = [ "default" => "custom.php", "hackernews" => "hackernews.css", ]; $selectedTheme = array_search($_COOKIE['theme'], $themeFiles); $extraFooterScripts[] = array('src'=>'dist/huebee/huebee.pkgd.min.js', 'defer'=>false); $extraFooterScripts[] = array('src'=>'app/js/huebee.js', 'defer'=>false); $logLimit = isset($_SESSION['log_limit']) ? $_SESSION['log_limit'] : RASPI_LOG_SIZE_LIMIT; try { $plugins = callbackTimeout(fn() => $pluginInstaller->getUserPlugins(), 3000); $pluginsTable = $pluginInstaller->getHTMLPluginsTable($plugins); } catch (\Exception $e) { $errResponse = sprintf( '