X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=shared%2Fserver-commands%2Fserver%2Fserver.ts;h=7096faf21d50d2f976e6cb941014120e17cbd038;hb=56f47830758ff8e92abcfcc5f35d474ab12fe215;hp=0ad818a11f9d19e711379a8571bb89f5974db510;hpb=b211106695bb82f6c32e53306081b5262c3d109d;p=github%2FChocobozzz%2FPeerTube.git diff --git a/shared/server-commands/server/server.ts b/shared/server-commands/server/server.ts index 0ad818a11..7096faf21 100644 --- a/shared/server-commands/server/server.ts +++ b/shared/server-commands/server/server.ts @@ -2,7 +2,7 @@ import { ChildProcess, fork } from 'child_process' import { copy } from 'fs-extra' import { join } from 'path' import { parallelTests, randomInt, root } from '@shared/core-utils' -import { Video, VideoChannel, VideoCreateResult, VideoDetails } from '@shared/models' +import { Video, VideoChannel, VideoChannelSync, VideoCreateResult, VideoDetails } from '@shared/models' import { BulkCommand } from '../bulk' import { CLICommand } from '../cli' import { CustomPagesCommand } from '../custom-pages' @@ -13,12 +13,21 @@ import { AbusesCommand } from '../moderation' import { OverviewsCommand } from '../overviews' import { SearchCommand } from '../search' import { SocketIOCommand } from '../socket' -import { AccountsCommand, BlocklistCommand, LoginCommand, NotificationsCommand, SubscriptionsCommand, UsersCommand } from '../users' +import { + AccountsCommand, + BlocklistCommand, + LoginCommand, + NotificationsCommand, + SubscriptionsCommand, + TwoFactorCommand, + UsersCommand +} from '../users' import { BlacklistCommand, CaptionsCommand, ChangeOwnershipCommand, ChannelsCommand, + ChannelSyncsCommand, HistoryCommand, ImportsCommand, LiveCommand, @@ -36,6 +45,7 @@ import { ContactFormCommand } from './contact-form-command' import { DebugCommand } from './debug-command' import { FollowsCommand } from './follows-command' import { JobsCommand } from './jobs-command' +import { MetricsCommand } from './metrics-command' import { ObjectStorageCommand } from './object-storage-command' import { PluginsCommand } from './plugins-command' import { RedundancyCommand } from './redundancy-command' @@ -79,6 +89,7 @@ export class PeerTubeServer { } channel?: VideoChannel + videoChannelSync?: Partial video?: Video videoCreated?: VideoCreateResult @@ -102,6 +113,7 @@ export class PeerTubeServer { debug?: DebugCommand follows?: FollowsCommand jobs?: JobsCommand + metrics?: MetricsCommand plugins?: PluginsCommand redundancy?: RedundancyCommand stats?: StatsCommand @@ -118,6 +130,7 @@ export class PeerTubeServer { playlists?: PlaylistsCommand history?: HistoryCommand imports?: ImportsCommand + channelSyncs?: ChannelSyncsCommand streamingPlaylists?: StreamingPlaylistsCommand channels?: ChannelsCommand comments?: CommentsCommand @@ -131,6 +144,7 @@ export class PeerTubeServer { videos?: VideosCommand videoStats?: VideoStatsCommand views?: ViewsCommand + twoFactor?: TwoFactorCommand constructor (options: { serverNumber: number } | { url: string }) { if ((options as any).url) { @@ -177,6 +191,12 @@ export class PeerTubeServer { this.port = parseInt(parsed.port) } + getDirectoryPath (directoryName: string) { + const testDirectory = 'test' + this.internalServerNumber + + return join(root(), testDirectory, directoryName) + } + async flushAndRun (configOverride?: Object, options: RunServerOptions = {}) { await ServersCommand.flushTests(this.internalServerNumber) @@ -336,19 +356,20 @@ export class PeerTubeServer { suffix: '_test' + this.internalServerNumber }, storage: { - tmp: `test${this.internalServerNumber}/tmp/`, - bin: `test${this.internalServerNumber}/bin/`, - avatars: `test${this.internalServerNumber}/avatars/`, - videos: `test${this.internalServerNumber}/videos/`, - streaming_playlists: `test${this.internalServerNumber}/streaming-playlists/`, - redundancy: `test${this.internalServerNumber}/redundancy/`, - logs: `test${this.internalServerNumber}/logs/`, - previews: `test${this.internalServerNumber}/previews/`, - thumbnails: `test${this.internalServerNumber}/thumbnails/`, - torrents: `test${this.internalServerNumber}/torrents/`, - captions: `test${this.internalServerNumber}/captions/`, - cache: `test${this.internalServerNumber}/cache/`, - plugins: `test${this.internalServerNumber}/plugins/` + tmp: this.getDirectoryPath('tmp') + '/', + bin: this.getDirectoryPath('bin') + '/', + avatars: this.getDirectoryPath('avatars') + '/', + videos: this.getDirectoryPath('videos') + '/', + streaming_playlists: this.getDirectoryPath('streaming-playlists') + '/', + redundancy: this.getDirectoryPath('redundancy') + '/', + logs: this.getDirectoryPath('logs') + '/', + previews: this.getDirectoryPath('previews') + '/', + thumbnails: this.getDirectoryPath('thumbnails') + '/', + torrents: this.getDirectoryPath('torrents') + '/', + captions: this.getDirectoryPath('captions') + '/', + cache: this.getDirectoryPath('cache') + '/', + plugins: this.getDirectoryPath('plugins') + '/', + well_known: this.getDirectoryPath('well-known') + '/' }, admin: { email: `admin${this.internalServerNumber}@example.com` @@ -374,6 +395,7 @@ export class PeerTubeServer { this.debug = new DebugCommand(this) this.follows = new FollowsCommand(this) this.jobs = new JobsCommand(this) + this.metrics = new MetricsCommand(this) this.plugins = new PluginsCommand(this) this.redundancy = new RedundancyCommand(this) this.stats = new StatsCommand(this) @@ -390,6 +412,7 @@ export class PeerTubeServer { this.playlists = new PlaylistsCommand(this) this.history = new HistoryCommand(this) this.imports = new ImportsCommand(this) + this.channelSyncs = new ChannelSyncsCommand(this) this.streamingPlaylists = new StreamingPlaylistsCommand(this) this.channels = new ChannelsCommand(this) this.comments = new CommentsCommand(this) @@ -403,5 +426,6 @@ export class PeerTubeServer { this.videoStudio = new VideoStudioCommand(this) this.videoStats = new VideoStatsCommand(this) this.views = new ViewsCommand(this) + this.twoFactor = new TwoFactorCommand(this) } }