diff --git a/install/froxlor.sql.php b/install/froxlor.sql.php index 1f64b9ce..90326c37 100644 --- a/install/froxlor.sql.php +++ b/install/froxlor.sql.php @@ -642,7 +642,7 @@ opcache.validate_timestamps'), ('system', 'leprivatekey', 'unset'), ('system', 'lepublickey', 'unset'), ('system', 'letsencryptca', 'letsencrypt'), - ('system', 'letsencryptchallengepath', '/var/www/froxlor'), + ('system', 'letsencryptchallengepath', '/var/www/html/froxlor'), ('system', 'letsencryptkeysize', '4096'), ('system', 'letsencryptreuseold', 0), ('system', 'leenabled', '0'), @@ -741,7 +741,7 @@ opcache.validate_timestamps'), ('panel', 'logo_overridecustom', '0'), ('panel', 'settings_mode', '0'), ('panel', 'version', '2.0.7'), - ('panel', 'db_version', '202212060'); + ('panel', 'db_version', '202301120'); DROP TABLE IF EXISTS `panel_tasks`; diff --git a/install/updates/froxlor/update_2.x.inc.php b/install/updates/froxlor/update_2.x.inc.php index b5ee6543..73b3b5d5 100644 --- a/install/updates/froxlor/update_2.x.inc.php +++ b/install/updates/froxlor/update_2.x.inc.php @@ -38,10 +38,9 @@ if (!defined('_CRON_UPDATE')) { // last 0.10.x release if (Froxlor::isFroxlorVersion('0.10.38.3')) { - $update_to = '2.0.0-beta1'; - Update::showUpdateStep("Updating from 0.10.38.3 to ".$update_to, false); + Update::showUpdateStep("Updating from 0.10.38.3 to " . $update_to, false); Update::showUpdateStep("Removing unused table"); Database::query("DROP TABLE IF EXISTS `panel_sessions`;"); @@ -146,7 +145,7 @@ if (Froxlor::isFroxlorVersion('0.10.38.3')) { } Update::showUpdateStep("Adding new settings"); - $panel_settings_mode = isset($_POST['panel_settings_mode']) ? (int) $_POST['panel_settings_mode'] : 0; + $panel_settings_mode = isset($_POST['panel_settings_mode']) ? (int)$_POST['panel_settings_mode'] : 0; Settings::AddNew("panel.settings_mode", $panel_settings_mode); $system_distribution = isset($_POST['system_distribution']) ? $_POST['system_distribution'] : ''; Settings::AddNew("system.distribution", $system_distribution); @@ -193,7 +192,6 @@ if (Froxlor::isFroxlorVersion('0.10.38.3')) { } 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); @@ -204,7 +202,6 @@ if (Froxlor::isDatabaseVersion('202112310')) { } if (Froxlor::isDatabaseVersion('202211030')) { - Update::showUpdateStep("Creating backward compatibility for cronjob"); $disabled = explode(',', ini_get('disable_functions')); $exec_allowed = !in_array('exec', $disabled); @@ -226,7 +223,7 @@ EOF; Update::lastStepStatus(0); } else { $cron_run_cmd = 'chmod +x ' . FileDir::makeCorrectFile(Froxlor::getInstallDir() . '/bin/froxlor-cli') . PHO_EOL; - $cron_run_cmd .= FileDir::makeCorrectFile(Froxlor::getInstallDir() . '/bin/froxlor-cli').' froxlor:cron -r 99'; + $cron_run_cmd .= FileDir::makeCorrectFile(Froxlor::getInstallDir() . '/bin/froxlor-cli') . ' froxlor:cron -r 99'; Update::lastStepStatus(1, 'manual commands needed', 'Please run the following commands manually:
' . $cron_run_cmd . '
'); } @@ -268,20 +265,27 @@ if (Froxlor::isFroxlorVersion('2.0.3')) { $complete_filedir = Froxlor::getInstallDir() . '/scripts'; // check if compat. cronjob still exists (most likely didn't run successfully b/c of error from former 2.0 release) - if (@file_exists($complete_filedir.'/froxlor_master_cronjob.php')) { + if (@file_exists($complete_filedir . '/froxlor_master_cronjob.php')) { Update::showUpdateStep("Adjusting backward compatibility for cronjob"); - $newCronBin = Froxlor::getInstallDir() . '/bin/froxlor-cli'; - $compCron = <<
' . $cron_run_cmd . '
'); + } } - Froxlor::updateToVersion('2.0.4'); } @@ -312,3 +316,17 @@ if (Froxlor::isFroxlorVersion('2.0.6')) { Froxlor::updateToVersion('2.0.7'); } + +if (Froxlor::isDatabaseVersion('202212060')) { + Update::showUpdateStep("Validating acme.sh challenge path"); + $acmesh_challenge_dir = Settings::Get('system.letsencryptchallengepath'); + $system_letsencryptchallengepath_upd = isset($_POST['system_letsencryptchallengepath_upd']) ? $_POST['system_letsencryptchallengepath_upd'] : $acmesh_challenge_dir; + if ($acmesh_challenge_dir != $system_letsencryptchallengepath_upd) { + Settings::Set('system.letsencryptchallengepath', $system_letsencryptchallengepath_upd); + Update::lastStepStatus(1, 'manual commands needed', 'Please reconfigure webserver service using
bin/froxlor-cli froxlor:config-services
or adjust the path manually in
' . Settings::Get('system.letsencryptacmeconf') . '
'); + } else { + Update::lastStepStatus(0); + } + + Froxlor::updateToDbVersion('202301120'); +} diff --git a/install/updates/preconfig/preconfig_0.10.inc.php b/install/updates/preconfig/preconfig_0.10.inc.php index 2a50eb7a..a1711fda 100644 --- a/install/updates/preconfig/preconfig_0.10.inc.php +++ b/install/updates/preconfig/preconfig_0.10.inc.php @@ -34,9 +34,14 @@ $return = []; if (Update::versionInUpdate($current_db_version, '202004140')) { $has_preconfig = true; $description = 'Froxlor can now optionally validate the dns entries of domains that request Lets Encrypt certificates to reduce dns-related problems (e.g. freshly registered domain or updated a-record).'; - $return['system_le_domain_dnscheck_note'] = ['type' => 'infotext', 'value' => $description]; $question = 'Validate DNS of domains when using Lets Encrypt '; - $return['system_le_domain_dnscheck'] = ['type' => 'checkbox', 'value' => 1, 'checked' => 1, 'label' => $question]; + $return['system_le_domain_dnscheck'] = [ + 'type' => 'checkbox', + 'value' => 1, + 'checked' => 1, + 'label' => $question, + 'prior_infotext' => $description + ]; } $preconfig['fields'] = $return; diff --git a/install/updates/preconfig/preconfig_2.x.inc.php b/install/updates/preconfig/preconfig_2.x.inc.php index ff427cf5..45f0cd3a 100644 --- a/install/updates/preconfig/preconfig_2.x.inc.php +++ b/install/updates/preconfig/preconfig_2.x.inc.php @@ -27,6 +27,7 @@ use Froxlor\Froxlor; use Froxlor\FileDir; use Froxlor\Config\ConfigParser; use Froxlor\Install\Update; +use Froxlor\Settings; $preconfig = [ 'title' => '2.x updates', @@ -36,7 +37,6 @@ $return = []; if (Update::versionInUpdate($current_version, '2.0.0-beta1')) { $description = 'We have rearranged the settings and split them into basic and advanced categories. This makes it easier for users who do not need all the detailed or very specific settings and options and gives a better overview of the basic/mostly used settings.'; - $return['panel_settings_mode_note'] = ['type' => 'infotext', 'value' => $description]; $question = 'Chose settings mode (you can change that at any time)'; $return['panel_settings_mode'] = [ 'type' => 'select', @@ -45,11 +45,11 @@ if (Update::versionInUpdate($current_version, '2.0.0-beta1')) { 1 => 'Advanced' ], 'selected' => 1, - 'label' => $question + 'label' => $question, + 'prior_infotext' => $description ]; $description = 'The configuration page now can preselect a distribution, please select your current distribution'; - $return['system_distribution_note'] = ['type' => 'infotext', 'value' => $description]; $question = 'Select distribution'; $config_dir = FileDir::makeCorrectDir(Froxlor::getInstallDir() . '/lib/configfiles/'); // show list of available distro's @@ -68,9 +68,26 @@ if (Update::versionInUpdate($current_version, '2.0.0-beta1')) { 'type' => 'select', 'select_var' => $distributions_select, 'selected' => '', - 'label' => $question + 'label' => $question, + 'prior_infotext' => $description ]; } +if (Update::versionInUpdate($current_db_version, '202301120')) { + $acmesh_challenge_dir = Settings::Get('system.letsencryptchallengepath'); + if ($acmesh_challenge_dir != Froxlor::getInstallDir()) { + $has_preconfig = true; + $description = 'ACME challenge docroot from settings differs from the current installation directory.'; + $question = 'Validate Let\'s Encrypt challenge path '; + $return['system_letsencryptchallengepath_upd'] = [ + 'type' => 'text', + 'value' => $acmesh_challenge_dir, + 'placeholder' => Froxlor::getInstallDir(), + 'label' => $question, + 'prior_infotext' => $description + ]; + } +} + $preconfig['fields'] = $return; return $preconfig; diff --git a/lib/Froxlor/Froxlor.php b/lib/Froxlor/Froxlor.php index dafed67a..05485f6d 100644 --- a/lib/Froxlor/Froxlor.php +++ b/lib/Froxlor/Froxlor.php @@ -34,7 +34,7 @@ final class Froxlor const VERSION = '2.0.7'; // Database version (YYYYMMDDC where C is a daily counter) - const DBVERSION = '202212060'; + const DBVERSION = '202301120'; // Distribution branding-tag (used for Debian etc.) const BRANDING = ''; diff --git a/templates/Froxlor/form/formfields.html.twig b/templates/Froxlor/form/formfields.html.twig index a247c0ca..c7549e1e 100644 --- a/templates/Froxlor/form/formfields.html.twig +++ b/templates/Froxlor/form/formfields.html.twig @@ -2,6 +2,9 @@ {% if field.visible is not defined or (field.visible is defined and field.visible) or nohide == true %} {% if norow == false and (field.type != 'hidden' or (field.type == 'hidden' and field.display is defined and field.display is not empty)) %}
+ {% if field.prior_infotext is defined and field.prior_infotext|length > 0 %} +
{{ field.prior_infotext }}
+ {% endif %} {% if field.label is iterable %}