Merge branch 'Master' into 'Pipedrive-OAuth2-support'

This commit is contained in:
ricardo
2020-07-23 16:51:05 -04:00
parent c1b4c570fd
commit b187a8fd7d
271 changed files with 17019 additions and 2796 deletions

View File

@@ -41,8 +41,13 @@ export async function prepareUserSettings(): Promise<IUserSettings> {
userSettings = {};
}
// Settings and/or key do not exist. So generate a new encryption key
userSettings.encryptionKey = randomBytes(24).toString('base64');
if (process.env[ENCRYPTION_KEY_ENV_OVERWRITE] !== undefined) {
// Use the encryption key which got set via environment
userSettings.encryptionKey = process.env[ENCRYPTION_KEY_ENV_OVERWRITE];
} else {
// Generate a new encryption key
userSettings.encryptionKey = randomBytes(24).toString('base64');
}
console.log(`UserSettings got generated and saved to: ${settingsPath}`);