Skip to content

Commit

Permalink
change encryption key path
Browse files Browse the repository at this point in the history
  • Loading branch information
HenryHengZJ committed Dec 20, 2023
1 parent c6a8215 commit 8c694e7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 11 deletions.
11 changes: 1 addition & 10 deletions packages/components/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -428,16 +428,7 @@ export const getEnvironmentVariable = (name: string): string | undefined => {
* @returns {string}
*/
const getEncryptionKeyFilePath = (): string => {
const checkPaths = [
path.join(__dirname, '..', '..', 'encryption.key'),
path.join(__dirname, '..', '..', 'server', 'encryption.key'),
path.join(__dirname, '..', '..', '..', 'encryption.key'),
path.join(__dirname, '..', '..', '..', 'server', 'encryption.key'),
path.join(__dirname, '..', '..', '..', '..', 'encryption.key'),
path.join(__dirname, '..', '..', '..', '..', 'server', 'encryption.key'),
path.join(__dirname, '..', '..', '..', '..', '..', 'encryption.key'),
path.join(__dirname, '..', '..', '..', '..', '..', 'server', 'encryption.key')
]
const checkPaths = [path.join(getUserHome(), '.flowise', 'encryption.key')]
for (const checkPath of checkPaths) {
if (fs.existsSync(checkPath)) {
return checkPath
Expand Down
2 changes: 1 addition & 1 deletion packages/server/src/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -859,7 +859,7 @@ export const isFlowValidForStream = (reactFlowNodes: IReactFlowNode[], endingNod
export const getEncryptionKeyPath = (): string => {
return process.env.SECRETKEY_PATH
? path.join(process.env.SECRETKEY_PATH, 'encryption.key')
: path.join(__dirname, '..', '..', 'encryption.key')
: path.join(getUserHome(), '.flowise', 'encryption.key')
}

/**
Expand Down

0 comments on commit 8c694e7

Please sign in to comment.