diff --git a/lib/Connector/Sabre/PropFindPlugin.php b/lib/Connector/Sabre/PropFindPlugin.php
index 66c0565ff..f4a851a31 100644
--- a/lib/Connector/Sabre/PropFindPlugin.php
+++ b/lib/Connector/Sabre/PropFindPlugin.php
@@ -66,17 +66,31 @@ public function setE2EEProperties(PropFind $propFind, \Sabre\DAV\INode $node) {
});
$propFind->handle(self::E2EE_METADATA_PROPERTYNAME, function () use ($node) {
- if ($this->isE2EEnabledPath($node)) {
+ if (!$this->isE2EEnabledPath($node)) {
+ return null;
+ }
+
+ try {
return $this->metaDataStorage->getMetaData(
$this->userSession->getUser()->getUID(),
$node->getId(),
);
+ } catch (\Throwable $e) {
+ // Missing metadata must not break PROPFIND (avoid 500)
+ return null;
}
});
$propFind->handle(self::E2EE_METADATA_SIGNATURE_PROPERTYNAME, function () use ($node) {
- if ($this->isE2EEnabledPath($node)) {
+ if (!$this->isE2EEnabledPath($node)) {
+ return null;
+ }
+
+ try {
return $this->metaDataStorage->readSignature($node->getId());
+ } catch (\Throwable $e) {
+ // Missing signature/metadata must not break PROPFIND (avoid 500)
+ return null;
}
});
}
diff --git a/lib/Controller/ConfigController.php b/lib/Controller/ConfigController.php
index 84a4712ff..e9f0ebdd8 100644
--- a/lib/Controller/ConfigController.php
+++ b/lib/Controller/ConfigController.php
@@ -38,6 +38,11 @@ public function setUserConfig(string $key, string $value): JSONResponse {
return new JSONResponse([], Http::STATUS_PRECONDITION_FAILED);
}
+ // force disable e2eeInBrowserEnabled
+ if ($key === 'e2eeInBrowserEnabled') {
+ $value = 'false';
+ }
+
$this->config->setUserValue($this->userId, Application::APP_ID, $key, $value);
return new JSONResponse([], Http::STATUS_OK);
}
diff --git a/lib/Listener/LoadAdditionalListener.php b/lib/Listener/LoadAdditionalListener.php
index f66932667..bf5ed5cea 100644
--- a/lib/Listener/LoadAdditionalListener.php
+++ b/lib/Listener/LoadAdditionalListener.php
@@ -36,7 +36,7 @@ public function handle(Event $event): void {
$this->initialState->provideInitialState(
'userConfig',
[
- 'e2eeInBrowserEnabled' => $this->config->getUserValue($this->userId, 'end_to_end_encryption', 'e2eeInBrowserEnabled', 'false') === 'true',
+ 'e2eeInBrowserEnabled' => false,
]
);
diff --git a/lib/MetaDataStorage.php b/lib/MetaDataStorage.php
index a1206f493..b544ba4b8 100644
--- a/lib/MetaDataStorage.php
+++ b/lib/MetaDataStorage.php
@@ -53,11 +53,18 @@ public function getMetaData(string $userId, int $id): string {
}
$folderName = $this->getFolderNameForFileId($id);
- $folder = $this->appData->getFolder($folderName);
- return $folder
- ->getFile($this->metaDataFileName)
- ->getContent();
+ try {
+ $folder = $this->appData->getFolder($folderName);
+ } catch (NotFoundException $e) {
+ throw new MissingMetaDataException('Meta-data folder missing');
+ }
+
+ try {
+ return $folder->getFile($this->metaDataFileName)->getContent();
+ } catch (NotFoundException $e) {
+ throw new MissingMetaDataException('Meta-data file missing');
+ }
}
/**
diff --git a/lib/Settings/Personal.php b/lib/Settings/Personal.php
index 66246a72f..f968475e3 100644
--- a/lib/Settings/Personal.php
+++ b/lib/Settings/Personal.php
@@ -39,7 +39,7 @@ public function getForm(): TemplateResponse {
$this->initialState->provideInitialState(
'userConfig',
[
- 'e2eeInBrowserEnabled' => $this->config->getUserValue($this->userId, 'end_to_end_encryption', 'e2eeInBrowserEnabled', 'false') === 'true',
+ 'e2eeInBrowserEnabled' => false,
]
);
diff --git a/src/components/MnemonicPromptDialog.vue b/src/components/MnemonicPromptDialog.vue
index 15e36107a..14ceb7d60 100644
--- a/src/components/MnemonicPromptDialog.vue
+++ b/src/components/MnemonicPromptDialog.vue
@@ -30,7 +30,7 @@ function submit() {
const buttons = computed(() => [
{
- label: t('end_to_en_encryption', 'Submit'),
+ label: t('end_to_end_encryption', 'Submit'),
nativeType: 'submit',
type: 'primary',
disabled: !isFormValid.value,
diff --git a/src/components/SecuritySection.vue b/src/components/SecuritySection.vue
index 4a13b6d9e..1e3c5996b 100644
--- a/src/components/SecuritySection.vue
+++ b/src/components/SecuritySection.vue
@@ -6,40 +6,41 @@
-
- {{ t('end_to_end_encryption', 'Enable E2EE navigation in browser') }}
-
-
-
-
-
-
-
-
- {{ t('end_to_end_encryption', 'The server could serve malicious source code to extract the secret that protects your files.') }}
-
-
+ setConfig('e2eeInBrowserEnabled', value)">
+ :disabled="!hasKey"
+ type="secondary"
+ @click="shouldDisplayE2EEInBrowserWarning = true">
{{ t('end_to_end_encryption', 'Enable E2EE navigation in browser') }}
-
-
+
+
+
+
+
+
+
+
+ {{ t('end_to_end_encryption', 'The server could serve malicious source code to extract the secret that protects your files.') }}
+ setConfig('e2eeInBrowserEnabled', value)">
+ {{ t('end_to_end_encryption', 'Enable E2EE navigation in browser') }}
+
+
+