X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=shared%2Fserver-commands%2Fserver%2Fserver.ts;h=af4423e8d25d413f44e6dc0a29d21463208a5cfa;hb=55f0a7a76249dda79d2815bd5c1d81ccd8bc7002;hp=339b9cabb8a13abb14b63e0a89cd80f7e3de5b65;hpb=bf54587a3e2ad9c2c186828f2a5682b91ee2cc00;p=github%2FChocobozzz%2FPeerTube.git diff --git a/shared/server-commands/server/server.ts b/shared/server-commands/server/server.ts index 339b9cabb..af4423e8d 100644 --- a/shared/server-commands/server/server.ts +++ b/shared/server-commands/server/server.ts @@ -1,14 +1,14 @@ import { ChildProcess, fork } from 'child_process' import { copy } from 'fs-extra' import { join } from 'path' -import { root, randomInt } from '@shared/core-utils' -import { Video, VideoChannel, VideoCreateResult, VideoDetails } from '../../models/videos' +import { parallelTests, randomInt, root } from '@shared/core-utils' +import { Video, VideoChannel, VideoCreateResult, VideoDetails } from '@shared/models' import { BulkCommand } from '../bulk' import { CLICommand } from '../cli' import { CustomPagesCommand } from '../custom-pages' import { FeedCommand } from '../feeds' import { LogsCommand } from '../logs' -import { parallelTests, SQLCommand } from '../miscs' +import { SQLCommand } from '../miscs' import { AbusesCommand } from '../moderation' import { OverviewsCommand } from '../overviews' import { SearchCommand } from '../search' @@ -25,6 +25,7 @@ import { PlaylistsCommand, ServicesCommand, StreamingPlaylistsCommand, + VideoEditorCommand, VideosCommand } from '../videos' import { CommentsCommand } from '../videos/comments-command' @@ -33,11 +34,11 @@ import { ContactFormCommand } from './contact-form-command' import { DebugCommand } from './debug-command' import { FollowsCommand } from './follows-command' import { JobsCommand } from './jobs-command' +import { ObjectStorageCommand } from './object-storage-command' import { PluginsCommand } from './plugins-command' import { RedundancyCommand } from './redundancy-command' import { ServersCommand } from './servers-command' import { StatsCommand } from './stats-command' -import { ObjectStorageCommand } from './object-storage-command' export type RunServerOptions = { hideLogs?: boolean @@ -124,6 +125,7 @@ export class PeerTubeServer { login?: LoginCommand users?: UsersCommand objectStorage?: ObjectStorageCommand + videoEditor?: VideoEditorCommand videos?: VideosCommand constructor (options: { serverNumber: number } | { url: string }) { @@ -210,18 +212,24 @@ export class PeerTubeServer { Object.assign(env, options.env) } + const execArgv = options.nodeArgs || [] + // FIXME: too slow :/ + // execArgv.push('--enable-source-maps') + const forkOptions = { silent: true, env, detached: true, - execArgv: options.nodeArgs || [] + execArgv } + const peertubeArgs = options.peertubeArgs || [] + return new Promise((res, rej) => { const self = this let aggregatedLogs = '' - this.app = fork(join(root(), 'dist', 'server.js'), options.peertubeArgs || [], forkOptions) + this.app = fork(join(root(), 'dist', 'server.js'), peertubeArgs, forkOptions) const onPeerTubeExit = () => rej(new Error('Process exited:\n' + aggregatedLogs)) const onParentExit = () => { @@ -388,5 +396,6 @@ export class PeerTubeServer { this.users = new UsersCommand(this) this.videos = new VideosCommand(this) this.objectStorage = new ObjectStorageCommand(this) + this.videoEditor = new VideoEditorCommand(this) } }