Commit d84fefe1 authored by Marius Burkard's avatar Marius Burkard
Browse files

enabled arguments and selective installs

parent bfa56f69
......@@ -4,7 +4,11 @@
if(function_exists('spl_autoload_register')) {
spl_autoload_register('ISPConfig::autoload');
}
define('ISPC_WEBSERVER_NONE', 0);
define('ISPC_WEBSERVER_APACHE', 1);
define('ISPC_WEBSERVER_NGINX', 2);
/**
* Main controller class
*
......@@ -18,6 +22,8 @@ class ISPConfig {
'PXBashColor' => LIB_DIR . '/libbashcolor.inc.php'
);
public static $WEBSERVER = ISPC_WEBSERVER_APACHE;
private static function init() {
if(php_sapi_name() == 'cli') {
self::$is_cli_run = true;
......@@ -49,6 +55,13 @@ class ISPConfig {
}
}
if(!self::shallInstall('web')) {
self::$WEBSERVER = ISPC_WEBSERVER_NONE;
} elseif(isset($_GET['use-nginx']) && $_GET['use-nginx']) {
self::$WEBSERVER = ISPC_WEBSERVER_NGINX;
} else {
self::$WEBSERVER = ISPC_WEBSERVER_APACHE;
}
}
private static function input() {
......@@ -122,6 +135,22 @@ class ISPConfig {
return self::$cli_script;
}
public static function shallInstall($what) {
if(isset($_GET['no-'.$what]) && $_GET['no-'.$what]) {
return false;
} else {
return true;
}
}
public static function wantsInteractive() {
if(isset($_GET['interactive']) && $_GET['interactive']) {
return true;
} else {
return false;
}
}
private static function printHelp() {
$message = '
......@@ -139,12 +168,13 @@ Possible arguments are:
--debug ->Enable verbose logging (logs each command with the exit code)
--interactive ->Don\'t install ISPConfig in non-interactive mode. This is needed if you want to use expert mode, e. g. to install a slave server that shall be integrated into an existing multiserver setup.
--use-nginx ->Use nginx webserver instead of apache2
--no-web ->Do not use ISPConfig on this server to manage webserver setting and don\'t install nginx/apache. This will also prevent installing an ISPConfig UI and implies --no-roundcube as well as --no-pma
--no-mail ->Do not use ISPConfig on this server to manage mailserver settings. This will install postfix for sending system mails, but not dovecot and not configure any settings for ISPConfig mail.
--no-web ->Do not use ISPConfig on this server to manage webserver setting and don\'t install nginx/apache or pureftpd. This will also prevent installing an ISPConfig UI and implies --no-roundcube as well as --no-pma
--no-mail ->Do not use ISPConfig on this server to manage mailserver settings. This will install postfix for sending system mails, but not dovecot and not configure any settings for ISPConfig mail. It implies --no-mailman.
--no-dns ->Do not use ISPConfig on this server to manage DNS entries. Bind will be installed for local DNS caching / resolving only.
--no-firewall ->Do not install ufw and tell ISPConfig to not manage firewall settings on this server.
--no-roundcube ->Do not install roundcube webmail.
--no-pma ->Do not install PHPMyAdmin on this server.
--no-mailman ->Do not install Mailman mailing list manager.
--i-know-what-i-am-doing
->Prevent the autoinstaller to ask for confirmation before continuing to reconfigure the server.
';
......@@ -182,6 +212,11 @@ Possible arguments are:
try {
$os = ISPConfigBaseOS::getOSVersion();
if(self::$WEBSERVER === ISPC_WEBSERVER_NGINX) {
ISPConfigLog::error('Nginx install is not yet supported and will be available in a future release.', true);
exit;
}
ISPConfigLog::info('Starting perfect server setup for ' . $os['NAME'], true);
$installer = ISPConfigBaseOS::getOSInstance();
$installer->runPerfectSetup();
......
......@@ -51,6 +51,10 @@ class ISPConfigDebian10OS extends ISPConfigDebianOS {
}
protected function installPHPMyAdmin($mysql_root_pw) {
if(!ISPConfig::shallInstall('web') || !ISPConfig::shallInstall('pma')) {
return;
}
ISPConfigLog::info('Installing package phpmyadmin', true);
if(!is_dir('/usr/share/phpmyadmin')) {
......
This diff is collapsed.
......@@ -35,14 +35,6 @@ deb http://security.ubuntu.com/ubuntu bionic-security multiverse
}
}
protected function getPackagesToInstall($section) {
if($section === 'mail') {
$packages = parent::getPackagesToInstall($section);
}
return $packages;
}
protected function afterPackageInstall($section = '') {
if($section === 'mail') {
$cmd = 'freshclam';
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment