Merge remote-tracking branch 'origin/master' into 0.10.0

This commit is contained in:
Michael Kaufmann
2018-09-30 10:04:15 +02:00
12 changed files with 315 additions and 29 deletions

View File

@@ -406,21 +406,12 @@ INSERT INTO `panel_settings` (`settinggroup`, `varname`, `value`) VALUES
('login', 'maxloginattempts', '3'),
('login', 'deactivatetime', '900'),
('phpfpm', 'enabled', '0'),
('phpfpm', 'configdir', '/etc/php-fpm.d/'),
('phpfpm', 'reload', '/etc/init.d/php-fpm restart'),
('phpfpm', 'pm', 'static'),
('phpfpm', 'max_children', '1'),
('phpfpm', 'start_servers', '20'),
('phpfpm', 'min_spare_servers', '5'),
('phpfpm', 'max_spare_servers', '35'),
('phpfpm', 'max_requests', '0'),
('phpfpm', 'tmpdir', '/var/customers/tmp/'),
('phpfpm', 'peardir', '/usr/share/php/:/usr/share/php5/'),
('phpfpm', 'envpath', '/usr/local/bin:/usr/bin:/bin'),
('phpfpm', 'enabled_ownvhost', '0'),
('phpfpm', 'vhost_httpuser', 'froxlorlocal'),
('phpfpm', 'vhost_httpgroup', 'froxlorlocal'),
('phpfpm', 'idle_timeout', '30'),
('phpfpm', 'aliasconfigdir', '/var/www/php-fpm/'),
('phpfpm', 'defaultini', '1'),
('phpfpm', 'vhost_defaultini', '2'),
@@ -696,7 +687,7 @@ opcache.interned_strings_buffer'),
('panel', 'password_special_char', '!?<>§$%+#=@'),
('panel', 'customer_hide_options', ''),
('panel', 'version', '0.10.0'),
('panel', 'db_version', '201809180');
('panel', 'db_version', '201809280');
DROP TABLE IF EXISTS `panel_tasks`;
@@ -904,6 +895,15 @@ CREATE TABLE `panel_phpconfigs` (
`phpsettings` text NOT NULL,
`fpmsettingid` int(11) NOT NULL DEFAULT '1',
`pass_authorizationheader` tinyint(1) NOT NULL default '0',
`override_fpmconfig` tinyint(1) NOT NULL DEFAULT '0',
`pm` varchar(15) NOT NULL DEFAULT 'static',
`max_children` int(4) NOT NULL DEFAULT '1',
`start_servers` int(4) NOT NULL DEFAULT '20',
`min_spare_servers` int(4) NOT NULL DEFAULT '5',
`max_spare_servers` int(4) NOT NULL DEFAULT '35',
`max_requests` int(4) NOT NULL DEFAULT '0',
`idle_timeout` int(4) NOT NULL DEFAULT '30',
`limit_extensions` varchar(255) NOT NULL default '.php',
PRIMARY KEY (`id`),
KEY `fpmsettingid` (`fpmsettingid`)
) ENGINE=MyISAM CHARSET=utf8 COLLATE=utf8_general_ci;

View File

@@ -4011,3 +4011,52 @@ if (isDatabaseVersion('201805290')) {
updateToDbVersion('201809180');
}
if (isDatabaseVersion('201809180')) {
showUpdateStep("Adding new fields for php configs");
Database::query("ALTER TABLE `" . TABLE_PANEL_PHPCONFIGS . "` ADD `override_fpmconfig` tinyint(1) NOT NULL DEFAULT '0';");
Database::query("ALTER TABLE `" . TABLE_PANEL_PHPCONFIGS . "` ADD `pm` varchar(15) NOT NULL DEFAULT 'static';");
Database::query("ALTER TABLE `" . TABLE_PANEL_PHPCONFIGS . "` ADD `max_children` int(4) NOT NULL DEFAULT '1';");
Database::query("ALTER TABLE `" . TABLE_PANEL_PHPCONFIGS . "` ADD `start_servers` int(4) NOT NULL DEFAULT '20';");
Database::query("ALTER TABLE `" . TABLE_PANEL_PHPCONFIGS . "` ADD `min_spare_servers` int(4) NOT NULL DEFAULT '5';");
Database::query("ALTER TABLE `" . TABLE_PANEL_PHPCONFIGS . "` ADD `max_spare_servers` int(4) NOT NULL DEFAULT '35';");
Database::query("ALTER TABLE `" . TABLE_PANEL_PHPCONFIGS . "` ADD `max_requests` int(4) NOT NULL DEFAULT '0';");
Database::query("ALTER TABLE `" . TABLE_PANEL_PHPCONFIGS . "` ADD `idle_timeout` int(4) NOT NULL DEFAULT '30';");
Database::query("ALTER TABLE `" . TABLE_PANEL_PHPCONFIGS . "` ADD `limit_extensions` varchar(255) NOT NULL default '.php';");
lastStepStatus(0);
showUpdateStep("Synchronize fpm-daemon process manager settings with php-configs");
// get all fpm-daemons
$sel_stmt = Database::prepare("SELECT * FROM `panel_fpmdaemons`;");
Database::pexecute($sel_stmt);
$fpm_daemons = $sel_stmt->fetchAll(PDO::FETCH_ASSOC);
$upd_stmt = Database::prepare("UPDATE `" . TABLE_PANEL_PHPCONFIGS . "` SET
`pm` = :pm,
`max_children` = :maxc,
`start_servers` = :starts,
`min_spare_servers` = :minss,
`max_spare_servers` = :maxss,
`max_requests` = :maxr,
`idle_timeout` = :it,
`limit_extensions` = :le
WHERE `fpmsettingid` = :fpmid
");
// update all php-configs with the pm data from the fpm-daemon
foreach ($fpm_daemons as $fpm_daemon) {
Database::pexecute($upd_stmt, array(
'pm' => $fpm_daemon['pm'],
'maxc' => $fpm_daemon['max_children'],
'starts' => $fpm_daemon['start_servers'],
'minss' => $fpm_daemon['min_spare_servers'],
'maxss' => $fpm_daemon['max_spare_servers'],
'maxr' => $fpm_daemon['max_requests'],
'it' => $fpm_daemon['idle_timeout'],
'le' => $fpm_daemon['limit_extensions'],
'fpmid' => $fpm_daemon['id']
));
}
lastStepStatus(0);
updateToDbVersion('201809280');
}