mirror of
https://github.com/n8n-io/n8n.git
synced 2025-03-05 20:50:17 -08:00
Some checks failed
Test Master / install-and-build (push) Waiting to run
Test Master / Unit tests (18.x) (push) Blocked by required conditions
Test Master / Unit tests (20.x) (push) Blocked by required conditions
Test Master / Unit tests (22.4) (push) Blocked by required conditions
Test Master / Lint (push) Blocked by required conditions
Test Master / Notify Slack on failure (push) Blocked by required conditions
Benchmark Docker Image CI / build (push) Has been cancelled
29 lines
893 B
TypeScript
29 lines
893 B
TypeScript
import { Config, Env } from '@n8n/config';
|
|
import path from 'node:path';
|
|
|
|
@Config
|
|
export class InstanceSettingsConfig {
|
|
/**
|
|
* Whether to enforce that n8n settings file doesn't have overly wide permissions.
|
|
* If set to true, n8n will check the permissions of the settings file and
|
|
* attempt change them to 0600 (only owner has rw access) if they are too wide.
|
|
*/
|
|
@Env('N8N_ENFORCE_SETTINGS_FILE_PERMISSIONS')
|
|
enforceSettingsFilePermissions: boolean = false;
|
|
|
|
/**
|
|
* The home folder path of the user.
|
|
* If none can be found it falls back to the current working directory
|
|
*/
|
|
readonly userHome: string;
|
|
|
|
readonly n8nFolder: string;
|
|
|
|
constructor() {
|
|
const homeVarName = process.platform === 'win32' ? 'USERPROFILE' : 'HOME';
|
|
this.userHome = process.env.N8N_USER_FOLDER ?? process.env[homeVarName] ?? process.cwd();
|
|
|
|
this.n8nFolder = path.join(this.userHome, '.n8n');
|
|
}
|
|
}
|