X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Finitializers%2Finstaller.ts;h=b02be956702505add2383ba165777c202f692f13;hb=43dc043a368a9cee4da2d1916ecbe5251ab5fec5;hp=0364bdbe53e54200c8e2237679be9962f25b10fe;hpb=c74cd9feaba583fc40c61d1c3a7c036267a56ea1;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/initializers/installer.ts b/server/initializers/installer.ts index 0364bdbe5..b02be9567 100644 --- a/server/initializers/installer.ts +++ b/server/initializers/installer.ts @@ -1,6 +1,8 @@ import { ensureDir, readdir, remove } from 'fs-extra' import passwordGenerator from 'password-generator' import { join } from 'path' +import { isTestOrDevInstance } from '@server/helpers/core-utils' +import { getNodeABIVersion } from '@server/helpers/version' import { UserRole } from '@shared/models' import { logger } from '../helpers/logger' import { buildUser, createApplicationActor, createUserAccountAndChannelAndPlaylist } from '../lib/user' @@ -135,8 +137,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) { @@ -174,7 +176,9 @@ async function createApplicationIfNotExist () { logger.info('Creating application account.') const application = await ApplicationModel.create({ - migrationVersion: LAST_MIGRATION_VERSION + migrationVersion: LAST_MIGRATION_VERSION, + nodeVersion: process.version, + nodeABIVersion: getNodeABIVersion() }) return createApplicationActor(application.id)