more cleaning of planned backup-feature (postponed, see backup-feature branch)
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
@@ -1,96 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This file is part of the Froxlor project.
|
|
||||||
* Copyright (c) 2010 the Froxlor Team (see authors).
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or
|
|
||||||
* modify it under the terms of the GNU General Public License
|
|
||||||
* as published by the Free Software Foundation; either version 2
|
|
||||||
* of the License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program; if not, you can also view it online at
|
|
||||||
* https://files.froxlor.org/misc/COPYING.txt
|
|
||||||
*
|
|
||||||
* @copyright the authors
|
|
||||||
* @author Froxlor team <team@froxlor.org>
|
|
||||||
* @license https://files.froxlor.org/misc/COPYING.txt GPLv2
|
|
||||||
*/
|
|
||||||
|
|
||||||
return [
|
|
||||||
'groups' => [
|
|
||||||
'backup' => [
|
|
||||||
'title' => lng('backup'),
|
|
||||||
'icon' => 'fa-solid fa-sliders',
|
|
||||||
'advanced_mode' => true,
|
|
||||||
'fields' => [
|
|
||||||
'backup_enabled' => [
|
|
||||||
'label' => lng('serversettings.backup_enabled'),
|
|
||||||
'settinggroup' => 'backup',
|
|
||||||
'varname' => 'enabled',
|
|
||||||
'type' => 'checkbox',
|
|
||||||
'default' => false,
|
|
||||||
'save_method' => 'storeSettingField',
|
|
||||||
'overview_option' => true,
|
|
||||||
'cronmodule' => 'froxlor/backup'
|
|
||||||
],
|
|
||||||
'backup_default_storage' => [
|
|
||||||
'label' => lng('serversettings.backup_default_storage'),
|
|
||||||
'settinggroup' => 'backup',
|
|
||||||
'varname' => 'default_storage',
|
|
||||||
'type' => 'select',
|
|
||||||
'default' => '1',
|
|
||||||
'option_options_method' => [
|
|
||||||
'\\Froxlor\\Backup\\Backup',
|
|
||||||
'getBackupStorages'
|
|
||||||
],
|
|
||||||
'save_method' => 'storeSettingField'
|
|
||||||
],
|
|
||||||
'backup_default_retention' => [
|
|
||||||
'label' => lng('serversettings.backup_default_retention'),
|
|
||||||
'settinggroup' => 'backup',
|
|
||||||
'varname' => 'default_retention',
|
|
||||||
'type' => 'number',
|
|
||||||
'default' => 3,
|
|
||||||
'min' => 0,
|
|
||||||
'save_method' => 'storeSettingField',
|
|
||||||
],
|
|
||||||
'backup_default_customer_access' => [
|
|
||||||
'label' => lng('serversettings.backup_default_customer_access'),
|
|
||||||
'settinggroup' => 'backup',
|
|
||||||
'varname' => 'default_customer_access',
|
|
||||||
'type' => 'checkbox',
|
|
||||||
'default' => true,
|
|
||||||
'save_method' => 'storeSettingField',
|
|
||||||
],
|
|
||||||
'backup_default_pgp_public_key' => [
|
|
||||||
'label' => lng('serversettings.backup_default_pgp_public_key'),
|
|
||||||
'settinggroup' => 'backup',
|
|
||||||
'varname' => 'default_pgp_public_key',
|
|
||||||
'type' => 'textarea',
|
|
||||||
'default' => '',
|
|
||||||
'save_method' => 'storeSettingField',
|
|
||||||
'plausibility_check_method' => [
|
|
||||||
'\\Froxlor\\Validate\\Check',
|
|
||||||
'checkPgpPublicKeySetting'
|
|
||||||
],
|
|
||||||
],
|
|
||||||
'backup_backup_tmp_dir' => [
|
|
||||||
'label' => lng('serversettings.backup_tmp_dir'),
|
|
||||||
'settinggroup' => 'backup',
|
|
||||||
'varname' => 'backup_tmp_dir',
|
|
||||||
'type' => 'text',
|
|
||||||
'string_type' => 'dir',
|
|
||||||
'default' => '/var/customers/backup/',
|
|
||||||
'save_method' => 'storeSettingField'
|
|
||||||
]
|
|
||||||
]
|
|
||||||
]
|
|
||||||
]
|
|
||||||
];
|
|
||||||
@@ -27,7 +27,6 @@ const AREA = 'admin';
|
|||||||
require __DIR__ . '/lib/init.php';
|
require __DIR__ . '/lib/init.php';
|
||||||
|
|
||||||
use Froxlor\Api\Commands\Admins;
|
use Froxlor\Api\Commands\Admins;
|
||||||
use Froxlor\Api\Commands\BackupStorages;
|
|
||||||
use Froxlor\Api\Commands\Customers;
|
use Froxlor\Api\Commands\Customers;
|
||||||
use Froxlor\Api\Commands\MysqlServer;
|
use Froxlor\Api\Commands\MysqlServer;
|
||||||
use Froxlor\CurrentUser;
|
use Froxlor\CurrentUser;
|
||||||
@@ -226,23 +225,6 @@ if (($page == 'customers' || $page == 'overview') && $userinfo['customers'] != '
|
|||||||
$hosting_plans[$row['id']] = $row['name'];
|
$hosting_plans[$row['id']] = $row['name'];
|
||||||
}
|
}
|
||||||
|
|
||||||
// backup storages
|
|
||||||
$backup_storages = [];
|
|
||||||
if (Settings::Get('backup.enabled') == '1' && $userinfo['change_serversettings'] == '1') {
|
|
||||||
$backup_storages = [
|
|
||||||
0 => lng('backup.storage_none')
|
|
||||||
];
|
|
||||||
try {
|
|
||||||
$result_json = BackupStorages::getLocal($userinfo)->listing();
|
|
||||||
$result_decoded = json_decode($result_json, true)['data']['list'];
|
|
||||||
foreach ($result_decoded as $storagedata) {
|
|
||||||
$backup_storages[$storagedata['id']] = "[" . $storagedata['type'] . "] " . html_entity_decode($storagedata['description']);
|
|
||||||
}
|
|
||||||
} catch (Exception $e) {
|
|
||||||
/* just none */
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$customer_add_data = include_once dirname(__FILE__) . '/lib/formfields/admin/customer/formfield.customer_add.php';
|
$customer_add_data = include_once dirname(__FILE__) . '/lib/formfields/admin/customer/formfield.customer_add.php';
|
||||||
|
|
||||||
UI::view('user/form.html.twig', [
|
UI::view('user/form.html.twig', [
|
||||||
@@ -325,23 +307,6 @@ if (($page == 'customers' || $page == 'overview') && $userinfo['customers'] != '
|
|||||||
$hosting_plans[$row['id']] = $row['name'];
|
$hosting_plans[$row['id']] = $row['name'];
|
||||||
}
|
}
|
||||||
|
|
||||||
// backup storages
|
|
||||||
$backup_storages = [];
|
|
||||||
if (Settings::Get('backup.enabled') == '1' && $userinfo['change_serversettings'] == '1') {
|
|
||||||
$backup_storages = [
|
|
||||||
0 => lng('backup.storage_none')
|
|
||||||
];
|
|
||||||
try {
|
|
||||||
$result_json = BackupStorages::getLocal($userinfo)->listing();
|
|
||||||
$result_decoded = json_decode($result_json, true)['data']['list'];
|
|
||||||
foreach ($result_decoded as $storagedata) {
|
|
||||||
$backup_storages[$storagedata['id']] = "[" . $storagedata['type'] . "] " . html_entity_decode($storagedata['description']);
|
|
||||||
}
|
|
||||||
} catch (Exception $e) {
|
|
||||||
/* just none */
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$available_admins_stmt = Database::prepare("
|
$available_admins_stmt = Database::prepare("
|
||||||
SELECT * FROM `" . TABLE_PANEL_ADMINS . "`
|
SELECT * FROM `" . TABLE_PANEL_ADMINS . "`
|
||||||
WHERE (`customers` = '-1' OR `customers` > `customers_used`)
|
WHERE (`customers` = '-1' OR `customers` > `customers_used`)
|
||||||
|
|||||||
@@ -26,7 +26,6 @@
|
|||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
use Froxlor\Cli\BackupCommand;
|
|
||||||
use Froxlor\Cli\ConfigDiff;
|
use Froxlor\Cli\ConfigDiff;
|
||||||
use Symfony\Component\Console\Application;
|
use Symfony\Component\Console\Application;
|
||||||
use Froxlor\Cli\RunApiCommand;
|
use Froxlor\Cli\RunApiCommand;
|
||||||
@@ -63,6 +62,5 @@ $application->add(new InstallCommand());
|
|||||||
$application->add(new MasterCron());
|
$application->add(new MasterCron());
|
||||||
$application->add(new UserCommand());
|
$application->add(new UserCommand());
|
||||||
$application->add(new ValidateAcmeWebroot());
|
$application->add(new ValidateAcmeWebroot());
|
||||||
$application->add(new BackupCommand());
|
|
||||||
$application->add(new ConfigDiff());
|
$application->add(new ConfigDiff());
|
||||||
$application->run();
|
$application->run();
|
||||||
|
|||||||
@@ -46,7 +46,6 @@
|
|||||||
"ext-fileinfo": "*",
|
"ext-fileinfo": "*",
|
||||||
"ext-gmp": "*",
|
"ext-gmp": "*",
|
||||||
"ext-gd": "*",
|
"ext-gd": "*",
|
||||||
"ext-ftp": "*",
|
|
||||||
"ext-gnupg": "*",
|
"ext-gnupg": "*",
|
||||||
"phpmailer/phpmailer": "~6.0",
|
"phpmailer/phpmailer": "~6.0",
|
||||||
"monolog/monolog": "^1.24",
|
"monolog/monolog": "^1.24",
|
||||||
|
|||||||
3
composer.lock
generated
3
composer.lock
generated
@@ -4,7 +4,7 @@
|
|||||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||||
"This file is @generated automatically"
|
"This file is @generated automatically"
|
||||||
],
|
],
|
||||||
"content-hash": "68bd39384604fb2afbfe7596496adc72",
|
"content-hash": "1f9acc318c920b38ee8141e74298655a",
|
||||||
"packages": [
|
"packages": [
|
||||||
{
|
{
|
||||||
"name": "amnuts/opcache-gui",
|
"name": "amnuts/opcache-gui",
|
||||||
@@ -4532,7 +4532,6 @@
|
|||||||
"ext-fileinfo": "*",
|
"ext-fileinfo": "*",
|
||||||
"ext-gmp": "*",
|
"ext-gmp": "*",
|
||||||
"ext-gd": "*",
|
"ext-gd": "*",
|
||||||
"ext-ftp": "*",
|
|
||||||
"ext-gnupg": "*"
|
"ext-gnupg": "*"
|
||||||
},
|
},
|
||||||
"platform-dev": {
|
"platform-dev": {
|
||||||
|
|||||||
@@ -223,8 +223,6 @@ CREATE TABLE `panel_customers` (
|
|||||||
`api_allowed` tinyint(1) NOT NULL default '1',
|
`api_allowed` tinyint(1) NOT NULL default '1',
|
||||||
`logviewenabled` tinyint(1) NOT NULL default '0',
|
`logviewenabled` tinyint(1) NOT NULL default '0',
|
||||||
`allowed_mysqlserver` text NOT NULL,
|
`allowed_mysqlserver` text NOT NULL,
|
||||||
`backup` int(11) NOT NULL default '1',
|
|
||||||
`access_backups` tinyint(1) NOT NULL default '1',
|
|
||||||
PRIMARY KEY (`customerid`),
|
PRIMARY KEY (`customerid`),
|
||||||
UNIQUE KEY `loginname` (`loginname`)
|
UNIQUE KEY `loginname` (`loginname`)
|
||||||
) ENGINE=InnoDB CHARSET=utf8 COLLATE=utf8_general_ci ROW_FORMAT=DYNAMIC;
|
) ENGINE=InnoDB CHARSET=utf8 COLLATE=utf8_general_ci ROW_FORMAT=DYNAMIC;
|
||||||
@@ -702,12 +700,6 @@ opcache.validate_timestamps'),
|
|||||||
('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),
|
||||||
('backup', 'enabled', 0),
|
|
||||||
('backup', 'default_storage', '1'),
|
|
||||||
('backup', 'default_customer_access', '1'),
|
|
||||||
('backup', 'default_pgp_public_key', ''),
|
|
||||||
('backup', 'default_retention', '3'),
|
|
||||||
('backup', 'backup_tmp_dir', '/var/customers/backup/'),
|
|
||||||
('api', 'enabled', '0'),
|
('api', 'enabled', '0'),
|
||||||
('api', 'customer_default', '1'),
|
('api', 'customer_default', '1'),
|
||||||
('2fa', 'enabled', '1'),
|
('2fa', 'enabled', '1'),
|
||||||
|
|||||||
@@ -36,19 +36,7 @@ $preconfig = [
|
|||||||
$return = [];
|
$return = [];
|
||||||
|
|
||||||
if (Update::versionInUpdate($current_version, '2.1.0-dev1')) {
|
if (Update::versionInUpdate($current_version, '2.1.0-dev1')) {
|
||||||
// Backup
|
|
||||||
$description = 'Froxlor now comes with a backup capability (More info see [DOCS LINK].';
|
|
||||||
$question = '<strong>Would you like to enable the backup-feature (default: yes)</strong>';
|
|
||||||
$return['panel_settings_mode'] = [
|
|
||||||
'type' => 'select',
|
|
||||||
'select_var' => [
|
|
||||||
0 => 'No',
|
|
||||||
1 => 'Yes'
|
|
||||||
],
|
|
||||||
'selected' => 1,
|
|
||||||
'label' => $question,
|
|
||||||
'prior_infotext' => $description
|
|
||||||
];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$preconfig['fields'] = $return;
|
$preconfig['fields'] = $return;
|
||||||
|
|||||||
Reference in New Issue
Block a user