From c57ad141a9ffb67f8e7d087b92eaacd2b653b562 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 11 Jul 2023 09:52:14 +0200 Subject: [PATCH] Rename webtorrent config to web_videos --- .../edit-custom-config.component.ts | 2 +- .../edit-vod-transcoding.component.html | 4 +- .../edit-vod-transcoding.component.ts | 14 +++---- config/default.yaml | 2 +- config/production.yaml.example | 2 +- config/test.yaml | 2 +- server/controllers/api/config.ts | 4 +- server/controllers/misc.ts | 4 +- server/initializers/checker-after-init.ts | 38 ++++++++++++++++--- server/initializers/checker-before-init.ts | 4 +- server/initializers/config.ts | 25 ++++++------ server/lib/server-config-manager.ts | 4 +- .../transcoding-job-queue-builder.ts | 4 +- .../transcoding-runner-job-builder.ts | 4 +- server/middlewares/validators/config.ts | 6 +-- server/tests/api/check-params/config.ts | 4 +- server/tests/api/redundancy/redundancy.ts | 2 +- server/tests/api/server/config.ts | 6 +-- server/tests/api/server/stats.ts | 2 +- server/tests/api/transcoding/audio-only.ts | 2 +- .../api/transcoding/create-transcoding.ts | 4 +- server/tests/api/transcoding/hls.ts | 2 +- server/tests/api/transcoding/transcoder.ts | 10 ++--- .../transcoding/update-while-transcoding.ts | 2 +- server/tests/api/transcoding/video-studio.ts | 2 +- server/tests/api/users/user-videos.ts | 2 +- server/tests/api/videos/video-imports.ts | 2 +- server/tests/feeds/feeds.ts | 2 +- server/tests/plugins/filter-hooks.ts | 2 +- server/tests/plugins/plugin-transcoding.ts | 2 +- server/tests/shared/videos.ts | 2 +- shared/models/server/custom-config.model.ts | 2 +- shared/models/server/server-config.model.ts | 2 +- .../server-commands/server/config-command.ts | 6 +-- support/doc/api/openapi.yaml | 4 +- .../config/custom-environment-variables.yaml | 8 ++-- 36 files changed, 108 insertions(+), 81 deletions(-) diff --git a/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts b/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts index 9219d608b..b381473d6 100644 --- a/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts +++ b/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts @@ -190,7 +190,7 @@ export class EditCustomConfigComponent extends FormReactive implements OnInit { hls: { enabled: null }, - webtorrent: { + webVideos: { enabled: null }, remoteRunners: { diff --git a/client/src/app/+admin/config/edit-custom-config/edit-vod-transcoding.component.html b/client/src/app/+admin/config/edit-custom-config/edit-vod-transcoding.component.html index 7218511a9..accf2c28c 100644 --- a/client/src/app/+admin/config/edit-custom-config/edit-vod-transcoding.component.html +++ b/client/src/app/+admin/config/edit-custom-config/edit-vod-transcoding.component.html @@ -67,10 +67,10 @@

Output formats

- +
diff --git a/client/src/app/+admin/config/edit-custom-config/edit-vod-transcoding.component.ts b/client/src/app/+admin/config/edit-custom-config/edit-vod-transcoding.component.ts index c5f4ecddb..6496e8753 100644 --- a/client/src/app/+admin/config/edit-custom-config/edit-vod-transcoding.component.ts +++ b/client/src/app/+admin/config/edit-custom-config/edit-vod-transcoding.component.ts @@ -90,9 +90,9 @@ export class EditVODTranscodingComponent implements OnInit, OnChanges { const transcodingControl = this.form.get('transcoding.enabled') const videoStudioControl = this.form.get('videoStudio.enabled') const hlsControl = this.form.get('transcoding.hls.enabled') - const webtorrentControl = this.form.get('transcoding.webtorrent.enabled') + const webVideosControl = this.form.get('transcoding.webVideos.enabled') - webtorrentControl.valueChanges + webVideosControl.valueChanges .subscribe(newValue => { if (newValue === false && !hlsControl.disabled) { hlsControl.disable() @@ -105,12 +105,12 @@ export class EditVODTranscodingComponent implements OnInit, OnChanges { hlsControl.valueChanges .subscribe(newValue => { - if (newValue === false && !webtorrentControl.disabled) { - webtorrentControl.disable() + if (newValue === false && !webVideosControl.disabled) { + webVideosControl.disable() } - if (newValue === true && !webtorrentControl.enabled) { - webtorrentControl.enable() + if (newValue === true && !webVideosControl.enabled) { + webVideosControl.enable() } }) @@ -122,7 +122,7 @@ export class EditVODTranscodingComponent implements OnInit, OnChanges { }) transcodingControl.updateValueAndValidity() - webtorrentControl.updateValueAndValidity() + webVideosControl.updateValueAndValidity() videoStudioControl.updateValueAndValidity() hlsControl.updateValueAndValidity() } diff --git a/config/default.yaml b/config/default.yaml index 6f78fb7e9..a9e74095e 100644 --- a/config/default.yaml +++ b/config/default.yaml @@ -483,7 +483,7 @@ transcoding: # Generate videos in a web compatible format # If you also enabled the hls format, it will multiply videos storage by 2 # If disabled, breaks federation with PeerTube instances < 2.1 - webtorrent: + web_videos: enabled: false # /!\ Requires ffmpeg >= 4.1 diff --git a/config/production.yaml.example b/config/production.yaml.example index 2898a45ac..8fccaa517 100644 --- a/config/production.yaml.example +++ b/config/production.yaml.example @@ -493,7 +493,7 @@ transcoding: # Generate videos in a web compatible format # If you also enabled the hls format, it will multiply videos storage by 2 # If disabled, breaks federation with PeerTube instances < 2.1 - webtorrent: + web_videos: enabled: false # /!\ Requires ffmpeg >= 4.1 diff --git a/config/test.yaml b/config/test.yaml index 41ec0917e..cc642327c 100644 --- a/config/test.yaml +++ b/config/test.yaml @@ -97,7 +97,7 @@ transcoding: 1080p: true 1440p: true 2160p: true - webtorrent: + web_videos: enabled: true hls: enabled: true 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 { '2160p': CONFIG.TRANSCODING.RESOLUTIONS['2160p'] }, alwaysTranscodeOriginalResolution: CONFIG.TRANSCODING.ALWAYS_TRANSCODE_ORIGINAL_RESOLUTION, - webtorrent: { - enabled: CONFIG.TRANSCODING.WEBTORRENT.ENABLED + webVideos: { + enabled: CONFIG.TRANSCODING.WEB_VIDEOS.ENABLED }, hls: { 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) { hls: { enabled: CONFIG.TRANSCODING.HLS.ENABLED }, - webtorrent: { - enabled: CONFIG.TRANSCODING.WEBTORRENT.ENABLED + web_videos: { + enabled: CONFIG.TRANSCODING.WEB_VIDEOS.ENABLED }, enabledResolutions: ServerConfigManager.Instance.getEnabledResolutions('vod') }, 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 @@ import config from 'config' +import { readFileSync, writeFileSync } from 'fs-extra' import { URL } from 'url' import { uniqify } from '@shared/core-utils' import { getFFmpegVersion } from '@shared/ffmpeg' @@ -10,7 +11,7 @@ import { logger } from '../helpers/logger' import { ApplicationModel, getServerActor } from '../models/application/application' import { OAuthClientModel } from '../models/oauth/oauth-client' import { UserModel } from '../models/user/user' -import { CONFIG, isEmailEnabled } from './config' +import { CONFIG, getLocalConfigFilePath, isEmailEnabled, reloadConfig } from './config' import { WEBSERVER } from './constants' async function checkActivityPubUrls () { @@ -37,10 +38,7 @@ function checkConfig () { const configFiles = config.util.getConfigSources().map(s => s.name).join(' -> ') logger.info('Using following configuration file hierarchy: %s.', configFiles) - // Moved configuration keys - if (config.has('services.csp-logger')) { - logger.warn('services.csp-logger configuration has been renamed to csp.report_uri. Please update your configuration file.') - } + checkRemovedConfigKeys() checkSecretsConfig() checkEmailConfig() @@ -104,6 +102,34 @@ export { // --------------------------------------------------------------------------- +function checkRemovedConfigKeys () { + // Moved configuration keys + if (config.has('services.csp-logger')) { + logger.warn('services.csp-logger configuration has been renamed to csp.report_uri. Please update your configuration file.') + } + + if (config.has('transcoding.webtorrent.enabled')) { + const localConfigPath = getLocalConfigFilePath() + + const content = readFileSync(localConfigPath, { encoding: 'utf-8' }) + if (!content.includes('"webtorrent"')) { + throw new Error('Please rename transcoding.webtorrent.enabled key to transcoding.web_videos.enabled in your configuration file') + } + + try { + logger.info( + 'Replacing "transcoding.webtorrent.enabled" key to "transcoding.web_videos.enabled" in your local configuration ' + localConfigPath + ) + + writeFileSync(localConfigPath, content.replace('"webtorrent"', '"web_videos"'), { encoding: 'utf-8' }) + + reloadConfig() + } catch (err) { + logger.error('Cannot write new configuration to file ' + localConfigPath, { err }) + } + } +} + function checkSecretsConfig () { if (!CONFIG.SECRETS.PEERTUBE) { throw new Error('secrets.peertube is missing in config. Generate one using `openssl rand -hex 32`') @@ -198,7 +224,7 @@ function checkStorageConfig () { function checkTranscodingConfig () { if (CONFIG.TRANSCODING.ENABLED) { - if (CONFIG.TRANSCODING.WEBTORRENT.ENABLED === false && CONFIG.TRANSCODING.HLS.ENABLED === false) { + if (CONFIG.TRANSCODING.WEB_VIDEOS.ENABLED === false && CONFIG.TRANSCODING.HLS.ENABLED === false) { throw new Error('You need to enable at least Web Video transcoding or HLS transcoding.') } 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 () { 'signup.enabled', 'signup.limit', 'signup.requires_approval', 'signup.requires_email_verification', 'signup.minimum_age', 'signup.filters.cidr.whitelist', 'signup.filters.cidr.blacklist', 'redundancy.videos.strategies', 'redundancy.videos.check_interval', - 'transcoding.enabled', 'transcoding.threads', 'transcoding.allow_additional_extensions', 'transcoding.hls.enabled', - 'transcoding.profile', 'transcoding.concurrency', + 'transcoding.enabled', 'transcoding.threads', 'transcoding.allow_additional_extensions', 'transcoding.web_videos.enabled', + 'transcoding.hls.enabled', 'transcoding.profile', 'transcoding.concurrency', 'transcoding.resolutions.0p', 'transcoding.resolutions.144p', 'transcoding.resolutions.240p', 'transcoding.resolutions.360p', 'transcoding.resolutions.480p', 'transcoding.resolutions.720p', 'transcoding.resolutions.1080p', 'transcoding.resolutions.1440p', '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 = { HLS: { get ENABLED () { return config.get('transcoding.hls.enabled') } }, - WEBTORRENT: { - get ENABLED () { return config.get('transcoding.webtorrent.enabled') } + WEB_VIDEOS: { + get ENABLED () { return config.get('transcoding.web_videos.enabled') } }, REMOTE_RUNNERS: { get ENABLED () { return config.get('transcoding.remote_runners.enabled') } @@ -584,16 +584,6 @@ function isEmailEnabled () { return false } -// --------------------------------------------------------------------------- - -export { - CONFIG, - registerConfigChangedHandler, - isEmailEnabled -} - -// --------------------------------------------------------------------------- - function getLocalConfigFilePath () { const localConfigDir = getLocalConfigDir() @@ -604,6 +594,17 @@ function getLocalConfigFilePath () { return join(localConfigDir, filename + '.json') } +// --------------------------------------------------------------------------- + +export { + CONFIG, + getLocalConfigFilePath, + registerConfigChangedHandler, + isEmailEnabled +} + +// --------------------------------------------------------------------------- + function getLocalConfigDir () { if (process.env.PEERTUBE_LOCAL_CONFIG) return process.env.PEERTUBE_LOCAL_CONFIG 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 { hls: { enabled: CONFIG.TRANSCODING.ENABLED && CONFIG.TRANSCODING.HLS.ENABLED }, - webtorrent: { - enabled: CONFIG.TRANSCODING.ENABLED && CONFIG.TRANSCODING.WEBTORRENT.ENABLED + web_videos: { + enabled: CONFIG.TRANSCODING.ENABLED && CONFIG.TRANSCODING.WEB_VIDEOS.ENABLED }, enabledResolutions: this.getEnabledResolutions('vod'), 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 { if (CONFIG.TRANSCODING.HLS.ENABLED === true) { nextTranscodingSequentialJobPayloads.push([ this.buildHLSJobPayload({ - deleteWebVideoFiles: CONFIG.TRANSCODING.WEBTORRENT.ENABLED === false, + deleteWebVideoFiles: CONFIG.TRANSCODING.WEB_VIDEOS.ENABLED === false, // We had some issues with a web video quick transcoded while producing a HLS version of it copyCodecs: !quickTranscode, @@ -208,7 +208,7 @@ export class TranscodingJobQueueBuilder extends AbstractJobBuilder { for (const resolution of resolutionsEnabled) { const fps = computeOutputFPS({ inputFPS: inputVideoFPS, resolution }) - if (CONFIG.TRANSCODING.WEBTORRENT.ENABLED) { + if (CONFIG.TRANSCODING.WEB_VIDEOS.ENABLED) { const payloads: (NewWebVideoResolutionTranscodingPayload | HLSTranscodingPayload)[] = [ this.buildWebVideoJobPayload({ 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 { if (CONFIG.TRANSCODING.HLS.ENABLED === true) { await new VODHLSTranscodingJobHandler().create({ video, - deleteWebVideoFiles: CONFIG.TRANSCODING.WEBTORRENT.ENABLED === false, + deleteWebVideoFiles: CONFIG.TRANSCODING.WEB_VIDEOS.ENABLED === false, resolution: maxResolution, fps, isNewVideo, @@ -169,7 +169,7 @@ export class TranscodingRunnerJobBuilder extends AbstractJobBuilder { for (const resolution of resolutionsEnabled) { const fps = computeOutputFPS({ inputFPS: inputVideoFPS, resolution }) - if (CONFIG.TRANSCODING.WEBTORRENT.ENABLED) { + if (CONFIG.TRANSCODING.WEB_VIDEOS.ENABLED) { await new VODWebVideoTranscodingJobHandler().create({ video, 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 = [ body('transcoding.alwaysTranscodeOriginalResolution').isBoolean(), - body('transcoding.webtorrent.enabled').isBoolean(), + body('transcoding.webVideos.enabled').isBoolean(), body('transcoding.hls.enabled').isBoolean(), body('videoStudio.enabled').isBoolean(), @@ -153,8 +153,8 @@ function checkInvalidConfigIfEmailDisabled (customConfig: CustomConfig, res: exp function checkInvalidTranscodingConfig (customConfig: CustomConfig, res: express.Response) { if (customConfig.transcoding.enabled === false) return true - if (customConfig.transcoding.webtorrent.enabled === false && customConfig.transcoding.hls.enabled === false) { - res.fail({ message: 'You need to enable at least webtorrent transcoding or hls transcoding' }) + if (customConfig.transcoding.webVideos.enabled === false && customConfig.transcoding.hls.enabled === false) { + res.fail({ message: 'You need to enable at least web_videos transcoding or hls transcoding' }) return false } 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 () { '2160p': false }, alwaysTranscodeOriginalResolution: false, - webtorrent: { + webVideos: { enabled: true }, hls: { @@ -353,7 +353,7 @@ describe('Test config API validators', function () { hls: { enabled: false }, - webtorrent: { + web_videos: { enabled: false } } 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 const config = { transcoding: { - webtorrent: { + web_videos: { enabled: withWebVideo }, 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) { expect(data.transcoding.resolutions['1440p']).to.be.true expect(data.transcoding.resolutions['2160p']).to.be.true expect(data.transcoding.alwaysTranscodeOriginalResolution).to.be.true - expect(data.transcoding.webtorrent.enabled).to.be.true + expect(data.transcoding.webVideos.enabled).to.be.true expect(data.transcoding.hls.enabled).to.be.true expect(data.live.enabled).to.be.false @@ -192,7 +192,7 @@ function checkUpdatedConfig (data: CustomConfig) { expect(data.transcoding.resolutions['2160p']).to.be.false expect(data.transcoding.alwaysTranscodeOriginalResolution).to.be.false expect(data.transcoding.hls.enabled).to.be.false - expect(data.transcoding.webtorrent.enabled).to.be.true + expect(data.transcoding.webVideos.enabled).to.be.true expect(data.live.enabled).to.be.true expect(data.live.allowReplay).to.be.true @@ -344,7 +344,7 @@ const newCustomConfig: CustomConfig = { '2160p': false }, alwaysTranscodeOriginalResolution: false, - webtorrent: { + webVideos: { enabled: true }, 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 () { newConfig: { transcoding: { enabled: true, - webtorrent: { + webVideos: { enabled: true }, 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 () { hls: { enabled: true }, - webtorrent: { + web_videos: { enabled: true } } 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) { enabled: true, resolutions: ConfigCommand.getCustomConfigResolutions(false), - webtorrent: { + webVideos: { enabled: true }, hls: { @@ -201,7 +201,7 @@ function runTests (enableObjectStorage: boolean) { enabled: true, resolutions: ConfigCommand.getCustomConfigResolutions(true), - webtorrent: { + webVideos: { enabled: true }, 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 () { hls: { enabled: true }, - webtorrent: { + webVideos: { enabled: false } } 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) { allowAdditionalExtensions: true, allowAudioFiles: true, hls: { enabled: true }, - webtorrent: { enabled: true }, + webVideos: { enabled: true }, resolutions: { '0p': false, '144p': true, @@ -333,7 +333,7 @@ describe('Test video transcoding', function () { newConfig: { transcoding: { hls: { enabled: true }, - webtorrent: { enabled: true }, + webVideos: { enabled: true }, resolutions: { '0p': false, '144p': false, @@ -405,7 +405,7 @@ describe('Test video transcoding', function () { newConfig: { transcoding: { hls: { enabled: true }, - webtorrent: { enabled: true }, + webVideos: { enabled: true }, resolutions: { '0p': true, '144p': false, @@ -586,7 +586,7 @@ describe('Test video transcoding', function () { '1440p': true, '2160p': true }, - webtorrent: { enabled: true }, + web_videos: { enabled: true }, hls: { enabled: true } } } @@ -728,7 +728,7 @@ describe('Test video transcoding', function () { transcoding: { enabled: true, hls: { enabled: true }, - webtorrent: { enabled: true }, + webVideos: { enabled: true }, resolutions: { '0p': false, '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 () { hls: { enabled: true }, - webtorrent: { + webVideos: { enabled: false } } 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 () { await servers[0].config.updateExistingSubConfig({ newConfig: { transcoding: { - webtorrent: { + webVideos: { enabled: false } } 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 () { { const config = await server.config.getCustomConfig() - config.transcoding.webtorrent.enabled = false + config.transcoding.webVideos.enabled = false config.transcoding.hls.enabled = true config.transcoding.enabled = true 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 () { '1440p': false, '2160p': false }, - webtorrent: { enabled: true }, + webVideos: { enabled: true }, hls: { enabled: false } } } 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', () => { serverHLSOnly = await createSingleServer(3, { transcoding: { enabled: true, - webtorrent: { enabled: false }, + web_videos: { enabled: false }, hls: { enabled: true } } }) 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 () { await servers[0].config.updateCustomSubConfig({ newConfig: { transcoding: { - webtorrent: { + webVideos: { enabled: true }, 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 hls: { enabled: true }, - webtorrent: { + webVideos: { enabled: true }, 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: { const serverConfig = await originServer.config.getConfig() const requiresAuth = video.privacy.id === VideoPrivacy.PRIVATE || video.privacy.id === VideoPrivacy.INTERNAL - const transcodingEnabled = serverConfig.transcoding.webtorrent.enabled + const transcodingEnabled = serverConfig.transcoding.web_videos.enabled for (const attributeFile of files) { const file = video.files.find(f => f.resolution.id === attributeFile.resolution) diff --git a/shared/models/server/custom-config.model.ts b/shared/models/server/custom-config.model.ts index 1012312f3..9aa66f2b8 100644 --- a/shared/models/server/custom-config.model.ts +++ b/shared/models/server/custom-config.model.ts @@ -133,7 +133,7 @@ export interface CustomConfig { alwaysTranscodeOriginalResolution: boolean - webtorrent: { + webVideos: { enabled: boolean } diff --git a/shared/models/server/server-config.model.ts b/shared/models/server/server-config.model.ts index 024ed35bf..288cf84cd 100644 --- a/shared/models/server/server-config.model.ts +++ b/shared/models/server/server-config.model.ts @@ -140,7 +140,7 @@ export interface ServerConfig { enabled: boolean } - webtorrent: { + web_videos: { enabled: boolean } diff --git a/shared/server-commands/server/config-command.ts b/shared/server-commands/server/config-command.ts index 00dc8e11c..7f1e9d977 100644 --- a/shared/server-commands/server/config-command.ts +++ b/shared/server-commands/server/config-command.ts @@ -142,7 +142,7 @@ export class ConfigCommand extends AbstractCommand { resolutions: ConfigCommand.getCustomConfigResolutions(true, with0p), - webtorrent: { + webVideos: { enabled: webVideo }, hls: { @@ -169,7 +169,7 @@ export class ConfigCommand extends AbstractCommand { '240p': true }, - webtorrent: { + webVideos: { enabled: webVideo }, hls: { @@ -424,7 +424,7 @@ export class ConfigCommand extends AbstractCommand { '2160p': false }, alwaysTranscodeOriginalResolution: true, - webtorrent: { + webVideos: { enabled: true }, hls: { diff --git a/support/doc/api/openapi.yaml b/support/doc/api/openapi.yaml index e1a21fb5c..b2303bdd1 100644 --- a/support/doc/api/openapi.yaml +++ b/support/doc/api/openapi.yaml @@ -7768,7 +7768,7 @@ components: properties: enabled: type: boolean - webtorrent: + web_videos: type: object properties: enabled: @@ -8134,7 +8134,7 @@ components: type: boolean 2160p: type: boolean - webtorrent: + web_videos: type: object description: Web Video specific settings properties: diff --git a/support/docker/production/config/custom-environment-variables.yaml b/support/docker/production/config/custom-environment-variables.yaml index 8fff54229..8c1231bfc 100644 --- a/support/docker/production/config/custom-environment-variables.yaml +++ b/support/docker/production/config/custom-environment-variables.yaml @@ -1,7 +1,7 @@ -# +# # This file will be read by node-config # See https://github.com/node-config/node-config/wiki/Environment-Variables#custom-environment-variables -# +# webserver: hostname: "PEERTUBE_WEBSERVER_HOSTNAME" @@ -177,9 +177,9 @@ transcoding: 2160p: __name: "PEERTUBE_TRANSCODING_2160P" __format: "json" - webtorrent: + web_videos: enabled: - __name: "PEERTUBE_TRANSCODING_WEBTORRENT_ENABLED" + __name: "PEERTUBE_TRANSCODING_WEB_VIDEOS_ENABLED" __format: "json" hls: enabled: