From c8c958007dfb9f24147b6289983ccf5fe5d3963a Mon Sep 17 00:00:00 2001 From: bergware Date: Fri, 8 Sep 2017 19:38:44 +0200 Subject: [PATCH] Miscellaneous encryption enhancements --- plugins/dynamix/ArrayOperation.page | 94 +++++++++++++++++++++++-- plugins/dynamix/EncryptionSettings.page | 45 ++++++++++-- plugins/dynamix/include/Browse.php | 10 +-- plugins/dynamix/include/DeviceList.php | 8 +-- plugins/dynamix/include/DiskList.php | 4 +- plugins/dynamix/include/KeyUpload.php | 11 ++- plugins/dynamix/include/ShareList.php | 4 +- 7 files changed, 149 insertions(+), 27 deletions(-) diff --git a/plugins/dynamix/ArrayOperation.page b/plugins/dynamix/ArrayOperation.page index e444a1817..94ca3ae1d 100644 --- a/plugins/dynamix/ArrayOperation.page +++ b/plugins/dynamix/ArrayOperation.page @@ -15,6 +15,22 @@ Tag="snowflake-o" */ ?> To unlock encrypted devices
select the keyfile which was originally set"; + case 'text': return "To unlock encrypted devices
enter the passphrase which was originally set
"; + default: return "Encrypted device(s) present
Encryption settings required
"; + } +} +function input_text() { + global $flag; + switch ($flag) { + case 'file': return "Keyfile: show passphrase"; + default: return " GO TO ENCRYPTION SETTINGS"; + } +} function maintenance_mode() { echo ""; echo ""; @@ -33,12 +49,48 @@ function status_indicator() { } return "$help"; } +$keyfile = file_exists($var['luksKeyfile']); +$cfg = '/boot/config/keyfile.cfg'; +$luks = false; foreach ($disks as $disk) $luks |= substr($disk['fsType'],0,5)=='luks:'; +$flag = $luks ? (file_exists($cfg) ? file_get_contents($cfg) : false) : false; ?>
+ 0 ? 'Disabled -- Parity operation is running' : ''; $mover = file_exists('/var/run/mover.pid') ? 'Disabled -- Mover is running' : ''; @@ -141,11 +194,20 @@ toggle_diskio(true); 0):?> - +".my_disk($disk['name'])." • ".my_id($disk['id'])." (".$disk['device'].")"; + if (strpos($disk['fsStatus'],'encryption')!==false) $verify = true; + } +?> + + + + + + Yes I want to do this + + + + + + + @@ -365,9 +433,15 @@ toggle_diskio(true); + + + + + + + + + + + + + + + + + +
Unmountable disk present:
-".my_disk($disk['name'])." • ".my_id($disk['id'])." (".$disk['device'].")";?>
Fix allows to format all unmountable disks OR to stop the array and correct the encryption key Format will create a file system in all Unmountable disks, discarding all data currently on those disks.
- Yes I want to do this -
Stopped. Missing encryption keyfile

Stopped. Configuration valid. Start will bring the array on-line and start Parity-Sync and/or Data-Rebuild.
Stopped. Missing encryption keyfile

Stopped. Configuration valid. Start will bring the array on-line.
Stopped. Missing encryption keyfile

Stopped. Configuration valid. Start will record all disk information and bring the array on-line.
The array will be immediately available, but unprotected since parity has not been assigned.
Stopped. Missing encryption keyfile

Stopped. Configuration valid. Start will record all disk information, bring the array on-line, and start Parity-Sync.
The array will be immediately available, but unprotected until Parity-Sync completes.
Parity is already valid.