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

This commit is contained in:
Michael Kaufmann (d00p)
2018-02-18 10:17:38 +01:00
7 changed files with 78 additions and 4 deletions

View File

@@ -316,7 +316,7 @@ class Action
case "file": case "file":
if (array_key_exists('content', $action)) { if (array_key_exists('content', $action)) {
CmdLineHandler::printwarn("Creating file '" . $action['name'] . "'"); CmdLineHandler::printwarn("Creating file '" . $action['name'] . "'");
file_put_contents($action['name'], strtr($action['content'], $replace_arr)); file_put_contents($action['name'], trim(strtr($action['content'], $replace_arr)));
} elseif (array_key_exists('subcommands', $action)) { } elseif (array_key_exists('subcommands', $action)) {
foreach ($action['subcommands'] as $fileaction) { foreach ($action['subcommands'] as $fileaction) {
if (array_key_exists('execute', $fileaction) && $fileaction['execute'] == "pre") { if (array_key_exists('execute', $fileaction) && $fileaction['execute'] == "pre") {
@@ -325,7 +325,7 @@ class Action
exec(strtr($fileaction['content'], $replace_arr)); exec(strtr($fileaction['content'], $replace_arr));
} elseif ($fileaction['type'] == 'file') { } elseif ($fileaction['type'] == 'file') {
CmdLineHandler::printwarn("Creating file '" . $fileaction['name'] . "'"); CmdLineHandler::printwarn("Creating file '" . $fileaction['name'] . "'");
file_put_contents($fileaction['name'], strtr($fileaction['content'], $replace_arr)); file_put_contents($fileaction['name'], trim(strtr($fileaction['content'], $replace_arr)));
} }
} }
} }

View File

@@ -98,14 +98,28 @@ class SImExporter
// when there were changes in the variable-name or similar // when there were changes in the variable-name or similar
unset($_data['panel.version']); unset($_data['panel.version']);
unset($_data['panel.db_version']); unset($_data['panel.db_version']);
// validate we got ssl enabled ips when ssl is enabled
// otherwise deactivate it
if ($_data['system.use_ssl'] == 1) {
$result_ssl_ipsandports_stmt = Database::prepare("
SELECT COUNT(*) as count_ssl_ip FROM `" . TABLE_PANEL_IPSANDPORTS . "` WHERE `ssl`='1'
");
$result = Database::pexecute_first($result_ssl_ipsandports_stmt);
if ($result['count_ssl_ip'] <= 0) {
// no ssl-ip -> deactivate
$_data['system.use_ssl'] = 0;
// deactivate other ssl-related settings
$_data['system.leenabled'] = 0;
$_data['system.le_froxlor_enabled'] = 0;
$_data['system.le_froxlor_redirect'] = 0;
}
}
// store new data // store new data
foreach ($_data as $index => $value) { foreach ($_data as $index => $value) {
Settings::Set($index, $value); Settings::Set($index, $value);
} }
// save to DB // save to DB
Settings::Flush(); Settings::Flush();
// all good // all good
return true; return true;
} }

View File

@@ -48,6 +48,11 @@
<include>//service[@type='http']/general/commands</include> <include>//service[@type='http']/general/commands</include>
<command><![CDATA[a2dismod userdir]]></command> <command><![CDATA[a2dismod userdir]]></command>
<command><![CDATA[a2enmod headers]]></command> <command><![CDATA[a2enmod headers]]></command>
<command>
<visibility mode="true">{{settings.system.use_ssl}}
</visibility>
<content><![CDATA[a2enmod ssl]]></content>
</command>
<command> <command>
<visibility mode="true">{{settings.phpfpm.enabled}} <visibility mode="true">{{settings.phpfpm.enabled}}
</visibility> </visibility>
@@ -4753,6 +4758,11 @@ aliases: files
</visibility> </visibility>
<command><![CDATA[a2dismod php5]]></command> <command><![CDATA[a2dismod php5]]></command>
</commands> </commands>
<commands index="5">
<visibility mode="equals" value="apache2">{{settings.system.webserver}}
</visibility>
<command><![CDATA[/etc/init.d/apache2 restart]]></command>
</commands>
<!-- instead of just restarting apache, we let the cronjob do all the <!-- instead of just restarting apache, we let the cronjob do all the
dirty work --> dirty work -->
<command><![CDATA[php {{const.FROXLOR_INSTALL_DIR}}/scripts/froxlor_master_cronjob.php --force]]></command> <command><![CDATA[php {{const.FROXLOR_INSTALL_DIR}}/scripts/froxlor_master_cronjob.php --force]]></command>

View File

@@ -49,6 +49,11 @@
<include>//service[@type='http']/general/commands</include> <include>//service[@type='http']/general/commands</include>
<command><![CDATA[a2dismod userdir]]></command> <command><![CDATA[a2dismod userdir]]></command>
<command><![CDATA[a2enmod headers]]></command> <command><![CDATA[a2enmod headers]]></command>
<command>
<visibility mode="true">{{settings.system.use_ssl}}
</visibility>
<content><![CDATA[a2enmod ssl]]></content>
</command>
<file name="/etc/apache2/mods-enabled/fastcgi.conf"> <file name="/etc/apache2/mods-enabled/fastcgi.conf">
<visibility mode="true">{{settings.phpfpm.enabled}} <visibility mode="true">{{settings.phpfpm.enabled}}
</visibility> </visibility>
@@ -1752,6 +1757,11 @@ aliases: files
</visibility> </visibility>
<command><![CDATA[a2dismod php5]]></command> <command><![CDATA[a2dismod php5]]></command>
</commands> </commands>
<commands index="5">
<visibility mode="equals" value="apache2">{{settings.system.webserver}}
</visibility>
<command><![CDATA[/etc/init.d/apache2 restart]]></command>
</commands>
<!-- instead of just restarting apache, we let the cronjob do all the <!-- instead of just restarting apache, we let the cronjob do all the
dirty work --> dirty work -->
<command><![CDATA[php {{const.FROXLOR_INSTALL_DIR}}/scripts/froxlor_master_cronjob.php --force]]></command> <command><![CDATA[php {{const.FROXLOR_INSTALL_DIR}}/scripts/froxlor_master_cronjob.php --force]]></command>

View File

@@ -48,6 +48,11 @@
<include>//service[@type='http']/general/commands</include> <include>//service[@type='http']/general/commands</include>
<command><![CDATA[a2dismod userdir]]></command> <command><![CDATA[a2dismod userdir]]></command>
<command><![CDATA[a2enmod headers]]></command> <command><![CDATA[a2enmod headers]]></command>
<command>
<visibility mode="true">{{settings.system.use_ssl}}
</visibility>
<content><![CDATA[a2enmod ssl]]></content>
</command>
<command> <command>
<visibility mode="true">{{settings.phpfpm.enabled}} <visibility mode="true">{{settings.phpfpm.enabled}}
</visibility> </visibility>
@@ -4647,6 +4652,11 @@ aliases: files
</visibility> </visibility>
<command><![CDATA[a2dismod php7.0]]></command> <command><![CDATA[a2dismod php7.0]]></command>
</commands> </commands>
<commands index="5">
<visibility mode="equals" value="apache2">{{settings.system.webserver}}
</visibility>
<command><![CDATA[/etc/init.d/apache2 restart]]></command>
</commands>
<!-- instead of just restarting apache, we let the cronjob do all the <!-- instead of just restarting apache, we let the cronjob do all the
dirty work --> dirty work -->
<command><![CDATA[php {{const.FROXLOR_INSTALL_DIR}}/scripts/froxlor_master_cronjob.php --force]]></command> <command><![CDATA[php {{const.FROXLOR_INSTALL_DIR}}/scripts/froxlor_master_cronjob.php --force]]></command>

View File

@@ -49,6 +49,11 @@
<include>//service[@type='http']/general/commands</include> <include>//service[@type='http']/general/commands</include>
<command><![CDATA[a2dismod userdir]]></command> <command><![CDATA[a2dismod userdir]]></command>
<command><![CDATA[a2enmod headers]]></command> <command><![CDATA[a2enmod headers]]></command>
<command>
<visibility mode="true">{{settings.system.use_ssl}}
</visibility>
<content><![CDATA[a2enmod ssl]]></content>
</command>
<file name="/etc/apache2/mods-enabled/fastcgi.conf"> <file name="/etc/apache2/mods-enabled/fastcgi.conf">
<visibility mode="true">{{settings.phpfpm.enabled}} <visibility mode="true">{{settings.phpfpm.enabled}}
</visibility> </visibility>
@@ -85,6 +90,11 @@ Alias "/.well-known/acme-challenge" "{{settings.system.letsencryptchallengepath}
<include>//service[@type='http']/general/commands</include> <include>//service[@type='http']/general/commands</include>
<command><![CDATA[a2dismod userdir]]></command> <command><![CDATA[a2dismod userdir]]></command>
<command><![CDATA[a2enmod headers]]></command> <command><![CDATA[a2enmod headers]]></command>
<command>
<visibility mode="true">{{settings.system.use_ssl}}
</visibility>
<content><![CDATA[a2enmod ssl]]></content>
</command>
<file name="/etc/apache2/mods-enabled/fastcgi.conf"> <file name="/etc/apache2/mods-enabled/fastcgi.conf">
<visibility mode="true">{{settings.phpfpm.enabled}} <visibility mode="true">{{settings.phpfpm.enabled}}
</visibility> </visibility>
@@ -1761,6 +1771,11 @@ aliases: files
</visibility> </visibility>
<command><![CDATA[a2dismod php5]]></command> <command><![CDATA[a2dismod php5]]></command>
</commands> </commands>
<commands index="5">
<visibility mode="equals" value="apache2">{{settings.system.webserver}}
</visibility>
<command><![CDATA[/etc/init.d/apache2 restart]]></command>
</commands>
<!-- instead of just restarting apache, we let the cronjob do all the <!-- instead of just restarting apache, we let the cronjob do all the
dirty work --> dirty work -->
<command><![CDATA[php {{const.FROXLOR_INSTALL_DIR}}/scripts/froxlor_master_cronjob.php --force]]></command> <command><![CDATA[php {{const.FROXLOR_INSTALL_DIR}}/scripts/froxlor_master_cronjob.php --force]]></command>

View File

@@ -49,6 +49,11 @@
<include>//service[@type='http']/general/commands</include> <include>//service[@type='http']/general/commands</include>
<command><![CDATA[a2dismod userdir]]></command> <command><![CDATA[a2dismod userdir]]></command>
<command><![CDATA[a2enmod headers]]></command> <command><![CDATA[a2enmod headers]]></command>
<command>
<visibility mode="true">{{settings.system.use_ssl}}
</visibility>
<content><![CDATA[a2enmod ssl]]></content>
</command>
<file name="/etc/apache2/mods-enabled/fastcgi.conf"> <file name="/etc/apache2/mods-enabled/fastcgi.conf">
<visibility mode="true">{{settings.phpfpm.enabled}} <visibility mode="true">{{settings.phpfpm.enabled}}
</visibility> </visibility>
@@ -85,6 +90,11 @@ Alias "/.well-known/acme-challenge" "{{settings.system.letsencryptchallengepath}
<include>//service[@type='http']/general/commands</include> <include>//service[@type='http']/general/commands</include>
<command><![CDATA[a2dismod userdir]]></command> <command><![CDATA[a2dismod userdir]]></command>
<command><![CDATA[a2enmod headers]]></command> <command><![CDATA[a2enmod headers]]></command>
<command>
<visibility mode="true">{{settings.system.use_ssl}}
</visibility>
<content><![CDATA[a2enmod ssl]]></content>
</command>
<file name="/etc/apache2/mods-enabled/fastcgi.conf"> <file name="/etc/apache2/mods-enabled/fastcgi.conf">
<visibility mode="true">{{settings.phpfpm.enabled}} <visibility mode="true">{{settings.phpfpm.enabled}}
</visibility> </visibility>
@@ -5561,6 +5571,11 @@ aliases: files
</visibility> </visibility>
<command><![CDATA[a2dismod php5]]></command> <command><![CDATA[a2dismod php5]]></command>
</commands> </commands>
<commands index="5">
<visibility mode="equals" value="apache2">{{settings.system.webserver}}
</visibility>
<command><![CDATA[/etc/init.d/apache2 restart]]></command>
</commands>
<!-- instead of just restarting apache, we let the cronjob do all the <!-- instead of just restarting apache, we let the cronjob do all the
dirty work --> dirty work -->
<command><![CDATA[php {{const.FROXLOR_INSTALL_DIR}}/scripts/froxlor_master_cronjob.php --force]]></command> <command><![CDATA[php {{const.FROXLOR_INSTALL_DIR}}/scripts/froxlor_master_cronjob.php --force]]></command>