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
+14 -3
View File
@@ -4,8 +4,8 @@ Icon="icon-disks"
Tag="icon-disk" Tag="icon-disk"
--- ---
<?PHP <?PHP
/* Copyright 2005-2018, Lime Technology /* Copyright 2005-2019, Lime Technology
* Copyright 2012-2018, Bergware International. * Copyright 2012-2019, Bergware International.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License version 2, * modify it under the terms of the GNU General Public License version 2,
@@ -36,7 +36,7 @@ function doDispatch(form) {
<?endif;?> <?endif;?>
fields['#cfg'] = "/boot/config/plugins/dynamix/dynamix.cfg"; fields['#cfg'] = "/boot/config/plugins/dynamix/dynamix.cfg";
fields['#cleanup'] = true; 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); $.post('/webGui/include/Dispatcher.php',fields);
} }
function prepareDiskSettings(form) { 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. > 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: Shutdown time-out:
: <input type="text" name="shutdownTimeout" maxlength="10" value="<?=$var['shutdownTimeout']?>" class="narrow"> : <input type="text" name="shutdownTimeout" maxlength="10" value="<?=$var['shutdownTimeout']?>" class="narrow">
@@ -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
@@ -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