]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - shared/server-commands/server/server.ts
Translated using Weblate (Japanese)
[github/Chocobozzz/PeerTube.git] / shared / server-commands / server / server.ts
index a8f8c1d8415f39ca13237d552acd6761c84179ac..793fae3a85b900ad8d5e4b59791ac04a022b9d4c 100644 (file)
@@ -13,7 +13,16 @@ 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,
+  RegistrationsCommand,
+  SubscriptionsCommand,
+  TwoFactorCommand,
+  UsersCommand
+} from '../users'
 import {
   BlacklistCommand,
   CaptionsCommand,
@@ -28,6 +37,7 @@ import {
   StreamingPlaylistsCommand,
   VideosCommand,
   VideoStudioCommand,
+  VideoTokenCommand,
   ViewsCommand
 } from '../videos'
 import { CommentsCommand } from '../videos/comments-command'
@@ -136,6 +146,9 @@ export class PeerTubeServer {
   videos?: VideosCommand
   videoStats?: VideoStatsCommand
   views?: ViewsCommand
+  twoFactor?: TwoFactorCommand
+  videoToken?: VideoTokenCommand
+  registrations?: RegistrationsCommand
 
   constructor (options: { serverNumber: number } | { url: string }) {
     if ((options as any).url) {
@@ -168,9 +181,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) {
@@ -248,7 +261,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)
@@ -417,5 +430,8 @@ export class PeerTubeServer {
     this.videoStudio = new VideoStudioCommand(this)
     this.videoStats = new VideoStatsCommand(this)
     this.views = new ViewsCommand(this)
+    this.twoFactor = new TwoFactorCommand(this)
+    this.videoToken = new VideoTokenCommand(this)
+    this.registrations = new RegistrationsCommand(this)
   }
 }