adjust spf-entry-regex; check for valid spf-entry in updater; set version to 2.1.0-rc2

Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
Michael Kaufmann
2023-11-11 21:38:24 +01:00
parent 287ad84b18
commit d52f33a50c
4 changed files with 20 additions and 5 deletions

View File

@@ -43,7 +43,7 @@ return [
'settinggroup' => 'spf', 'settinggroup' => 'spf',
'varname' => 'spf_entry', 'varname' => 'spf_entry',
'type' => 'text', 'type' => 'text',
'string_regexp' => '/^v=spf[a-z0-9:~?\s\.-]+$/i', 'string_regexp' => '/^v=spf[a-z0-9:~?\s.-]+$/i',
'default' => 'v=spf1 a mx -all', 'default' => 'v=spf1 a mx -all',
'save_method' => 'storeSettingField' 'save_method' => 'storeSettingField'
] ]

View File

@@ -391,7 +391,7 @@ INSERT INTO `panel_settings` (`settinggroup`, `varname`, `value`) VALUES
('admin', 'show_version_footer', '0'), ('admin', 'show_version_footer', '0'),
('caa', 'caa_entry', ''), ('caa', 'caa_entry', ''),
('spf', 'use_spf', '0'), ('spf', 'use_spf', '0'),
('spf', 'spf_entry', '"v=spf1 a mx -all"'), ('spf', 'spf_entry', 'v=spf1 a mx -all'),
('dkim', 'dkim_algorithm', 'all'), ('dkim', 'dkim_algorithm', 'all'),
('dkim', 'dkim_keylength', '1024'), ('dkim', 'dkim_keylength', '1024'),
('dkim', 'dkim_servicetype', '0'), ('dkim', 'dkim_servicetype', '0'),
@@ -679,7 +679,7 @@ opcache.validate_timestamps'),
('system', 'distribution', ''), ('system', 'distribution', ''),
('system', 'update_channel', 'stable'), ('system', 'update_channel', 'stable'),
('system', 'updatecheck_data', ''), ('system', 'updatecheck_data', ''),
('system', 'update_notify_last', '2.1.0-rc1'), ('system', 'update_notify_last', '2.1.0-rc2'),
('system', 'traffictool', 'goaccess'), ('system', 'traffictool', 'goaccess'),
('system', 'req_limit_per_interval', 60), ('system', 'req_limit_per_interval', 60),
('system', 'req_limit_interval', 60), ('system', 'req_limit_interval', 60),
@@ -727,7 +727,7 @@ opcache.validate_timestamps'),
('panel', 'logo_overridecustom', '0'), ('panel', 'logo_overridecustom', '0'),
('panel', 'settings_mode', '0'), ('panel', 'settings_mode', '0'),
('panel', 'menu_collapsed', '1'), ('panel', 'menu_collapsed', '1'),
('panel', 'version', '2.1.0-rc1'), ('panel', 'version', '2.1.0-rc2'),
('panel', 'db_version', '202305240'); ('panel', 'db_version', '202305240');

View File

@@ -108,3 +108,18 @@ if (Froxlor::isFroxlorVersion('2.1.0-beta2')) {
Update::showUpdateStep("Updating from 2.1.0-beta2 to 2.1.0-rc1", false); Update::showUpdateStep("Updating from 2.1.0-beta2 to 2.1.0-rc1", false);
Froxlor::updateToVersion('2.1.0-rc1'); Froxlor::updateToVersion('2.1.0-rc1');
} }
if (Froxlor::isFroxlorVersion('2.1.0-rc1')) {
Update::showUpdateStep("Updating from 2.1.0-rc1 to 2.1.0-rc2", false);
Update::showUpdateStep("Adjusting setting spf_entry");
$spf_entry = Settings::Get('spf.spf_entry');
if (!preg_match('/^v=spf[a-z0-9:~?\s.-]+$/i', $spf_entry)) {
Settings::Set('spf.spf_entry', 'v=spf1 a mx -all');
Update::lastStepStatus(1, 'corrected');
} else {
Update::lastStepStatus(0);
}
Froxlor::updateToVersion('2.1.0-rc2');
}

View File

@@ -31,7 +31,7 @@ final class Froxlor
{ {
// Main version variable // Main version variable
const VERSION = '2.1.0-rc1'; const VERSION = '2.1.0-rc2';
// Database version (YYYYMMDDC where C is a daily counter) // Database version (YYYYMMDDC where C is a daily counter)
const DBVERSION = '202305240'; const DBVERSION = '202305240';