Skip to content

Commit

Permalink
work on backup storages
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Kaufmann <[email protected]>
  • Loading branch information
d00p committed Jul 27, 2023
1 parent d1043b4 commit c52d9bb
Show file tree
Hide file tree
Showing 17 changed files with 623 additions and 143 deletions.
90 changes: 23 additions & 67 deletions actions/admin/settings/230.backup.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
'icon' => 'fa-solid fa-sliders',
'advanced_mode' => true,
'fields' => [
'system_backup_enabled' => [
'backup_enabled' => [
'label' => lng('serversettings.backup_enabled'),
'settinggroup' => 'backup',
'varname' => 'enabled',
Expand All @@ -40,74 +40,39 @@
'overview_option' => true,
'cronmodule' => 'froxlor/backup'
],
'system_backup_type' => [
'label' => lng('serversettings.backup_type'),
'backup_default_storage' => [
'label' => lng('serversettings.backup_default_storage'),
'settinggroup' => 'backup',
'varname' => 'type',
'varname' => 'default_storage',
'type' => 'select',
'default' => 'Local',
'select_var' => [
'Local' => lng('serversettings.local'),
'SFTP' => lng('serversettings.sftp'),
'FTPS' => lng('serversettings.ftps'),
'S3' => lng('serversettings.s3'),
'default' => '1',
'option_options_method' => [
'\\Froxlor\\Backup\\Backup',
'getBackupStorages'
],
'save_method' => 'storeSettingField',
'overview_option' => true,
],
'system_backup_region' => [
'label' => lng('serversettings.backup_region'),
'settinggroup' => 'backup',
'varname' => 'region',
'type' => 'text',
'default' => 'eu-central-1',
'save_method' => 'storeSettingField',
],
'system_backup_bucket' => [
'label' => lng('serversettings.backup_bucket'),
'settinggroup' => 'backup',
'varname' => 'bucket',
'type' => 'text',
'default' => '',
'save_method' => 'storeSettingField',
],
'system_backup_destination_path' => [
'label' => lng('serversettings.backup_destination_path'),
'settinggroup' => 'backup',
'varname' => 'destination_path',
'type' => 'text',
'string_type' => 'confdir',
'default' => '/srv/backups/',
'save_method' => 'storeSettingField',
],
'system_backup_hostname' => [
'label' => lng('serversettings.backup_hostname'),
'settinggroup' => 'backup',
'varname' => 'hostname',
'type' => 'text',
'default' => '',
'save_method' => 'storeSettingField',
'save_method' => 'storeSettingField'
],
'system_backup_username' => [
'label' => lng('serversettings.backup_username'),
'backup_default_retention' => [
'label' => lng('serversettings.backup_default_retention'),
'settinggroup' => 'backup',
'varname' => 'username',
'type' => 'text',
'default' => '',
'varname' => 'default_retention',
'type' => 'number',
'default' => 3,
'min' => 0,
'save_method' => 'storeSettingField',
],
'system_backup_password' => [
'label' => lng('serversettings.backup_password'),
'backup_default_customer_access' => [
'label' => lng('serversettings.backup_default_customer_access'),
'settinggroup' => 'backup',
'varname' => 'password',
'type' => 'password',
'default' => '',
'varname' => 'default_customer_access',
'type' => 'checkbox',
'default' => true,
'save_method' => 'storeSettingField',
],
'system_backup_pgp_public_key' => [
'label' => lng('serversettings.backup_pgp_public_key'),
'backup_default_pgp_public_key' => [
'label' => lng('serversettings.backup_default_pgp_public_key'),
'settinggroup' => 'backup',
'varname' => 'pgp_public_key',
'varname' => 'default_pgp_public_key',
'type' => 'textarea',
'default' => '',
'save_method' => 'storeSettingField',
Expand All @@ -116,15 +81,6 @@
'checkPgpPublicKeySetting'
],
],
'system_backup_retention' => [
'label' => lng('serversettings.backup_retention'),
'settinggroup' => 'backup',
'varname' => 'retention',
'type' => 'number',
'default' => 3,
'min' => 0,
'save_method' => 'storeSettingField',
],
]
]
]
Expand Down
4 changes: 2 additions & 2 deletions admin_customers.php
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@
$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['description'] . ' (' . $storagedata['type'] . ')';
$backup_storages[$storagedata['id']] = "[" . $storagedata['type'] . "] " . html_entity_decode($storagedata['description']);
}
} catch (Exception $e) {
/* just none */
Expand Down Expand Up @@ -335,7 +335,7 @@
$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['description'] . ' (' . $storagedata['type'] . ')';
$backup_storages[$storagedata['id']] = "[" . $storagedata['type'] . "] " . html_entity_decode($storagedata['description']);
}
} catch (Exception $e) {
/* just none */
Expand Down
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
"ext-fileinfo": "*",
"ext-gmp": "*",
"ext-gd": "*",
"ext-ftp": "*",
"phpmailer/phpmailer": "~6.0",
"monolog/monolog": "^1.24",
"robthree/twofactorauth": "^1.6",
Expand Down
Loading

0 comments on commit c52d9bb

Please sign in to comment.