aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorLouis <louis@chmn.me>2024-08-28 10:34:55 +0200
committerGitHub <noreply@github.com>2024-08-28 10:34:55 +0200
commit6fe25228080d33889183759fc3701e1423961ee4 (patch)
tree66a9314bd23c9d6eaefecace32acf13efc0d4b02 /core
parent32d76b0b4b7da1183a5c54161ed22b08ddd91f04 (diff)
parentfffe826d90d9d17e47c9f7f37b91ab086e3aece8 (diff)
downloadnextcloud-server-6fe25228080d33889183759fc3701e1423961ee4.tar.gz
nextcloud-server-6fe25228080d33889183759fc3701e1423961ee4.zip
Merge pull request #47496 from nextcloud/artonge/feat/improve_encryption_detection_in_occ
feat: Improve encryption mode detection in occ info:file
Diffstat (limited to 'core')
-rw-r--r--core/Command/Info/File.php11
1 files changed, 9 insertions, 2 deletions
diff --git a/core/Command/Info/File.php b/core/Command/Info/File.php
index 0a3006ac1d7..76fbd38712c 100644
--- a/core/Command/Info/File.php
+++ b/core/Command/Info/File.php
@@ -11,6 +11,7 @@ use OC\Files\ObjectStore\ObjectStoreStorage;
use OC\Files\View;
use OCA\Files_External\Config\ExternalMountPoint;
use OCA\GroupFolders\Mount\GroupMountPoint;
+use OCP\Files\File as OCPFile;
use OCP\Files\Folder;
use OCP\Files\IHomeStorage;
use OCP\Files\Mount\IMountPoint;
@@ -61,8 +62,9 @@ class File extends Command {
$output->writeln(' fileid: ' . $node->getId());
$output->writeln(' mimetype: ' . $node->getMimetype());
$output->writeln(' modified: ' . (string)$this->l10n->l('datetime', $node->getMTime()));
- $output->writeln(' ' . ($node->isEncrypted() ? 'encrypted' : 'not encrypted'));
- if ($node->isEncrypted()) {
+
+ if ($node instanceof OCPFile && $node->isEncrypted()) {
+ $output->writeln(' ' . 'server-side encrypted: yes');
$keyPath = $this->encryptionUtil->getFileKeyDir('', $node->getPath());
if ($this->rootView->file_exists($keyPath)) {
$output->writeln(' encryption key at: ' . $keyPath);
@@ -70,6 +72,11 @@ class File extends Command {
$output->writeln(' <error>encryption key not found</error> should be located at: ' . $keyPath);
}
}
+
+ if ($node instanceof Folder && $node->isEncrypted() || $node instanceof OCPFile && $node->getParent()->isEncrypted()) {
+ $output->writeln(' ' . 'end-to-end encrypted: yes');
+ }
+
$output->writeln(' size: ' . Util::humanFileSize($node->getSize()));
$output->writeln(' etag: ' . $node->getEtag());
if ($node instanceof Folder) {