diff options
author | Chocobozzz <me@florianbigard.com> | 2023-07-11 09:52:14 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2023-07-11 09:52:14 +0200 |
commit | c57ad141a9ffb67f8e7d087b92eaacd2b653b562 (patch) | |
tree | bddd5d4457cb9c922275cc1d8bb71cd88b1d0293 /server | |
parent | 784e2ad5c34bcfef36a3f69e9e9acd7cbb3d6428 (diff) | |
download | PeerTube-c57ad141a9ffb67f8e7d087b92eaacd2b653b562.tar.gz PeerTube-c57ad141a9ffb67f8e7d087b92eaacd2b653b562.tar.zst PeerTube-c57ad141a9ffb67f8e7d087b92eaacd2b653b562.zip |
Rename webtorrent config to web_videos
Diffstat (limited to 'server')
25 files changed, 84 insertions, 57 deletions
diff --git a/server/controllers/api/config.ts b/server/controllers/api/config.ts index c1f6756de..0980ec10a 100644 --- a/server/controllers/api/config.ts +++ b/server/controllers/api/config.ts | |||
@@ -242,8 +242,8 @@ function customConfig (): CustomConfig { | |||
242 | '2160p': CONFIG.TRANSCODING.RESOLUTIONS['2160p'] | 242 | '2160p': CONFIG.TRANSCODING.RESOLUTIONS['2160p'] |
243 | }, | 243 | }, |
244 | alwaysTranscodeOriginalResolution: CONFIG.TRANSCODING.ALWAYS_TRANSCODE_ORIGINAL_RESOLUTION, | 244 | alwaysTranscodeOriginalResolution: CONFIG.TRANSCODING.ALWAYS_TRANSCODE_ORIGINAL_RESOLUTION, |
245 | webtorrent: { | 245 | webVideos: { |
246 | enabled: CONFIG.TRANSCODING.WEBTORRENT.ENABLED | 246 | enabled: CONFIG.TRANSCODING.WEB_VIDEOS.ENABLED |
247 | }, | 247 | }, |
248 | hls: { | 248 | hls: { |
249 | enabled: CONFIG.TRANSCODING.HLS.ENABLED | 249 | enabled: CONFIG.TRANSCODING.HLS.ENABLED |
diff --git a/server/controllers/misc.ts b/server/controllers/misc.ts index 4c8af2adc..163352ac5 100644 --- a/server/controllers/misc.ts +++ b/server/controllers/misc.ts | |||
@@ -120,8 +120,8 @@ async function generateNodeinfo (req: express.Request, res: express.Response) { | |||
120 | hls: { | 120 | hls: { |
121 | enabled: CONFIG.TRANSCODING.HLS.ENABLED | 121 | enabled: CONFIG.TRANSCODING.HLS.ENABLED |
122 | }, | 122 | }, |
123 | webtorrent: { | 123 | web_videos: { |
124 | enabled: CONFIG.TRANSCODING.WEBTORRENT.ENABLED | 124 | enabled: CONFIG.TRANSCODING.WEB_VIDEOS.ENABLED |
125 | }, | 125 | }, |
126 | enabledResolutions: ServerConfigManager.Instance.getEnabledResolutions('vod') | 126 | enabledResolutions: ServerConfigManager.Instance.getEnabledResolutions('vod') |
127 | }, | 127 | }, |
diff --git a/server/initializers/checker-after-init.ts b/server/initializers/checker-after-init.ts index 21bc5911c..906a918e3 100644 --- a/server/initializers/checker-after-init.ts +++ b/server/initializers/checker-after-init.ts | |||
@@ -1,4 +1,5 @@ | |||
1 | import config from 'config' | 1 | import config from 'config' |
2 | import { readFileSync, writeFileSync } from 'fs-extra' | ||
2 | import { URL } from 'url' | 3 | import { URL } from 'url' |
3 | import { uniqify } from '@shared/core-utils' | 4 | import { uniqify } from '@shared/core-utils' |
4 | import { getFFmpegVersion } from '@shared/ffmpeg' | 5 | import { getFFmpegVersion } from '@shared/ffmpeg' |
@@ -10,7 +11,7 @@ import { logger } from '../helpers/logger' | |||
10 | import { ApplicationModel, getServerActor } from '../models/application/application' | 11 | import { ApplicationModel, getServerActor } from '../models/application/application' |
11 | import { OAuthClientModel } from '../models/oauth/oauth-client' | 12 | import { OAuthClientModel } from '../models/oauth/oauth-client' |
12 | import { UserModel } from '../models/user/user' | 13 | import { UserModel } from '../models/user/user' |
13 | import { CONFIG, isEmailEnabled } from './config' | 14 | import { CONFIG, getLocalConfigFilePath, isEmailEnabled, reloadConfig } from './config' |
14 | import { WEBSERVER } from './constants' | 15 | import { WEBSERVER } from './constants' |
15 | 16 | ||
16 | async function checkActivityPubUrls () { | 17 | async function checkActivityPubUrls () { |
@@ -37,10 +38,7 @@ function checkConfig () { | |||
37 | const configFiles = config.util.getConfigSources().map(s => s.name).join(' -> ') | 38 | const configFiles = config.util.getConfigSources().map(s => s.name).join(' -> ') |
38 | logger.info('Using following configuration file hierarchy: %s.', configFiles) | 39 | logger.info('Using following configuration file hierarchy: %s.', configFiles) |
39 | 40 | ||
40 | // Moved configuration keys | 41 | checkRemovedConfigKeys() |
41 | if (config.has('services.csp-logger')) { | ||
42 | logger.warn('services.csp-logger configuration has been renamed to csp.report_uri. Please update your configuration file.') | ||
43 | } | ||
44 | 42 | ||
45 | checkSecretsConfig() | 43 | checkSecretsConfig() |
46 | checkEmailConfig() | 44 | checkEmailConfig() |
@@ -104,6 +102,34 @@ export { | |||
104 | 102 | ||
105 | // --------------------------------------------------------------------------- | 103 | // --------------------------------------------------------------------------- |
106 | 104 | ||
105 | function checkRemovedConfigKeys () { | ||
106 | // Moved configuration keys | ||
107 | if (config.has('services.csp-logger')) { | ||
108 | logger.warn('services.csp-logger configuration has been renamed to csp.report_uri. Please update your configuration file.') | ||
109 | } | ||
110 | |||
111 | if (config.has('transcoding.webtorrent.enabled')) { | ||
112 | const localConfigPath = getLocalConfigFilePath() | ||
113 | |||
114 | const content = readFileSync(localConfigPath, { encoding: 'utf-8' }) | ||
115 | if (!content.includes('"webtorrent"')) { | ||
116 | throw new Error('Please rename transcoding.webtorrent.enabled key to transcoding.web_videos.enabled in your configuration file') | ||
117 | } | ||
118 | |||
119 | try { | ||
120 | logger.info( | ||
121 | 'Replacing "transcoding.webtorrent.enabled" key to "transcoding.web_videos.enabled" in your local configuration ' + localConfigPath | ||
122 | ) | ||
123 | |||
124 | writeFileSync(localConfigPath, content.replace('"webtorrent"', '"web_videos"'), { encoding: 'utf-8' }) | ||
125 | |||
126 | reloadConfig() | ||
127 | } catch (err) { | ||
128 | logger.error('Cannot write new configuration to file ' + localConfigPath, { err }) | ||
129 | } | ||
130 | } | ||
131 | } | ||
132 | |||
107 | function checkSecretsConfig () { | 133 | function checkSecretsConfig () { |
108 | if (!CONFIG.SECRETS.PEERTUBE) { | 134 | if (!CONFIG.SECRETS.PEERTUBE) { |
109 | throw new Error('secrets.peertube is missing in config. Generate one using `openssl rand -hex 32`') | 135 | throw new Error('secrets.peertube is missing in config. Generate one using `openssl rand -hex 32`') |
@@ -198,7 +224,7 @@ function checkStorageConfig () { | |||
198 | 224 | ||
199 | function checkTranscodingConfig () { | 225 | function checkTranscodingConfig () { |
200 | if (CONFIG.TRANSCODING.ENABLED) { | 226 | if (CONFIG.TRANSCODING.ENABLED) { |
201 | if (CONFIG.TRANSCODING.WEBTORRENT.ENABLED === false && CONFIG.TRANSCODING.HLS.ENABLED === false) { | 227 | if (CONFIG.TRANSCODING.WEB_VIDEOS.ENABLED === false && CONFIG.TRANSCODING.HLS.ENABLED === false) { |
202 | throw new Error('You need to enable at least Web Video transcoding or HLS transcoding.') | 228 | throw new Error('You need to enable at least Web Video transcoding or HLS transcoding.') |
203 | } | 229 | } |
204 | 230 | ||
diff --git a/server/initializers/checker-before-init.ts b/server/initializers/checker-before-init.ts index 939b73344..3d117d1b9 100644 --- a/server/initializers/checker-before-init.ts +++ b/server/initializers/checker-before-init.ts | |||
@@ -34,8 +34,8 @@ function checkMissedConfig () { | |||
34 | 'signup.enabled', 'signup.limit', 'signup.requires_approval', 'signup.requires_email_verification', 'signup.minimum_age', | 34 | 'signup.enabled', 'signup.limit', 'signup.requires_approval', 'signup.requires_email_verification', 'signup.minimum_age', |
35 | 'signup.filters.cidr.whitelist', 'signup.filters.cidr.blacklist', | 35 | 'signup.filters.cidr.whitelist', 'signup.filters.cidr.blacklist', |
36 | 'redundancy.videos.strategies', 'redundancy.videos.check_interval', | 36 | 'redundancy.videos.strategies', 'redundancy.videos.check_interval', |
37 | 'transcoding.enabled', 'transcoding.threads', 'transcoding.allow_additional_extensions', 'transcoding.hls.enabled', | 37 | 'transcoding.enabled', 'transcoding.threads', 'transcoding.allow_additional_extensions', 'transcoding.web_videos.enabled', |
38 | 'transcoding.profile', 'transcoding.concurrency', | 38 | 'transcoding.hls.enabled', 'transcoding.profile', 'transcoding.concurrency', |
39 | 'transcoding.resolutions.0p', 'transcoding.resolutions.144p', 'transcoding.resolutions.240p', 'transcoding.resolutions.360p', | 39 | 'transcoding.resolutions.0p', 'transcoding.resolutions.144p', 'transcoding.resolutions.240p', 'transcoding.resolutions.360p', |
40 | 'transcoding.resolutions.480p', 'transcoding.resolutions.720p', 'transcoding.resolutions.1080p', 'transcoding.resolutions.1440p', | 40 | 'transcoding.resolutions.480p', 'transcoding.resolutions.720p', 'transcoding.resolutions.1080p', 'transcoding.resolutions.1440p', |
41 | 'transcoding.resolutions.2160p', 'transcoding.always_transcode_original_resolution', 'transcoding.remote_runners.enabled', | 41 | 'transcoding.resolutions.2160p', 'transcoding.always_transcode_original_resolution', 'transcoding.remote_runners.enabled', |
diff --git a/server/initializers/config.ts b/server/initializers/config.ts index 60ab6e204..5301a1708 100644 --- a/server/initializers/config.ts +++ b/server/initializers/config.ts | |||
@@ -371,8 +371,8 @@ const CONFIG = { | |||
371 | HLS: { | 371 | HLS: { |
372 | get ENABLED () { return config.get<boolean>('transcoding.hls.enabled') } | 372 | get ENABLED () { return config.get<boolean>('transcoding.hls.enabled') } |
373 | }, | 373 | }, |
374 | WEBTORRENT: { | 374 | WEB_VIDEOS: { |
375 | get ENABLED () { return config.get<boolean>('transcoding.webtorrent.enabled') } | 375 | get ENABLED () { return config.get<boolean>('transcoding.web_videos.enabled') } |
376 | }, | 376 | }, |
377 | REMOTE_RUNNERS: { | 377 | REMOTE_RUNNERS: { |
378 | get ENABLED () { return config.get<boolean>('transcoding.remote_runners.enabled') } | 378 | get ENABLED () { return config.get<boolean>('transcoding.remote_runners.enabled') } |
@@ -584,16 +584,6 @@ function isEmailEnabled () { | |||
584 | return false | 584 | return false |
585 | } | 585 | } |
586 | 586 | ||
587 | // --------------------------------------------------------------------------- | ||
588 | |||
589 | export { | ||
590 | CONFIG, | ||
591 | registerConfigChangedHandler, | ||
592 | isEmailEnabled | ||
593 | } | ||
594 | |||
595 | // --------------------------------------------------------------------------- | ||
596 | |||
597 | function getLocalConfigFilePath () { | 587 | function getLocalConfigFilePath () { |
598 | const localConfigDir = getLocalConfigDir() | 588 | const localConfigDir = getLocalConfigDir() |
599 | 589 | ||
@@ -604,6 +594,17 @@ function getLocalConfigFilePath () { | |||
604 | return join(localConfigDir, filename + '.json') | 594 | return join(localConfigDir, filename + '.json') |
605 | } | 595 | } |
606 | 596 | ||
597 | // --------------------------------------------------------------------------- | ||
598 | |||
599 | export { | ||
600 | CONFIG, | ||
601 | getLocalConfigFilePath, | ||
602 | registerConfigChangedHandler, | ||
603 | isEmailEnabled | ||
604 | } | ||
605 | |||
606 | // --------------------------------------------------------------------------- | ||
607 | |||
607 | function getLocalConfigDir () { | 608 | function getLocalConfigDir () { |
608 | if (process.env.PEERTUBE_LOCAL_CONFIG) return process.env.PEERTUBE_LOCAL_CONFIG | 609 | if (process.env.PEERTUBE_LOCAL_CONFIG) return process.env.PEERTUBE_LOCAL_CONFIG |
609 | 610 | ||
diff --git a/server/lib/server-config-manager.ts b/server/lib/server-config-manager.ts index 924adb337..5ce89b16d 100644 --- a/server/lib/server-config-manager.ts +++ b/server/lib/server-config-manager.ts | |||
@@ -132,8 +132,8 @@ class ServerConfigManager { | |||
132 | hls: { | 132 | hls: { |
133 | enabled: CONFIG.TRANSCODING.ENABLED && CONFIG.TRANSCODING.HLS.ENABLED | 133 | enabled: CONFIG.TRANSCODING.ENABLED && CONFIG.TRANSCODING.HLS.ENABLED |
134 | }, | 134 | }, |
135 | webtorrent: { | 135 | web_videos: { |
136 | enabled: CONFIG.TRANSCODING.ENABLED && CONFIG.TRANSCODING.WEBTORRENT.ENABLED | 136 | enabled: CONFIG.TRANSCODING.ENABLED && CONFIG.TRANSCODING.WEB_VIDEOS.ENABLED |
137 | }, | 137 | }, |
138 | enabledResolutions: this.getEnabledResolutions('vod'), | 138 | enabledResolutions: this.getEnabledResolutions('vod'), |
139 | profile: CONFIG.TRANSCODING.PROFILE, | 139 | profile: CONFIG.TRANSCODING.PROFILE, |
diff --git a/server/lib/transcoding/shared/job-builders/transcoding-job-queue-builder.ts b/server/lib/transcoding/shared/job-builders/transcoding-job-queue-builder.ts index 2ecd57249..0505c2b2f 100644 --- a/server/lib/transcoding/shared/job-builders/transcoding-job-queue-builder.ts +++ b/server/lib/transcoding/shared/job-builders/transcoding-job-queue-builder.ts | |||
@@ -60,7 +60,7 @@ export class TranscodingJobQueueBuilder extends AbstractJobBuilder { | |||
60 | if (CONFIG.TRANSCODING.HLS.ENABLED === true) { | 60 | if (CONFIG.TRANSCODING.HLS.ENABLED === true) { |
61 | nextTranscodingSequentialJobPayloads.push([ | 61 | nextTranscodingSequentialJobPayloads.push([ |
62 | this.buildHLSJobPayload({ | 62 | this.buildHLSJobPayload({ |
63 | deleteWebVideoFiles: CONFIG.TRANSCODING.WEBTORRENT.ENABLED === false, | 63 | deleteWebVideoFiles: CONFIG.TRANSCODING.WEB_VIDEOS.ENABLED === false, |
64 | 64 | ||
65 | // We had some issues with a web video quick transcoded while producing a HLS version of it | 65 | // We had some issues with a web video quick transcoded while producing a HLS version of it |
66 | copyCodecs: !quickTranscode, | 66 | copyCodecs: !quickTranscode, |
@@ -208,7 +208,7 @@ export class TranscodingJobQueueBuilder extends AbstractJobBuilder { | |||
208 | for (const resolution of resolutionsEnabled) { | 208 | for (const resolution of resolutionsEnabled) { |
209 | const fps = computeOutputFPS({ inputFPS: inputVideoFPS, resolution }) | 209 | const fps = computeOutputFPS({ inputFPS: inputVideoFPS, resolution }) |
210 | 210 | ||
211 | if (CONFIG.TRANSCODING.WEBTORRENT.ENABLED) { | 211 | if (CONFIG.TRANSCODING.WEB_VIDEOS.ENABLED) { |
212 | const payloads: (NewWebVideoResolutionTranscodingPayload | HLSTranscodingPayload)[] = [ | 212 | const payloads: (NewWebVideoResolutionTranscodingPayload | HLSTranscodingPayload)[] = [ |
213 | this.buildWebVideoJobPayload({ | 213 | this.buildWebVideoJobPayload({ |
214 | videoUUID: video.uuid, | 214 | videoUUID: video.uuid, |
diff --git a/server/lib/transcoding/shared/job-builders/transcoding-runner-job-builder.ts b/server/lib/transcoding/shared/job-builders/transcoding-runner-job-builder.ts index b98172c2d..c0a45f40e 100644 --- a/server/lib/transcoding/shared/job-builders/transcoding-runner-job-builder.ts +++ b/server/lib/transcoding/shared/job-builders/transcoding-runner-job-builder.ts | |||
@@ -62,7 +62,7 @@ export class TranscodingRunnerJobBuilder extends AbstractJobBuilder { | |||
62 | if (CONFIG.TRANSCODING.HLS.ENABLED === true) { | 62 | if (CONFIG.TRANSCODING.HLS.ENABLED === true) { |
63 | await new VODHLSTranscodingJobHandler().create({ | 63 | await new VODHLSTranscodingJobHandler().create({ |
64 | video, | 64 | video, |
65 | deleteWebVideoFiles: CONFIG.TRANSCODING.WEBTORRENT.ENABLED === false, | 65 | deleteWebVideoFiles: CONFIG.TRANSCODING.WEB_VIDEOS.ENABLED === false, |
66 | resolution: maxResolution, | 66 | resolution: maxResolution, |
67 | fps, | 67 | fps, |
68 | isNewVideo, | 68 | isNewVideo, |
@@ -169,7 +169,7 @@ export class TranscodingRunnerJobBuilder extends AbstractJobBuilder { | |||
169 | for (const resolution of resolutionsEnabled) { | 169 | for (const resolution of resolutionsEnabled) { |
170 | const fps = computeOutputFPS({ inputFPS: inputVideoFPS, resolution }) | 170 | const fps = computeOutputFPS({ inputFPS: inputVideoFPS, resolution }) |
171 | 171 | ||
172 | if (CONFIG.TRANSCODING.WEBTORRENT.ENABLED) { | 172 | if (CONFIG.TRANSCODING.WEB_VIDEOS.ENABLED) { |
173 | await new VODWebVideoTranscodingJobHandler().create({ | 173 | await new VODWebVideoTranscodingJobHandler().create({ |
174 | video, | 174 | video, |
175 | resolution, | 175 | resolution, |
diff --git a/server/middlewares/validators/config.ts b/server/middlewares/validators/config.ts index 7029a857f..a6dbba524 100644 --- a/server/middlewares/validators/config.ts +++ b/server/middlewares/validators/config.ts | |||
@@ -59,7 +59,7 @@ const customConfigUpdateValidator = [ | |||
59 | 59 | ||
60 | body('transcoding.alwaysTranscodeOriginalResolution').isBoolean(), | 60 | body('transcoding.alwaysTranscodeOriginalResolution').isBoolean(), |
61 | 61 | ||
62 | body('transcoding.webtorrent.enabled').isBoolean(), | 62 | body('transcoding.webVideos.enabled').isBoolean(), |
63 | body('transcoding.hls.enabled').isBoolean(), | 63 | body('transcoding.hls.enabled').isBoolean(), |
64 | 64 | ||
65 | body('videoStudio.enabled').isBoolean(), | 65 | body('videoStudio.enabled').isBoolean(), |
@@ -153,8 +153,8 @@ function checkInvalidConfigIfEmailDisabled (customConfig: CustomConfig, res: exp | |||
153 | function checkInvalidTranscodingConfig (customConfig: CustomConfig, res: express.Response) { | 153 | function checkInvalidTranscodingConfig (customConfig: CustomConfig, res: express.Response) { |
154 | if (customConfig.transcoding.enabled === false) return true | 154 | if (customConfig.transcoding.enabled === false) return true |
155 | 155 | ||
156 | if (customConfig.transcoding.webtorrent.enabled === false && customConfig.transcoding.hls.enabled === false) { | 156 | if (customConfig.transcoding.webVideos.enabled === false && customConfig.transcoding.hls.enabled === false) { |
157 | res.fail({ message: 'You need to enable at least webtorrent transcoding or hls transcoding' }) | 157 | res.fail({ message: 'You need to enable at least web_videos transcoding or hls transcoding' }) |
158 | return false | 158 | return false |
159 | } | 159 | } |
160 | 160 | ||
diff --git a/server/tests/api/check-params/config.ts b/server/tests/api/check-params/config.ts index 7f825f79e..80b616ccf 100644 --- a/server/tests/api/check-params/config.ts +++ b/server/tests/api/check-params/config.ts | |||
@@ -126,7 +126,7 @@ describe('Test config API validators', function () { | |||
126 | '2160p': false | 126 | '2160p': false |
127 | }, | 127 | }, |
128 | alwaysTranscodeOriginalResolution: false, | 128 | alwaysTranscodeOriginalResolution: false, |
129 | webtorrent: { | 129 | webVideos: { |
130 | enabled: true | 130 | enabled: true |
131 | }, | 131 | }, |
132 | hls: { | 132 | hls: { |
@@ -353,7 +353,7 @@ describe('Test config API validators', function () { | |||
353 | hls: { | 353 | hls: { |
354 | enabled: false | 354 | enabled: false |
355 | }, | 355 | }, |
356 | webtorrent: { | 356 | web_videos: { |
357 | enabled: false | 357 | enabled: false |
358 | } | 358 | } |
359 | } | 359 | } |
diff --git a/server/tests/api/redundancy/redundancy.ts b/server/tests/api/redundancy/redundancy.ts index b35059c29..9a8cb4f51 100644 --- a/server/tests/api/redundancy/redundancy.ts +++ b/server/tests/api/redundancy/redundancy.ts | |||
@@ -60,7 +60,7 @@ async function createServers (strategy: VideoRedundancyStrategy | null, addition | |||
60 | 60 | ||
61 | const config = { | 61 | const config = { |
62 | transcoding: { | 62 | transcoding: { |
63 | webtorrent: { | 63 | web_videos: { |
64 | enabled: withWebVideo | 64 | enabled: withWebVideo |
65 | }, | 65 | }, |
66 | hls: { | 66 | hls: { |
diff --git a/server/tests/api/server/config.ts b/server/tests/api/server/config.ts index efa7b50e3..0e700eddb 100644 --- a/server/tests/api/server/config.ts +++ b/server/tests/api/server/config.ts | |||
@@ -79,7 +79,7 @@ function checkInitialConfig (server: PeerTubeServer, data: CustomConfig) { | |||
79 | expect(data.transcoding.resolutions['1440p']).to.be.true | 79 | expect(data.transcoding.resolutions['1440p']).to.be.true |
80 | expect(data.transcoding.resolutions['2160p']).to.be.true | 80 | expect(data.transcoding.resolutions['2160p']).to.be.true |
81 | expect(data.transcoding.alwaysTranscodeOriginalResolution).to.be.true | 81 | expect(data.transcoding.alwaysTranscodeOriginalResolution).to.be.true |
82 | expect(data.transcoding.webtorrent.enabled).to.be.true | 82 | expect(data.transcoding.webVideos.enabled).to.be.true |
83 | expect(data.transcoding.hls.enabled).to.be.true | 83 | expect(data.transcoding.hls.enabled).to.be.true |
84 | 84 | ||
85 | expect(data.live.enabled).to.be.false | 85 | expect(data.live.enabled).to.be.false |
@@ -192,7 +192,7 @@ function checkUpdatedConfig (data: CustomConfig) { | |||
192 | expect(data.transcoding.resolutions['2160p']).to.be.false | 192 | expect(data.transcoding.resolutions['2160p']).to.be.false |
193 | expect(data.transcoding.alwaysTranscodeOriginalResolution).to.be.false | 193 | expect(data.transcoding.alwaysTranscodeOriginalResolution).to.be.false |
194 | expect(data.transcoding.hls.enabled).to.be.false | 194 | expect(data.transcoding.hls.enabled).to.be.false |
195 | expect(data.transcoding.webtorrent.enabled).to.be.true | 195 | expect(data.transcoding.webVideos.enabled).to.be.true |
196 | 196 | ||
197 | expect(data.live.enabled).to.be.true | 197 | expect(data.live.enabled).to.be.true |
198 | expect(data.live.allowReplay).to.be.true | 198 | expect(data.live.allowReplay).to.be.true |
@@ -344,7 +344,7 @@ const newCustomConfig: CustomConfig = { | |||
344 | '2160p': false | 344 | '2160p': false |
345 | }, | 345 | }, |
346 | alwaysTranscodeOriginalResolution: false, | 346 | alwaysTranscodeOriginalResolution: false, |
347 | webtorrent: { | 347 | webVideos: { |
348 | enabled: true | 348 | enabled: true |
349 | }, | 349 | }, |
350 | hls: { | 350 | hls: { |
diff --git a/server/tests/api/server/stats.ts b/server/tests/api/server/stats.ts index aad0d231a..a1bf189fa 100644 --- a/server/tests/api/server/stats.ts +++ b/server/tests/api/server/stats.ts | |||
@@ -194,7 +194,7 @@ describe('Test stats (excluding redundancy)', function () { | |||
194 | newConfig: { | 194 | newConfig: { |
195 | transcoding: { | 195 | transcoding: { |
196 | enabled: true, | 196 | enabled: true, |
197 | webtorrent: { | 197 | webVideos: { |
198 | enabled: true | 198 | enabled: true |
199 | }, | 199 | }, |
200 | hls: { | 200 | hls: { |
diff --git a/server/tests/api/transcoding/audio-only.ts b/server/tests/api/transcoding/audio-only.ts index aa1113fc1..f4cc012ef 100644 --- a/server/tests/api/transcoding/audio-only.ts +++ b/server/tests/api/transcoding/audio-only.ts | |||
@@ -37,7 +37,7 @@ describe('Test audio only video transcoding', function () { | |||
37 | hls: { | 37 | hls: { |
38 | enabled: true | 38 | enabled: true |
39 | }, | 39 | }, |
40 | webtorrent: { | 40 | web_videos: { |
41 | enabled: true | 41 | enabled: true |
42 | } | 42 | } |
43 | } | 43 | } |
diff --git a/server/tests/api/transcoding/create-transcoding.ts b/server/tests/api/transcoding/create-transcoding.ts index 21a63f547..9a891043c 100644 --- a/server/tests/api/transcoding/create-transcoding.ts +++ b/server/tests/api/transcoding/create-transcoding.ts | |||
@@ -165,7 +165,7 @@ function runTests (enableObjectStorage: boolean) { | |||
165 | enabled: true, | 165 | enabled: true, |
166 | resolutions: ConfigCommand.getCustomConfigResolutions(false), | 166 | resolutions: ConfigCommand.getCustomConfigResolutions(false), |
167 | 167 | ||
168 | webtorrent: { | 168 | webVideos: { |
169 | enabled: true | 169 | enabled: true |
170 | }, | 170 | }, |
171 | hls: { | 171 | hls: { |
@@ -201,7 +201,7 @@ function runTests (enableObjectStorage: boolean) { | |||
201 | enabled: true, | 201 | enabled: true, |
202 | resolutions: ConfigCommand.getCustomConfigResolutions(true), | 202 | resolutions: ConfigCommand.getCustomConfigResolutions(true), |
203 | 203 | ||
204 | webtorrent: { | 204 | webVideos: { |
205 | enabled: true | 205 | enabled: true |
206 | }, | 206 | }, |
207 | hls: { | 207 | hls: { |
diff --git a/server/tests/api/transcoding/hls.ts b/server/tests/api/transcoding/hls.ts index ba889e718..0d2fc0fba 100644 --- a/server/tests/api/transcoding/hls.ts +++ b/server/tests/api/transcoding/hls.ts | |||
@@ -136,7 +136,7 @@ describe('Test HLS videos', function () { | |||
136 | hls: { | 136 | hls: { |
137 | enabled: true | 137 | enabled: true |
138 | }, | 138 | }, |
139 | webtorrent: { | 139 | webVideos: { |
140 | enabled: false | 140 | enabled: false |
141 | } | 141 | } |
142 | } | 142 | } |
diff --git a/server/tests/api/transcoding/transcoder.ts b/server/tests/api/transcoding/transcoder.ts index 36e1d90f4..b899b736d 100644 --- a/server/tests/api/transcoding/transcoder.ts +++ b/server/tests/api/transcoding/transcoder.ts | |||
@@ -31,7 +31,7 @@ function updateConfigForTranscoding (server: PeerTubeServer) { | |||
31 | allowAdditionalExtensions: true, | 31 | allowAdditionalExtensions: true, |
32 | allowAudioFiles: true, | 32 | allowAudioFiles: true, |
33 | hls: { enabled: true }, | 33 | hls: { enabled: true }, |
34 | webtorrent: { enabled: true }, | 34 | webVideos: { enabled: true }, |
35 | resolutions: { | 35 | resolutions: { |
36 | '0p': false, | 36 | '0p': false, |
37 | '144p': true, | 37 | '144p': true, |
@@ -333,7 +333,7 @@ describe('Test video transcoding', function () { | |||
333 | newConfig: { | 333 | newConfig: { |
334 | transcoding: { | 334 | transcoding: { |
335 | hls: { enabled: true }, | 335 | hls: { enabled: true }, |
336 | webtorrent: { enabled: true }, | 336 | webVideos: { enabled: true }, |
337 | resolutions: { | 337 | resolutions: { |
338 | '0p': false, | 338 | '0p': false, |
339 | '144p': false, | 339 | '144p': false, |
@@ -405,7 +405,7 @@ describe('Test video transcoding', function () { | |||
405 | newConfig: { | 405 | newConfig: { |
406 | transcoding: { | 406 | transcoding: { |
407 | hls: { enabled: true }, | 407 | hls: { enabled: true }, |
408 | webtorrent: { enabled: true }, | 408 | webVideos: { enabled: true }, |
409 | resolutions: { | 409 | resolutions: { |
410 | '0p': true, | 410 | '0p': true, |
411 | '144p': false, | 411 | '144p': false, |
@@ -586,7 +586,7 @@ describe('Test video transcoding', function () { | |||
586 | '1440p': true, | 586 | '1440p': true, |
587 | '2160p': true | 587 | '2160p': true |
588 | }, | 588 | }, |
589 | webtorrent: { enabled: true }, | 589 | web_videos: { enabled: true }, |
590 | hls: { enabled: true } | 590 | hls: { enabled: true } |
591 | } | 591 | } |
592 | } | 592 | } |
@@ -728,7 +728,7 @@ describe('Test video transcoding', function () { | |||
728 | transcoding: { | 728 | transcoding: { |
729 | enabled: true, | 729 | enabled: true, |
730 | hls: { enabled: true }, | 730 | hls: { enabled: true }, |
731 | webtorrent: { enabled: true }, | 731 | webVideos: { enabled: true }, |
732 | resolutions: { | 732 | resolutions: { |
733 | '0p': false, | 733 | '0p': false, |
734 | '144p': false, | 734 | '144p': false, |
diff --git a/server/tests/api/transcoding/update-while-transcoding.ts b/server/tests/api/transcoding/update-while-transcoding.ts index 2e0edc770..cfb4fa0cc 100644 --- a/server/tests/api/transcoding/update-while-transcoding.ts +++ b/server/tests/api/transcoding/update-while-transcoding.ts | |||
@@ -121,7 +121,7 @@ describe('Test update video privacy while transcoding', function () { | |||
121 | hls: { | 121 | hls: { |
122 | enabled: true | 122 | enabled: true |
123 | }, | 123 | }, |
124 | webtorrent: { | 124 | webVideos: { |
125 | enabled: false | 125 | enabled: false |
126 | } | 126 | } |
127 | } | 127 | } |
diff --git a/server/tests/api/transcoding/video-studio.ts b/server/tests/api/transcoding/video-studio.ts index 2595d3cdb..ba68f8e24 100644 --- a/server/tests/api/transcoding/video-studio.ts +++ b/server/tests/api/transcoding/video-studio.ts | |||
@@ -277,7 +277,7 @@ describe('Test video studio', function () { | |||
277 | await servers[0].config.updateExistingSubConfig({ | 277 | await servers[0].config.updateExistingSubConfig({ |
278 | newConfig: { | 278 | newConfig: { |
279 | transcoding: { | 279 | transcoding: { |
280 | webtorrent: { | 280 | webVideos: { |
281 | enabled: false | 281 | enabled: false |
282 | } | 282 | } |
283 | } | 283 | } |
diff --git a/server/tests/api/users/user-videos.ts b/server/tests/api/users/user-videos.ts index 70f22e2eb..77226e48e 100644 --- a/server/tests/api/users/user-videos.ts +++ b/server/tests/api/users/user-videos.ts | |||
@@ -189,7 +189,7 @@ describe('Test user videos', function () { | |||
189 | 189 | ||
190 | { | 190 | { |
191 | const config = await server.config.getCustomConfig() | 191 | const config = await server.config.getCustomConfig() |
192 | config.transcoding.webtorrent.enabled = false | 192 | config.transcoding.webVideos.enabled = false |
193 | config.transcoding.hls.enabled = true | 193 | config.transcoding.hls.enabled = true |
194 | config.transcoding.enabled = true | 194 | config.transcoding.enabled = true |
195 | await server.config.updateCustomSubConfig({ newConfig: config }) | 195 | await server.config.updateCustomSubConfig({ newConfig: config }) |
diff --git a/server/tests/api/videos/video-imports.ts b/server/tests/api/videos/video-imports.ts index 4f3149d52..b78b4f344 100644 --- a/server/tests/api/videos/video-imports.ts +++ b/server/tests/api/videos/video-imports.ts | |||
@@ -328,7 +328,7 @@ describe('Test video imports', function () { | |||
328 | '1440p': false, | 328 | '1440p': false, |
329 | '2160p': false | 329 | '2160p': false |
330 | }, | 330 | }, |
331 | webtorrent: { enabled: true }, | 331 | webVideos: { enabled: true }, |
332 | hls: { enabled: false } | 332 | hls: { enabled: false } |
333 | } | 333 | } |
334 | } | 334 | } |
diff --git a/server/tests/feeds/feeds.ts b/server/tests/feeds/feeds.ts index 83a85be58..1754ac466 100644 --- a/server/tests/feeds/feeds.ts +++ b/server/tests/feeds/feeds.ts | |||
@@ -47,7 +47,7 @@ describe('Test syndication feeds', () => { | |||
47 | serverHLSOnly = await createSingleServer(3, { | 47 | serverHLSOnly = await createSingleServer(3, { |
48 | transcoding: { | 48 | transcoding: { |
49 | enabled: true, | 49 | enabled: true, |
50 | webtorrent: { enabled: false }, | 50 | web_videos: { enabled: false }, |
51 | hls: { enabled: true } | 51 | hls: { enabled: true } |
52 | } | 52 | } |
53 | }) | 53 | }) |
diff --git a/server/tests/plugins/filter-hooks.ts b/server/tests/plugins/filter-hooks.ts index a02a53c50..a75a8c8fa 100644 --- a/server/tests/plugins/filter-hooks.ts +++ b/server/tests/plugins/filter-hooks.ts | |||
@@ -493,7 +493,7 @@ describe('Test plugin filter hooks', function () { | |||
493 | await servers[0].config.updateCustomSubConfig({ | 493 | await servers[0].config.updateCustomSubConfig({ |
494 | newConfig: { | 494 | newConfig: { |
495 | transcoding: { | 495 | transcoding: { |
496 | webtorrent: { | 496 | webVideos: { |
497 | enabled: true | 497 | enabled: true |
498 | }, | 498 | }, |
499 | hls: { | 499 | hls: { |
diff --git a/server/tests/plugins/plugin-transcoding.ts b/server/tests/plugins/plugin-transcoding.ts index f3d929426..21f82fbac 100644 --- a/server/tests/plugins/plugin-transcoding.ts +++ b/server/tests/plugins/plugin-transcoding.ts | |||
@@ -35,7 +35,7 @@ function updateConf (server: PeerTubeServer, vodProfile: string, liveProfile: st | |||
35 | hls: { | 35 | hls: { |
36 | enabled: true | 36 | enabled: true |
37 | }, | 37 | }, |
38 | webtorrent: { | 38 | webVideos: { |
39 | enabled: true | 39 | enabled: true |
40 | }, | 40 | }, |
41 | resolutions: { | 41 | resolutions: { |
diff --git a/server/tests/shared/videos.ts b/server/tests/shared/videos.ts index 6cba5b14c..b7f7a1613 100644 --- a/server/tests/shared/videos.ts +++ b/server/tests/shared/videos.ts | |||
@@ -28,7 +28,7 @@ async function completeWebVideoFilesCheck (options: { | |||
28 | const serverConfig = await originServer.config.getConfig() | 28 | const serverConfig = await originServer.config.getConfig() |
29 | const requiresAuth = video.privacy.id === VideoPrivacy.PRIVATE || video.privacy.id === VideoPrivacy.INTERNAL | 29 | const requiresAuth = video.privacy.id === VideoPrivacy.PRIVATE || video.privacy.id === VideoPrivacy.INTERNAL |
30 | 30 | ||
31 | const transcodingEnabled = serverConfig.transcoding.webtorrent.enabled | 31 | const transcodingEnabled = serverConfig.transcoding.web_videos.enabled |
32 | 32 | ||
33 | for (const attributeFile of files) { | 33 | for (const attributeFile of files) { |
34 | const file = video.files.find(f => f.resolution.id === attributeFile.resolution) | 34 | const file = video.files.find(f => f.resolution.id === attributeFile.resolution) |