diff --git a/packages/server/src/utils/index.ts b/packages/server/src/utils/index.ts index a232094e..aa3e9ef6 100644 --- a/packages/server/src/utils/index.ts +++ b/packages/server/src/utils/index.ts @@ -1099,6 +1099,7 @@ export const getTelemetryFlowObj = (nodes: IReactFlowNode[], edges: IReactFlowEd * TODO: move env variables to settings json file, easier configuration */ export const getUserSettingsFilePath = () => { + if (process.env.SECRETKEY_PATH) return path.join(process.env.SECRETKEY_PATH, 'settings.json') const checkPaths = [path.join(getUserHome(), '.flowise', 'settings.json')] for (const checkPath of checkPaths) { if (fs.existsSync(checkPath)) { diff --git a/packages/server/src/utils/telemetry.ts b/packages/server/src/utils/telemetry.ts index 4254ea76..4b033f20 100644 --- a/packages/server/src/utils/telemetry.ts +++ b/packages/server/src/utils/telemetry.ts @@ -25,7 +25,9 @@ export class Telemetry { const settings = { instanceId } - const defaultLocation = path.join(getUserHome(), '.flowise', 'settings.json') + const defaultLocation = process.env.SECRETKEY_PATH + ? path.join(process.env.SECRETKEY_PATH, 'settings.json') + : path.join(getUserHome(), '.flowise', 'settings.json') await fs.promises.writeFile(defaultLocation, JSON.stringify(settings, null, 2)) return instanceId }