Added new setting "Cache encryption passphrase" under Disk Settings

This commit is contained in:
bergware
2019-08-31 08:23:11 +02:00
parent 6b4a150eb9
commit 7ee4deb795
3 changed files with 18 additions and 3 deletions

View File

@@ -4,8 +4,8 @@ Icon="icon-disks"
Tag="icon-disk"
---
<?PHP
/* Copyright 2005-2018, Lime Technology
* Copyright 2012-2018, Bergware International.
/* Copyright 2005-2019, Lime Technology
* Copyright 2012-2019, Bergware International.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License version 2,
@@ -36,7 +36,7 @@ function doDispatch(form) {
<?endif;?>
fields['#cfg'] = "/boot/config/plugins/dynamix/dynamix.cfg";
fields['#cleanup'] = true;
$(form).find('input[name^="display_"]').each(function(){fields[$(this).attr('name')] = $(this).val(); $(this).prop('disabled',true);});
$(form).find('input[name^="display_"],select[name^="display_"]').each(function(){fields[$(this).attr('name')] = $(this).val(); $(this).prop('disabled',true);});
$.post('/webGui/include/Dispatcher.php',fields);
}
function prepareDiskSettings(form) {
@@ -131,6 +131,17 @@ Default file system:
>
> The default file system type for a single or multi-device cache is always Btrfs.
Cache encryption passphrase:
: <select name="display_keyfile" size="1">
<?=mk_option($display['keyfile'], "", "No")?>
<?=mk_option($display['keyfile'], "1", "Yes")?>
</select>
> By default the user is asked to enter the passphrase each time the array is restarted.<br>
> Caching the passphrase allows for restarting the array without intervention once the passphrase is entered the first time
>
> Note: the passphrase is lost after a system reboot or system powerdown and must be re-entered
Shutdown time-out:
: <input type="text" name="shutdownTimeout" maxlength="10" value="<?=$var['shutdownTimeout']?>" class="narrow">

View File

@@ -0,0 +1,2 @@
#!/bin/bash
[[ -f /root/keyfile && -z $(grep -Po '^keyfile="\K[^"]+' /boot/config/plugins/dynamix/dynamix.cfg 2>/dev/null) ]] && rm -f /root/keyfile

View File

@@ -0,0 +1,2 @@
#!/bin/bash
[[ -f /root/keyfile && -z $(grep -Po '^keyfile="\K[^"]+' /boot/config/plugins/dynamix/dynamix.cfg 2>/dev/null) ]] && rm -f /root/keyfile