X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Finitializers%2Finstaller.ts;h=b0084b368de84e26893c82a143e9d1315e724df1;hb=81e504b34e71e91633442c8021e05f9cd52a49c6;hp=ee3c9dfd9c79a2073ea7136c9d3a2eb45504800e;hpb=50d6de9c286abcb34ff4234d56d9cbb803db7665;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/initializers/installer.ts b/server/initializers/installer.ts index ee3c9dfd9..b0084b368 100644 --- a/server/initializers/installer.ts +++ b/server/initializers/installer.ts @@ -1,6 +1,7 @@ import * as passwordGenerator from 'password-generator' import { UserRole } from '../../shared' -import { logger, mkdirpPromise, rimrafPromise } from '../helpers' +import { mkdirpPromise, rimrafPromise } from '../helpers/core-utils' +import { logger } from '../helpers/logger' import { createApplicationActor, createUserAccountAndChannel } from '../lib/user' import { UserModel } from '../models/account/user' import { ApplicationModel } from '../models/application/application' @@ -18,8 +19,8 @@ async function installApplication () { await createOAuthClientIfNotExist() await createOAuthAdminIfNotExist() } catch (err) { - logger.error('Cannot install application.', err) - throw err + logger.error('Cannot install application.', { err }) + process.exit(-1) } } @@ -111,7 +112,7 @@ async function createOAuthAdminIfNotExist () { // Our password is weak so do not validate it validatePassword = false } else { - password = passwordGenerator(8, true) + password = passwordGenerator(16, true) } const userData = { @@ -119,6 +120,7 @@ async function createOAuthAdminIfNotExist () { email, password, role, + nsfwPolicy: CONFIG.INSTANCE.DEFAULT_NSFW_POLICY, videoQuota: -1 } const user = new UserModel(userData) @@ -133,8 +135,6 @@ async function createApplicationIfNotExist () { // Nothing to do, application already exist if (exist === true) return undefined - logger.info('Creating Application table.') - logger.info('Creating application account.') const application = await ApplicationModel.create({