X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=shared%2Fserver-commands%2Fserver%2Fserver.ts;h=f68b8136776e3af967a8c67232f0b427b5c2d978;hb=3a0c2a77b1a6626699514ddaf8135f4397175443;hp=c062e6986904f2bcf0601b159c3f944e8dd461d2;hpb=2f061e065ab43cc0b73595b619639a92952aeeba;p=github%2FChocobozzz%2FPeerTube.git diff --git a/shared/server-commands/server/server.ts b/shared/server-commands/server/server.ts index c062e6986..f68b81367 100644 --- a/shared/server-commands/server/server.ts +++ b/shared/server-commands/server/server.ts @@ -8,9 +8,9 @@ import { CLICommand } from '../cli' import { CustomPagesCommand } from '../custom-pages' import { FeedCommand } from '../feeds' import { LogsCommand } from '../logs' -import { SQLCommand } from '../miscs' import { AbusesCommand } from '../moderation' import { OverviewsCommand } from '../overviews' +import { RunnerJobsCommand, RunnerRegistrationTokensCommand, RunnersCommand } from '../runners' import { SearchCommand } from '../search' import { SocketIOCommand } from '../socket' import { @@ -18,6 +18,7 @@ import { BlocklistCommand, LoginCommand, NotificationsCommand, + RegistrationsCommand, SubscriptionsCommand, TwoFactorCommand, UsersCommand @@ -135,7 +136,6 @@ export class PeerTubeServer { streamingPlaylists?: StreamingPlaylistsCommand channels?: ChannelsCommand comments?: CommentsCommand - sql?: SQLCommand notifications?: NotificationsCommand servers?: ServersCommand login?: LoginCommand @@ -147,6 +147,11 @@ export class PeerTubeServer { views?: ViewsCommand twoFactor?: TwoFactorCommand videoToken?: VideoTokenCommand + registrations?: RegistrationsCommand + + runners?: RunnersCommand + runnerRegistrationTokens?: RunnerRegistrationTokensCommand + runnerJobs?: RunnerJobsCommand constructor (options: { serverNumber: number } | { url: string }) { if ((options as any).url) { @@ -179,9 +184,9 @@ export class PeerTubeServer { this.rtmpsPort = this.parallel ? this.randomRTMP() : 1937 this.port = 9000 + this.internalServerNumber - this.url = `http://localhost:${this.port}` - this.host = `localhost:${this.port}` - this.hostname = 'localhost' + this.url = `http://127.0.0.1:${this.port}` + this.host = `127.0.0.1:${this.port}` + this.hostname = '127.0.0.1' } setUrl (url: string) { @@ -199,7 +204,7 @@ export class PeerTubeServer { return join(root(), testDirectory, directoryName) } - async flushAndRun (configOverride?: Object, options: RunServerOptions = {}) { + async flushAndRun (configOverride?: object, options: RunServerOptions = {}) { await ServersCommand.flushTests(this.internalServerNumber) return this.run(configOverride, options) @@ -259,7 +264,7 @@ export class PeerTubeServer { const onPeerTubeExit = () => rej(new Error('Process exited:\n' + aggregatedLogs)) const onParentExit = () => { - if (!this.app || !this.app.pid) return + if (!this.app?.pid) return try { process.kill(self.app.pid) @@ -309,14 +314,14 @@ export class PeerTubeServer { }) } - async kill () { - if (!this.app) return - - await this.sql.cleanup() + kill () { + if (!this.app) return Promise.resolve() process.kill(-this.app.pid) this.app = null + + return Promise.resolve() } private randomServer () { @@ -418,7 +423,6 @@ export class PeerTubeServer { this.streamingPlaylists = new StreamingPlaylistsCommand(this) this.channels = new ChannelsCommand(this) this.comments = new CommentsCommand(this) - this.sql = new SQLCommand(this) this.notifications = new NotificationsCommand(this) this.servers = new ServersCommand(this) this.login = new LoginCommand(this) @@ -430,5 +434,10 @@ export class PeerTubeServer { this.views = new ViewsCommand(this) this.twoFactor = new TwoFactorCommand(this) this.videoToken = new VideoTokenCommand(this) + this.registrations = new RegistrationsCommand(this) + + this.runners = new RunnersCommand(this) + this.runnerRegistrationTokens = new RunnerRegistrationTokensCommand(this) + this.runnerJobs = new RunnerJobsCommand(this) } }