fix default encryption key file path - Error: Error: Error: ENOENT: no such file or directory, open ''

This commit is contained in:
Henry
2023-07-29 01:46:51 +01:00
parent 1e3f9a8d9b
commit 6378e08f27
2 changed files with 9 additions and 5 deletions
+4 -4
View File
@@ -355,10 +355,10 @@ export const getEnvironmentVariable = (name: string): string | undefined => {
*/
const getEncryptionKeyFilePath = (): string => {
const checkPaths = [
path.join(__dirname, '..', '..', 'server', 'encryption.key'),
path.join(__dirname, '..', '..', '..', 'server', 'encryption.key'),
path.join(__dirname, '..', '..', '..', '..', 'server', 'encryption.key'),
path.join(__dirname, '..', '..', '..', '..', '..', 'server', 'encryption.key')
path.join(__dirname, '..', '..', 'encryption.key'),
path.join(__dirname, '..', '..', '..', 'encryption.key'),
path.join(__dirname, '..', '..', '..', '..', 'encryption.key'),
path.join(__dirname, '..', '..', '..', '..', '..', 'encryption.key')
]
for (const checkPath of checkPaths) {
if (fs.existsSync(checkPath)) {