Skip to content

Commit

Permalink
set file-log (if enabled) to be in froxlor/logs/ folder; fix ssl para…
Browse files Browse the repository at this point in the history
…m directive for dovecot in Ubuntu Bionic; set version to 2.0.8

Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
  • Loading branch information
d00p committed Jan 14, 2023
1 parent 529890b commit 090cfc2
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 12 deletions.
4 changes: 2 additions & 2 deletions install/froxlor.sql.php
Expand Up @@ -696,7 +696,7 @@
('system', 'distribution', ''),
('system', 'update_channel', 'stable'),
('system', 'updatecheck_data', ''),
('system', 'update_notify_last', '2.0.7'),
('system', 'update_notify_last', '2.0.8'),
('system', 'traffictool', 'goaccess'),
('api', 'enabled', '0'),
('2fa', 'enabled', '1'),
Expand Down Expand Up @@ -740,7 +740,7 @@
('panel', 'logo_overridetheme', '0'),
('panel', 'logo_overridecustom', '0'),
('panel', 'settings_mode', '0'),
('panel', 'version', '2.0.7'),
('panel', 'version', '2.0.8'),
('panel', 'db_version', '202301120');
Expand Down
14 changes: 14 additions & 0 deletions install/updates/froxlor/update_2.x.inc.php
Expand Up @@ -330,3 +330,17 @@

Froxlor::updateToDbVersion('202301120');
}

if (Froxlor::isFroxlorVersion('2.0.7')) {
Update::showUpdateStep("Updating from 2.0.7 to 2.0.8", false);

// adjust file-logging to be set to froxlor/logs/
$logtypes = explode(',', Settings::Get('logger.logtypes'));
if (in_array('file', $logtypes)) {
Update::showUpdateStep("Adjusting froxlor logfile for system-logging to be stored in logs/froxlor.log");
Settings::Set('logger.logfile', 'froxlor.log');
Update::lastStepStatus(0);
}

Froxlor::updateToVersion('2.0.8');
}
2 changes: 1 addition & 1 deletion lib/Froxlor/Froxlor.php
Expand Up @@ -31,7 +31,7 @@ final class Froxlor
{

// Main version variable
const VERSION = '2.0.7';
const VERSION = '2.0.8';

// Database version (YYYYMMDDC where C is a daily counter)
const DBVERSION = '202301120';
Expand Down
10 changes: 8 additions & 2 deletions lib/Froxlor/FroxlorLogger.php
Expand Up @@ -100,11 +100,17 @@ protected function __construct($userinfo = [])
self::$ml->pushHandler(new SyslogHandler('froxlor', LOG_USER, Logger::DEBUG));
break;
case 'file':
$logger_logfile = Settings::Get('logger.logfile');
$logger_logfile = FileDir::makeCorrectFile(Froxlor::getInstallDir() . '/logs/' . Settings::Get('logger.logfile'));
// is_writable needs an existing file to check if it's actually writable
@touch($logger_logfile);
if (empty($logger_logfile) || !is_writable($logger_logfile)) {
Settings::Set('logger.logfile', '/tmp/froxlor.log');
Settings::Set('logger.logfile', 'froxlor.log');
$logger_logfile = FileDir::makeCorrectFile(Froxlor::getInstallDir() . '/logs/froxlor.log');
@touch($logger_logfile);
if (empty($logger_logfile) || !is_writable($logger_logfile)) {
// not writable in our own directory? Skip
break;
}
}
self::$ml->pushHandler(new StreamHandler($logger_logfile, Logger::DEBUG));
break;
Expand Down
6 changes: 1 addition & 5 deletions lib/configfiles/bionic.xml
Expand Up @@ -3458,11 +3458,7 @@ ssl_key = <<SSL_KEY_FILE>
# auth_ssl_username_from_cert=yes.
#ssl_cert_username_field = commonName
# SSL DH parameters
# Generate new params with `openssl dhparam -out /etc/dovecot/dh.pem 4096`
# Or migrate from old ssl-parameters.dat file with the command dovecot
# gives on startup when ssl_dh is unset.
ssl_dh = </usr/share/dovecot/dh.pem
ssl_dh_parameters_length = 2048
# SSL protocols to use
#ssl_protocols = !SSLv3
Expand Down
5 changes: 4 additions & 1 deletion lng/de.lng.php
Expand Up @@ -1494,7 +1494,10 @@
'title' => 'Log-Art(en)',
'description' => 'Wählen Sie hier die gewünschten Logtypen. Für Mehrfachauswahl, halten Sie während der Auswahl STRG gedrückt<br />Mögliche Logtypen sind: syslog, file, mysql',
],
'logfile' => 'Log-Datei Pfad inklusive Dateinamen',
'logfile' => [
'title' => 'Dateiname der Logdatei',
'description' => 'Wird nur verwendet, wenn die Log-Art "file" ausgewählt ist. Diese Datei wird unter froxlor/logs/ geschrieben. Dieser Ordner ist vor Webzugriff geschützt.',
],
'logcron' => 'Logge Cronjobs',
'logcronoption' => [
'never' => 'Nie',
Expand Down
5 changes: 4 additions & 1 deletion lng/en.lng.php
Expand Up @@ -1613,7 +1613,10 @@
'title' => 'Log-type(s)',
'description' => 'Specify logtypes. To select multiple types, hold down CTRL while selecting.<br />Available logtypes are: syslog, file, mysql',
],
'logfile' => 'Logfile path including filename',
'logfile' => [
'title' => 'Filename for log',
'description' => 'Only used if log-type includes "file". This file will be created in froxlor/logs/. This folder is protected against public access.',
],
'logcron' => 'Log cronjobs',
'logcronoption' => [
'never' => 'Never',
Expand Down

0 comments on commit 090cfc2

Please sign in to comment.