aboutsummaryrefslogtreecommitdiffhomepage
path: root/shared/server-commands/server
diff options
context:
space:
mode:
Diffstat (limited to 'shared/server-commands/server')
-rw-r--r--shared/server-commands/server/config-command.ts21
-rw-r--r--shared/server-commands/server/jobs.ts15
-rw-r--r--shared/server-commands/server/object-storage-command.ts6
-rw-r--r--shared/server-commands/server/server.ts13
-rw-r--r--shared/server-commands/server/servers-command.ts4
5 files changed, 44 insertions, 15 deletions
diff --git a/shared/server-commands/server/config-command.ts b/shared/server-commands/server/config-command.ts
index b94bd2625..7f1e9d977 100644
--- a/shared/server-commands/server/config-command.ts
+++ b/shared/server-commands/server/config-command.ts
@@ -131,7 +131,7 @@ export class ConfigCommand extends AbstractCommand {
131 } 131 }
132 132
133 // TODO: convert args to object 133 // TODO: convert args to object
134 enableTranscoding (webtorrent = true, hls = true, with0p = false) { 134 enableTranscoding (webVideo = true, hls = true, with0p = false) {
135 return this.updateExistingSubConfig({ 135 return this.updateExistingSubConfig({
136 newConfig: { 136 newConfig: {
137 transcoding: { 137 transcoding: {
@@ -142,8 +142,8 @@ export class ConfigCommand extends AbstractCommand {
142 142
143 resolutions: ConfigCommand.getCustomConfigResolutions(true, with0p), 143 resolutions: ConfigCommand.getCustomConfigResolutions(true, with0p),
144 144
145 webtorrent: { 145 webVideos: {
146 enabled: webtorrent 146 enabled: webVideo
147 }, 147 },
148 hls: { 148 hls: {
149 enabled: hls 149 enabled: hls
@@ -154,19 +154,23 @@ export class ConfigCommand extends AbstractCommand {
154 } 154 }
155 155
156 // TODO: convert args to object 156 // TODO: convert args to object
157 enableMinimumTranscoding (webtorrent = true, hls = true) { 157 enableMinimumTranscoding (webVideo = true, hls = true) {
158 return this.updateExistingSubConfig({ 158 return this.updateExistingSubConfig({
159 newConfig: { 159 newConfig: {
160 transcoding: { 160 transcoding: {
161 enabled: true, 161 enabled: true,
162
163 allowAudioFiles: true,
164 allowAdditionalExtensions: true,
165
162 resolutions: { 166 resolutions: {
163 ...ConfigCommand.getCustomConfigResolutions(false), 167 ...ConfigCommand.getCustomConfigResolutions(false),
164 168
165 '240p': true 169 '240p': true
166 }, 170 },
167 171
168 webtorrent: { 172 webVideos: {
169 enabled: webtorrent 173 enabled: webVideo
170 }, 174 },
171 hls: { 175 hls: {
172 enabled: hls 176 enabled: hls
@@ -368,6 +372,9 @@ export class ConfigCommand extends AbstractCommand {
368 }, 372 },
369 torrents: { 373 torrents: {
370 size: 4 374 size: 4
375 },
376 storyboards: {
377 size: 5
371 } 378 }
372 }, 379 },
373 signup: { 380 signup: {
@@ -417,7 +424,7 @@ export class ConfigCommand extends AbstractCommand {
417 '2160p': false 424 '2160p': false
418 }, 425 },
419 alwaysTranscodeOriginalResolution: true, 426 alwaysTranscodeOriginalResolution: true,
420 webtorrent: { 427 webVideos: {
421 enabled: true 428 enabled: true
422 }, 429 },
423 hls: { 430 hls: {
diff --git a/shared/server-commands/server/jobs.ts b/shared/server-commands/server/jobs.ts
index ff3098063..8f131fba4 100644
--- a/shared/server-commands/server/jobs.ts
+++ b/shared/server-commands/server/jobs.ts
@@ -33,6 +33,8 @@ async function waitJobs (
33 33
34 // Check if each server has pending request 34 // Check if each server has pending request
35 for (const server of servers) { 35 for (const server of servers) {
36 if (process.env.DEBUG) console.log('Checking ' + server.url)
37
36 for (const state of states) { 38 for (const state of states) {
37 39
38 const jobPromise = server.jobs.list({ 40 const jobPromise = server.jobs.list({
@@ -45,6 +47,10 @@ async function waitJobs (
45 .then(jobs => { 47 .then(jobs => {
46 if (jobs.length !== 0) { 48 if (jobs.length !== 0) {
47 pendingRequests = true 49 pendingRequests = true
50
51 if (process.env.DEBUG) {
52 console.log(jobs)
53 }
48 } 54 }
49 }) 55 })
50 56
@@ -55,6 +61,10 @@ async function waitJobs (
55 .then(obj => { 61 .then(obj => {
56 if (obj.activityPubMessagesWaiting !== 0) { 62 if (obj.activityPubMessagesWaiting !== 0) {
57 pendingRequests = true 63 pendingRequests = true
64
65 if (process.env.DEBUG) {
66 console.log('AP messages waiting: ' + obj.activityPubMessagesWaiting)
67 }
58 } 68 }
59 }) 69 })
60 tasks.push(debugPromise) 70 tasks.push(debugPromise)
@@ -65,12 +75,15 @@ async function waitJobs (
65 for (const job of data) { 75 for (const job of data) {
66 if (job.state.id !== RunnerJobState.COMPLETED) { 76 if (job.state.id !== RunnerJobState.COMPLETED) {
67 pendingRequests = true 77 pendingRequests = true
78
79 if (process.env.DEBUG) {
80 console.log(job)
81 }
68 } 82 }
69 } 83 }
70 }) 84 })
71 tasks.push(runnerJobsPromise) 85 tasks.push(runnerJobsPromise)
72 } 86 }
73
74 } 87 }
75 88
76 return tasks 89 return tasks
diff --git a/shared/server-commands/server/object-storage-command.ts b/shared/server-commands/server/object-storage-command.ts
index 7d8ec93cd..6bb232c36 100644
--- a/shared/server-commands/server/object-storage-command.ts
+++ b/shared/server-commands/server/object-storage-command.ts
@@ -42,7 +42,7 @@ export class ObjectStorageCommand {
42 bucket_name: this.getMockStreamingPlaylistsBucketName() 42 bucket_name: this.getMockStreamingPlaylistsBucketName()
43 }, 43 },
44 44
45 videos: { 45 web_videos: {
46 bucket_name: this.getMockWebVideosBucketName() 46 bucket_name: this.getMockWebVideosBucketName()
47 } 47 }
48 } 48 }
@@ -136,9 +136,9 @@ export class ObjectStorageCommand {
136 prefix: `test:server-${serverNumber}-streaming-playlists:` 136 prefix: `test:server-${serverNumber}-streaming-playlists:`
137 }, 137 },
138 138
139 videos: { 139 web_videos: {
140 bucket_name: this.DEFAULT_SCALEWAY_BUCKET, 140 bucket_name: this.DEFAULT_SCALEWAY_BUCKET,
141 prefix: `test:server-${serverNumber}-videos:` 141 prefix: `test:server-${serverNumber}-web-videos:`
142 } 142 }
143 } 143 }
144 } 144 }
diff --git a/shared/server-commands/server/server.ts b/shared/server-commands/server/server.ts
index 70f7a3ee2..38568a890 100644
--- a/shared/server-commands/server/server.ts
+++ b/shared/server-commands/server/server.ts
@@ -32,8 +32,10 @@ import {
32 HistoryCommand, 32 HistoryCommand,
33 ImportsCommand, 33 ImportsCommand,
34 LiveCommand, 34 LiveCommand,
35 VideoPasswordsCommand,
35 PlaylistsCommand, 36 PlaylistsCommand,
36 ServicesCommand, 37 ServicesCommand,
38 StoryboardCommand,
37 StreamingPlaylistsCommand, 39 StreamingPlaylistsCommand,
38 VideosCommand, 40 VideosCommand,
39 VideoStudioCommand, 41 VideoStudioCommand,
@@ -146,6 +148,9 @@ export class PeerTubeServer {
146 twoFactor?: TwoFactorCommand 148 twoFactor?: TwoFactorCommand
147 videoToken?: VideoTokenCommand 149 videoToken?: VideoTokenCommand
148 registrations?: RegistrationsCommand 150 registrations?: RegistrationsCommand
151 videoPasswords?: VideoPasswordsCommand
152
153 storyboard?: StoryboardCommand
149 154
150 runners?: RunnersCommand 155 runners?: RunnersCommand
151 runnerRegistrationTokens?: RunnerRegistrationTokensCommand 156 runnerRegistrationTokens?: RunnerRegistrationTokensCommand
@@ -232,7 +237,7 @@ export class PeerTubeServer {
232 } 237 }
233 238
234 // Share the environment 239 // Share the environment
235 const env = Object.create(process.env) 240 const env = { ...process.env }
236 env['NODE_ENV'] = 'test' 241 env['NODE_ENV'] = 'test'
237 env['NODE_APP_INSTANCE'] = this.internalServerNumber.toString() 242 env['NODE_APP_INSTANCE'] = this.internalServerNumber.toString()
238 env['NODE_CONFIG'] = JSON.stringify(configOverride) 243 env['NODE_CONFIG'] = JSON.stringify(configOverride)
@@ -365,12 +370,13 @@ export class PeerTubeServer {
365 tmp_persistent: this.getDirectoryPath('tmp-persistent') + '/', 370 tmp_persistent: this.getDirectoryPath('tmp-persistent') + '/',
366 bin: this.getDirectoryPath('bin') + '/', 371 bin: this.getDirectoryPath('bin') + '/',
367 avatars: this.getDirectoryPath('avatars') + '/', 372 avatars: this.getDirectoryPath('avatars') + '/',
368 videos: this.getDirectoryPath('videos') + '/', 373 web_videos: this.getDirectoryPath('web-videos') + '/',
369 streaming_playlists: this.getDirectoryPath('streaming-playlists') + '/', 374 streaming_playlists: this.getDirectoryPath('streaming-playlists') + '/',
370 redundancy: this.getDirectoryPath('redundancy') + '/', 375 redundancy: this.getDirectoryPath('redundancy') + '/',
371 logs: this.getDirectoryPath('logs') + '/', 376 logs: this.getDirectoryPath('logs') + '/',
372 previews: this.getDirectoryPath('previews') + '/', 377 previews: this.getDirectoryPath('previews') + '/',
373 thumbnails: this.getDirectoryPath('thumbnails') + '/', 378 thumbnails: this.getDirectoryPath('thumbnails') + '/',
379 storyboards: this.getDirectoryPath('storyboards') + '/',
374 torrents: this.getDirectoryPath('torrents') + '/', 380 torrents: this.getDirectoryPath('torrents') + '/',
375 captions: this.getDirectoryPath('captions') + '/', 381 captions: this.getDirectoryPath('captions') + '/',
376 cache: this.getDirectoryPath('cache') + '/', 382 cache: this.getDirectoryPath('cache') + '/',
@@ -434,8 +440,11 @@ export class PeerTubeServer {
434 this.videoToken = new VideoTokenCommand(this) 440 this.videoToken = new VideoTokenCommand(this)
435 this.registrations = new RegistrationsCommand(this) 441 this.registrations = new RegistrationsCommand(this)
436 442
443 this.storyboard = new StoryboardCommand(this)
444
437 this.runners = new RunnersCommand(this) 445 this.runners = new RunnersCommand(this)
438 this.runnerRegistrationTokens = new RunnerRegistrationTokensCommand(this) 446 this.runnerRegistrationTokens = new RunnerRegistrationTokensCommand(this)
439 this.runnerJobs = new RunnerJobsCommand(this) 447 this.runnerJobs = new RunnerJobsCommand(this)
448 this.videoPasswords = new VideoPasswordsCommand(this)
440 } 449 }
441} 450}
diff --git a/shared/server-commands/server/servers-command.ts b/shared/server-commands/server/servers-command.ts
index 19645cb93..c91c2b008 100644
--- a/shared/server-commands/server/servers-command.ts
+++ b/shared/server-commands/server/servers-command.ts
@@ -77,8 +77,8 @@ export class ServersCommand extends AbstractCommand {
77 return join(root(), 'test' + this.server.internalServerNumber, directory) 77 return join(root(), 'test' + this.server.internalServerNumber, directory)
78 } 78 }
79 79
80 buildWebTorrentFilePath (fileUrl: string) { 80 buildWebVideoFilePath (fileUrl: string) {
81 return this.buildDirectory(join('videos', basename(fileUrl))) 81 return this.buildDirectory(join('web-videos', basename(fileUrl)))
82 } 82 }
83 83
84 buildFragmentedFilePath (videoUUID: string, fileUrl: string) { 84 buildFragmentedFilePath (videoUUID: string, fileUrl: string) {