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
pull/5163/head
Florent 2022-07-26 09:31:26 +02:00 committed by Chocobozzz
parent 9e2a4af3a0
commit 3efa4da1fe
1 changed files with 3 additions and 2 deletions

View File

@ -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) {