Skip to content

Commit

Permalink
remove old files in updater; avoid including old cli files in froxlor…
Browse files Browse the repository at this point in the history
…-cli; fix css for card list-groups

Signed-off-by: Michael Kaufmann <[email protected]>
  • Loading branch information
d00p committed Dec 5, 2023
1 parent 5c06683 commit 02ae52e
Show file tree
Hide file tree
Showing 6 changed files with 79 additions and 6 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/build-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ name: build-documentation

on:
release:
types: [published]
# only run for stable releases
types: [released]

jobs:
build_docs:
Expand Down
14 changes: 13 additions & 1 deletion bin/froxlor-cli
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,19 @@ require dirname(__DIR__) . '/lib/tables.inc.php';
$application = new Application('froxlor-cli', Froxlor::getFullVersion());

// files that are no commands
$fileIgnoreList = ['CliCommand.php', 'index.html', 'install.functions.php'];
$fileIgnoreList = [
// Current non-command files
'CliCommand.php',
'index.html',
'install.functions.php',
// older files not used anymore (should be removed by the updater), but take care of it just in case
'Action.php',
'CmdLineHandler.php',
'ConfigServicesCmd.php',
'PhpSessioncleanCmd.php',
'SwitchServerIpCmd.php',
'UpdateCliCmd.php',
];
// directory of commands to include
$cmd_files = glob(Froxlor::getInstallDir() . '/lib/Froxlor/Cli/*.php');

Expand Down
2 changes: 1 addition & 1 deletion install/froxlor.sql.php
Original file line number Diff line number Diff line change
Expand Up @@ -727,7 +727,7 @@
('panel', 'settings_mode', '0'),
('panel', 'menu_collapsed', '1'),
('panel', 'version', '2.1.0-rc3'),
('panel', 'db_version', '202311260');
('panel', 'db_version', '202312050');
DROP TABLE IF EXISTS `panel_tasks`;
Expand Down
61 changes: 59 additions & 2 deletions install/updates/froxlor/update_2.1.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,8 @@
$current_fileextension = Settings::Get('system.index_file_extension');
Database::query("DELETE FROM `" . TABLE_PANEL_SETTINGS . "` WHERE `settinggroup`= 'system' AND `varname`= 'index_file_extension'");
Database::query("ALTER TABLE `" . TABLE_PANEL_TEMPLATES . "` ADD `file_extension` varchar(50) NOT NULL default 'html';");
if (strtolower(trim($current_fileextension)) != 'html') {
$stmt = Database::prepare("UPDATE TABLE `" . TABLE_PANEL_TEMPLATES . "` SET `file_extension` = :ext WHERE `templategroup` = 'files'");
if (!empty(trim($current_fileextension)) && strtolower(trim($current_fileextension)) != 'html') {
$stmt = Database::prepare("UPDATE `" . TABLE_PANEL_TEMPLATES . "` SET `file_extension` = :ext WHERE `templategroup` = 'files'");
Database::pexecute($stmt, ['ext' => strtolower(trim($current_fileextension))]);
}
Update::lastStepStatus(0);
Expand All @@ -143,3 +143,60 @@
Update::showUpdateStep("Updating from 2.1.0-rc2 to 2.1.0-rc3", false);
Froxlor::updateToVersion('2.1.0-rc3');
}

if (Froxlor::isDatabaseVersion('202311260')) {
Update::showUpdateStep("Cleaning up old files");
$to_clean = array(
"install/updates/froxlor/update_2.x.inc.php",
"install/updates/preconfig/preconfig_2.x.inc.php",
"lib/Froxlor/Api/Commands/CustomerBackups.php",
"lib/Froxlor/Cli/Action",
"lib/Froxlor/Cli/Action.php",
"lib/Froxlor/Cli/CmdLineHandler.php",
"lib/Froxlor/Cli/ConfigServicesCmd.php",
"lib/Froxlor/Cli/PhpSessioncleanCmd.php",
"lib/Froxlor/Cli/SwitchServerIpCmd.php",
"lib/Froxlor/Cli/UpdateCliCmd.php",
"lib/Froxlor/Cron/System/BackupCron.php",
"lib/formfields/customer/extras/formfield.backup.php",
"lib/tablelisting/customer/tablelisting.backups.php",
"templates/Froxlor/assets/mix-manifest.json",
"templates/Froxlor/assets/css",
"templates/Froxlor/assets/webfonts",
"templates/Froxlor/assets/js/main.js",
"templates/Froxlor/assets/js/main.js.LICENSE.txt",
"templates/Froxlor/src",
"templates/Froxlor/user/change_language.html.twig",
"templates/Froxlor/user/change_password.html.twig",
"templates/Froxlor/user/change_theme.html.twig",
"tests/Backup/CustomerBackupsTest.php"
);
$disabled = explode(',', ini_get('disable_functions'));
$exec_allowed = !in_array('exec', $disabled);
$del_list = "";
foreach ($to_clean as $filedir) {
$complete_filedir = Froxlor::getInstallDir() . $filedir;
if (file_exists($complete_filedir)) {
if ($exec_allowed) {
FileDir::safe_exec("rm -rf " . escapeshellarg($complete_filedir));
} else {
$del_list .= "rm -rf " . escapeshellarg($complete_filedir) . PHP_EOL;
}
}
}
if ($exec_allowed) {
Update::lastStepStatus(0);
} else {
if (empty($del_list)) {
// none of the files existed
Update::lastStepStatus(0);
} else {
Update::lastStepStatus(
1,
'manual commands needed',
'Please run the following commands manually:<br><pre>' . $del_list . '</pre>'
);
}
}
Froxlor::updateToDbVersion('202312050');
}
2 changes: 1 addition & 1 deletion lib/Froxlor/Froxlor.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ final class Froxlor
const VERSION = '2.1.0-rc3';

// Database version (YYYYMMDDC where C is a daily counter)
const DBVERSION = '202311260';
const DBVERSION = '202312050';

// Distribution branding-tag (used for Debian etc.)
const BRANDING = '';
Expand Down
3 changes: 3 additions & 0 deletions templates/Froxlor/assets/scss/components/_card.scss
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
}
}
}
.list-group-item {
background: $white;
}

@include color-mode(dark) {
.card, .list-group-item {
Expand Down

0 comments on commit 02ae52e

Please sign in to comment.