aboutsummaryrefslogtreecommitdiffstats
path: root/core/Command
diff options
context:
space:
mode:
Diffstat (limited to 'core/Command')
-rw-r--r--core/Command/Config/System/SetConfig.php9
-rw-r--r--core/Command/Info/File.php10
2 files changed, 18 insertions, 1 deletions
diff --git a/core/Command/Config/System/SetConfig.php b/core/Command/Config/System/SetConfig.php
index 4d23c191ac1..62ab7f7120f 100644
--- a/core/Command/Config/System/SetConfig.php
+++ b/core/Command/Config/System/SetConfig.php
@@ -142,6 +142,13 @@ class SetConfig extends Base {
'readable-value' => ($value === '') ? 'empty string' : 'string ' . $value,
];
+ case 'json':
+ $value = json_decode($value, true);
+ return [
+ 'value' => $value,
+ 'readable-value' => 'json ' . json_encode($value),
+ ];
+
default:
throw new \InvalidArgumentException('Invalid type');
}
@@ -183,7 +190,7 @@ class SetConfig extends Base {
*/
public function completeOptionValues($optionName, CompletionContext $context) {
if ($optionName === 'type') {
- return ['string', 'integer', 'double', 'boolean'];
+ return ['string', 'integer', 'double', 'boolean', 'json', 'null'];
}
return parent::completeOptionValues($optionName, $context);
}
diff --git a/core/Command/Info/File.php b/core/Command/Info/File.php
index a081d1d13e1..c21c2e666fb 100644
--- a/core/Command/Info/File.php
+++ b/core/Command/Info/File.php
@@ -8,6 +8,7 @@ declare(strict_types=1);
namespace OC\Core\Command\Info;
use OC\Files\ObjectStore\ObjectStoreStorage;
+use OC\Files\Storage\Wrapper\Encryption;
use OC\Files\View;
use OCA\Files_External\Config\ExternalMountPoint;
use OCA\GroupFolders\Mount\GroupMountPoint;
@@ -71,6 +72,15 @@ class File extends Command {
} else {
$output->writeln(' <error>encryption key not found</error> should be located at: ' . $keyPath);
}
+ $storage = $node->getStorage();
+ if ($storage->instanceOfStorage(Encryption::class)) {
+ /** @var Encryption $storage */
+ if (!$storage->hasValidHeader($node->getInternalPath())) {
+ $output->writeln(' <error>file doesn\'t have a valid encryption header</error>');
+ }
+ } else {
+ $output->writeln(' <error>file is marked as encrypted, but encryption doesn\'t seem to be setup</error>');
+ }
}
if ($node instanceof Folder && $node->isEncrypted() || $node instanceof OCPFile && $node->getParent()->isEncrypted()) {