add 'goaccess' as new and default traffic analyzer tool

Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
Michael Kaufmann
2022-11-03 08:58:11 +01:00
parent a052333296
commit a8dc576833
27 changed files with 254 additions and 157 deletions

View File

@@ -185,7 +185,7 @@ return [
'apache2', 'apache2',
'nginx' 'nginx'
], ],
'visible' => Settings::Get('system.awstats_enabled') == 1, 'visible' => Settings::Get('system.traffictool') != 'webalizer',
'advanced_mode' => true 'advanced_mode' => true
], ],
'system_logfiles_type' => [ 'system_logfiles_type' => [

View File

@@ -31,6 +31,19 @@ return [
'title' => lng('admin.statisticsettings'), 'title' => lng('admin.statisticsettings'),
'icon' => 'fa-solid fa-chart-area', 'icon' => 'fa-solid fa-chart-area',
'fields' => [ 'fields' => [
'system_traffictool' => [
'label' => lng('serversettings.traffictool.toolselect'),
'settinggroup' => 'system',
'varname' => 'traffictool',
'type' => 'select',
'default' => 'goaccess',
'select_var' => [
'webalizer' => lng('serversettings.traffictool.webalizer'),
'awstats' => lng('serversettings.traffictool.awstats'),
'goaccess' => lng('serversettings.traffictool.goaccess')
],
'save_method' => 'storeSettingUpdateTrafficTool',
],
'system_webalizer_quiet' => [ 'system_webalizer_quiet' => [
'label' => lng('serversettings.webalizer_quiet'), 'label' => lng('serversettings.webalizer_quiet'),
'settinggroup' => 'system', 'settinggroup' => 'system',
@@ -43,15 +56,7 @@ return [
2 => lng('admin.webalizer.veryquiet') 2 => lng('admin.webalizer.veryquiet')
], ],
'save_method' => 'storeSettingField', 'save_method' => 'storeSettingField',
'visible' => Settings::Get('system.awstats_enabled') == 0 'visible' => Settings::Get('system.traffictool') == 'webalizer'
],
'system_awstats_enabled' => [
'label' => lng('serversettings.awstats_enabled'),
'settinggroup' => 'system',
'varname' => 'awstats_enabled',
'type' => 'checkbox',
'default' => false,
'save_method' => 'storeSettingField'
], ],
'system_awstats_path' => [ 'system_awstats_path' => [
'label' => lng('serversettings.awstats_path'), 'label' => lng('serversettings.awstats_path'),
@@ -61,7 +66,7 @@ return [
'string_type' => 'dir', 'string_type' => 'dir',
'default' => '/usr/share/awstats/tools/', 'default' => '/usr/share/awstats/tools/',
'save_method' => 'storeSettingField', 'save_method' => 'storeSettingField',
'visible' => Settings::Get('system.awstats_enabled') == 1 'visible' => Settings::Get('system.traffictool') == 'awstats'
], ],
'system_awstats_awstatspath' => [ 'system_awstats_awstatspath' => [
'label' => lng('serversettings.awstats_awstatspath'), 'label' => lng('serversettings.awstats_awstatspath'),
@@ -71,7 +76,7 @@ return [
'string_type' => 'dir', 'string_type' => 'dir',
'default' => '/usr/lib/cgi-bin/', 'default' => '/usr/lib/cgi-bin/',
'save_method' => 'storeSettingField', 'save_method' => 'storeSettingField',
'visible' => Settings::Get('system.awstats_enabled') == 1 'visible' => Settings::Get('system.traffictool') == 'awstats'
], ],
'system_awstats_conf' => [ 'system_awstats_conf' => [
'label' => lng('serversettings.awstats_conf'), 'label' => lng('serversettings.awstats_conf'),
@@ -81,7 +86,7 @@ return [
'string_type' => 'dir', 'string_type' => 'dir',
'default' => '/etc/awstats/', 'default' => '/etc/awstats/',
'save_method' => 'storeSettingField', 'save_method' => 'storeSettingField',
'visible' => Settings::Get('system.awstats_enabled') == 1 'visible' => Settings::Get('system.traffictool') == 'awstats'
], ],
'system_awstats_icons' => [ 'system_awstats_icons' => [
'label' => lng('serversettings.awstats_icons'), 'label' => lng('serversettings.awstats_icons'),
@@ -91,7 +96,7 @@ return [
'string_type' => 'dir', 'string_type' => 'dir',
'default' => '/usr/share/awstats/icon/', 'default' => '/usr/share/awstats/icon/',
'save_method' => 'storeSettingField', 'save_method' => 'storeSettingField',
'visible' => Settings::Get('system.awstats_enabled') == 1 'visible' => Settings::Get('system.traffictool') == 'awstats'
], ],
'system_awstats_logformat' => [ 'system_awstats_logformat' => [
'label' => lng('serversettings.awstats.logformat'), 'label' => lng('serversettings.awstats.logformat'),
@@ -100,7 +105,7 @@ return [
'type' => 'text', 'type' => 'text',
'default' => '1', 'default' => '1',
'save_method' => 'storeSettingField', 'save_method' => 'storeSettingField',
'visible' => Settings::Get('system.awstats_enabled') == 1, 'visible' => Settings::Get('system.traffictool') == 'awstats',
'advanced_mode' => true 'advanced_mode' => true
] ]
] ]

View File

@@ -26,7 +26,6 @@
const AREA = 'admin'; const AREA = 'admin';
require __DIR__ . '/lib/init.php'; require __DIR__ . '/lib/init.php';
use Exception;
use Froxlor\Cron\TaskId; use Froxlor\Cron\TaskId;
use Froxlor\Froxlor; use Froxlor\Froxlor;
use Froxlor\FroxlorLogger; use Froxlor\FroxlorLogger;

View File

@@ -575,8 +575,6 @@ opcache.validate_timestamps'),
('system', 'default_sslvhostconf', ''), ('system', 'default_sslvhostconf', ''),
('system', 'mail_quota_enabled', '0'), ('system', 'mail_quota_enabled', '0'),
('system', 'mail_quota', '100'), ('system', 'mail_quota', '100'),
('system', 'webalizer_enabled', '1'),
('system', 'awstats_enabled', '0'),
('system', 'httpuser', 'www-data'), ('system', 'httpuser', 'www-data'),
('system', 'httpgroup', 'www-data'), ('system', 'httpgroup', 'www-data'),
('system', 'webserver', 'apache2'), ('system', 'webserver', 'apache2'),
@@ -700,6 +698,7 @@ opcache.validate_timestamps'),
('system', 'update_channel', 'stable'), ('system', 'update_channel', 'stable'),
('system', 'updatecheck_data', ''), ('system', 'updatecheck_data', ''),
('system', 'update_notify_last', '2.0.0-beta1'), ('system', 'update_notify_last', '2.0.0-beta1'),
('system', 'traffictool', 'goaccess'),
('api', 'enabled', '0'), ('api', 'enabled', '0'),
('2fa', 'enabled', '1'), ('2fa', 'enabled', '1'),
('panel', 'decimal_places', '4'), ('panel', 'decimal_places', '4'),
@@ -743,7 +742,7 @@ opcache.validate_timestamps'),
('panel', 'logo_overridecustom', '0'), ('panel', 'logo_overridecustom', '0'),
('panel', 'settings_mode', '0'), ('panel', 'settings_mode', '0'),
('panel', 'version', '2.0.0-beta1'), ('panel', 'version', '2.0.0-beta1'),
('panel', 'db_version', '202112310'); ('panel', 'db_version', '202211030');
DROP TABLE IF EXISTS `panel_tasks`; DROP TABLE IF EXISTS `panel_tasks`;

View File

@@ -176,3 +176,14 @@ if (Froxlor::isFroxlorVersion('0.10.38')) {
Froxlor::updateToVersion($update_to); Froxlor::updateToVersion($update_to);
} }
if (Froxlor::isDatabaseVersion('202112310')) {
Update::showUpdateStep("Adjusting traffic tool settings");
$traffic_tool = Settings::Get('system.awstats_enabled') == 1 ? 'awstats' : 'webalizer';
Settings::AddNew("system.traffictool", $traffic_tool);
Database::query("DELETE FROM `" . TABLE_PANEL_SETTINGS . "` WHERE `settinggroup` = 'system' AND `varname` = 'awstats_enabled'");
Update::lastStepStatus(0);
Froxlor::updateToDbVersion('202211030');
}

View File

@@ -633,10 +633,7 @@ class Customers extends ApiCommand implements ResourceEntity
'passwd' => $htpasswdPassword 'passwd' => $htpasswdPassword
]; ];
$stats_folder = 'webalizer'; $stats_folder = Settings::Get('system.traffictool');
if (Settings::Get('system.awstats_enabled') == '1') {
$stats_folder = 'awstats';
}
$ins_data['path'] = FileDir::makeCorrectDir($documentroot . '/' . $stats_folder . '/'); $ins_data['path'] = FileDir::makeCorrectDir($documentroot . '/' . $stats_folder . '/');
$this->logger()->logAction(FroxlorLogger::ADM_ACTION, LOG_NOTICE, "[API] automatically added " . $stats_folder . " htpasswd for user '" . $loginname . "'"); $this->logger()->logAction(FroxlorLogger::ADM_ACTION, LOG_NOTICE, "[API] automatically added " . $stats_folder . " htpasswd for user '" . $loginname . "'");
Database::pexecute($ins_stmt, $ins_data, true, true); Database::pexecute($ins_stmt, $ins_data, true, true);

View File

@@ -1032,30 +1032,17 @@ class Apache extends HttpConfigBase
{ {
$stats_text = ''; $stats_text = '';
$statTool = Settings::Get('system.traffictool');
$statDomain = ($domain['parentdomainid'] == '0') ? $domain['domain'] : $domain['parentdomain'];
if ($domain['speciallogfile'] == '1') { if ($domain['speciallogfile'] == '1') {
$statDomain = ($domain['parentdomainid'] == '0') ? $domain['domain'] : $domain['parentdomain']; $statDomain = $domain['domain'];
if (Settings::Get('system.awstats_enabled') == '1') { }
$stats_text .= ' Alias /awstats "' . FileDir::makeCorrectFile($domain['customerroot'] . '/awstats/' . $statDomain) . '"' . "\n"; $statDocroot = FileDir::makeCorrectFile($domain['customerroot'] . '/'.$statTool.'/' . $statDomain);
$stats_text .= ' Alias /'.$statTool.' "' . $statDocroot . '"' . "\n";
// awstats special requirement for icons
if ($statTool == 'awstats') {
$stats_text .= ' Alias /awstats-icon "' . FileDir::makeCorrectDir(Settings::Get('system.awstats_icons')) . '"' . "\n"; $stats_text .= ' Alias /awstats-icon "' . FileDir::makeCorrectDir(Settings::Get('system.awstats_icons')) . '"' . "\n";
} else {
$stats_text .= ' Alias /webalizer "' . FileDir::makeCorrectFile($domain['customerroot'] . '/webalizer/' . $statDomain) . '"' . "\n";
}
} else {
if ($domain['customerroot'] != $domain['documentroot']) {
if (Settings::Get('system.awstats_enabled') == '1') {
$stats_text .= ' Alias /awstats "' . FileDir::makeCorrectFile($domain['customerroot'] . '/awstats/' . $domain['domain']) . '"' . "\n";
$stats_text .= ' Alias /awstats-icon "' . FileDir::makeCorrectDir(Settings::Get('system.awstats_icons')) . '"' . "\n";
} else {
$stats_text .= ' Alias /webalizer "' . FileDir::makeCorrectFile($domain['customerroot'] . '/webalizer') . '"' . "\n";
}
} elseif (Settings::Get('system.awstats_enabled') == '1') {
// if the docroots are equal, we still have to set an alias for awstats
// because the stats are in /awstats/[domain], not just /awstats/
// also, the awstats-icons are someplace else too!
// -> webalizer does not need this!
$stats_text .= ' Alias /awstats "' . FileDir::makeCorrectFile($domain['documentroot'] . '/awstats/' . $domain['domain']) . '"' . "\n";
$stats_text .= ' Alias /awstats-icon "' . FileDir::makeCorrectDir(Settings::Get('system.awstats_icons')) . '"' . "\n";
}
} }
return $stats_text; return $stats_text;
@@ -1138,7 +1125,7 @@ class Apache extends HttpConfigBase
$logfiles_text .= ' CustomLog "' . $access_log . '" ' . $logtype . "\n"; $logfiles_text .= ' CustomLog "' . $access_log . '" ' . $logtype . "\n";
} }
if (Settings::Get('system.awstats_enabled') == '1') { if (Settings::Get('system.traffictool') == 'awstats') {
if ((int)$domain['parentdomainid'] == 0) { if ((int)$domain['parentdomainid'] == 0) {
// prepare the aliases and subdomains for stats config files // prepare the aliases and subdomains for stats config files
$server_alias = ''; $server_alias = '';

View File

@@ -85,7 +85,7 @@ class ConfigIO
*/ */
private function cleanAwstatsFiles() private function cleanAwstatsFiles()
{ {
if (Settings::Get('system.awstats_enabled') == '0') { if (Settings::Get('system.traffictool') != 'awstats') {
return; return;
} }

View File

@@ -717,38 +717,18 @@ class Lighttpd extends HttpConfigBase
{ {
$stats_text = ''; $stats_text = '';
$statTool = Settings::Get('system.traffictool');
$statDomain = ($domain['parentdomainid'] == '0') ? $domain['domain'] : $domain['parentdomain'];
if ($domain['speciallogfile'] == '1') { if ($domain['speciallogfile'] == '1') {
if ($domain['parentdomainid'] == '0') { $statDomain = $domain['domain'];
if (Settings::Get('system.awstats_enabled') == '1') { }
$stats_text .= ' alias.url = ( "/awstats/" => "' . FileDir::makeCorrectFile($domain['customerroot'] . '/awstats/' . $domain['domain']) . '" )' . "\n"; $statDocroot = FileDir::makeCorrectFile($domain['customerroot'] . '/'.$statTool.'/' . $statDomain);
$stats_text .= ' alias.url += ( "/awstats-icon" => "' . FileDir::makeCorrectDir(Settings::Get('system.awstats_icons')) . '" )' . "\n";
} else { $stats_text .= ' alias.url = ( "/'.$statTool.'/" => "' . $statDocroot . '" )' . "\n";
$stats_text .= ' alias.url = ( "/webalizer/" => "' . FileDir::makeCorrectFile($domain['customerroot'] . '/webalizer/' . $domain['domain']) . '/" )' . "\n";
} // awstats special requirement for icons
} else { if ($statTool == 'awstats') {
if (Settings::Get('system.awstats_enabled') == '1') { $stats_text .= ' alias.url += ( "/awstats-icon" => "' . FileDir::makeCorrectDir(Settings::Get('system.awstats_icons')) . '" )' . "\n";
$stats_text .= ' alias.url = ( "/awstats/" => "' . FileDir::makeCorrectFile($domain['customerroot'] . '/awstats/' . $domain['parentdomain']) . '" )' . "\n";
$stats_text .= ' alias.url += ( "/awstats-icon" => "' . FileDir::makeCorrectDir(Settings::Get('system.awstats_icons')) . '" )' . "\n";
} else {
$stats_text .= ' alias.url = ( "/webalizer/" => "' . FileDir::makeCorrectFile($domain['customerroot'] . '/webalizer/' . $domain['parentdomain']) . '/" )' . "\n";
}
}
} else {
if ($domain['customerroot'] != $domain['documentroot']) {
if (Settings::Get('system.awstats_enabled') == '1') {
$stats_text .= ' alias.url = ( "/awstats/" => "' . FileDir::makeCorrectFile($domain['customerroot'] . '/awstats/' . $domain['domain']) . '" )' . "\n";
$stats_text .= ' alias.url += ( "/awstats-icon" => "' . FileDir::makeCorrectDir(Settings::Get('system.awstats_icons')) . '" )' . "\n";
} else {
$stats_text .= ' alias.url = ( "/webalizer/" => "' . FileDir::makeCorrectFile($domain['customerroot'] . '/webalizer/') . '" )' . "\n";
}
} elseif (Settings::Get('system.awstats_enabled') == '1') {
// if the docroots are equal, we still have to set an alias for awstats
// because the stats are in /awstats/[domain], not just /awstats/
// also, the awstats-icons are someplace else too!
// -> webalizer does not need this!
$stats_text .= ' alias.url = ( "/awstats/" => "' . FileDir::makeCorrectFile($domain['documentroot'] . '/awstats/' . $domain['domain']) . '" )' . "\n";
$stats_text .= ' alias.url += ( "/awstats-icon" => "' . FileDir::makeCorrectDir(Settings::Get('system.awstats_icons')) . '" )' . "\n";
}
} }
return $stats_text; return $stats_text;
@@ -837,7 +817,7 @@ class Lighttpd extends HttpConfigBase
$logfiles_text .= ' accesslog.filename = "' . $access_log . '"' . "\n"; $logfiles_text .= ' accesslog.filename = "' . $access_log . '"' . "\n";
} }
if (Settings::Get('system.awstats_enabled') == '1') { if (Settings::Get('system.traffictool') == 'awstats') {
if ((int)$domain['parentdomainid'] == 0) { if ((int)$domain['parentdomainid'] == 0) {
// prepare the aliases and subdomains for stats config files // prepare the aliases and subdomains for stats config files
$server_alias = ''; $server_alias = '';

View File

@@ -725,7 +725,7 @@ class Nginx extends HttpConfigBase
$logfiles_text .= "\t" . 'access_log ' . $access_log . ' ' . $logtype . ';' . "\n"; $logfiles_text .= "\t" . 'access_log ' . $access_log . ' ' . $logtype . ';' . "\n";
$logfiles_text .= "\t" . 'error_log ' . $error_log . ' ' . Settings::Get('system.errorlog_level') . ';' . "\n"; $logfiles_text .= "\t" . 'error_log ' . $error_log . ' ' . Settings::Get('system.errorlog_level') . ';' . "\n";
if (Settings::Get('system.awstats_enabled') == '1') { if (Settings::Get('system.traffictool') == 'awstats') {
if ((int)$domain['parentdomainid'] == 0) { if ((int)$domain['parentdomainid'] == 0) {
// prepare the aliases and subdomains for stats config files // prepare the aliases and subdomains for stats config files
$server_alias = ''; $server_alias = '';
@@ -962,6 +962,7 @@ class Nginx extends HttpConfigBase
switch ($single['path']) { switch ($single['path']) {
case '/awstats/': case '/awstats/':
case '/webalizer/': case '/webalizer/':
case '/goaccess/':
// no stats-alias in "location /"-context // no stats-alias in "location /"-context
break; break;
default: default:
@@ -1023,6 +1024,7 @@ class Nginx extends HttpConfigBase
switch ($single['path']) { switch ($single['path']) {
case '/awstats/': case '/awstats/':
case '/webalizer/': case '/webalizer/':
case '/goaccess/':
$path_options .= $this->getStats($domain, $single); $path_options .= $this->getStats($domain, $single);
unset($htpasswds[$idx]); unset($htpasswds[$idx]);
break; break;
@@ -1115,35 +1117,21 @@ class Nginx extends HttpConfigBase
{ {
$stats_text = ''; $stats_text = '';
// define basic path to the stats $statTool = Settings::Get('system.traffictool');
if (Settings::Get('system.awstats_enabled') == '1') { $statDomain = ($domain['parentdomainid'] == '0') ? $domain['domain'] : $domain['parentdomain'];
$alias_dir = FileDir::makeCorrectFile($domain['customerroot'] . '/awstats/'); if ($domain['speciallogfile'] == '1') {
} else { $statDomain = $domain['domain'];
$alias_dir = FileDir::makeCorrectFile($domain['customerroot'] . '/webalizer/');
} }
$statDocroot = FileDir::makeCorrectFile($domain['customerroot'] . '/'.$statTool.'/' . $statDomain);
// if this is a parentdomain, we use this domain-name $stats_text .= "\t" . 'location ^~ /'.$statTool.' {' . "\n";
if ($domain['parentdomainid'] == '0') { $stats_text .= "\t\t" . 'alias ' . $statDocroot . '/;' . "\n";
$alias_dir = FileDir::makeCorrectDir($alias_dir . '/' . $domain['domain']);
} else {
$alias_dir = FileDir::makeCorrectDir($alias_dir . '/' . $domain['parentdomain']);
}
if (Settings::Get('system.awstats_enabled') == '1') {
// awstats
$stats_text .= "\t" . 'location ^~ /awstats/ {' . "\n";
} else {
// webalizer
$stats_text .= "\t" . 'location ^~ /webalizer {' . "\n";
}
$stats_text .= "\t\t" . 'alias ' . $alias_dir . ';' . "\n";
$stats_text .= "\t\t" . 'auth_basic "' . $single['authname'] . '";' . "\n"; $stats_text .= "\t\t" . 'auth_basic "' . $single['authname'] . '";' . "\n";
$stats_text .= "\t\t" . 'auth_basic_user_file ' . FileDir::makeCorrectFile($single['usrf']) . ';' . "\n"; $stats_text .= "\t\t" . 'auth_basic_user_file ' . FileDir::makeCorrectFile($single['usrf']) . ';' . "\n";
$stats_text .= "\t" . '}' . "\n\n"; $stats_text .= "\t" . '}' . "\n\n";
// awstats icons // awstats special requirement for icons
if (Settings::Get('system.awstats_enabled') == '1') { if ($statTool == 'awstats') {
$stats_text .= "\t" . 'location ~ ^/awstats-icon/(.*)$ {' . "\n"; $stats_text .= "\t" . 'location ~ ^/awstats-icon/(.*)$ {' . "\n";
$stats_text .= "\t\t" . 'alias ' . FileDir::makeCorrectDir(Settings::Get('system.awstats_icons')) . '$1;' . "\n"; $stats_text .= "\t\t" . 'alias ' . FileDir::makeCorrectDir(Settings::Get('system.awstats_icons')) . '$1;' . "\n";
$stats_text .= "\t" . '}' . "\n\n"; $stats_text .= "\t" . '}' . "\n\n";

View File

@@ -205,21 +205,16 @@ class TasksCron extends FroxlorCron
$usermaildir = FileDir::makeCorrectDir(Settings::Get('system.vmail_homedir') . '/' . $row['data']['loginname'] . '/'); $usermaildir = FileDir::makeCorrectDir(Settings::Get('system.vmail_homedir') . '/' . $row['data']['loginname'] . '/');
// stats directory // stats directory
if (Settings::Get('system.awstats_enabled') == '1') { $statsdir = FileDir::makeCorrectDir($userhomedir . '/' . Settings::Get('system.traffictool'));
FroxlorLogger::getInstanceOf()->logAction(FroxlorLogger::CRON_ACTION, LOG_NOTICE, 'Running: mkdir -p ' . escapeshellarg($userhomedir . 'awstats')); FroxlorLogger::getInstanceOf()->logAction(FroxlorLogger::CRON_ACTION, LOG_NOTICE, 'Running: mkdir -p ' . escapeshellarg($statsdir));
FileDir::safe_exec('mkdir -p ' . escapeshellarg($userhomedir . 'awstats')); FileDir::safe_exec('mkdir -p ' . escapeshellarg($statsdir));
foreach (['webalizer', 'awstats', 'goaccess'] as $statstools) {
$statsdir = FileDir::makeCorrectDir($userhomedir . '/' . $statstool);
// in case we changed from the other stats -> remove old // in case we changed from the other stats -> remove old
// (yes i know, the stats are lost - that's why you should not change all the time!) if (Settings::Get('system.traffictool') != $statstools && file_exists($statsdir)) {
if (file_exists($userhomedir . 'webalizer')) { // (yes i know, the stats are lost - that's why you should not change all the time!)
FileDir::safe_exec('rm -rf ' . escapeshellarg($userhomedir . 'webalizer')); FileDir::safe_exec('rm -rf ' . escapeshellarg($statsdir));
}
} else {
FroxlorLogger::getInstanceOf()->logAction(FroxlorLogger::CRON_ACTION, LOG_NOTICE, 'Running: mkdir -p ' . escapeshellarg($userhomedir . 'webalizer'));
FileDir::safe_exec('mkdir -p ' . escapeshellarg($userhomedir . 'webalizer'));
// in case we changed from the other stats -> remove old
// (yes i know, the stats are lost - that's why you should not change all the time!)
if (file_exists($userhomedir . 'awstats')) {
FileDir::safe_exec('rm -rf ' . escapeshellarg($userhomedir . 'awstats'));
} }
} }

View File

@@ -185,6 +185,8 @@ class TrafficCron extends FroxlorCron
$current_stamp = time(); $current_stamp = time();
$current_year = date('Y', $current_stamp); $current_year = date('Y', $current_stamp);
$current_month = date('m', $current_stamp); $current_month = date('m', $current_stamp);
// @todo locale?
$current_month_short = date('M', $current_stamp);
$current_day = date('d', $current_stamp); $current_day = date('d', $current_stamp);
while ($row = $result_stmt->fetch(PDO::FETCH_ASSOC)) { while ($row = $result_stmt->fetch(PDO::FETCH_ASSOC)) {
@@ -215,11 +217,17 @@ class TrafficCron extends FroxlorCron
$httptraffic = 0; $httptraffic = 0;
reset($domainlist[$row['customerid']]); reset($domainlist[$row['customerid']]);
$statsTool = Settings::Get('system.traffictool');
if (isset($speciallogfile_domainlist[$row['customerid']]) && is_array($speciallogfile_domainlist[$row['customerid']]) && count($speciallogfile_domainlist[$row['customerid']]) != 0) { if (isset($speciallogfile_domainlist[$row['customerid']]) && is_array($speciallogfile_domainlist[$row['customerid']]) && count($speciallogfile_domainlist[$row['customerid']]) != 0) {
reset($speciallogfile_domainlist[$row['customerid']]); reset($speciallogfile_domainlist[$row['customerid']]);
if (Settings::Get('system.awstats_enabled') == '0') { if ($statsTool != 'awstats') {
foreach ($speciallogfile_domainlist[$row['customerid']] as $domainid => $domain) { foreach ($speciallogfile_domainlist[$row['customerid']] as $domainid => $domain) {
$httptraffic += floatval(self::callWebalizerGetTraffic($row['loginname'] . '-' . $domain, $row['documentroot'] . '/webalizer/' . $domain . '/', $domain, $domainlist[$row['customerid']])); if ($statsTool == 'goaccess') {
$httptraffic += floatval(self::callGoaccessGetTraffic($row['loginname'] . '-' . $domain, $row['documentroot'] . '/goaccess/' . $domain . '/', $domain, $domainlist[$row['customerid']], ['month' => $current_month_short, 'year' => $current_year]));
} else {
$httptraffic += floatval(self::callWebalizerGetTraffic($row['loginname'] . '-' . $domain, $row['documentroot'] . '/webalizer/' . $domain . '/', $domain, $domainlist[$row['customerid']]));
}
} }
} }
} }
@@ -230,8 +238,10 @@ class TrafficCron extends FroxlorCron
// *not* also in the special-logfiles-loop, because the function // *not* also in the special-logfiles-loop, because the function
// will iterate through all customer-domains and the awstats-configs // will iterate through all customer-domains and the awstats-configs
// know the logfile-name, #246 // know the logfile-name, #246
if (Settings::Get('system.awstats_enabled') == '1') { if ($statsTool == 'awstats') {
$httptraffic += floatval(self::callAwstatsGetTraffic($row['customerid'], $row['documentroot'] . '/awstats/', $domainlist[$row['customerid']], $current_stamp)); $httptraffic += floatval(self::callAwstatsGetTraffic($row['customerid'], $row['documentroot'] . '/awstats/', $domainlist[$row['customerid']], $current_stamp));
} elseif ($statsTool == 'goaccess') {
$httptraffic += floatval(self::callGoaccessGetTraffic($row['loginname'], $row['documentroot'] . '/goaccess/', $caption, $domainlist[$row['customerid']], ['month' => $current_month_short, 'year' => $current_year]));
} else { } else {
$httptraffic += floatval(self::callWebalizerGetTraffic($row['loginname'], $row['documentroot'] . '/webalizer/', $caption, $domainlist[$row['customerid']])); $httptraffic += floatval(self::callWebalizerGetTraffic($row['loginname'], $row['documentroot'] . '/webalizer/', $caption, $domainlist[$row['customerid']]));
} }
@@ -608,19 +618,59 @@ class TrafficCron extends FroxlorCron
} }
} }
/**
* Run goaccess to create statistics and return used traffic since last run
*
* @param string $logfile Name of logfile
* @param string $outputdir Place where stats should be build
* @param string $caption Caption for webalizer output
* @param array $usersdomainlist
*
* @return int Used traffic
*/
private static function callGoaccessGetTraffic($logfile, $outputdir, $caption, array $usersdomainlist = [], array $monthyear_arr = [])
{
$returnval = 0;
$logfile = FileDir::makeCorrectFile(Settings::Get('system.logfiles_directory') . $logfile . '-access.log');
if (file_exists($logfile)) {
$outputdir = FileDir::makeCorrectDir($outputdir);
if (!file_exists($outputdir)) {
FileDir::safe_exec('mkdir -p ' . escapeshellarg($outputdir));
}
if (file_exists($outputdir . '.tmp.json')) {
@unlink($outputdir . '.tmp.json');
}
$format = Settings::Get('system.logfiles_type') == '2' ? 'VCOMBINED' : 'COMBINED';
$monthyear = $monthyear_arr['month'] . '/' . $monthyear_arr['year'];
$return_value = false;
FileDir::safe_exec("grep '" . $monthyear . "' " . escapeshellarg($logfile) . " | goaccess -o " . escapeshellarg($outputdir . '.tmp.json') . " -o " . escapeshellarg($outputdir . 'index.html') . " --html-report-title=" . escapeshellarg($caption) . " --log-format=" . $format . " - ", $return_value, ['|']);
if (file_exists($outputdir . '.tmp.json')) {
$statscontent = json_decode(file_get_contents($outputdir . '.tmp.json'), true);
if ($statscontent) {
$returnval = $statscontent['general']['bandwidth'] ?? 0;
}
@unlink($outputdir . '.tmp.json');
}
}
return $returnval;
}
/** /**
* Function which make webalizer statistics and returns used traffic since last run * Function which make webalizer statistics and returns used traffic since last run
* *
* @param * @param string $logfile Name of logfile
* string Name of logfile * @param string $outputdir Place where stats should be build
* @param * @param string $caption Caption for webalizer output
* string Place where stats should be build * @param array $usersdomainlist
* @param *
* string Caption for webalizer output * @return float Used traffic
* @return int Used traffic
* @author Florian Lippert <flo@syscp.org> (2003-2009)
*/ */
private static function callWebalizerGetTraffic($logfile, $outputdir, $caption, $usersdomainlist) private static function callWebalizerGetTraffic($logfile, $outputdir, $caption, array $usersdomainlist = [])
{ {
$returnval = 0; $returnval = 0;
@@ -738,7 +788,7 @@ class TrafficCron extends FroxlorCron
// as we check for the config-model awstats will only parse // as we check for the config-model awstats will only parse
// 'real' domains and no subdomains which are aliases in the // 'real' domains and no subdomains which are aliases in the
// model-config-file. // model-config-file.
$returnval += self::awstatsDoSingleDomain($singledomain, $outputdir); $returnval += self::awstatsDoSingleDomain($singledomain, $outputdir, $current_stamp);
} }
/** /**
@@ -774,7 +824,7 @@ class TrafficCron extends FroxlorCron
return floatval($returnval); return floatval($returnval);
} }
private static function awstatsDoSingleDomain($domain, $outputdir) private static function awstatsDoSingleDomain($domain, $outputdir, $current_stamp)
{ {
$returnval = 0; $returnval = 0;
@@ -799,7 +849,7 @@ class TrafficCron extends FroxlorCron
} }
FroxlorLogger::getInstanceOf()->logAction(FroxlorLogger::CRON_ACTION, LOG_INFO, "Running awstats_buildstaticpages.pl for domain '" . $domain . "' (Output: '" . $staticOutputdir . "')"); FroxlorLogger::getInstanceOf()->logAction(FroxlorLogger::CRON_ACTION, LOG_INFO, "Running awstats_buildstaticpages.pl for domain '" . $domain . "' (Output: '" . $staticOutputdir . "')");
FileDir::safe_exec($awbsp . ' -awstatsprog=' . escapeshellarg($awprog) . ' -update -month=' . date('m') . ' -year=' . date('Y') . ' -config=' . $domain . ' -dir=' . escapeshellarg($staticOutputdir)); FileDir::safe_exec($awbsp . ' -awstatsprog=' . escapeshellarg($awprog) . ' -update -month=' . date('m', $current_stamp) . ' -year=' . date('Y', $current_stamp) . ' -config=' . $domain . ' -dir=' . escapeshellarg($staticOutputdir));
// update our awstats index files // update our awstats index files
self::awstatsGenerateIndex($domain, $outputdir); self::awstatsGenerateIndex($domain, $outputdir);

View File

@@ -34,7 +34,7 @@ final class Froxlor
const VERSION = '2.0.0-beta1'; const VERSION = '2.0.0-beta1';
// Database version (YYYYMMDDC where C is a daily counter) // Database version (YYYYMMDDC where C is a daily counter)
const DBVERSION = '202112310'; const DBVERSION = '202211030';
// Distribution branding-tag (used for Debian etc.) // Distribution branding-tag (used for Debian etc.)
const BRANDING = ''; const BRANDING = '';

View File

@@ -148,12 +148,7 @@ class Statistics
} }
// get correct directory // get correct directory
$dir = $row['documentroot']; $dir = $row['documentroot'] . '/' . Settings::Get('system.traffictool') . '/';
if (Settings::Get('system.awstats_enabled') == '1') {
$dir .= '/awstats/';
} else {
$dir .= '/webalizer/';
}
// only run chown if directory exists // only run chown if directory exists
if (file_exists($dir)) { if (file_exists($dir)) {

View File

@@ -661,7 +661,7 @@ class Core
private function createJsonArray() private function createJsonArray()
{ {
$system_params = ["cron", "libnssextrausers", "logrotate"]; $system_params = ["cron", "libnssextrausers", "logrotate", "goaccess"];
if ($this->validatedData['webserver_backend'] == 'php-fpm') { if ($this->validatedData['webserver_backend'] == 'php-fpm') {
$system_params[] = 'php-fpm'; $system_params[] = 'php-fpm';
} elseif ($this->validatedData['webserver_backend'] == 'fcgid') { } elseif ($this->validatedData['webserver_backend'] == 'fcgid') {

View File

@@ -469,4 +469,23 @@ class Store
} }
return $value; return $value;
} }
public static function storeSettingUpdateTrafficTool($fieldname, $fielddata, $newfieldvalue)
{
$returnvalue = self::storeSettingField($fieldname, $fielddata, $newfieldvalue);
if ($returnvalue !== false && is_array($fielddata) && isset($fielddata['settinggroup']) && $fielddata['settinggroup'] == 'system' && isset($fielddata['varname']) && $fielddata['varname'] == 'traffictool' && $newfieldvalue != $fielddata['value']) {
$oldpath = '/'.$fielddata['value'].'/';
$newpath = '/'.$newfieldvalue.'/';
$upd_stmt = Database::query("
UPDATE `" . TABLE_PANEL_HTPASSWDS . "` SET `path` = :newpath WHERE `path` = :oldpath
");
Database::pexecute($upd_stmt, [
'newpath' => $newpath,
'oldpath' => $oldpath
]);
}
return $returnvalue;
}
} }

View File

@@ -81,11 +81,8 @@ class Domain
$result .= '<a href="http://' . $attributes['data'] . '" target="_blank">' . $attributes['data'] . '</a>'; $result .= '<a href="http://' . $attributes['data'] . '" target="_blank">' . $attributes['data'] . '</a>';
// check for statistics if parentdomainid==0 to show stats-link for customers // check for statistics if parentdomainid==0 to show stats-link for customers
if ((int)UI::getCurrentUser()['adminsession'] == 0 && $attributes['fields']['parentdomainid'] == 0) { if ((int)UI::getCurrentUser()['adminsession'] == 0 && $attributes['fields']['parentdomainid'] == 0) {
$statsapp = 'webalizer'; $statsapp = Settings::Get('system.traffictool');
if (Settings::Get('system.awstats_enabled') == '1') { $result .= ' <a href="http://' . $attributes['data'] . '/' . $statsapp . '" rel="external" target="_blank" title="' . lng('domains.statstics') . '"><i class="fa-solid fa-chart-line text-secondary"></i></a>';
$statsapp = 'awstats';
}
$result .= ' <a href="http://' . $attributes['data'] . '/' . $statsapp . '" rel="external" title="' . lng('domains.statstics') . '"><i class="fa-solid fa-chart-line text-secondary"></i></a>';
} }
if ($attributes['fields']['registration_date'] != '') { if ($attributes['fields']['registration_date'] != '') {
$result .= '<br><small>' . lng('domains.registration_date') . ': ' . $attributes['fields']['registration_date'] . '</small>'; $result .= '<br><small>' . lng('domains.registration_date') . ': ' . $attributes['fields']['registration_date'] . '</small>';

View File

@@ -4579,9 +4579,19 @@ UPLOADGID=
</service> </service>
<!-- System tools/services --> <!-- System tools/services -->
<service type="system" title="{{lng.admin.configfiles.etc}}"> <service type="system" title="{{lng.admin.configfiles.etc}}">
<!-- Webalizer -->
<daemon name="webalizer"
title="Webalizer (traffic analyzer)">
<install><![CDATA[apt-get install webalizer]]></install>
</daemon>
<!-- goaccess -->
<daemon name="goaccess"
title="goaccess (traffic analyzer)" default="true">
<install><![CDATA[apt-get install goaccess]]></install>
</daemon>
<!-- AWstats --> <!-- AWstats -->
<daemon name="awstats" <daemon name="awstats"
title="Awstats (webalizer alternative)"> title="Awstats (traffic analyzer)">
<install><![CDATA[apt-get install awstats]]></install> <install><![CDATA[apt-get install awstats]]></install>
<command><![CDATA[mv {{settings.system.awstats_conf}}/awstats.conf {{settings.system.awstats_conf}}/awstats.model.conf]]></command> <command><![CDATA[mv {{settings.system.awstats_conf}}/awstats.conf {{settings.system.awstats_conf}}/awstats.model.conf]]></command>
<command><![CDATA[sed -i.bak 's/^DirData/# DirData/' {{settings.system.awstats_conf}}/awstats.model.conf]]></command> <command><![CDATA[sed -i.bak 's/^DirData/# DirData/' {{settings.system.awstats_conf}}/awstats.model.conf]]></command>

View File

@@ -3218,9 +3218,19 @@ UPLOADGID=
</service> </service>
<!-- System tools/services --> <!-- System tools/services -->
<service type="system" title="{{lng.admin.configfiles.etc}}"> <service type="system" title="{{lng.admin.configfiles.etc}}">
<!-- Webalizer -->
<daemon name="webalizer"
title="Webalizer (traffic analyzer)">
<install><![CDATA[apt-get install webalizer]]></install>
</daemon>
<!-- goaccess -->
<daemon name="goaccess"
title="goaccess (traffic analyzer)" default="true">
<install><![CDATA[apt-get install goaccess]]></install>
</daemon>
<!-- AWstats --> <!-- AWstats -->
<daemon name="awstats" <daemon name="awstats"
title="Awstats (webalizer alternative)"> title="Awstats (traffic analyzer)">
<install><![CDATA[apt-get install awstats]]></install> <install><![CDATA[apt-get install awstats]]></install>
<command><![CDATA[mv {{settings.system.awstats_conf}}/awstats.conf {{settings.system.awstats_conf}}/awstats.model.conf]]></command> <command><![CDATA[mv {{settings.system.awstats_conf}}/awstats.conf {{settings.system.awstats_conf}}/awstats.model.conf]]></command>
<command><![CDATA[sed -i.bak 's/^DirData/# DirData/' {{settings.system.awstats_conf}}/awstats.model.conf]]></command> <command><![CDATA[sed -i.bak 's/^DirData/# DirData/' {{settings.system.awstats_conf}}/awstats.model.conf]]></command>

View File

@@ -4790,9 +4790,19 @@ UPLOADGID=
</service> </service>
<!-- System tools/services --> <!-- System tools/services -->
<service type="system" title="{{lng.admin.configfiles.etc}}"> <service type="system" title="{{lng.admin.configfiles.etc}}">
<!-- Webalizer -->
<daemon name="webalizer"
title="Webalizer (traffic analyzer)">
<install><![CDATA[apt-get install webalizer]]></install>
</daemon>
<!-- goaccess -->
<daemon name="goaccess"
title="goaccess (traffic analyzer)" default="true">
<install><![CDATA[apt-get install goaccess]]></install>
</daemon>
<!-- AWstats --> <!-- AWstats -->
<daemon name="awstats" <daemon name="awstats"
title="Awstats (webalizer alternative)"> title="Awstats (traffic analyzer)">
<install><![CDATA[apt-get install awstats]]></install> <install><![CDATA[apt-get install awstats]]></install>
<command><![CDATA[mv {{settings.system.awstats_conf}}/awstats.conf {{settings.system.awstats_conf}}/awstats.model.conf]]></command> <command><![CDATA[mv {{settings.system.awstats_conf}}/awstats.conf {{settings.system.awstats_conf}}/awstats.model.conf]]></command>
<command><![CDATA[sed -i.bak 's/^DirData/# DirData/' {{settings.system.awstats_conf}}/awstats.model.conf]]></command> <command><![CDATA[sed -i.bak 's/^DirData/# DirData/' {{settings.system.awstats_conf}}/awstats.model.conf]]></command>

View File

@@ -4781,9 +4781,19 @@ UPLOADGID=
</service> </service>
<!-- System tools/services --> <!-- System tools/services -->
<service type="system" title="{{lng.admin.configfiles.etc}}"> <service type="system" title="{{lng.admin.configfiles.etc}}">
<!-- Webalizer -->
<daemon name="webalizer"
title="Webalizer (traffic analyzer)">
<install><![CDATA[apt-get install webalizer]]></install>
</daemon>
<!-- goaccess -->
<daemon name="goaccess"
title="goaccess (traffic analyzer)" default="true">
<install><![CDATA[apt-get install goaccess]]></install>
</daemon>
<!-- AWstats --> <!-- AWstats -->
<daemon name="awstats" <daemon name="awstats"
title="Awstats (webalizer alternative)"> title="Awstats (traffic analyzer)">
<install><![CDATA[apt-get install awstats]]></install> <install><![CDATA[apt-get install awstats]]></install>
<command><![CDATA[mv {{settings.system.awstats_conf}}/awstats.conf {{settings.system.awstats_conf}}/awstats.model.conf]]></command> <command><![CDATA[mv {{settings.system.awstats_conf}}/awstats.conf {{settings.system.awstats_conf}}/awstats.model.conf]]></command>
<command><![CDATA[sed -i.bak 's/^DirData/# DirData/' {{settings.system.awstats_conf}}/awstats.model.conf]]></command> <command><![CDATA[sed -i.bak 's/^DirData/# DirData/' {{settings.system.awstats_conf}}/awstats.model.conf]]></command>

View File

@@ -3996,9 +3996,19 @@ UPLOADGID=
</service> </service>
<!-- System tools/services --> <!-- System tools/services -->
<service type="system" title="{{lng.admin.configfiles.etc}}"> <service type="system" title="{{lng.admin.configfiles.etc}}">
<!-- Webalizer -->
<daemon name="webalizer"
title="Webalizer (traffic analyzer)">
<install><![CDATA[apt-get install webalizer]]></install>
</daemon>
<!-- goaccess -->
<daemon name="goaccess"
title="goaccess (traffic analyzer)" default="true">
<install><![CDATA[apt-get install goaccess]]></install>
</daemon>
<!-- AWstats --> <!-- AWstats -->
<daemon name="awstats" <daemon name="awstats"
title="Awstats (webalizer alternative)"> title="Awstats (traffic analyzer)">
<install><![CDATA[apt-get install awstats]]></install> <install><![CDATA[apt-get install awstats]]></install>
<command><![CDATA[mv {{settings.system.awstats_conf}}/awstats.conf {{settings.system.awstats_conf}}/awstats.model.conf]]></command> <command><![CDATA[mv {{settings.system.awstats_conf}}/awstats.conf {{settings.system.awstats_conf}}/awstats.model.conf]]></command>
<command><![CDATA[sed -i.bak 's/^DirData/# DirData/' {{settings.system.awstats_conf}}/awstats.model.conf]]></command> <command><![CDATA[sed -i.bak 's/^DirData/# DirData/' {{settings.system.awstats_conf}}/awstats.model.conf]]></command>

View File

@@ -3664,9 +3664,19 @@ account required pam_mysql.so user=<SQL_UNPRIVILEGED_USER> passwd=<SQL_UN
</service> </service>
<!-- System tools/services --> <!-- System tools/services -->
<service type="system" title="{{lng.admin.configfiles.etc}}"> <service type="system" title="{{lng.admin.configfiles.etc}}">
<!-- Webalizer -->
<daemon name="webalizer"
title="Webalizer (traffic analyzer)">
<install><![CDATA[emerge app-admin/webalizer]]></install>
</daemon>
<!-- goaccess -->
<daemon name="goaccess"
title="goaccess (traffic analyzer)" default="true">
<install><![CDATA[emerge net-analyzer/goaccess]]></install>
</daemon>
<!-- AWstats --> <!-- AWstats -->
<daemon name="awstats" <daemon name="awstats"
title="Awstats (webalizer alternative)"> title="Awstats (traffic analyzer)">
<install><![CDATA[emerge www-misc/awstats]]></install> <install><![CDATA[emerge www-misc/awstats]]></install>
<command><![CDATA[sed -i.bak 's/^DirData/# DirData/' {{settings.system.awstats_conf}}/awstats.model.conf]]></command> <command><![CDATA[sed -i.bak 's/^DirData/# DirData/' {{settings.system.awstats_conf}}/awstats.model.conf]]></command>
<command><![CDATA[sed -i.bak 's|^\\(DirIcons=\\).*$|\\1\\"/awstats-icon\\"|' {{settings.system.awstats_conf}}/awstats.model.conf]]></command> <command><![CDATA[sed -i.bak 's|^\\(DirIcons=\\).*$|\\1\\"/awstats-icon\\"|' {{settings.system.awstats_conf}}/awstats.model.conf]]></command>

View File

@@ -3996,9 +3996,19 @@ UPLOADGID=
</service> </service>
<!-- System tools/services --> <!-- System tools/services -->
<service type="system" title="{{lng.admin.configfiles.etc}}"> <service type="system" title="{{lng.admin.configfiles.etc}}">
<!-- Webalizer -->
<daemon name="webalizer"
title="Webalizer (traffic analyzer)">
<install><![CDATA[apt-get install webalizer]]></install>
</daemon>
<!-- goaccess -->
<daemon name="goaccess"
title="goaccess (traffic analyzer)" default="true">
<install><![CDATA[apt-get install goaccess]]></install>
</daemon>
<!-- AWstats --> <!-- AWstats -->
<daemon name="awstats" <daemon name="awstats"
title="Awstats (webalizer alternative)"> title="Awstats (traffic analyzer)">
<install><![CDATA[apt-get install awstats]]></install> <install><![CDATA[apt-get install awstats]]></install>
<command><![CDATA[mv {{settings.system.awstats_conf}}/awstats.conf {{settings.system.awstats_conf}}/awstats.model.conf]]></command> <command><![CDATA[mv {{settings.system.awstats_conf}}/awstats.conf {{settings.system.awstats_conf}}/awstats.model.conf]]></command>
<command><![CDATA[sed -i.bak 's/^DirData/# DirData/' {{settings.system.awstats_conf}}/awstats.model.conf]]></command> <command><![CDATA[sed -i.bak 's/^DirData/# DirData/' {{settings.system.awstats_conf}}/awstats.model.conf]]></command>

View File

@@ -1535,8 +1535,6 @@ Vielen Dank, Ihr Administrator',
'description' => 'Der Inhalt dieses Feldes wird in die 05_froxlor_dirfix_nofcgid.conf Apache Konfigurationsdatei eingefügt. Wenn leer werden folgende Standardwerte verwendet:<br><br>apache >=2.4<br><code>Require all granted<br>AllowOverride All</code><br><br>apache <=2.2<br><code>Order allow,deny<br>allow from all</code>', 'description' => 'Der Inhalt dieses Feldes wird in die 05_froxlor_dirfix_nofcgid.conf Apache Konfigurationsdatei eingefügt. Wenn leer werden folgende Standardwerte verwendet:<br><br>apache >=2.4<br><code>Require all granted<br>AllowOverride All</code><br><br>apache <=2.2<br><code>Order allow,deny<br>allow from all</code>',
], ],
'decimal_places' => 'Nachkommastellen bei der Ausgabe von Traffic/Webspace', 'decimal_places' => 'Nachkommastellen bei der Ausgabe von Traffic/Webspace',
'webalizer_enabled' => 'Nutze Webalizer-Statistiken',
'awstats_enabled' => 'Nutze AWStats-Statistiken',
'selfdns' => [ 'selfdns' => [
'title' => 'Manuelle DNS-Einstellungen für Domains', 'title' => 'Manuelle DNS-Einstellungen für Domains',
], ],
@@ -2040,6 +2038,9 @@ Vielen Dank, Ihr Administrator',
'title' => 'froxlor Update Kanal', 'title' => 'froxlor Update Kanal',
'description' => 'Wähle den bevorzugten Update Kanal. Standard ist "stable"', 'description' => 'Wähle den bevorzugten Update Kanal. Standard ist "stable"',
], ],
'traffictool' => [
'toolselect' => 'Traffic Analyzer',
],
], ],
'spf' => [ 'spf' => [
'use_spf' => 'Aktiviere SPF für Domains?', 'use_spf' => 'Aktiviere SPF für Domains?',

View File

@@ -1652,8 +1652,6 @@ Yours sincerely, your administrator',
'description' => 'The content of this field will be included into the domain vHost container directly. You can use the following variables:<br/><code>{DOMAIN}</code>, <code>{DOCROOT}</code>, <code>{CUSTOMER}</code>, <code>{IP}</code>, <code>{PORT}</code>, <code>{SCHEME}</code>, <code>{FPMSOCKET}</code> (if applicable)<br/> Attention: The code won\'t be checked for any errors. If it contains errors, webserver might not start again!', 'description' => 'The content of this field will be included into the domain vHost container directly. You can use the following variables:<br/><code>{DOMAIN}</code>, <code>{DOCROOT}</code>, <code>{CUSTOMER}</code>, <code>{IP}</code>, <code>{PORT}</code>, <code>{SCHEME}</code>, <code>{FPMSOCKET}</code> (if applicable)<br/> Attention: The code won\'t be checked for any errors. If it contains errors, webserver might not start again!',
], ],
'decimal_places' => 'Number of decimal places in traffic/webspace output', 'decimal_places' => 'Number of decimal places in traffic/webspace output',
'webalizer_enabled' => 'Enable webalizer statistics',
'awstats_enabled' => 'Enable AWstats statistics',
'selfdns' => [ 'selfdns' => [
'title' => 'Customer domain dns settings', 'title' => 'Customer domain dns settings',
], ],
@@ -2159,6 +2157,12 @@ Yours sincerely, your administrator',
], ],
'uc_stable' => 'stable', 'uc_stable' => 'stable',
'uc_testing' => 'testing', 'uc_testing' => 'testing',
'traffictool' => [
'toolselect' => 'Traffic analyzer',
'webalizer' => 'Webalizer',
'awstats' => 'AWStats',
'goaccess' => 'goacccess'
],
], ],
'spf' => [ 'spf' => [
'use_spf' => 'Activate SPF for domains?', 'use_spf' => 'Activate SPF for domains?',

View File

@@ -46,7 +46,7 @@
<div class="form-check"> <div class="form-check">
{% set recommended = false %} {% set recommended = false %}
{% if {% if
(dtype == 'awstats' and get_setting('system.awstats_enabled') == '1') or (dtype == get_setting('system.traffictool')) or
(dtype == 'libnssextrausers' and (get_setting('system.mod_fcgid') == '1' or get_setting('phpfpm.enabled') == '1' or get_setting('system.apacheitksupport') == '1')) or (dtype == 'libnssextrausers' and (get_setting('system.mod_fcgid') == '1' or get_setting('phpfpm.enabled') == '1' or get_setting('system.apacheitksupport') == '1')) or
(dtype == 'logrotate') or (dtype == 'logrotate') or
(dtype == 'fcgid' and get_setting('system.mod_fcgid') == '1') or (dtype == 'fcgid' and get_setting('system.mod_fcgid') == '1') or