From bddd7e35734100f99a31bab33b50dcf023017e8e Mon Sep 17 00:00:00 2001 From: Montassar Ghanmy Date: Tue, 7 Nov 2023 14:33:04 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=9B=A0=EF=B8=8F=20Default=20local=20stora?= =?UTF-8?q?ge=20home=20directory=20(#244)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tdrive/backend/node/config/default.json | 2 +- .../backend/node/src/core/platform/services/storage/index.ts | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/tdrive/backend/node/config/default.json b/tdrive/backend/node/config/default.json index 71adef60..ffa4dd33 100644 --- a/tdrive/backend/node/config/default.json +++ b/tdrive/backend/node/config/default.json @@ -132,7 +132,7 @@ "secretKey":"x1yz" }, "local":{ - "path":"/storage/" + "path":"/tdrive" } }, "email-pusher":{ diff --git a/tdrive/backend/node/src/core/platform/services/storage/index.ts b/tdrive/backend/node/src/core/platform/services/storage/index.ts index 0dc5466a..e4d3049b 100644 --- a/tdrive/backend/node/src/core/platform/services/storage/index.ts +++ b/tdrive/backend/node/src/core/platform/services/storage/index.ts @@ -23,7 +23,7 @@ export default class StorageService extends TdriveService implements private encryptionOptions: EncryptionConfiguration; private algorithm = "aes-256-cbc"; - private homeDir = "/tdrive"; + private homeDir = this.configuration.get("local.path", "/tdrive"); api(): StorageAPI { return this; @@ -48,6 +48,9 @@ export default class StorageService extends TdriveService implements accessKey: this.configuration.get("S3.accessKey"), secretKey: this.configuration.get("S3.secretKey"), }); + } else { + logger.info("Using 'local' connector for storage."); + if (!this.homeDir) this.homeDir = "/tdrive"; } logger.info( `Using 'local' connector for storage${