acme-challenge path adjustments if docroot changed after update from 0.10.x (via apt)
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
@@ -642,7 +642,7 @@ opcache.validate_timestamps'),
|
|||||||
('system', 'leprivatekey', 'unset'),
|
('system', 'leprivatekey', 'unset'),
|
||||||
('system', 'lepublickey', 'unset'),
|
('system', 'lepublickey', 'unset'),
|
||||||
('system', 'letsencryptca', 'letsencrypt'),
|
('system', 'letsencryptca', 'letsencrypt'),
|
||||||
('system', 'letsencryptchallengepath', '/var/www/froxlor'),
|
('system', 'letsencryptchallengepath', '/var/www/html/froxlor'),
|
||||||
('system', 'letsencryptkeysize', '4096'),
|
('system', 'letsencryptkeysize', '4096'),
|
||||||
('system', 'letsencryptreuseold', 0),
|
('system', 'letsencryptreuseold', 0),
|
||||||
('system', 'leenabled', '0'),
|
('system', 'leenabled', '0'),
|
||||||
@@ -741,7 +741,7 @@ opcache.validate_timestamps'),
|
|||||||
('panel', 'logo_overridecustom', '0'),
|
('panel', 'logo_overridecustom', '0'),
|
||||||
('panel', 'settings_mode', '0'),
|
('panel', 'settings_mode', '0'),
|
||||||
('panel', 'version', '2.0.7'),
|
('panel', 'version', '2.0.7'),
|
||||||
('panel', 'db_version', '202212060');
|
('panel', 'db_version', '202301120');
|
||||||
|
|
||||||
|
|
||||||
DROP TABLE IF EXISTS `panel_tasks`;
|
DROP TABLE IF EXISTS `panel_tasks`;
|
||||||
|
|||||||
@@ -38,10 +38,9 @@ if (!defined('_CRON_UPDATE')) {
|
|||||||
|
|
||||||
// last 0.10.x release
|
// last 0.10.x release
|
||||||
if (Froxlor::isFroxlorVersion('0.10.38.3')) {
|
if (Froxlor::isFroxlorVersion('0.10.38.3')) {
|
||||||
|
|
||||||
$update_to = '2.0.0-beta1';
|
$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");
|
Update::showUpdateStep("Removing unused table");
|
||||||
Database::query("DROP TABLE IF EXISTS `panel_sessions`;");
|
Database::query("DROP TABLE IF EXISTS `panel_sessions`;");
|
||||||
@@ -146,7 +145,7 @@ if (Froxlor::isFroxlorVersion('0.10.38.3')) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Update::showUpdateStep("Adding new settings");
|
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);
|
Settings::AddNew("panel.settings_mode", $panel_settings_mode);
|
||||||
$system_distribution = isset($_POST['system_distribution']) ? $_POST['system_distribution'] : '';
|
$system_distribution = isset($_POST['system_distribution']) ? $_POST['system_distribution'] : '';
|
||||||
Settings::AddNew("system.distribution", $system_distribution);
|
Settings::AddNew("system.distribution", $system_distribution);
|
||||||
@@ -193,7 +192,6 @@ if (Froxlor::isFroxlorVersion('0.10.38.3')) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (Froxlor::isDatabaseVersion('202112310')) {
|
if (Froxlor::isDatabaseVersion('202112310')) {
|
||||||
|
|
||||||
Update::showUpdateStep("Adjusting traffic tool settings");
|
Update::showUpdateStep("Adjusting traffic tool settings");
|
||||||
$traffic_tool = Settings::Get('system.awstats_enabled') == 1 ? 'awstats' : 'webalizer';
|
$traffic_tool = Settings::Get('system.awstats_enabled') == 1 ? 'awstats' : 'webalizer';
|
||||||
Settings::AddNew("system.traffictool", $traffic_tool);
|
Settings::AddNew("system.traffictool", $traffic_tool);
|
||||||
@@ -204,7 +202,6 @@ if (Froxlor::isDatabaseVersion('202112310')) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (Froxlor::isDatabaseVersion('202211030')) {
|
if (Froxlor::isDatabaseVersion('202211030')) {
|
||||||
|
|
||||||
Update::showUpdateStep("Creating backward compatibility for cronjob");
|
Update::showUpdateStep("Creating backward compatibility for cronjob");
|
||||||
$disabled = explode(',', ini_get('disable_functions'));
|
$disabled = explode(',', ini_get('disable_functions'));
|
||||||
$exec_allowed = !in_array('exec', $disabled);
|
$exec_allowed = !in_array('exec', $disabled);
|
||||||
@@ -226,7 +223,7 @@ EOF;
|
|||||||
Update::lastStepStatus(0);
|
Update::lastStepStatus(0);
|
||||||
} else {
|
} else {
|
||||||
$cron_run_cmd = 'chmod +x ' . FileDir::makeCorrectFile(Froxlor::getInstallDir() . '/bin/froxlor-cli') . PHO_EOL;
|
$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:<br><pre>' . $cron_run_cmd . '</pre>');
|
Update::lastStepStatus(1, 'manual commands needed', 'Please run the following commands manually:<br><pre>' . $cron_run_cmd . '</pre>');
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -268,20 +265,27 @@ if (Froxlor::isFroxlorVersion('2.0.3')) {
|
|||||||
|
|
||||||
$complete_filedir = Froxlor::getInstallDir() . '/scripts';
|
$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)
|
// 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");
|
Update::showUpdateStep("Adjusting backward compatibility for cronjob");
|
||||||
$newCronBin = Froxlor::getInstallDir() . '/bin/froxlor-cli';
|
$disabled = explode(',', ini_get('disable_functions'));
|
||||||
$compCron = <<<EOF
|
$exec_allowed = !in_array('exec', $disabled);
|
||||||
|
if ($exec_allowed) {
|
||||||
|
$newCronBin = Froxlor::getInstallDir() . '/bin/froxlor-cli';
|
||||||
|
$compCron = <<<EOF
|
||||||
<?php
|
<?php
|
||||||
chmod('$newCronBin', 0755);
|
chmod('$newCronBin', 0755);
|
||||||
// re-create cron.d configuration file
|
// re-create cron.d configuration file
|
||||||
exec('$newCronBin froxlor:cron -r 99');
|
exec('$newCronBin froxlor:cron -r 99');
|
||||||
exit;
|
exit;
|
||||||
EOF;
|
EOF;
|
||||||
file_put_contents($complete_filedir . '/froxlor_master_cronjob.php', $compCron);
|
file_put_contents($complete_filedir . '/froxlor_master_cronjob.php', $compCron);
|
||||||
Update::lastStepStatus(0);
|
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';
|
||||||
|
Update::lastStepStatus(1, 'manual commands needed', 'Please run the following commands manually:<br><pre>' . $cron_run_cmd . '</pre>');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Froxlor::updateToVersion('2.0.4');
|
Froxlor::updateToVersion('2.0.4');
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -312,3 +316,17 @@ if (Froxlor::isFroxlorVersion('2.0.6')) {
|
|||||||
|
|
||||||
Froxlor::updateToVersion('2.0.7');
|
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 <pre>bin/froxlor-cli froxlor:config-services</pre> or adjust the path manually in <pre>' . Settings::Get('system.letsencryptacmeconf') . '</pre>');
|
||||||
|
} else {
|
||||||
|
Update::lastStepStatus(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
Froxlor::updateToDbVersion('202301120');
|
||||||
|
}
|
||||||
|
|||||||
@@ -34,9 +34,14 @@ $return = [];
|
|||||||
if (Update::versionInUpdate($current_db_version, '202004140')) {
|
if (Update::versionInUpdate($current_db_version, '202004140')) {
|
||||||
$has_preconfig = true;
|
$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).';
|
$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 = '<strong>Validate DNS of domains when using Lets Encrypt ';
|
$question = '<strong>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;
|
$preconfig['fields'] = $return;
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ use Froxlor\Froxlor;
|
|||||||
use Froxlor\FileDir;
|
use Froxlor\FileDir;
|
||||||
use Froxlor\Config\ConfigParser;
|
use Froxlor\Config\ConfigParser;
|
||||||
use Froxlor\Install\Update;
|
use Froxlor\Install\Update;
|
||||||
|
use Froxlor\Settings;
|
||||||
|
|
||||||
$preconfig = [
|
$preconfig = [
|
||||||
'title' => '2.x updates',
|
'title' => '2.x updates',
|
||||||
@@ -36,7 +37,6 @@ $return = [];
|
|||||||
|
|
||||||
if (Update::versionInUpdate($current_version, '2.0.0-beta1')) {
|
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.';
|
$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 = '<strong>Chose settings mode (you can change that at any time)</strong>';
|
$question = '<strong>Chose settings mode (you can change that at any time)</strong>';
|
||||||
$return['panel_settings_mode'] = [
|
$return['panel_settings_mode'] = [
|
||||||
'type' => 'select',
|
'type' => 'select',
|
||||||
@@ -45,11 +45,11 @@ if (Update::versionInUpdate($current_version, '2.0.0-beta1')) {
|
|||||||
1 => 'Advanced'
|
1 => 'Advanced'
|
||||||
],
|
],
|
||||||
'selected' => 1,
|
'selected' => 1,
|
||||||
'label' => $question
|
'label' => $question,
|
||||||
|
'prior_infotext' => $description
|
||||||
];
|
];
|
||||||
|
|
||||||
$description = 'The configuration page now can preselect a distribution, please select your current distribution';
|
$description = 'The configuration page now can preselect a distribution, please select your current distribution';
|
||||||
$return['system_distribution_note'] = ['type' => 'infotext', 'value' => $description];
|
|
||||||
$question = '<strong>Select distribution</strong>';
|
$question = '<strong>Select distribution</strong>';
|
||||||
$config_dir = FileDir::makeCorrectDir(Froxlor::getInstallDir() . '/lib/configfiles/');
|
$config_dir = FileDir::makeCorrectDir(Froxlor::getInstallDir() . '/lib/configfiles/');
|
||||||
// show list of available distro's
|
// show list of available distro's
|
||||||
@@ -68,9 +68,26 @@ if (Update::versionInUpdate($current_version, '2.0.0-beta1')) {
|
|||||||
'type' => 'select',
|
'type' => 'select',
|
||||||
'select_var' => $distributions_select,
|
'select_var' => $distributions_select,
|
||||||
'selected' => '',
|
'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 = '<strong>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;
|
$preconfig['fields'] = $return;
|
||||||
return $preconfig;
|
return $preconfig;
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ final class Froxlor
|
|||||||
const VERSION = '2.0.7';
|
const VERSION = '2.0.7';
|
||||||
|
|
||||||
// Database version (YYYYMMDDC where C is a daily counter)
|
// Database version (YYYYMMDDC where C is a daily counter)
|
||||||
const DBVERSION = '202212060';
|
const DBVERSION = '202301120';
|
||||||
|
|
||||||
// Distribution branding-tag (used for Debian etc.)
|
// Distribution branding-tag (used for Debian etc.)
|
||||||
const BRANDING = '';
|
const BRANDING = '';
|
||||||
|
|||||||
@@ -2,6 +2,9 @@
|
|||||||
{% if field.visible is not defined or (field.visible is defined and field.visible) or nohide == true %}
|
{% 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 norow == false and (field.type != 'hidden' or (field.type == 'hidden' and field.display is defined and field.display is not empty)) %}
|
||||||
<div class="row g-0 formfield d-flex align-items-center">
|
<div class="row g-0 formfield d-flex align-items-center">
|
||||||
|
{% if field.prior_infotext is defined and field.prior_infotext|length > 0 %}
|
||||||
|
<h5>{{ field.prior_infotext }}</h5>
|
||||||
|
{% endif %}
|
||||||
{% if field.label is iterable %}
|
{% if field.label is iterable %}
|
||||||
<label for="{{ id }}" class="col-sm-6 col-form-label pe-3">
|
<label for="{{ id }}" class="col-sm-6 col-form-label pe-3">
|
||||||
{% if em %}
|
{% if em %}
|
||||||
|
|||||||
Reference in New Issue
Block a user