]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/commitdiff
Fix password for root in dev mode
authorFlorent <florent.git@zeteo.me>
Tue, 26 Jul 2022 07:31:26 +0000 (09:31 +0200)
committerChocobozzz <chocobozzz@cpy.re>
Tue, 26 Jul 2022 08:00:17 +0000 (10:00 +0200)
password should remain "test" in dev mode for root.
Fix regression of 9452d4fd33 which introduces NODE_ENV=dev

server/initializers/installer.ts

index 0364bdbe53e54200c8e2237679be9962f25b10fe..7d5919459bf42c0f179c13b57f3f353620873e3c 100644 (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) {