File manager - Edit - /home/newsbmcs.com/public_html/static/img/logo/ows.tar
Back
Product.php 0000644 00000003677 15030354277 0006720 0 ustar 00 <?php class Product { const PROD_NAME = 'OpenLiteSpeed'; private $version; private $new_version; private function __construct() { $matches = []; $str = $_SERVER['LSWS_EDITION']; if (preg_match('/(\d.*)$/i', $str, $matches)) { $this->version = trim($matches[1]); } $releasefile = SERVER_ROOT . 'autoupdate/release'; $releasefilecb = $releasefile . 'cb'; $newver = ''; $rel0 = $rel1 = ''; if (file_exists($releasefilecb)) { $rel = trim(file_get_contents($releasefilecb)); if (($pos = strpos($rel, ' ')) !== false) { $rel0 = substr($rel, 0, $pos); } else { $rel0 = $rel; } if ($this->version != $rel0) { $newver = $rel . ' (' . DMsg::UIStr('note_curbranch') . ') '; // will carry over extra string if it's in release } } if (file_exists($releasefile)) { $rel = trim(file_get_contents($releasefile)); if (($pos = strpos($rel, ' ')) !== false) { $rel1 = substr($rel, 0, $pos); } else { $rel1 = $rel; } if ($this->version != $rel1 && $rel0 != $rel1) { $newver .= $rel; // will carry over extra string if it's in release } } $this->new_version = $newver; } public static function GetInstance() { if (!isset($GLOBALS['_PRODUCT_'])) $GLOBALS['_PRODUCT_'] = new Product(); return $GLOBALS['_PRODUCT_']; } public function getVersion() { return $this->version; } public function refreshVersion() { $versionfile = SERVER_ROOT . 'VERSION'; $this->version = trim(file_get_contents($versionfile)); } public function getNewVersion() { return $this->new_version; } } RealTimeStats.php 0000644 00000026315 15030354277 0010013 0 ustar 00 <?php class RealTimeStats { const FLD_BPS_IN = 0; const FLD_BPS_OUT = 1; const FLD_SSL_BPS_IN = 2; const FLD_SSL_BPS_OUT = 3; const FLD_PLAINCONN = 4; const FLD_IDLECONN = 5; const FLD_SSLCONN = 6; const FLD_S_REQ_PROCESSING = 7; const FLD_S_REQ_PER_SEC = 8; const FLD_UPTIME = 9; const FLD_MAXCONN = 10; const FLD_MAXSSL_CONN = 11; const FLD_AVAILCONN = 12; const FLD_AVAILSSL = 13; const FLD_BLOCKEDIP_COUNT = 14; const FLD_S_TOT_REQS = 15; const COUNT_FLD_SERVER = 16; const FLD_BLOCKEDIP = 16; //const FLD_VH_NAME = 0; const FLD_VH_EAP_INUSE = 0; const FLD_VH_EAP_WAITQUE = 1; const FLD_VH_EAP_IDLE = 2; const FLD_VH_EAP_REQ_PER_SEC = 3; const FLD_VH_REQ_PROCESSING = 4; const FLD_VH_REQ_PER_SEC = 5; const FLD_VH_TOT_REQS = 6; const FLD_VH_EAP_COUNT = 7; const COUNT_FLD_VH = 8; const FLD_EA_CMAXCONN = 0; const FLD_EA_EMAXCONN = 1; const FLD_EA_POOL_SIZE = 2; const FLD_EA_INUSE_CONN = 3; const FLD_EA_IDLE_CONN = 4; const FLD_EA_WAITQUE_DEPTH = 5; const FLD_EA_REQ_PER_SEC = 6; const FLD_EA_TOT_REQS = 7; const FLD_EA_TYPE = 8; const COUNT_FLD_EA = 9; private $_serv; private $_vhosts; private $_rawdata; private function __construct() { $this->_rawdata = ''; $processes = $_SERVER['LSWS_CHILDREN']; $statsDir = isset($_SERVER['LSWS_STATDIR']) ? $_SERVER['LSWS_STATDIR'] : '/tmp/lshttpd'; $rtrpt = rtrim($statsDir, '/') . '/.rtreport'; for ($i = 1; $i <= $processes; $i ++) { if ($i > 1) $this->_rawdata .= "\n" . file_get_contents("{$rtrpt}.{$i}"); else { $this->_rawdata = file_get_contents($rtrpt); if ($this->_rawdata == false) break; // fail to open, may due to restart, ignore } } } public static function GetDashPlot() { $stat = new RealTimeStats(); $stat->parse_server(); return $stat->_serv; } public static function GetPlotStats() { $stat = new RealTimeStats(); $stat->parse_server(); $stat->parse_plotvh(); $stat->_rawdata = ''; return $stat; } public static function GetVHStats() { $stat = new RealTimeStats(); $stat->parse_vhosts(); $stat->_rawdata = ''; return $stat; } public function GetServerData() { return $this->_serv; } public function GetVHData() { return $this->_vhosts; } private function parse_server() { $this->_serv = array_fill(0, self::COUNT_FLD_SERVER, 0); //error_log("rawdata = " . $this->_rawdata); $m = []; if ($found = preg_match_all("/^UPTIME: ([0-9A-Za-z\ \:]+)\nBPS_IN:([0-9\ ]+), BPS_OUT:([0-9\ ]+), SSL_BPS_IN:([0-9\ ]+), SSL_BPS_OUT:([0-9\ ]+)\nMAXCONN:([0-9\ ]+), MAXSSL_CONN:([0-9\ ]+), PLAINCONN:([0-9\ ]+), AVAILCONN:([0-9\ ]+), IDLECONN:([0-9\ ]+), SSLCONN:([0-9\ ]+), AVAILSSL:([0-9\ ]+)/m", $this->_rawdata, $m)) { for ($f = 0; $f < $found; $f ++) { $this->_serv[self::FLD_UPTIME] = trim($m[1][$f]); $this->_serv[self::FLD_BPS_IN] += (int) $m[2][$f]; $this->_serv[self::FLD_BPS_OUT] += (int) $m[3][$f]; $this->_serv[self::FLD_SSL_BPS_IN] += (int) $m[4][$f]; $this->_serv[self::FLD_SSL_BPS_OUT] += (int) $m[5][$f]; $this->_serv[self::FLD_MAXCONN] += (int) $m[6][$f]; $this->_serv[self::FLD_MAXSSL_CONN] += (int) $m[7][$f]; $this->_serv[self::FLD_PLAINCONN] += (int) $m[8][$f]; $this->_serv[self::FLD_AVAILCONN] += (int) $m[9][$f]; $this->_serv[self::FLD_IDLECONN] += (int) $m[10][$f]; $this->_serv[self::FLD_SSLCONN] += (int) $m[11][$f]; $this->_serv[self::FLD_AVAILSSL] += (int) $m[12][$f]; } } $m = []; if ($found = preg_match_all("/^BLOCKED_IP: ([0-9 \[\]\.,;:A-Za-f]*)/m", $this->_rawdata, $m)) { $blockedips = []; for ($f = 0; $f < $found; $f ++) { $ips = trim($m[1][$f]); if ($ips != "") { $iplist = preg_split("/[\s,]+/", $ips, -1, PREG_SPLIT_NO_EMPTY); $blockedips = array_merge($blockedips, $iplist); } } //$this->_serv[self::FLD_BLOCKEDIP] = $blockedips; $this->_serv[self::FLD_BLOCKEDIP_COUNT] = count($blockedips); } $m = []; if ($found = preg_match_all("/^REQ_RATE \[\]: REQ_PROCESSING: ([0-9]+), REQ_PER_SEC: ([0-9\.]+), TOT_REQS: ([0-9]+)/m", $this->_rawdata, $m)) { for ($f = 0; $f < $found; $f ++) { $this->_serv[self::FLD_S_REQ_PROCESSING] += (int) $m[1][$f]; $this->_serv[self::FLD_S_REQ_PER_SEC] += doubleval($m[2][$f]); $this->_serv[self::FLD_S_TOT_REQS] += doubleval($m[3][$f]); } } } private function parse_plotvh() { $this->_vhosts = []; $vhmonitored = null; if (isset($_REQUEST['vhnames']) && is_array($_REQUEST['vhnames'])) $vhmonitored = $_REQUEST['vhnames']; else return; $vhosts = []; $m = []; $found = preg_match_all("/REQ_RATE \[(.+)\]: REQ_PROCESSING: ([0-9]+), REQ_PER_SEC: ([0-9\.]+), TOT_REQS: ([0-9]+)/i", $this->_rawdata, $m); //$found = preg_match_all("/REQ_RATE \[(.+)\]: REQ_PROCESSING: ([0-9]+), REQ_PER_SEC: ([0-9\.]+), TOT_REQS: ([0-9]+), CACHE_HITS_PER_SEC: ([0-9\.]+), TOTAL_CACHE_HITS: ([0-9]+)/i", $this->_rawdata, $m); for ($f = 0; $f < $found; $f ++) { $vhname = trim($m[1][$f]); if ($vhmonitored != null && !in_array($vhname, $vhmonitored)) continue; if (!isset($vhosts[$vhname])) { $vhosts[$vhname] = array_fill(0, self::COUNT_FLD_VH, 0); $vhosts[$vhname]['ea'] = []; } $vh = &$vhosts[$vhname]; $vh[self::FLD_VH_REQ_PROCESSING] += (int) $m[2][$f]; $vh[self::FLD_VH_REQ_PER_SEC] += doubleval($m[3][$f]); $vh[self::FLD_VH_TOT_REQS] += doubleval($m[4][$f]); } //reset $m = []; $found = preg_match_all("/EXTAPP \[(.+)\] \[(.+)\] \[(.+)\]: CMAXCONN: ([0-9]+), EMAXCONN: ([0-9]+), POOL_SIZE: ([0-9]+), INUSE_CONN: ([0-9]+), IDLE_CONN: ([0-9]+), WAITQUE_DEPTH: ([0-9]+), REQ_PER_SEC: ([0-9\.]+), TOT_REQS: ([0-9]+)/i", $this->_rawdata, $m); for ($f = 0; $f < $found; $f ++) { $vhname = trim($m[2][$f]); $extapp = trim($m[3][$f]); if ($vhname == '') { $vhname = '_Server'; if (!isset($vhosts[$vhname])) { $vhosts[$vhname] = array_fill(0, self::COUNT_FLD_VH, 0); $vhosts[$vhname]['ea'] = []; } } else { if (!isset($vhosts[$vhname])) continue; } if (!isset($vhosts[$vhname]['ea'][$extapp])) { $vhosts[$vhname][self::FLD_VH_EAP_COUNT] ++; $vhosts[$vhname]['ea'][$extapp] = 1; } $vhosts[$vhname][self::FLD_VH_EAP_INUSE] += (int) $m[7][$f]; $vhosts[$vhname][self::FLD_VH_EAP_IDLE] += (int) $m[8][$f]; $vhosts[$vhname][self::FLD_VH_EAP_WAITQUE] += (int) $m[9][$f]; $vhosts[$vhname][self::FLD_VH_EAP_REQ_PER_SEC] += doubleval($m[10][$f]); } $this->_vhosts = $vhosts; } private function parse_vhosts() { $this->_vhosts = []; $top = UIBase::GrabGoodInput("request", "vh_topn", 'int'); $filter = UIBase::GrabGoodInput("request", "vh_filter", "string"); $sort = UIBase::GrabGoodInput("request", "vh_sort", "int"); $vhosts = []; $m = []; $found = preg_match_all("/REQ_RATE \[(.+)\]: REQ_PROCESSING: ([0-9]+), REQ_PER_SEC: ([0-9\.]+), TOT_REQS: ([0-9]+)/i", $this->_rawdata, $m); for ($f = 0; $f < $found; $f ++) { $vhname = trim($m[1][$f]); if ($filter != "" && (!preg_match("/$filter/i", $vhname))) continue; if (!isset($vhosts[$vhname])) { $vhosts[$vhname] = array_fill(0, 10, 0); $vhosts[$vhname]['ea'] = []; } $vh = &$vhosts[$vhname]; $vh[self::FLD_VH_REQ_PROCESSING] += (int) $m[2][$f]; $vh[self::FLD_VH_REQ_PER_SEC] += doubleval($m[3][$f]); $vh[self::FLD_VH_TOT_REQS] += doubleval($m[4][$f]); } //reset $m = []; $found = preg_match_all("/EXTAPP \[(.+)\] \[(.+)\] \[(.+)\]: CMAXCONN: ([0-9]+), EMAXCONN: ([0-9]+), POOL_SIZE: ([0-9]+), INUSE_CONN: ([0-9]+), IDLE_CONN: ([0-9]+), WAITQUE_DEPTH: ([0-9]+), REQ_PER_SEC: ([0-9\.]+), TOT_REQS: ([0-9]+)/i", $this->_rawdata, $m); for ($f = 0; $f < $found; $f ++) { $vhname = trim($m[2][$f]); $extapp = trim($m[3][$f]); if ($vhname == '') { $vhname = '_Server'; if (!isset($vhosts[$vhname])) { $vhosts[$vhname] = array_fill(0, 10, 0); $vhosts[$vhname]['ea'] = []; } } else { if (!isset($vhosts[$vhname])) continue; } if (!isset($vhosts[$vhname]['ea'][$extapp])) { $vhosts[$vhname][self::FLD_VH_EAP_COUNT] ++; $vhosts[$vhname]['ea'][$extapp] = array_fill(0, 8, 0); } $ea = &$vhosts[$vhname]['ea'][$extapp]; $ea[self::FLD_EA_TYPE] = trim($m[1][$f]); $ea[self::FLD_EA_CMAXCONN] += (int) $m[4][$f]; $ea[self::FLD_EA_EMAXCONN] += (int) $m[5][$f]; $ea[self::FLD_EA_POOL_SIZE] += (int) $m[6][$f]; $ea[self::FLD_EA_INUSE_CONN] += (int) $m[7][$f]; $ea[self::FLD_EA_IDLE_CONN] += (int) $m[8][$f]; $ea[self::FLD_EA_WAITQUE_DEPTH] += (int) $m[9][$f]; $ea[self::FLD_EA_REQ_PER_SEC] += doubleval($m[10][$f]); $ea[self::FLD_EA_TOT_REQS] += doubleval($m[11][$f]); $vhosts[$vhname][self::FLD_VH_EAP_INUSE] += (int) $m[7][$f]; $vhosts[$vhname][self::FLD_VH_EAP_IDLE] += (int) $m[8][$f]; $vhosts[$vhname][self::FLD_VH_EAP_WAITQUE] += (int) $m[9][$f]; $vhosts[$vhname][self::FLD_VH_EAP_REQ_PER_SEC] += doubleval($m[10][$f]); } $sortDesc1 = []; $sortAsc2 = []; $names = array_keys($vhosts); if ($sort != "" && count($names) > 1) { foreach ($names as $vhname) { if ($vhosts[$vhname][$sort] > 0) { $sortDesc1[] = $vhosts[$vhname][$sort]; $sortAsc2[] = $vhname; } } if (count($sortAsc2) > 0) { array_multisort($sortDesc1, SORT_DESC, SORT_NUMERIC, $sortAsc2, SORT_ASC, SORT_STRING); $names = $sortAsc2; } } if ($top != 0 && count($names) > $top) { $names = array_slice($names, 0, $top); } foreach ($names as $vn) { $this->_vhosts[$vn] = $vhosts[$vn]; } } } UI.php 0000644 00000000254 15030354277 0005601 0 ustar 00 <?php class UI extends UIBase { public static function PrintConfPage($disp, $page) { $ui = new UI(); $ui->print_conf_page($disp, $page); } } ConfValidation.php 0000644 00000002755 15030354277 0010174 0 ustar 00 <?php class ConfValidation extends CValidation { // to hold special validation protected function isValidAttr($attr, $cval) { $isValid = parent::isValidAttr($attr, $cval); if ($isValid == 1 && $attr->_type == 'modulename') { $res = $this->chkAttr_modulename($attr, $cval); $this->setValid($isValid, $res); } return $isValid; } protected function chkAttr_modulename($attr, $cval) { $name = $cval->Get(CNode::FLD_VAL); if ( preg_match( "/[<>&%\s]/", $name) ) { $cval->SetErr('invalid characters in name'); return -1; } else return 1; } protected function validatePostTbl($tbl, $extracted) { if ($tbl->Get(DTbl::FLD_ID) == 'S_MOD') { $isValid = $this->chkPostTbl_SERV_MODULE($extracted); } else { $isValid = parent::validatePostTbl($tbl, $extracted); } return $isValid; } protected function chkPostTbl_SERV_MODULE($extracted) { $isValid = 1; $name = $extracted->GetChildVal('name'); if ($extracted->GetChildVal('internal') == 0) { if ($name != 'cache') { $module = SERVER_ROOT . "modules/{$name}.so"; if (!file_exists($module)) { $extracted->SetChildErr('name', "cannot find external module: $module"); $isValid = -1; } } else { $extracted->SetChildErr('internal', 'This is a built-in internal module'); $isValid = -1; } } return $isValid; } } DPageDef.php 0000644 00000046316 15030354277 0006674 0 ustar 00 <?php class DPageDef { protected $_pageDef = []; protected $_fileDef = []; protected function __construct() { $this->defineAll(); } public static function GetInstance() { if ( !isset($GLOBALS['_DPageDef_']) ) { $GLOBALS['_DPageDef_'] = new DPageDef(); } return $GLOBALS['_DPageDef_']; } public static function GetPage($dinfo) { $pagedef = DPageDef::GetInstance(); $type = $dinfo->Get(DInfo::FLD_View); $pid = $dinfo->Get(DInfo::FLD_PID); return $pagedef->_pageDef[$type][$pid]; } public function GetFileMap($type) { if ( !isset($this->_fileDef[$type]) ) { $funcname = 'add_FileMap_' . $type; if (!method_exists($this, $funcname)) { die("invalid func name $funcname"); } $this->$funcname(); } return $this->_fileDef[$type]; } private function add_FileMap_serv() { $map = new DTblMap(['httpServerConfig', '' ], ['S_PROCESS', 'S_GENERAL', new DTblMap(['logging:log', 'errorlog$fileName' ], 'S_LOG'), new DTblMap(['logging:*accessLog', '*accesslog$fileName' ], 'S_ACLOG'), 'S_INDEX', new DTblMap('expires', 'A_EXPIRES'), 'S_AUTOLOADHTA', 'S_FILEUPLOAD', new DTblMap(['ipToGeo:geoipDB', '*geoipdb$geoipDBFile' ], 'S_GEOIP'), new DTblMap('ip2locDB', 'S_IP2LOCATION'), new DTblMap('tuning', ['S_TUNING_OS', 'S_TUNING_CONN', 'S_TUNING_REQ', 'S_TUNING_STATIC', 'S_TUNING_GZIP', 'S_TUNING_SSL', 'S_TUNING_QUIC' ]), new DTblMap(['security:fileAccessControl', 'fileAccessControl' ], 'S_SEC_FILE'), new DTblMap(['security:perClientConnLimit', 'perClientConnLimit' ], 'S_SEC_CONN'), new DTblMap(['security:CGIRLimit', 'CGIRLimit' ], 'S_SEC_CGI'), new DTblMap(['security', ''], 'S_SEC_BUBBLEWRAP'), new DTblMap(['security:accessDenyDir', 'accessDenyDir' ], 'S_SEC_DENY'), new DTblMap(['security:accessControl', 'accessControl' ], 'A_SEC_AC'), new DTblMap('lsrecaptcha', 'S_SEC_RECAP'), new DTblMap(['extProcessorList:*extProcessor', '*extprocessor$name' ], 'A_EXT_SEL'), new DTblMap(['scriptHandlerList', 'scripthandler' ], new DTblMap(['*scriptHandler', '*addsuffix$suffix' ], 'A_SCRIPT')), new DTblMap('railsDefaults', 'S_RAILS'), new DTblMap('wsgiDefaults', 'S_WSGI'), new DTblMap('nodeDefaults', 'S_NODEJS'), new DTblMap(['moduleList:*module', '*module$name' ], 'S_MOD'), new DTblMap(['virtualHostList:*virtualHost', '*virtualhost$name' ], 'V_TOPD'), new DTblMap(['listenerList:*listener', '*listener$name' ], ['L_GENERAL', new DTblMap(['vhostMapList:*vhostMap', '*vhmap$vhost' ], 'L_VHMAP'), 'LVT_SSL_CERT', 'L_SSL', 'L_SSL_FEATURE', 'LVT_SSL_OCSP', 'LVT_SSL_CLVERIFY', new DTblMap(['moduleList:*module', '*module$name' ], 'L_MOD') ]), new DTblMap(['vhTemplateList:*vhTemplate', '*vhTemplate$name' ], ['T_TOPD', new DTblMap(['*member', '*member$vhName' ], 'T_MEMBER') ]), 'SERVICE_SUSPENDVH' ]) ; $this->_fileDef['serv'] = $map; } private function add_FileMap_vh_() { $map = new DTblMap(['virtualHostConfig', ''], [ 'V_GENERAL', new DTblMap(['logging:log','errorlog$fileName'], 'V_LOG'), new DTblMap(['logging:*accessLog','*accesslog$fileName'], 'V_ACLOG'), new DTblMap('index', 'VT_INDXF'), new DTblMap(['customErrorPages:errorPage', '*errorpage$errCode'], 'VT_ERRPG'), new DTblMap(['scriptHandlerList','scripthandler'], new DTblMap(['*scriptHandler','*addsuffix$suffix'], 'A_SCRIPT')), new DTblMap('expires', 'A_EXPIRES'), 'VT_FILEUPLOAD', new DTblMap('phpIniOverride','VT_PHPINIOVERRIDE'), new DTblMap(['security:accessControl','accessControl'], 'A_SEC_AC'), new DTblMap(['security:realmList:*realm','*realm$name'], 'V_REALM_FILE'), new DTblMap('lsrecaptcha', 'VT_SEC_RECAP'), new DTblMap(['security',''], 'VT_SEC_BUBBLEWRAP'), new DTblMap(['extProcessorList:*extProcessor','*extprocessor$name'], 'A_EXT_SEL'), new DTblMap(['contextList:*context', '*context$uri'], 'VT_CTX_SEL'), new DTblMap('rewrite', ['VT_REWRITE_CTRL', new DTblMap(['*map', '*map$name'], 'VT_REWRITE_MAP'), 'VT_REWRITE_RULE']), new DTblMap('vhssl', ['LVT_SSL_CERT', 'VT_SSL', 'VT_SSL_FEATURE', 'LVT_SSL_OCSP', 'LVT_SSL_CLVERIFY']), new DTblMap(['websocketList:*websocket', '*websocket$uri'], 'VT_WBSOCK'), new DTblMap(['moduleList:*module','*module$name'], ['VT_MOD', new DTblMap(['urlFilterList:*urlFilter', '*urlFilter$uri'], 'VT_MOD_FILTER')]) ]); $this->_fileDef['vh_'] = $map; } private function add_FileMap_tp_() { $map = new DTblMap(['virtualHostTemplate', ''], [ 'T_GENERAL1', 'T_SEC_FILE', 'T_SEC_CONN', 'T_SEC_CGI', new DTblMap('virtualHostConfig', [ 'T_GENERAL2', new DTblMap(['logging:log','errorlog$fileName'], 'T_LOG'), new DTblMap(['logging:*accessLog','*accesslog$fileName'], 'T_ACLOG'), new DTblMap('index', 'VT_INDXF'), new DTblMap(['customErrorPages:errorPage', '*errorpage$errCode'], 'VT_ERRPG'), new DTblMap(['scriptHandlerList','scripthandler'], new DTblMap(['*scriptHandler','*addsuffix$suffix'], 'A_SCRIPT')), 'VT_FILEUPLOAD', new DTblMap('phpIniOverride','VT_PHPINIOVERRIDE'), new DTblMap('expires', 'A_EXPIRES'), new DTblMap(['security:accessControl','accessControl'], 'A_SEC_AC'), new DTblMap(['security:realmList:*realm','*realm$name'], 'T_REALM_FILE'), new DTblMap('lsrecaptcha', 'VT_SEC_RECAP'), new DTblMap(['security', ''], 'VT_SEC_BUBBLEWRAP'), new DTblMap(['extProcessorList:*extProcessor','*extprocessor$name'], 'T_EXT_SEL'), new DTblMap(['contextList:*context', '*context$uri'], 'VT_CTX_SEL'), new DTblMap('rewrite', ['VT_REWRITE_CTRL', new DTblMap(['*map', '*map$name'], 'VT_REWRITE_MAP'), 'VT_REWRITE_RULE']), new DTblMap('vhssl', ['LVT_SSL_CERT', 'VT_SSL', 'VT_SSL_FEATURE', 'LVT_SSL_OCSP', 'LVT_SSL_CLVERIFY']), new DTblMap(['websocketList:*websocket', '*websocket$uri'], 'VT_WBSOCK'), new DTblMap(['moduleList:*module','*module$name'], ['VT_MOD', new DTblMap(['urlFilterList:*urlFilter', '*urlFilter$uri'], 'VT_MOD_FILTER')]) ] ), ]); $this->_fileDef['tp_'] = $map; } private function add_FileMap_admin() { $map = new DTblMap(['adminConfig', ''], ['ADM_PHP', new DTblMap(['logging:log','errorlog$fileName'], 'V_LOG'), new DTblMap(['logging:accessLog','accesslog$fileName'], 'ADM_ACLOG'), new DTblMap(['security:accessControl','accessControl'], 'A_SEC_AC'), new DTblMap(['listenerList:*listener','*listener$name'], ['ADM_L_GENERAL', 'LVT_SSL_CERT', 'L_SSL', 'L_SSL_FEATURE', 'LVT_SSL_CLVERIFY']) ]); $this->_fileDef['admin'] = $map; } public function GetTabDef($view) { if(!isset($this->_pageDef[$view])) die("Invalid tabs $view"); $tabs = []; foreach ($this->_pageDef[$view] as $p) { $tabs[$p->GetID()] = $p->GetLabel(); } return $tabs; } protected function defineAll() { $id = 'g'; $page = new DPage($id, DMsg::UIStr('tab_g'), new DTblMap('', ['S_PROCESS', 'S_GENERAL', 'S_INDEX', new DTblMap('expires', 'A_EXPIRES'), 'S_AUTOLOADHTA','S_FILEUPLOAD', new DTblMap('*geoipdb$geoipDBFile', 'S_GEOIP_TOP', 'S_GEOIP'), new DTblMap('ip2locDB', 'S_IP2LOCATION'), ], new DTblMap('*index', ['S_MIME_TOP', 'S_MIME']))); $this->_pageDef['serv'][$id] = $page; $id = 'log'; $page = new DPage($id, DMsg::UIStr('tab_log'), new DTblMap('', [ new DTblMap('errorlog$fileName', 'S_LOG'), new DTblMap('*accesslog$fileName', 'S_ACLOG_TOP', 'S_ACLOG'), ] )); $this->_pageDef['serv'][$id] = $page; $id = 'tuning'; $page = new DPage($id, DMsg::UIStr('tab_tuning'), new DTblMap('tuning', ['S_TUNING_OS', 'S_TUNING_CONN', 'S_TUNING_REQ', 'S_TUNING_STATIC', 'S_TUNING_GZIP', 'S_TUNING_SSL', 'S_TUNING_QUIC'])); $this->_pageDef['serv'][$id] = $page; $id = 'sec'; $page = new DPage($id, DMsg::UIStr('tab_sec'), new DTblMap('', [new DTblMap('fileAccessControl', 'S_SEC_FILE'), new DTblMap('perClientConnLimit', 'S_SEC_CONN'), new DTblMap('CGIRLimit', 'S_SEC_CGI'), new DTblMap('lsrecaptcha', 'S_SEC_RECAP'), 'S_SEC_BUBBLEWRAP', new DTblMap('accessDenyDir', 'S_SEC_DENY'), new DTblMap('accessControl', 'A_SEC_AC')])); $this->_pageDef['serv'][$id] = $page; $id = 'ext'; $page = new DPage($id, DMsg::UIStr('tab_ext'), new DTblMap('*extprocessor$name', 'A_EXT_TOP', ['A_EXT_SEL', 'A_EXT_FCGI', 'A_EXT_FCGIAUTH', 'A_EXT_LSAPI', 'A_EXT_SERVLET', 'A_EXT_PROXY', 'A_EXT_LOGGER', 'A_EXT_LOADBALANCER'])); $this->_pageDef['serv'][$id] = $page; $id = 'sh'; $page = new DPage($id, DMsg::UIStr('tab_sh'), new DTblMap('scripthandler:*addsuffix$suffix', 'A_SCRIPT_TOP', 'A_SCRIPT')); $this->_pageDef['serv'][$id] = $page; $id = 'appserver'; $page = new DPage($id, DMsg::UIStr('tab_rails'), new DTblMap('', [new DTblMap('railsDefaults', 'S_RAILS'), new DTblMap('wsgiDefaults', 'S_WSGI'), new DTblMap('nodeDefaults', 'S_NODEJS')])); $this->_pageDef['serv'][$id] = $page; $id = 'mod'; $page = new DPage($id, DMsg::UIStr('tab_mod'), new DTblMap('*module$name', 'S_MOD_TOP', 'S_MOD')); $this->_pageDef['serv'][$id] = $page; $id = 'top'; $page = new DPage($id, DMsg::UIStr('tab_top'), new DTblMap('*listener$name', 'L_TOP', 'L_GENERAL')); $this->_pageDef['sl'][$id] = $page; $id = 'lg'; $page = new DPage($id, DMsg::UIStr('tab_g'), new DTblMap('*listener$name', ['L_GENERAL', new DTblMap('*vhmap$vhost', 'L_VHMAP_TOP', 'L_VHMAP')])); $this->_pageDef['sl_'][$id] = $page; $id = 'lsec'; $page = new DPage($id, DMsg::UIStr('tab_ssl'), new DTblMap('*listener$name', ['LVT_SSL_CERT', 'L_SSL', 'L_SSL_FEATURE', 'LVT_SSL_OCSP', 'LVT_SSL_CLVERIFY'])); $this->_pageDef['sl_'][$id] = $page; $id = 'lmod'; $page = new DPage($id, DMsg::UIStr('tab_mod'), new DTblMap('*listener$name', new DTblMap('*module$name', 'L_MOD_TOP', 'L_MOD'))); $this->_pageDef['sl_'][$id] = $page; $id = 'top'; $page = new DPage($id, DMsg::UIStr('tab_top'), new DTblMap('*virtualhost$name', 'V_TOP', 'V_TOPD')); $this->_pageDef['vh'][$id] = $page; //$id = 'top'; $page = new DPage($id, DMsg::UIStr('tab_top'), new DTblMap('*vhTemplate$name', 'T_TOP', 'T_TOPD')); $this->_pageDef['tp'][$id] = $page; $id = 'mbr'; $page = new DPage($id, DMsg::UIStr('tab_tp'), new DTblMap('*vhTemplate$name', ['T_TOPD', new DTblMap('*member$vhName', 'T_MEMBER_TOP', 'T_MEMBER')])); $this->_pageDef['tp_'][$id] = $page; $id = 'base'; $page = new DPage($id, DMsg::UIStr('tab_base'), new DTblMap('*virtualhost$name', ['V_BASE', 'V_BASE_CONN','V_BASE_SEC', 'V_BASE_THROTTLE'])); $this->_pageDef['vh_'][$id] = $page; $id = 'g'; $page = new DPage($id, DMsg::UIStr('tab_g'), new DTblMap('', [ 'V_GENERAL', new DTblMap('index', 'VT_INDXF'), new DTblMap('*errorpage$errCode', 'VT_ERRPG_TOP', 'VT_ERRPG'), new DTblMap('expires', 'A_EXPIRES'), 'VT_FILEUPLOAD', new DTblMap('phpIniOverride','VT_PHPINIOVERRIDE'), ])); $this->_pageDef['vh_'][$id] = $page; $page = new DPage($id, DMsg::UIStr('tab_g'), new DTblMap('', ['T_GENERAL1', new DTblMap('virtualHostConfig', [ 'T_GENERAL2', new DTblMap('index', 'VT_INDXF'), new DTblMap('*errorpage$errCode', 'VT_ERRPG_TOP', 'VT_ERRPG'), new DTblMap('scripthandler', new DTblMap(['*scriptHandler','*addsuffix$suffix'], 'A_SCRIPT')), new DTblMap('expires', 'A_EXPIRES'), 'VT_FILEUPLOAD', new DTblMap('phpIniOverride','VT_PHPINIOVERRIDE'), ])])); $this->_pageDef['tp_'][$id] = $page; $id = 'log'; $page = new DPage($id, DMsg::UIStr('tab_log'), new DTblMap( '', [ new DTblMap('errorlog$fileName', 'V_LOG'), new DTblMap('*accesslog$fileName', 'V_ACLOG_TOP', 'V_ACLOG'), ] )); $this->_pageDef['vh_'][$id] = $page; $page = new DPage($id, DMsg::UIStr('tab_log'), new DTblMap('virtualHostConfig', [new DTblMap('errorlog$fileName', 'T_LOG'), new DTblMap('*accesslog$fileName', 'T_ACLOG_TOP', 'T_ACLOG')])); $this->_pageDef['tp_'][$id] = $page; $id = 'sec'; $page = new DPage($id, DMsg::UIStr('tab_sec'), new DTblMap('', [ new DTblMap('lsrecaptcha', 'VT_SEC_RECAP'), 'VT_SEC_BUBBLEWRAP', new DTblMap('accessControl', 'A_SEC_AC'), new DTblMap('*realm$name', 'V_REALM_TOP', 'V_REALM_FILE')], new DTblMap('*index', ['V_UDB_TOP', 'V_UDB', 'V_GDB_TOP','V_GDB']))); $this->_pageDef['vh_'][$id] = $page; $page = new DPage($id, DMsg::UIStr('tab_sec'), new DTblMap('', ['T_SEC_FILE', 'T_SEC_CONN', 'T_SEC_CGI', new DTblMap('virtualHostConfig', [new DTblMap('lsrecaptcha', 'VT_SEC_RECAP'), 'VT_SEC_BUBBLEWRAP', new DTblMap('accessControl', 'A_SEC_AC'), new DTblMap('*realm$name', 'T_REALM_TOP', 'T_REALM_FILE')])])); $this->_pageDef['tp_'][$id] = $page; $id = 'ext'; $page = new DPage($id, DMsg::UIStr('tab_ext'), new DTblMap('*extprocessor$name', 'A_EXT_TOP', ['A_EXT_SEL', 'A_EXT_FCGI', 'A_EXT_FCGIAUTH', 'A_EXT_LSAPI', 'A_EXT_SERVLET', 'A_EXT_PROXY', 'A_EXT_LOGGER', 'A_EXT_LOADBALANCER'])); $this->_pageDef['vh_'][$id] = $page; $page = new DPage($id, DMsg::UIStr('tab_ext'), new DTblMap('virtualHostConfig:*extprocessor$name', 'T_EXT_TOP', ['T_EXT_SEL', 'T_EXT_FCGI', 'T_EXT_FCGIAUTH', 'T_EXT_LSAPI', 'T_EXT_SERVLET', 'T_EXT_PROXY', 'T_EXT_LOGGER', 'T_EXT_LOADBALANCER'])); $this->_pageDef['tp_'][$id] = $page; $id = 'sh'; $page = new DPage($id, DMsg::UIStr('tab_sh'), new DTblMap('scripthandler:*addsuffix$suffix', 'A_SCRIPT_TOP', 'A_SCRIPT')); $this->_pageDef['vh_'][$id] = $page; $page = new DPage($id, DMsg::UIStr('tab_sh'), new DTblMap('virtualHostConfig:scripthandler:*addsuffix$suffix', 'A_SCRIPT_TOP', 'A_SCRIPT')); $this->_pageDef['tp_'][$id] = $page; $id = 'rw' ; $page = new DPage($id, DMsg::UIStr('tab_rewrite'), new DTblMap('rewrite', ['VT_REWRITE_CTRL', new DTblMap('*map$name', 'VT_REWRITE_MAP_TOP', 'VT_REWRITE_MAP'), 'VT_REWRITE_RULE', ])); $this->_pageDef['vh_'][$id] = $page ; $page = new DPage($id, DMsg::UIStr('tab_rewrite'), new DTblMap('virtualHostConfig:rewrite', ['VT_REWRITE_CTRL', new DTblMap('*map$name', 'VT_REWRITE_MAP_TOP', 'VT_REWRITE_MAP'), 'VT_REWRITE_RULE', ])); $this->_pageDef['tp_'][$id] = $page ; $id = 'ctx'; $page = new DPage($id, DMsg::UIStr('tab_ctx'), new DTblMap('*context$uri', 'VT_CTX_TOP', ['VT_CTX_SEL', 'VT_CTXG', 'VT_CTXJ', 'VT_CTXS', 'VT_CTXF', 'VT_CTXL', 'VT_CTXP', 'VT_CTXC', 'VT_CTXB', 'VT_CTXR', 'VT_CTXAS', 'VT_CTXMD'])); $this->_pageDef['vh_'][$id] = $page; $page = new DPage($id, DMsg::UIStr('tab_ctx'), new DTblMap('virtualHostConfig:*context$uri', 'VT_CTX_TOP', ['VT_CTX_SEL', 'VT_CTXG', 'VT_CTXJ', 'VT_CTXS', 'VT_CTXF', 'VT_CTXL', 'VT_CTXP', 'VT_CTXC', 'VT_CTXB', 'VT_CTXR', 'VT_CTXAS'])); $this->_pageDef['tp_'][$id] = $page; $id = 'vhssl'; $page = new DPage($id, DMsg::UIStr('tab_ssl'), new DTblMap('vhssl', ['LVT_SSL_CERT', 'VT_SSL', 'VT_SSL_FEATURE', 'LVT_SSL_OCSP', 'LVT_SSL_CLVERIFY'])); $this->_pageDef['vh_'][$id] = $page; $page = new DPage($id, DMsg::UIStr('tab_ssl'), new DTblMap('virtualHostConfig:vhssl', ['LVT_SSL_CERT', 'VT_SSL', 'VT_SSL_FEATURE', 'LVT_SSL_OCSP', 'LVT_SSL_CLVERIFY'])); $this->_pageDef['tp_'][$id] = $page; $id = 'wsp'; $page = new DPage($id, DMsg::UIStr('tab_wsp'), new DTblMap('*websocket$uri', 'VT_WBSOCK_TOP', 'VT_WBSOCK')); $this->_pageDef['vh_'][$id] = $page; $page = new DPage($id, DMsg::UIStr('tab_wsp'), new DTblMap('virtualHostConfig:*websocket$uri', 'VT_WBSOCK_TOP', 'VT_WBSOCK')); $this->_pageDef['tp_'][$id] = $page; $id = 'mod' ; $page = new DPage($id, DMsg::UIStr('tab_mod'), new DTblMap('*module$name', ['VT_MOD_TOP', new DTblMap('*urlFilter$uri', NULL, ['VT_MOD_FILTERTOP', 'VT_MOD_FILTER' ]) ], 'VT_MOD')) ; $this->_pageDef['vh_'][$id] = $page ; $page = new DPage($id, DMsg::UIStr('tab_mod'), new DTblMap('virtualHostConfig:*module$name', ['VT_MOD_TOP', new DTblMap('*urlFilter$uri', NULL, ['VT_MOD_FILTERTOP', 'VT_MOD_FILTER' ]) ], 'VT_MOD')) ; $this->_pageDef['tp_'][$id] = $page ; $id = 'g' ; $page = new DPage($id, DMsg::UIStr('tab_g'), new DTblMap('', ['ADM_PHP', new DTblMap('errorlog$fileName', 'V_LOG'), new DTblMap('accesslog$fileName', 'ADM_ACLOG'), new DTblMap('accessControl', 'A_SEC_AC') ])) ; $this->_pageDef['admin'][$id] = $page ; $id = 'usr' ; $page = new DPage($id, DMsg::UIStr('tab_user'), new DTblMap('*index', 'ADM_USR_TOP', ['ADM_USR', 'ADM_USR_NEW' ])) ; $this->_pageDef['admin'][$id] = $page ; $id = 'top' ; $page = new DPage($id, DMsg::UIStr('tab_top'), new DTblMap('*listener$name', 'ADM_L_TOP', 'ADM_L_GENERAL')) ; $this->_pageDef['al'][$id] = $page ; $id = 'lg' ; $page = new DPage($id, DMsg::UIStr('tab_g'), new DTblMap('*listener$name', 'ADM_L_GENERAL')) ; $this->_pageDef['al_'][$id] = $page ; $id = 'lsec' ; $page = new DPage($id, DMsg::UIStr('tab_ssl'), new DTblMap('*listener$name', ['LVT_SSL_CERT', 'L_SSL', 'L_SSL_FEATURE', 'LVT_SSL_CLVERIFY' ])) ; $this->_pageDef['al_'][$id] = $page ; } } DAttr.php 0000644 00000000632 15030354277 0006302 0 ustar 00 <?php class DAttr extends DAttrBase { public $cyberpanelBlocked = false; public function blockedVersion() { if ($this->cyberpanelBlocked) { if (PathTool::IsCyberPanel()) { return 'Locked due to CyberPanel'; } } // no other block return false; } public function bypassSavePost() { return ($this->IsFlagOn(DAttr::BM_NOEDIT)); } } Service.php 0000644 00000000060 15030354277 0006657 0 ustar 00 <?php class Service extends ControllerBase { } DTblDef.php 0000644 00000070015 15030354277 0006532 0 ustar 00 <?php class DTblDef extends DTblDefBase { public static function getInstance() { if (!isset($GLOBALS['_DTblDef_'])) { $GLOBALS['_DTblDef_'] = new DTblDef(); } return $GLOBALS['_DTblDef_']; } private function __construct() { $this->loadCommonOptions(); $this->loadCommonAttrs(); $this->loadSpecials(); } protected function loadSpecials() { // define special block contains raw data parent::loadSpecials(); $this->addSpecial('phpIniOverride', [], 'data'); $this->addSpecial('rewrite', ['enable', 'autoLoadHtaccess', 'logLevel', 'map', 'inherit', 'base'], 'rules'); $this->addSpecial('virtualHostConfig:rewrite', ['enable', 'autoLoadHtaccess', 'logLevel', 'map', 'inherit', 'base'], 'rules'); // for template $tags = array_merge(['ls_enabled', 'note', 'internal', 'urlFilter'], $this->getModuleTags()); $this->addSpecial('module', $tags, 'param'); $this->addSpecial('urlFilter', ['ls_enabled'], 'param'); } protected function loadCommonOptions() { parent::loadCommonOptions(); $this->_options['scriptHandler'] = [ 'fcgi' => 'Fast CGI', 'servlet' => 'Servlet Engine', 'lsapi' => 'LiteSpeed SAPI', 'proxy' => 'Web Server', 'cgi' => 'CGI', 'loadbalancer' => 'Load Balancer', 'module' => 'Module Handler' ]; $this->_options['ctxType'] = [ 'null' => 'Static', 'webapp' => 'Java Web App', 'servlet' => 'Servlet', 'fcgi' => 'Fast CGI', 'lsapi' => 'LiteSpeed SAPI', 'proxy' => 'Proxy', 'cgi' => 'CGI', 'loadbalancer' => 'Load Balancer', 'redirect' => 'Redirect', 'appserver' => 'App Server', 'module' => 'Module Handler' ]; $this->_options['ctxTbl'] = [ 0 => 'type', 1 => 'VT_CTXG', 'null' => 'VT_CTXG', 'webapp' => 'VT_CTXJ', 'servlet' => 'VT_CTXS', 'fcgi' => 'VT_CTXF', 'lsapi' => 'VT_CTXL', 'proxy' => 'VT_CTXP', 'cgi' => 'VT_CTXC', 'loadbalancer' => 'VT_CTXB', 'redirect' => 'VT_CTXR', 'appserver' => 'VT_CTXAS', 'module' => 'VT_CTXMD' ]; $this->_options['realmType'] = ['file' => 'Password File']; } protected function loadCommonAttrs() { parent::loadCommonAttrs(); $param = self::NewTextAreaAttr('param', DMsg::ALbl('l_moduleparams'), 'cust', true, 4, 'modParams', 1, 1); $param->SetFlag(DAttr::BM_RAWDATA); $this->_attrs['mod_params'] = $param; $this->_attrs['mod_enabled'] = self::NewBoolAttr('ls_enabled', DMsg::ALbl('l_enablehooks'), true, 'moduleEnabled'); } protected function add_S_PROCESS($id) //keep { $attrs = [ self::NewTextAttr('serverName', DMsg::ALbl('l_servername'), 'name'), self::NewIntAttr('httpdWorkers', DMsg::ALbl('l_numworkers'), true, 1, 16), self::NewCustFlagAttr('runningAs', DMsg::ALbl('l_runningas'), (DAttr::BM_NOFILE | DAttr::BM_NOEDIT)), self::NewCustFlagAttr('user', null, (DAttr::BM_HIDE | DAttr::BM_NOEDIT), false), self::NewCustFlagAttr('group', null, (DAttr::BM_HIDE | DAttr::BM_NOEDIT), false), $this->_attrs['priority']->dup(null, null, 'serverPriority'), DTblDefBase::NewIntAttr('cpuAffinity', DMsg::ALbl('l_cpuaffinity'), true, 0, 64), DTblDefBase::NewSelAttr('enableLVE', DMsg::ALbl('l_enablelve'), [0 => DMsg::ALbl('o_disabled'), 1 => "LVE", 2 => "CageFS", 3 => DMsg::ALbl('o_cagefswithoutsuexec')]), self::NewIntAttr('inMemBufSize', DMsg::ALbl('l_inmembufsize'), false, 0), self::NewTextAttr('swappingDir', DMsg::ALbl('l_swappingdir'), 'cust', false), self::NewBoolAttr('autoFix503', DMsg::ALbl('l_autofix503')), self::NewBoolAttr('enableh2c', DMsg::ALbl('l_enableh2c')), self::NewIntAttr('gracefulRestartTimeout', DMsg::ALbl('l_gracefulrestarttimeout'), true, -1, 2592000), self::NewTextAttr('statDir', DMsg::ALbl('l_statDir'), 'cust'), self::NewBoolAttr('jsonReports', DMsg::ALbl('l_jsonreports')), ]; $this->_tblDef[$id] = DTbl::NewRegular($id, DMsg::ALbl('l_serverprocess'), $attrs); } protected function add_S_GENERAL($id) // keep { $attr_mime = self::NewPathAttr('mime', DMsg::ALbl('l_mimesettings'), 'file', 2, 'rw', false); $attr_mime->_href = '&t=S_MIME_TOP'; $attrs = [ $attr_mime, self::NewBoolAttr('disableInitLogRotation', DMsg::ALbl('l_disableinitlogrotation')), self::NewSelAttr('showVersionNumber', DMsg::ALbl('l_serversig'), [ '0' => DMsg::ALbl('o_hidever'), '1' => DMsg::ALbl('o_showver'), '2' => DMsg::ALbl('o_hidefullheader'), ], false), $this->_attrs['enableIpGeo'], self::NewSelAttr('useIpInProxyHeader', DMsg::ALbl('l_useipinproxyheader'), [ '0' => DMsg::ALbl('o_no'), '1' => DMsg::ALbl('o_yes'), '2' => DMsg::ALbl('o_trustediponly'), '3' => DMsg::ALbl('o_keepheaderfortrusted'), '4' => DMsg::ALbl('o_use_last_ip_for elb'), ]), $this->_attrs['adminEmails'], ]; $this->_tblDef[$id] = DTbl::NewRegular($id, DMsg::ALbl('l_generalsettings'), $attrs); } protected function add_S_AUTOLOADHTA($id) { $attrs = [ self::NewBoolAttr('autoLoadHtaccess', DMsg::ALbl('l_autoLoadRewriteHtaccess')), ]; $this->_tblDef[$id] = DTbl::NewRegular($id, DMsg::ALbl('l_rewritecontrol'), $attrs); } protected function add_VT_REWRITE_CTRL($id) { $attrs = [ self::NewBoolAttr('enable', DMsg::ALbl('l_enablerewrite'), true, 'enableRewrite'), self::NewBoolAttr('autoLoadHtaccess', DMsg::ALbl('l_autoLoadRewriteHtaccess')), self::NewIntAttr('logLevel', DMsg::ALbl('l_loglevel'), true, 0, 9, 'rewriteLogLevel') ]; $this->_tblDef[$id] = DTbl::NewRegular($id, DMsg::ALbl('l_rewritecontrol'), $attrs); } protected function add_VT_REWRITE_MAP_TOP($id) { $align = ['left', 'left', 'center']; $name = self::NewViewAttr('name', DMsg::ALbl('l_name')); $location = self::NewViewAttr('location', DMsg::ALbl('l_location')); $action = self::NewActionAttr('VT_REWRITE_MAP', 'Ed'); $name->cyberpanelBlocked = true; $location->cyberpanelBlocked = true; $action->cyberpanelBlocked = true; $label = DMsg::ALbl('l_rewritemap'); if (PathTool::IsCyberPanel()) { $label .= ' (Disabled by CyberPanel)'; } $attrs = [ $name, $location, $action ]; $this->_tblDef[$id] = DTbl::NewTop($id, $label, $attrs, 'name', 'VT_REWRITE_MAP', $align, null, 'redirect', true); } protected function add_VT_REWRITE_MAP($id) { $parseFormat = '/^((txt|rnd):\/*)|(int:(toupper|tolower|escape|unescape))$/'; $name = self::NewTextAttr('name', DMsg::ALbl('l_name'), 'name', false, 'rewriteMapName'); $location = self::NewParseTextAttr('location', DMsg::ALbl('l_location'), $parseFormat, DMsg::ALbl('parse_rewritemaplocation'), true, 'rewriteMapLocation'); $note = $this->_attrs['note']->dup(null, null, null); $name->cyberpanelBlocked = true; $location->cyberpanelBlocked = true; $note->cyberpanelBlocked = true; $attrs = [ $name, $location, $note, ]; $label = DMsg::ALbl('l_rewritemap'); if (PathTool::IsCyberPanel()) { $label .= ' (Disabled by CyberPanel)'; } $this->_tblDef[$id] = DTbl::NewIndexed($id, $label, $attrs, 'name'); } protected function add_VT_REWRITE_RULE($id) { $rules = self::NewTextAreaAttr('rules', null, 'cust', true, 5, null, 1, 1); // no label, will use table header $rules->cyberpanelBlocked = true; $attrs = [ $rules ]; $label = DMsg::ALbl('l_rewriterules'); if (PathTool::IsCyberPanel()) { $label .= ' (Disabled by CyberPanel)'; } $this->_tblDef[$id] = DTbl::NewRegular($id, $label, $attrs, 'rewriteRules', 1); } protected function add_S_FILEUPLOAD($id) { $attrs = [ self::NewPathAttr('uploadTmpDir', DMsg::ALbl('l_uploadtmpdir'), 'path', 2), self::NewParseTextAttr('uploadTmpFilePermission', DMsg::ALbl('l_uploadtmpfilepermission'), $this->_options['parseFormat']['filePermission3'], DMsg::ALbl('parse_uploadtmpfilepermission')), self::NewBoolAttr('uploadPassByPath', DMsg::ALbl('l_uploadpassbypath')) ]; $this->_tblDef[$id] = DTbl::NewRegular($id, DMsg::ALbl('l_uploadfile'), $attrs, 'fileUpload'); } protected function add_VT_FILEUPLOAD($id) { $attrs = [ self::NewPathAttr('uploadTmpDir', DMsg::ALbl('l_uploadtmpdir'), 'path', 3), self::NewParseTextAttr('uploadTmpFilePermission', DMsg::ALbl('l_uploadtmpfilepermission'), $this->_options['parseFormat']['filePermission3'], DMsg::ALbl('parse_uploadtmpfilepermission')), self::NewBoolAttr('uploadPassByPath', DMsg::ALbl('l_uploadpassbypath')) ]; $this->_tblDef[$id] = DTbl::NewRegular($id, DMsg::ALbl('l_uploadfile'), $attrs, 'fileUpload'); } protected function add_VT_PHPINIOVERRIDE($id) { $override = self::NewTextAreaAttr('data', null, 'cust', true, 6, null, 1, 1); $override->SetFlag(DAttr::BM_RAWDATA); $attrs = [ $override, ]; $this->_tblDef[$id] = DTbl::NewRegular($id, DMsg::ALbl('l_phpinioverride'), $attrs, 'phpIniOverride', 1); } protected function add_S_TUNING_OS($id) //keep { $attrs = [ self::NewTextAttr('shmDefaultDir', DMsg::ALbl('l_shmDefaultDir'), 'cust'), self::NewTextAreaAttr('proxyProtocol', DMsg::ALbl('l_proxyprotocol'), 'subnet', true, 5, null, 1, 0, 1), ]; $this->_tblDef[$id] = DTbl::NewRegular($id, DMsg::ALbl('l_tuningos'), $attrs); } protected function add_S_TUNING_STATIC($id) { $attrs = [ self::NewIntAttr('maxCachedFileSize', DMsg::ALbl('l_maxcachedfilesize'), false, 0, 1048576), self::NewIntAttr('totalInMemCacheSize', DMsg::ALbl('l_totalinmemcachesize'), false, 0), self::NewIntAttr('maxMMapFileSize', DMsg::ALbl('l_maxmmapfilesize'), false, 0), self::NewIntAttr('totalMMapCacheSize', DMsg::ALbl('l_totalmmapcachesize'), false, 0), self::NewBoolAttr('useSendfile', DMsg::ALbl('l_usesendfile')), self::NewSelAttr('useAIO', DMsg::ALbl('l_useaio'), [ '0' => DMsg::ALbl('o_no'), '1' => 'POSIX AIO', '2' => 'Linux AIO', '3' => 'io_uring', ], false), self::NewSelAttr('AIOBlockSize', DMsg::ALbl('l_aioblocksize'), [ '1' => '128K', '2' => '256K', '3' => '512K', '4' => '1M', '5' => '2M', '6' => '4M', '7' => '8M', ], false), self::NewCheckBoxAttr('fileETag', DMsg::ALbl('l_fileetag'), ['4' => 'iNode', '8' => DMsg::ALbl('o_modifiedtime'), '16' => DMsg::ALbl('o_size'), '0' => DMsg::ALbl('o_none')], true, null, 28), ]; $this->_tblDef[$id] = DTbl::NewRegular($id, DMsg::ALbl('l_tuningstatic'), $attrs); } protected function add_S_TUNING_SSL($id) { $attrs = [ self::NewTextAttr('sslDefaultCiphers', DMsg::ALbl('l_sslDefaultCiphers'), 'cust'), self::NewBoolAttr('sslStrongDhKey', DMsg::ALbl('l_sslStrongDhKey')), self::NewBoolAttr('sslEnableMultiCerts', DMsg::ALbl('l_sslEnableMultiCerts')), $this->_attrs['sslSessionCache'], self::NewIntAttr('sslSessionCacheSize', DMsg::ALbl('l_sslSessionCacheSize'), true, 512), self::NewIntAttr('sslSessionCacheTimeout', DMsg::ALbl('l_sslSessionCacheTimeout'), true, 10, 1000000), $this->_attrs['sslSessionTickets'], self::NewIntAttr('sslSessionTicketLifetime', DMsg::ALbl('l_sslSessionTicketLifetime'), true, 10, 1000000), self::NewTextAttr('sslSessionTicketKeyFile', DMsg::ALbl('l_sslSessionTicketKeyFile'), 'cust'), self::NewParseTextAttr('sslOcspProxy', DMsg::ALbl('l_ocspproxy'), '/^((http|https):\/\/)?([A-z0-9._\-]+|\[[[:xdigit:]:]+\])(:\d+)$/', DMsg::ALbl('parse_ocspproxy')), self::NewBoolAttr('sslStrictSni', DMsg::ALbl('l_sslStrictSni')), ]; $this->_tblDef[$id] = DTbl::NewRegular($id, DMsg::ALbl('l_tuningsslsettings'), $attrs, 'sslGlobal'); } protected function add_S_MOD_TOP($id) { $align = ['center', 'center', 'center', 'center']; $attrs = [self::NewViewAttr('name', DMsg::ALbl('l_module')), self::NewBoolAttr('internal', DMsg::ALbl('l_internal'), true, 'internalmodule'), $this->_attrs['mod_params'], $this->_attrs['mod_enabled'], self::NewActionAttr('S_MOD', 'vEd') ]; $this->_tblDef[$id] = DTbl::NewTop($id, DMsg::ALbl('l_servermodulesdef'), $attrs, 'name', 'S_MOD', $align, null, 'module', TRUE); } protected function getModuleTags() { $tags = ['L4_BEGINSESSION', 'L4_ENDSESSION', 'L4_RECVING', 'L4_SENDING', 'HTTP_BEGIN', 'RECV_REQ_HEADER', 'URI_MAP', 'HTTP_AUTH', 'RECV_REQ_BODY', 'RCVD_REQ_BODY', 'RECV_RESP_HEADER', 'RECV_RESP_BODY', 'RCVD_RESP_BODY', 'HANDLER_RESTART', 'SEND_RESP_HEADER', 'SEND_RESP_BODY', 'HTTP_END', 'MAIN_INITED', 'MAIN_PREFORK', 'MAIN_POSTFORK', 'WORKER_POSTFORK', 'WORKER_ATEXIT', 'MAIN_ATEXIT']; return $tags; } protected function add_S_MOD($id) { $attrs = [self::NewTextAttr('name', DMsg::ALbl('l_module'), 'modulename', false, 'modulename'), $this->_attrs['note'], self::NewBoolAttr('internal', DMsg::ALbl('l_internal'), true, 'internalmodule'), $this->_attrs['mod_params'], $this->_attrs['mod_enabled'] ]; $tags = $this->getModuleTags(); $hook = DMsg::ALbl('l_hook'); $priority = DMsg::ALbl('l_priority'); foreach ($tags as $tag) { $attrs[] = self::NewIntAttr($tag, "$hook $tag $priority", true, -6000, 6000); } $this->_tblDef[$id] = DTbl::NewIndexed($id, DMsg::ALbl('l_servermoduledef'), $attrs, 'name', 'servModules'); } protected function add_VT_MOD_TOP($id) { $align = ['center', 'center', 'center', 'center']; $attrs = [self::NewViewAttr('name', DMsg::ALbl('l_module')), $this->_attrs['mod_params'], $this->_attrs['mod_enabled']->dup(null, null, 'moduleEnabled_vh'), self::NewActionAttr('VT_MOD', 'vEd') ]; $this->_tblDef[$id] = DTbl::NewTop($id, DMsg::ALbl('l_moduleconf'), $attrs, 'name', 'VT_MOD', $align, 'vhModules', 'module', TRUE); } protected function add_VT_MOD($id) { $attrs = [self::NewSelAttr('name', DMsg::ALbl('l_module'), 'module', false, 'moduleNameSel'), $this->_attrs['note'], $this->_attrs['mod_params'], $this->_attrs['mod_enabled']->dup(null, null, 'moduleEnabled_vh') ]; $this->_tblDef[$id] = DTbl::NewIndexed($id, DMsg::ALbl('l_moduleconf'), $attrs, 'name', 'vhModules'); $this->_tblDef[$id]->Set(DTbl::FLD_LINKEDTBL, ['VT_MOD_FILTERTOP']); } protected function add_VT_MOD_FILTERTOP($id) { $align = ['center', 'center', 'center', 'center']; $attrs = [self::NewViewAttr('uri', DMsg::ALbl('l_uri')), $this->_attrs['mod_params'], self::NewActionAttr('VT_MOD_FILTER', 'vEd') ]; $this->_tblDef[$id] = DTbl::NewTop($id, DMsg::ALbl('l_urlfilter'), $attrs, 'uri', 'VT_MOD_FILTER', $align, 'vhModuleUrlFilters', 'filter', FALSE); $this->_tblDef[$id]->Set(Dtbl::FLD_SHOWPARENTREF, true); } protected function add_VT_MOD_FILTER($id) { $attrs = [$this->_attrs['ctx_uri'], $this->_attrs['mod_params'], ]; $this->_tblDef[$id] = DTbl::NewIndexed($id, DMsg::ALbl('l_urlfilter'), $attrs, 'uri', 'vhModuleUrlFilters'); $this->_tblDef[$id]->Set(Dtbl::FLD_SHOWPARENTREF, true); } protected function add_L_MOD_TOP($id) { $align = ['center', 'center', 'center', 'center']; $attrs = [self::NewViewAttr('name', DMsg::ALbl('l_module')), $this->_attrs['mod_params'], $this->_attrs['mod_enabled']->dup(null, null, 'moduleEnabled_lst'), self::NewActionAttr('L_MOD', 'vEd') ]; $this->_tblDef[$id] = DTbl::NewTop($id, DMsg::ALbl('l_moduleconf'), $attrs, 'name', 'L_MOD', $align, 'listenerModules', 'module', TRUE); } protected function add_L_MOD($id) { $attrs = [self::NewSelAttr('name', DMsg::ALbl('l_module'), 'module', false, 'moduleNameSel'), $this->_attrs['note'], $this->_attrs['mod_params'], $this->_attrs['mod_enabled']->dup(null, null, 'moduleEnabled_lst') ]; $this->_tblDef[$id] = DTbl::NewIndexed($id, DMsg::ALbl('l_moduleconf'), $attrs, 'name', 'listenerModules'); } protected function add_V_TOPD($id) { $attrs = [ self::NewTextAttr('name', DMsg::ALbl('l_vhname'), 'vhname', false, 'vhName'), self::NewTextAttr('vhRoot', DMsg::ALbl('l_vhroot'), 'cust', false), //no validation, maybe suexec owner self::NewPathAttr('configFile', DMsg::ALbl('l_configfile'), 'filevh', 3, 'rwc', false), $this->_attrs['note'], $this->_attrs['vh_allowSymbolLink'], $this->_attrs['vh_enableScript'], $this->_attrs['vh_restrained'], $this->_attrs['vh_maxKeepAliveReq'], $this->_attrs['vh_setUIDMode'], $this->_attrs['vh_suexec_user'], $this->_attrs['vh_suexec_group'], $this->_attrs['staticReqPerSec'], $this->_attrs['dynReqPerSec'], $this->_attrs['outBandwidth'], $this->_attrs['inBandwidth'], ]; $this->_tblDef[$id] = DTbl::NewIndexed($id, DMsg::ALbl('l_vhost'), $attrs, 'name'); } protected function add_V_BASE_SEC($id) { $attrs = [ $this->_attrs['vh_allowSymbolLink'], $this->_attrs['vh_enableScript'], $this->_attrs['vh_restrained'], $this->_attrs['vh_setUIDMode'], $this->_attrs['vh_suexec_user'], $this->_attrs['vh_suexec_group'], ]; $this->_tblDef[$id] = DTbl::NewIndexed($id, DMsg::UIStr('tab_sec'), $attrs, 'name'); } protected function add_V_GENERAL($id) { $attrs = [ self::NewTextAttr('docRoot', DMsg::ALbl('l_docroot'), 'cust', false), //no validation, maybe suexec owner $this->_attrs['tp_vhDomain'], // this setting is a new way, will merge with listener map settings for backward compatible $this->_attrs['tp_vhAliases'], $this->_attrs['adminEmails']->dup(null, null, 'vhadminEmails'), $this->_attrs['vh_enableGzip'], $this->_attrs['vh_enableBr'], $this->_attrs['enableIpGeo'], $this->_attrs['vh_cgroups'], ]; $this->_tblDef[$id] = DTbl::NewRegular($id, DMsg::UIStr('tab_g'), $attrs); } protected function add_T_GENERAL2($id) { $attrs = [ $this->_attrs['tp_vrFile']->dup('docRoot', DMsg::ALbl('l_docroot'), 'templateVHDocRoot'), $this->_attrs['adminEmails']->dup(null, null, 'vhadminEmails'), $this->_attrs['vh_enableGzip'], $this->_attrs['vh_enableBr'], $this->_attrs['enableIpGeo'], $this->_attrs['vh_cgroups'], ]; $this->_tblDef[$id] = DTbl::NewRegular($id, DMsg::ALbl('l_base2'), $attrs); } protected function add_V_REALM_TOP($id) { $align = ['center', 'center', 'center']; $realm_attr = $this->get_realm_attrs(); $attrs = [ $realm_attr['realm_name'], self::NewViewAttr('userDB:location', DMsg::ALbl('l_userdblocation'), 'userDBLocation'), self::NewActionAttr('V_REALM_FILE', 'vEd') ]; $this->_tblDef[$id] = DTbl::NewTop($id, DMsg::ALbl('l_realmlist'), $attrs, 'name', 'V_REALM_FILE', $align, 'realms', 'shield', TRUE); } protected function add_T_REALM_TOP($id) { $align = ['center', 'center', 'center']; $realm_attr = $this->get_realm_attrs(); $attrs = [ $realm_attr['realm_name'], self::NewViewAttr('userDB:location', DMsg::ALbl('l_userdblocation'), 'userDBLocation'), self::NewActionAttr('T_REALM_FILE', 'vEd') ]; $this->_tblDef[$id] = DTbl::NewTop($id, DMsg::ALbl('l_realmlist'), $attrs, 'name', 'T_REALM_FILE', $align, 'realms', 'shield', TRUE); } protected function add_VT_CTX_TOP($id) { $align = ['center', 'left', 'center', 'center']; $attrs = [ $this->_attrs['ctx_type'], self::NewViewAttr('uri', DMsg::ALbl('l_uri')), self::NewBoolAttr('allowBrowse', DMsg::ALbl('l_allowbrowse'), false), self::NewCustFlagAttr('order', DMsg::ALbl('l_order'), (DAttr::BM_NOFILE | DAttr::BM_NOEDIT), true, 'ctxseq'), self::NewActionAttr($this->_options['ctxTbl'], 'vEd') ]; $this->_tblDef[$id] = DTbl::NewTop($id, DMsg::ALbl('l_contextlist'), $attrs, 'uri', 'VT_CTX_SEL', $align, null, ['null' => 'file', 'proxy' => 'network', 'redirect' => 'redirect', 'module' => 'module'], TRUE); } protected function add_VT_CTXG($id) { $override = self::NewTextAreaAttr('phpIniOverride:data', DMsg::ALbl('l_phpinioverride'), 'cust', true, 6, 'phpIniOverride', 1, 1); $override->SetFlag(DAttr::BM_RAWDATA); $attrs = array_merge( $this->get_ctx_attrs('uri'), [ $this->_attrs['ctx_location'], self::NewBoolAttr('allowBrowse', DMsg::ALbl('l_allowbrowse'), false), $this->_attrs['note'] ], $this->get_expires_attrs(), [ $this->_attrs['extraHeaders'], self::NewParseTextAreaAttr('addMIMEType', DMsg::ALbl('l_mimetype'), '/[A-z0-9_\-\.\+]+\/[A-z0-9_\-\.\+]+(\s+[A-z0-9_\-\+]+)+/', DMsg::ALbl('parse_mimetype'), true, 2, null, 0, 0, 1), self::NewParseTextAttr('forceType', DMsg::ALbl('l_forcemimetype'), '/^([A-z0-9_\-\.\+]+\/[A-z0-9_\-\.\+]+)|(NONE)$/i', DMsg::ALbl('parse_forcemimetype')), self::NewParseTextAttr('defaultType', DMsg::ALbl('l_defaultmimetype'), '/^[A-z0-9_\-\.\+]+\/[A-z0-9_\-\.\+]+$/', DMsg::ALbl('parse_defaultmimetype')), $this->_attrs['indexFiles'], $this->_attrs['autoIndex'] ], $this->get_ctx_attrs('auth'), $this->get_ctx_attrs('rewrite'), $this->get_ctx_attrs('charset'), [ $override, ] ); $defaultExtract = ['type' => 'null']; $this->_tblDef[$id] = DTbl::NewIndexed($id, DMsg::ALbl('l_ctxg'), $attrs, 'uri', 'generalContext', $defaultExtract); } protected function add_VT_CTXJ($id) { $attrs = array_merge( [ self::NewTextAttr('uri', DMsg::ALbl('l_uri'), 'uri', false), $this->_attrs['ctx_order'], $this->_attrs['ctx_location']->dup(null, null, 'javaWebApp_location'), $this->_attrs['ctx_shandler'], $this->_attrs['note'] ], $this->get_expires_attrs(), [ $this->_attrs['extraHeaders'], $this->_attrs['indexFiles'], $this->_attrs['autoIndex'] ], $this->get_ctx_attrs('auth'), $this->get_ctx_attrs('charset') ); $defaultExtract = ['type' => 'webapp']; $this->_tblDef[$id] = DTbl::NewIndexed($id, DMsg::ALbl('l_ctxj'), $attrs, 'uri', 'javaWebAppContext', $defaultExtract); } protected function add_VT_CTXAS($id) { $attrs = array_merge( $this->get_ctx_attrs('uri'), [ self::NewTextAttr('location', DMsg::ALbl('l_location'), 'cust', false, 'as_location'), self::NewPathAttr('binPath', DMsg::ALbl('l_binpath'), 'file', 1, 'x'), self::NewSelAttr('appType', DMsg::ALbl('l_apptype'), ['' => '', 'rails' => 'Rails', 'wsgi' => 'WSGI', 'node' => 'Node']), self::NewTextAttr('startupFile', DMsg::ALbl('l_startupfile'), 'cust', true, 'as_startupfile'), $this->_attrs['note'], $this->_attrs['appserverEnv'], self::NewIntAttr('maxConns', DMsg::ALbl('l_maxconns'), true, 1, 2000), $this->_attrs['ext_env'] ], $this->get_expires_attrs(), [ $this->_attrs['extraHeaders'], $this->_attrs['indexFiles'], $this->_attrs['autoIndex'] ], $this->get_ctx_attrs('auth'), $this->get_ctx_attrs('rewrite'), $this->get_ctx_attrs('charset') ); $defaultExtract = ['type' => 'appserver']; $this->_tblDef[$id] = DTbl::NewIndexed($id, DMsg::ALbl('l_ctxas'), $attrs, 'uri', 'appserverContext', $defaultExtract); } protected function add_VT_CTXS($id) { $attrs = array_merge( $this->get_ctx_attrs('uri'), [ $this->_attrs['ctx_shandler'], $this->_attrs['note'], $this->_attrs['extraHeaders'] ], $this->get_ctx_attrs('auth'), $this->get_ctx_attrs('charset') ); $defaultExtract = ['type' => 'servlet']; $this->_tblDef[$id] = DTbl::NewIndexed($id, DMsg::ALbl('l_ctxs'), $attrs, 'uri', 'servletContext', $defaultExtract); } protected function add_VT_CTXF($id) { $attrs = array_merge( $this->get_ctx_attrs('uri'), [ self::NewSelAttr('handler', DMsg::ALbl('l_fcgiapp'), 'extprocessor:fcgi', false, 'fcgiapp'), $this->_attrs['note'], $this->_attrs['extraHeaders'] ], $this->get_ctx_attrs('auth'), $this->get_ctx_attrs('charset') ); $defaultExtract = ['type' => 'fcgi']; $this->_tblDef[$id] = DTbl::NewIndexed($id, DMsg::ALbl('l_ctxf'), $attrs, 'uri', 'fcgiContext', $defaultExtract); } protected function add_VT_CTXL($id) { $attrs = array_merge( $this->get_ctx_attrs('uri'), [ self::NewSelAttr('handler', DMsg::ALbl('l_lsapiapp'), 'extprocessor:lsapi', false, 'lsapiapp'), $this->_attrs['note'], $this->_attrs['extraHeaders'] ], $this->get_ctx_attrs('auth'), $this->get_ctx_attrs('charset') ); $defaultExtract = ['type' => 'lsapi']; $this->_tblDef[$id] = DTbl::NewIndexed($id, DMsg::ALbl('l_ctxl'), $attrs, 'uri', 'lsapiContext', $defaultExtract); } protected function add_VT_CTXMD($id) { $attrs = array_merge( $this->get_ctx_attrs('uri'), [ self::NewSelAttr('handler', DMsg::ALbl('l_modulehandler'), 'module', false, 'moduleNameSel'), $this->_attrs['note'], $this->_attrs['mod_params'], $this->_attrs['extraHeaders'] ], $this->get_ctx_attrs('auth'), $this->get_ctx_attrs('charset') ); $defaultExtract = ['type' => 'module']; $this->_tblDef[$id] = DTbl::NewIndexed($id, DMsg::ALbl('l_ctxmd'), $attrs, 'uri', 'lmodContext', $defaultExtract); } protected function add_VT_CTXB($id) { $attrs = array_merge( $this->get_ctx_attrs('uri'), [ self::NewSelAttr('handler', DMsg::ALbl('l_loadbalancer'), 'extprocessor:loadbalancer', false, 'lbapp'), $this->_attrs['note'], $this->_attrs['extraHeaders'] ], $this->get_ctx_attrs('auth'), $this->get_ctx_attrs('charset') ); $defaultExtract = ['type' => 'loadbalancer']; $this->_tblDef[$id] = DTbl::NewIndexed($id, DMsg::ALbl('l_ctxb'), $attrs, 'uri', 'lbContext', $defaultExtract); } protected function add_VT_CTXP($id) { $attrs = array_merge( $this->get_ctx_attrs('uri'), [ self::NewSelAttr('handler', DMsg::ALbl('l_webserver'), 'extprocessor:proxy', false, 'proxyWebServer'), $this->_attrs['note'], $this->_attrs['extraHeaders'] ], $this->get_ctx_attrs('auth'), $this->get_ctx_attrs('charset') ); $defaultExtract = ['type' => 'proxy']; $this->_tblDef[$id] = DTbl::NewIndexed($id, DMsg::ALbl('l_ctxp'), $attrs, 'uri', 'proxyContext', $defaultExtract); } protected function add_VT_CTXC($id) { $attrs = array_merge( $this->get_ctx_attrs('uri'), [ $this->_attrs['ctx_location']->dup(null, DMsg::ALbl('l_path'), 'cgi_path'), $this->_attrs['note'], $this->_attrs['extraHeaders'], self::NewBoolAttr('allowSetUID', DMsg::ALbl('l_allowsetuid')) ], $this->get_ctx_attrs('auth'), $this->get_ctx_attrs('rewrite'), $this->get_ctx_attrs('charset') ); $defaultExtract = ['type' => 'cgi']; $this->_tblDef[$id] = DTbl::NewIndexed($id, DMsg::ALbl('l_ctxc'), $attrs, 'uri', 'cgiContext', $defaultExtract); } protected function add_VT_CTXR($id) { $options = $this->get_cust_status_code(); $attrs = array_merge( $this->get_ctx_attrs('uri'), [ self::NewBoolAttr('externalRedirect', DMsg::ALbl('l_externalredirect'), false, 'externalredirect'), self::NewSelAttr('statusCode', DMsg::ALbl('l_statuscode'), $options, true, 'statuscode'), self::NewTextAttr('location', DMsg::ALbl('l_desturi'), 'url', true, 'destinationuri'), $this->_attrs['note'], $this->_attrs['extraHeaders'] ], $this->get_ctx_attrs('auth') ); $defaultExtract = ['type' => 'redirect']; $this->_tblDef[$id] = DTbl::NewIndexed($id, DMsg::ALbl('l_ctxr'), $attrs, 'uri', 'redirectContext', $defaultExtract); } protected function add_T_SEC_CGI($id) { $attrs = [ $this->_attrs['vh_setUIDMode'], $this->_attrs['vh_suexec_user'], $this->_attrs['vh_suexec_group'], ]; $this->_tblDef[$id] = DTbl::NewRegular($id, DMsg::ALbl('l_extappsec'), $attrs); } protected function add_L_GENERAL($id) { $ip = self::NewSelAttr('ip', DMsg::ALbl('l_ip'), $this->_options['ip'], false, 'listenerIP'); $ip->SetFlag(DAttr::BM_NOFILE); $port = self::NewIntAttr('port', DMsg::ALbl('l_port'), false, 0, 65535, 'listenerPort'); $port->SetFlag(DAttr::BM_NOFILE); $processes = isset($_SERVER['LSWS_CHILDREN']) ? $_SERVER['LSWS_CHILDREN'] : 1; for ($i = 1; $i <= $processes; ++$i) { $bindoptions[1 << ($i - 1)] = "Process $i"; } $attrs = [ self::NewTextAttr('name', DMsg::ALbl('l_listenername'), 'name', false, 'listenerName'), self::NewCustFlagAttr('address', DMsg::ALbl('l_address'), (DAttr::BM_HIDE | DAttr::BM_NOEDIT), false), $ip, $port, self::NewCheckBoxAttr('binding', DMsg::ALbl('l_binding'), $bindoptions, true, 'listenerBinding'), self::NewBoolAttr('reusePort', DMsg::ALbl('l_reuseport')), self::NewBoolAttr('secure', DMsg::ALbl('l_secure'), false, 'listenerSecure'), $this->_attrs['note'], ]; $this->_tblDef[$id] = DTbl::NewIndexed($id, DMsg::ALbl('l_addresssettings'), $attrs, 'name'); } protected function add_LVT_SSL_CLVERIFY($id) { $attrs = [ self::NewSelAttr('clientVerify', DMsg::ALbl('l_clientverify'), ['0' => 'none', '1' => 'optional', '2' => 'require', '3' => 'optional_no_ca']), self::NewIntAttr('verifyDepth', DMsg::ALbl('l_verifydepth'), true, 0, 100), self::NewTextAttr('crlPath', DMsg::ALbl('l_crlpath'), 'cust'), self::NewTextAttr('crlFile', DMsg::ALbl('l_crlfile'), 'cust'), ]; $this->_tblDef[$id] = DTbl::NewRegular($id, DMsg::ALbl('l_clientverify'), $attrs); } }
| ver. 1.4 |
Github
|
.
| PHP 8.2.28 | Generation time: 0.02 |
proxy
|
phpinfo
|
Settings