small adjustments to install when ssl is activated and gentoo-config-templates

Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
Michael Kaufmann
2022-05-07 13:23:32 +02:00
parent 2ae67c39fd
commit d42e71fa9f
3 changed files with 19 additions and 39 deletions

View File

@@ -23,7 +23,7 @@
* @license https://files.froxlor.org/misc/COPYING.txt GPLv2 * @license https://files.froxlor.org/misc/COPYING.txt GPLv2
*/ */
return <<<FROXLORSQL return <<<'FROXLORSQL'
DROP TABLE IF EXISTS `ftp_groups`; DROP TABLE IF EXISTS `ftp_groups`;
CREATE TABLE `ftp_groups` ( CREATE TABLE `ftp_groups` (
`id` int(20) NOT NULL auto_increment, `id` int(20) NOT NULL auto_increment,

View File

@@ -429,7 +429,7 @@ class Core
// check currently used php version and set values of fpm/fcgid accordingly // check currently used php version and set values of fpm/fcgid accordingly
if (defined('PHP_MAJOR_VERSION') && defined('PHP_MINOR_VERSION')) { if (defined('PHP_MAJOR_VERSION') && defined('PHP_MINOR_VERSION')) {
// @todo does not work for gentoo // gentoo specific
if ($this->validatedData['distribution'] == 'gentoo') { if ($this->validatedData['distribution'] == 'gentoo') {
// php-fpm // php-fpm
$reload = "/etc/init.d/php-fpm restart"; $reload = "/etc/init.d/php-fpm restart";
@@ -447,6 +447,11 @@ class Core
$db_user->query("UPDATE `" . TABLE_PANEL_PHPCONFIGS . "` SET `binary` = '" . $binary . "';"); $db_user->query("UPDATE `" . TABLE_PANEL_PHPCONFIGS . "` SET `binary` = '" . $binary . "';");
} }
if ($this->validatedData['use_ssl']) {
// enable let's encrypt cron
$db_user->query("UPDATE `" . TABLE_PANEL_CRONRUNS . "` SET `isactive` = '1' WHERE `module` = 'froxlor/letsencrypt';");
}
// set specific times for some crons (traffic only at night, etc.) // set specific times for some crons (traffic only at night, etc.)
$timestamp = mktime(0, 0, 0, date('m', time()), date('d', time()), date('Y', time())); $timestamp = mktime(0, 0, 0, date('m', time()), date('d', time()), date('Y', time()));
$db_user->query("UPDATE `" . TABLE_PANEL_CRONRUNS . "` SET `lastrun` = '" . $timestamp . "' WHERE `cronfile` ='cron_traffic';"); $db_user->query("UPDATE `" . TABLE_PANEL_CRONRUNS . "` SET `lastrun` = '" . $timestamp . "' WHERE `cronfile` ='cron_traffic';");

View File

@@ -65,43 +65,8 @@
</commands> </commands>
</general> </general>
<!-- HTTP Apache --> <!-- HTTP Apache -->
<daemon name="apache" version="2.2" title="Apache 2.2"
default="true">
<install><![CDATA[emerge www-servers/apache]]></install>
<include>//service[@type='http']/general/commands</include>
<file name="/etc/apache2/modules.d/70_fastcgi.conf">
<visibility mode="true">{{settings.phpfpm.enabled}}
</visibility>
<content><![CDATA[
<IfModule mod_fastcgi.c>
FastCgiIpcDir <FPM_IPCDIR>
<Location "/fastcgiphp">
Order Deny,Allow
Deny from All
# Prevent accessing this path directly
Allow from env=REDIRECT_STATUS
</Location>
</IfModule>
]]>
</content>
</file>
<file name="{{settings.system.letsencryptacmeconf}}">
<visibility mode="true">{{settings.system.leenabled}}
</visibility>
<content><![CDATA[
Alias "/.well-known/acme-challenge" "{{settings.system.letsencryptchallengepath}}/.well-known/acme-challenge"
<Directory "{{settings.system.letsencryptchallengepath}}/.well-known/acme-challenge">
Order allow,deny
Allow from all
</Directory>
]]>
</content>
</file>
<command><![CDATA[rc-update add apache2 default]]></command>
<command><![CDATA[{{settings.system.apachereload_command}}]]></command>
</daemon>
<daemon name="apache" version="2.4" title="Apache 2.4"> <daemon name="apache" version="2.4" title="Apache 2.4">
<install><![CDATA[emerge www-servers/apache]]></install>
<include>//service[@type='http']/general/commands</include> <include>//service[@type='http']/general/commands</include>
<file name="/etc/apache2/modules.d/70_fastcgi.conf"> <file name="/etc/apache2/modules.d/70_fastcgi.conf">
<visibility mode="true">{{settings.phpfpm.enabled}} <visibility mode="true">{{settings.phpfpm.enabled}}
@@ -3864,6 +3829,11 @@ aliases: files
</visibility> </visibility>
<command><![CDATA[echo "www-servers/apache suexec" >> /etc/portage/package.use/froxlor]]></command> <command><![CDATA[echo "www-servers/apache suexec" >> /etc/portage/package.use/froxlor]]></command>
</commands> </commands>
<install>
<visibility mode="true">{{settings.system.mod_fcgid}}
</visibility>
<command><![CDATA[echo "www-servers/apache apache2_modules_proxy_fcgi" >> /etc/portage/package.use/froxlor]]></command>
</install>
<install> <install>
<visibility mode="equals" value="apache2">{{settings.system.webserver}} <visibility mode="equals" value="apache2">{{settings.system.webserver}}
</visibility> </visibility>
@@ -3904,7 +3874,12 @@ aliases: files
<install> <install>
<visibility mode="equals" value="apache2">{{settings.system.webserver}} <visibility mode="equals" value="apache2">{{settings.system.webserver}}
</visibility> </visibility>
<content><![CDATA[emerge www-servers/apache www-apache/mod_fastcgi]]></content> <content><![CDATA[emerge www-servers/apache www-apache/mod_fastcgi_handler]]></content>
</install>
<install>
<visibility mode="true">{{settings.phpfpm.enabled}}
</visibility>
<command><![CDATA[echo "www-servers/apache apache2_modules_proxy_fcgi" >> /etc/portage/package.use/froxlor]]></command>
</install> </install>
<commands index="2"> <commands index="2">
<visibility mode="equals" value="apache2">{{settings.system.webserver}} <visibility mode="equals" value="apache2">{{settings.system.webserver}}