X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Finitializers%2Finstaller.ts;h=75daeb5d89e55792c5a2e236caef15e64737db0d;hb=221ee1adc916684d4881d2a9c4c01954dcde986e;hp=33970f0fae9195b4cc46c2e4107e93eb8956db7e;hpb=86aafd06f2d124786ea3d10477f356c2e3f85dd6;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/initializers/installer.ts b/server/initializers/installer.ts index 33970f0fa..75daeb5d8 100644 --- a/server/initializers/installer.ts +++ b/server/initializers/installer.ts @@ -1,15 +1,15 @@ -import * as passwordGenerator from 'password-generator' +import { ensureDir, remove } from 'fs-extra' +import passwordGenerator from 'password-generator' import { UserRole } from '../../shared' import { logger } from '../helpers/logger' import { createApplicationActor, createUserAccountAndChannelAndPlaylist } from '../lib/user' -import { UserModel } from '../models/account/user' import { ApplicationModel } from '../models/application/application' import { OAuthClientModel } from '../models/oauth/oauth-client' +import { UserModel } from '../models/user/user' import { applicationExist, clientsExist, usersExist } from './checker-after-init' -import { FILES_CACHE, HLS_STREAMING_PLAYLIST_DIRECTORY, LAST_MIGRATION_VERSION } from './constants' -import { sequelizeTypescript } from './database' -import { ensureDir, remove } from 'fs-extra' import { CONFIG } from './config' +import { FILES_CACHE, HLS_STREAMING_PLAYLIST_DIRECTORY, LAST_MIGRATION_VERSION, RESUMABLE_UPLOAD_DIRECTORY } from './constants' +import { sequelizeTypescript } from './database' async function installApplication () { try { @@ -79,6 +79,9 @@ function createDirectoriesIfNotExist () { // Playlist directories tasks.push(ensureDir(HLS_STREAMING_PLAYLIST_DIRECTORY)) + // Resumable upload directory + tasks.push(ensureDir(RESUMABLE_UPLOAD_DIRECTORY)) + return Promise.all(tasks) } @@ -146,7 +149,7 @@ async function createOAuthAdminIfNotExist () { } const user = new UserModel(userData) - await createUserAccountAndChannelAndPlaylist(user, validatePassword) + await createUserAccountAndChannelAndPlaylist({ userToCreate: user, channelNames: undefined, validateUser: validatePassword }) logger.info('Username: ' + username) logger.info('User password: ' + password) }