From 3efa4da1fef44400931c3db47dc27a92da77062e Mon Sep 17 00:00:00 2001 From: Florent Date: Tue, 26 Jul 2022 09:31:26 +0200 Subject: Fix password for root in dev mode password should remain "test" in dev mode for root. Fix regression of 9452d4fd33 which introduces NODE_ENV=dev --- server/initializers/installer.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'server/initializers') diff --git a/server/initializers/installer.ts b/server/initializers/installer.ts index 0364bdbe5..7d5919459 100644 --- a/server/initializers/installer.ts +++ b/server/initializers/installer.ts @@ -10,6 +10,7 @@ import { applicationExist, clientsExist, usersExist } from './checker-after-init import { CONFIG } from './config' import { FILES_CACHE, HLS_STREAMING_PLAYLIST_DIRECTORY, LAST_MIGRATION_VERSION, RESUMABLE_UPLOAD_DIRECTORY } from './constants' import { sequelizeTypescript } from './database' +import { isTestOrDevInstance } from '@server/helpers/core-utils' async function installApplication () { try { @@ -135,8 +136,8 @@ async function createOAuthAdminIfNotExist () { let validatePassword = true let password = '' - // Do not generate a random password for tests - if (process.env.NODE_ENV === 'test') { + // Do not generate a random password for test and dev environments + if (isTestOrDevInstance()) { password = 'test' if (process.env.NODE_APP_INSTANCE) { -- cgit v1.2.3