Rename webtorrent config to web_videos
This commit is contained in:
parent
784e2ad5c3
commit
c57ad141a9
|
@ -190,7 +190,7 @@ export class EditCustomConfigComponent extends FormReactive implements OnInit {
|
||||||
hls: {
|
hls: {
|
||||||
enabled: null
|
enabled: null
|
||||||
},
|
},
|
||||||
webtorrent: {
|
webVideos: {
|
||||||
enabled: null
|
enabled: null
|
||||||
},
|
},
|
||||||
remoteRunners: {
|
remoteRunners: {
|
||||||
|
|
|
@ -67,10 +67,10 @@
|
||||||
<div class="callout callout-light pt-2 mt-2 pb-0">
|
<div class="callout callout-light pt-2 mt-2 pb-0">
|
||||||
<h3 class="callout-title" i18n>Output formats</h3>
|
<h3 class="callout-title" i18n>Output formats</h3>
|
||||||
|
|
||||||
<ng-container formGroupName="webtorrent">
|
<ng-container formGroupName="webVideos">
|
||||||
<div class="form-group" [ngClass]="getTranscodingDisabledClass()">
|
<div class="form-group" [ngClass]="getTranscodingDisabledClass()">
|
||||||
<my-peertube-checkbox
|
<my-peertube-checkbox
|
||||||
inputName="transcodingWebTorrentEnabled" formControlName="enabled"
|
inputName="transcodingWebVideosEnabled" formControlName="enabled"
|
||||||
i18n-labelText labelText="Web Videos enabled"
|
i18n-labelText labelText="Web Videos enabled"
|
||||||
>
|
>
|
||||||
<ng-template ptTemplate="help">
|
<ng-template ptTemplate="help">
|
||||||
|
|
|
@ -90,9 +90,9 @@ export class EditVODTranscodingComponent implements OnInit, OnChanges {
|
||||||
const transcodingControl = this.form.get('transcoding.enabled')
|
const transcodingControl = this.form.get('transcoding.enabled')
|
||||||
const videoStudioControl = this.form.get('videoStudio.enabled')
|
const videoStudioControl = this.form.get('videoStudio.enabled')
|
||||||
const hlsControl = this.form.get('transcoding.hls.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 => {
|
.subscribe(newValue => {
|
||||||
if (newValue === false && !hlsControl.disabled) {
|
if (newValue === false && !hlsControl.disabled) {
|
||||||
hlsControl.disable()
|
hlsControl.disable()
|
||||||
|
@ -105,12 +105,12 @@ export class EditVODTranscodingComponent implements OnInit, OnChanges {
|
||||||
|
|
||||||
hlsControl.valueChanges
|
hlsControl.valueChanges
|
||||||
.subscribe(newValue => {
|
.subscribe(newValue => {
|
||||||
if (newValue === false && !webtorrentControl.disabled) {
|
if (newValue === false && !webVideosControl.disabled) {
|
||||||
webtorrentControl.disable()
|
webVideosControl.disable()
|
||||||
}
|
}
|
||||||
|
|
||||||
if (newValue === true && !webtorrentControl.enabled) {
|
if (newValue === true && !webVideosControl.enabled) {
|
||||||
webtorrentControl.enable()
|
webVideosControl.enable()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -122,7 +122,7 @@ export class EditVODTranscodingComponent implements OnInit, OnChanges {
|
||||||
})
|
})
|
||||||
|
|
||||||
transcodingControl.updateValueAndValidity()
|
transcodingControl.updateValueAndValidity()
|
||||||
webtorrentControl.updateValueAndValidity()
|
webVideosControl.updateValueAndValidity()
|
||||||
videoStudioControl.updateValueAndValidity()
|
videoStudioControl.updateValueAndValidity()
|
||||||
hlsControl.updateValueAndValidity()
|
hlsControl.updateValueAndValidity()
|
||||||
}
|
}
|
||||||
|
|
|
@ -483,7 +483,7 @@ transcoding:
|
||||||
# Generate videos in a web compatible format
|
# Generate videos in a web compatible format
|
||||||
# If you also enabled the hls format, it will multiply videos storage by 2
|
# If you also enabled the hls format, it will multiply videos storage by 2
|
||||||
# If disabled, breaks federation with PeerTube instances < 2.1
|
# If disabled, breaks federation with PeerTube instances < 2.1
|
||||||
webtorrent:
|
web_videos:
|
||||||
enabled: false
|
enabled: false
|
||||||
|
|
||||||
# /!\ Requires ffmpeg >= 4.1
|
# /!\ Requires ffmpeg >= 4.1
|
||||||
|
|
|
@ -493,7 +493,7 @@ transcoding:
|
||||||
# Generate videos in a web compatible format
|
# Generate videos in a web compatible format
|
||||||
# If you also enabled the hls format, it will multiply videos storage by 2
|
# If you also enabled the hls format, it will multiply videos storage by 2
|
||||||
# If disabled, breaks federation with PeerTube instances < 2.1
|
# If disabled, breaks federation with PeerTube instances < 2.1
|
||||||
webtorrent:
|
web_videos:
|
||||||
enabled: false
|
enabled: false
|
||||||
|
|
||||||
# /!\ Requires ffmpeg >= 4.1
|
# /!\ Requires ffmpeg >= 4.1
|
||||||
|
|
|
@ -97,7 +97,7 @@ transcoding:
|
||||||
1080p: true
|
1080p: true
|
||||||
1440p: true
|
1440p: true
|
||||||
2160p: true
|
2160p: true
|
||||||
webtorrent:
|
web_videos:
|
||||||
enabled: true
|
enabled: true
|
||||||
hls:
|
hls:
|
||||||
enabled: true
|
enabled: true
|
||||||
|
|
|
@ -242,8 +242,8 @@ function customConfig (): CustomConfig {
|
||||||
'2160p': CONFIG.TRANSCODING.RESOLUTIONS['2160p']
|
'2160p': CONFIG.TRANSCODING.RESOLUTIONS['2160p']
|
||||||
},
|
},
|
||||||
alwaysTranscodeOriginalResolution: CONFIG.TRANSCODING.ALWAYS_TRANSCODE_ORIGINAL_RESOLUTION,
|
alwaysTranscodeOriginalResolution: CONFIG.TRANSCODING.ALWAYS_TRANSCODE_ORIGINAL_RESOLUTION,
|
||||||
webtorrent: {
|
webVideos: {
|
||||||
enabled: CONFIG.TRANSCODING.WEBTORRENT.ENABLED
|
enabled: CONFIG.TRANSCODING.WEB_VIDEOS.ENABLED
|
||||||
},
|
},
|
||||||
hls: {
|
hls: {
|
||||||
enabled: CONFIG.TRANSCODING.HLS.ENABLED
|
enabled: CONFIG.TRANSCODING.HLS.ENABLED
|
||||||
|
|
|
@ -120,8 +120,8 @@ async function generateNodeinfo (req: express.Request, res: express.Response) {
|
||||||
hls: {
|
hls: {
|
||||||
enabled: CONFIG.TRANSCODING.HLS.ENABLED
|
enabled: CONFIG.TRANSCODING.HLS.ENABLED
|
||||||
},
|
},
|
||||||
webtorrent: {
|
web_videos: {
|
||||||
enabled: CONFIG.TRANSCODING.WEBTORRENT.ENABLED
|
enabled: CONFIG.TRANSCODING.WEB_VIDEOS.ENABLED
|
||||||
},
|
},
|
||||||
enabledResolutions: ServerConfigManager.Instance.getEnabledResolutions('vod')
|
enabledResolutions: ServerConfigManager.Instance.getEnabledResolutions('vod')
|
||||||
},
|
},
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import config from 'config'
|
import config from 'config'
|
||||||
|
import { readFileSync, writeFileSync } from 'fs-extra'
|
||||||
import { URL } from 'url'
|
import { URL } from 'url'
|
||||||
import { uniqify } from '@shared/core-utils'
|
import { uniqify } from '@shared/core-utils'
|
||||||
import { getFFmpegVersion } from '@shared/ffmpeg'
|
import { getFFmpegVersion } from '@shared/ffmpeg'
|
||||||
|
@ -10,7 +11,7 @@ import { logger } from '../helpers/logger'
|
||||||
import { ApplicationModel, getServerActor } from '../models/application/application'
|
import { ApplicationModel, getServerActor } from '../models/application/application'
|
||||||
import { OAuthClientModel } from '../models/oauth/oauth-client'
|
import { OAuthClientModel } from '../models/oauth/oauth-client'
|
||||||
import { UserModel } from '../models/user/user'
|
import { UserModel } from '../models/user/user'
|
||||||
import { CONFIG, isEmailEnabled } from './config'
|
import { CONFIG, getLocalConfigFilePath, isEmailEnabled, reloadConfig } from './config'
|
||||||
import { WEBSERVER } from './constants'
|
import { WEBSERVER } from './constants'
|
||||||
|
|
||||||
async function checkActivityPubUrls () {
|
async function checkActivityPubUrls () {
|
||||||
|
@ -37,10 +38,7 @@ function checkConfig () {
|
||||||
const configFiles = config.util.getConfigSources().map(s => s.name).join(' -> ')
|
const configFiles = config.util.getConfigSources().map(s => s.name).join(' -> ')
|
||||||
logger.info('Using following configuration file hierarchy: %s.', configFiles)
|
logger.info('Using following configuration file hierarchy: %s.', configFiles)
|
||||||
|
|
||||||
// Moved configuration keys
|
checkRemovedConfigKeys()
|
||||||
if (config.has('services.csp-logger')) {
|
|
||||||
logger.warn('services.csp-logger configuration has been renamed to csp.report_uri. Please update your configuration file.')
|
|
||||||
}
|
|
||||||
|
|
||||||
checkSecretsConfig()
|
checkSecretsConfig()
|
||||||
checkEmailConfig()
|
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 () {
|
function checkSecretsConfig () {
|
||||||
if (!CONFIG.SECRETS.PEERTUBE) {
|
if (!CONFIG.SECRETS.PEERTUBE) {
|
||||||
throw new Error('secrets.peertube is missing in config. Generate one using `openssl rand -hex 32`')
|
throw new Error('secrets.peertube is missing in config. Generate one using `openssl rand -hex 32`')
|
||||||
|
@ -198,7 +224,7 @@ function checkStorageConfig () {
|
||||||
|
|
||||||
function checkTranscodingConfig () {
|
function checkTranscodingConfig () {
|
||||||
if (CONFIG.TRANSCODING.ENABLED) {
|
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.')
|
throw new Error('You need to enable at least Web Video transcoding or HLS transcoding.')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -34,8 +34,8 @@ function checkMissedConfig () {
|
||||||
'signup.enabled', 'signup.limit', 'signup.requires_approval', 'signup.requires_email_verification', 'signup.minimum_age',
|
'signup.enabled', 'signup.limit', 'signup.requires_approval', 'signup.requires_email_verification', 'signup.minimum_age',
|
||||||
'signup.filters.cidr.whitelist', 'signup.filters.cidr.blacklist',
|
'signup.filters.cidr.whitelist', 'signup.filters.cidr.blacklist',
|
||||||
'redundancy.videos.strategies', 'redundancy.videos.check_interval',
|
'redundancy.videos.strategies', 'redundancy.videos.check_interval',
|
||||||
'transcoding.enabled', 'transcoding.threads', 'transcoding.allow_additional_extensions', 'transcoding.hls.enabled',
|
'transcoding.enabled', 'transcoding.threads', 'transcoding.allow_additional_extensions', 'transcoding.web_videos.enabled',
|
||||||
'transcoding.profile', 'transcoding.concurrency',
|
'transcoding.hls.enabled', 'transcoding.profile', 'transcoding.concurrency',
|
||||||
'transcoding.resolutions.0p', 'transcoding.resolutions.144p', 'transcoding.resolutions.240p', 'transcoding.resolutions.360p',
|
'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.480p', 'transcoding.resolutions.720p', 'transcoding.resolutions.1080p', 'transcoding.resolutions.1440p',
|
||||||
'transcoding.resolutions.2160p', 'transcoding.always_transcode_original_resolution', 'transcoding.remote_runners.enabled',
|
'transcoding.resolutions.2160p', 'transcoding.always_transcode_original_resolution', 'transcoding.remote_runners.enabled',
|
||||||
|
|
|
@ -371,8 +371,8 @@ const CONFIG = {
|
||||||
HLS: {
|
HLS: {
|
||||||
get ENABLED () { return config.get<boolean>('transcoding.hls.enabled') }
|
get ENABLED () { return config.get<boolean>('transcoding.hls.enabled') }
|
||||||
},
|
},
|
||||||
WEBTORRENT: {
|
WEB_VIDEOS: {
|
||||||
get ENABLED () { return config.get<boolean>('transcoding.webtorrent.enabled') }
|
get ENABLED () { return config.get<boolean>('transcoding.web_videos.enabled') }
|
||||||
},
|
},
|
||||||
REMOTE_RUNNERS: {
|
REMOTE_RUNNERS: {
|
||||||
get ENABLED () { return config.get<boolean>('transcoding.remote_runners.enabled') }
|
get ENABLED () { return config.get<boolean>('transcoding.remote_runners.enabled') }
|
||||||
|
@ -584,16 +584,6 @@ function isEmailEnabled () {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------
|
|
||||||
|
|
||||||
export {
|
|
||||||
CONFIG,
|
|
||||||
registerConfigChangedHandler,
|
|
||||||
isEmailEnabled
|
|
||||||
}
|
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------
|
|
||||||
|
|
||||||
function getLocalConfigFilePath () {
|
function getLocalConfigFilePath () {
|
||||||
const localConfigDir = getLocalConfigDir()
|
const localConfigDir = getLocalConfigDir()
|
||||||
|
|
||||||
|
@ -604,6 +594,17 @@ function getLocalConfigFilePath () {
|
||||||
return join(localConfigDir, filename + '.json')
|
return join(localConfigDir, filename + '.json')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
export {
|
||||||
|
CONFIG,
|
||||||
|
getLocalConfigFilePath,
|
||||||
|
registerConfigChangedHandler,
|
||||||
|
isEmailEnabled
|
||||||
|
}
|
||||||
|
|
||||||
|
// ---------------------------------------------------------------------------
|
||||||
|
|
||||||
function getLocalConfigDir () {
|
function getLocalConfigDir () {
|
||||||
if (process.env.PEERTUBE_LOCAL_CONFIG) return process.env.PEERTUBE_LOCAL_CONFIG
|
if (process.env.PEERTUBE_LOCAL_CONFIG) return process.env.PEERTUBE_LOCAL_CONFIG
|
||||||
|
|
||||||
|
|
|
@ -132,8 +132,8 @@ class ServerConfigManager {
|
||||||
hls: {
|
hls: {
|
||||||
enabled: CONFIG.TRANSCODING.ENABLED && CONFIG.TRANSCODING.HLS.ENABLED
|
enabled: CONFIG.TRANSCODING.ENABLED && CONFIG.TRANSCODING.HLS.ENABLED
|
||||||
},
|
},
|
||||||
webtorrent: {
|
web_videos: {
|
||||||
enabled: CONFIG.TRANSCODING.ENABLED && CONFIG.TRANSCODING.WEBTORRENT.ENABLED
|
enabled: CONFIG.TRANSCODING.ENABLED && CONFIG.TRANSCODING.WEB_VIDEOS.ENABLED
|
||||||
},
|
},
|
||||||
enabledResolutions: this.getEnabledResolutions('vod'),
|
enabledResolutions: this.getEnabledResolutions('vod'),
|
||||||
profile: CONFIG.TRANSCODING.PROFILE,
|
profile: CONFIG.TRANSCODING.PROFILE,
|
||||||
|
|
|
@ -60,7 +60,7 @@ export class TranscodingJobQueueBuilder extends AbstractJobBuilder {
|
||||||
if (CONFIG.TRANSCODING.HLS.ENABLED === true) {
|
if (CONFIG.TRANSCODING.HLS.ENABLED === true) {
|
||||||
nextTranscodingSequentialJobPayloads.push([
|
nextTranscodingSequentialJobPayloads.push([
|
||||||
this.buildHLSJobPayload({
|
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
|
// We had some issues with a web video quick transcoded while producing a HLS version of it
|
||||||
copyCodecs: !quickTranscode,
|
copyCodecs: !quickTranscode,
|
||||||
|
@ -208,7 +208,7 @@ export class TranscodingJobQueueBuilder extends AbstractJobBuilder {
|
||||||
for (const resolution of resolutionsEnabled) {
|
for (const resolution of resolutionsEnabled) {
|
||||||
const fps = computeOutputFPS({ inputFPS: inputVideoFPS, resolution })
|
const fps = computeOutputFPS({ inputFPS: inputVideoFPS, resolution })
|
||||||
|
|
||||||
if (CONFIG.TRANSCODING.WEBTORRENT.ENABLED) {
|
if (CONFIG.TRANSCODING.WEB_VIDEOS.ENABLED) {
|
||||||
const payloads: (NewWebVideoResolutionTranscodingPayload | HLSTranscodingPayload)[] = [
|
const payloads: (NewWebVideoResolutionTranscodingPayload | HLSTranscodingPayload)[] = [
|
||||||
this.buildWebVideoJobPayload({
|
this.buildWebVideoJobPayload({
|
||||||
videoUUID: video.uuid,
|
videoUUID: video.uuid,
|
||||||
|
|
|
@ -62,7 +62,7 @@ export class TranscodingRunnerJobBuilder extends AbstractJobBuilder {
|
||||||
if (CONFIG.TRANSCODING.HLS.ENABLED === true) {
|
if (CONFIG.TRANSCODING.HLS.ENABLED === true) {
|
||||||
await new VODHLSTranscodingJobHandler().create({
|
await new VODHLSTranscodingJobHandler().create({
|
||||||
video,
|
video,
|
||||||
deleteWebVideoFiles: CONFIG.TRANSCODING.WEBTORRENT.ENABLED === false,
|
deleteWebVideoFiles: CONFIG.TRANSCODING.WEB_VIDEOS.ENABLED === false,
|
||||||
resolution: maxResolution,
|
resolution: maxResolution,
|
||||||
fps,
|
fps,
|
||||||
isNewVideo,
|
isNewVideo,
|
||||||
|
@ -169,7 +169,7 @@ export class TranscodingRunnerJobBuilder extends AbstractJobBuilder {
|
||||||
for (const resolution of resolutionsEnabled) {
|
for (const resolution of resolutionsEnabled) {
|
||||||
const fps = computeOutputFPS({ inputFPS: inputVideoFPS, resolution })
|
const fps = computeOutputFPS({ inputFPS: inputVideoFPS, resolution })
|
||||||
|
|
||||||
if (CONFIG.TRANSCODING.WEBTORRENT.ENABLED) {
|
if (CONFIG.TRANSCODING.WEB_VIDEOS.ENABLED) {
|
||||||
await new VODWebVideoTranscodingJobHandler().create({
|
await new VODWebVideoTranscodingJobHandler().create({
|
||||||
video,
|
video,
|
||||||
resolution,
|
resolution,
|
||||||
|
|
|
@ -59,7 +59,7 @@ const customConfigUpdateValidator = [
|
||||||
|
|
||||||
body('transcoding.alwaysTranscodeOriginalResolution').isBoolean(),
|
body('transcoding.alwaysTranscodeOriginalResolution').isBoolean(),
|
||||||
|
|
||||||
body('transcoding.webtorrent.enabled').isBoolean(),
|
body('transcoding.webVideos.enabled').isBoolean(),
|
||||||
body('transcoding.hls.enabled').isBoolean(),
|
body('transcoding.hls.enabled').isBoolean(),
|
||||||
|
|
||||||
body('videoStudio.enabled').isBoolean(),
|
body('videoStudio.enabled').isBoolean(),
|
||||||
|
@ -153,8 +153,8 @@ function checkInvalidConfigIfEmailDisabled (customConfig: CustomConfig, res: exp
|
||||||
function checkInvalidTranscodingConfig (customConfig: CustomConfig, res: express.Response) {
|
function checkInvalidTranscodingConfig (customConfig: CustomConfig, res: express.Response) {
|
||||||
if (customConfig.transcoding.enabled === false) return true
|
if (customConfig.transcoding.enabled === false) return true
|
||||||
|
|
||||||
if (customConfig.transcoding.webtorrent.enabled === false && customConfig.transcoding.hls.enabled === false) {
|
if (customConfig.transcoding.webVideos.enabled === false && customConfig.transcoding.hls.enabled === false) {
|
||||||
res.fail({ message: 'You need to enable at least webtorrent transcoding or hls transcoding' })
|
res.fail({ message: 'You need to enable at least web_videos transcoding or hls transcoding' })
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -126,7 +126,7 @@ describe('Test config API validators', function () {
|
||||||
'2160p': false
|
'2160p': false
|
||||||
},
|
},
|
||||||
alwaysTranscodeOriginalResolution: false,
|
alwaysTranscodeOriginalResolution: false,
|
||||||
webtorrent: {
|
webVideos: {
|
||||||
enabled: true
|
enabled: true
|
||||||
},
|
},
|
||||||
hls: {
|
hls: {
|
||||||
|
@ -353,7 +353,7 @@ describe('Test config API validators', function () {
|
||||||
hls: {
|
hls: {
|
||||||
enabled: false
|
enabled: false
|
||||||
},
|
},
|
||||||
webtorrent: {
|
web_videos: {
|
||||||
enabled: false
|
enabled: false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -60,7 +60,7 @@ async function createServers (strategy: VideoRedundancyStrategy | null, addition
|
||||||
|
|
||||||
const config = {
|
const config = {
|
||||||
transcoding: {
|
transcoding: {
|
||||||
webtorrent: {
|
web_videos: {
|
||||||
enabled: withWebVideo
|
enabled: withWebVideo
|
||||||
},
|
},
|
||||||
hls: {
|
hls: {
|
||||||
|
|
|
@ -79,7 +79,7 @@ function checkInitialConfig (server: PeerTubeServer, data: CustomConfig) {
|
||||||
expect(data.transcoding.resolutions['1440p']).to.be.true
|
expect(data.transcoding.resolutions['1440p']).to.be.true
|
||||||
expect(data.transcoding.resolutions['2160p']).to.be.true
|
expect(data.transcoding.resolutions['2160p']).to.be.true
|
||||||
expect(data.transcoding.alwaysTranscodeOriginalResolution).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.transcoding.hls.enabled).to.be.true
|
||||||
|
|
||||||
expect(data.live.enabled).to.be.false
|
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.resolutions['2160p']).to.be.false
|
||||||
expect(data.transcoding.alwaysTranscodeOriginalResolution).to.be.false
|
expect(data.transcoding.alwaysTranscodeOriginalResolution).to.be.false
|
||||||
expect(data.transcoding.hls.enabled).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.enabled).to.be.true
|
||||||
expect(data.live.allowReplay).to.be.true
|
expect(data.live.allowReplay).to.be.true
|
||||||
|
@ -344,7 +344,7 @@ const newCustomConfig: CustomConfig = {
|
||||||
'2160p': false
|
'2160p': false
|
||||||
},
|
},
|
||||||
alwaysTranscodeOriginalResolution: false,
|
alwaysTranscodeOriginalResolution: false,
|
||||||
webtorrent: {
|
webVideos: {
|
||||||
enabled: true
|
enabled: true
|
||||||
},
|
},
|
||||||
hls: {
|
hls: {
|
||||||
|
|
|
@ -194,7 +194,7 @@ describe('Test stats (excluding redundancy)', function () {
|
||||||
newConfig: {
|
newConfig: {
|
||||||
transcoding: {
|
transcoding: {
|
||||||
enabled: true,
|
enabled: true,
|
||||||
webtorrent: {
|
webVideos: {
|
||||||
enabled: true
|
enabled: true
|
||||||
},
|
},
|
||||||
hls: {
|
hls: {
|
||||||
|
|
|
@ -37,7 +37,7 @@ describe('Test audio only video transcoding', function () {
|
||||||
hls: {
|
hls: {
|
||||||
enabled: true
|
enabled: true
|
||||||
},
|
},
|
||||||
webtorrent: {
|
web_videos: {
|
||||||
enabled: true
|
enabled: true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -165,7 +165,7 @@ function runTests (enableObjectStorage: boolean) {
|
||||||
enabled: true,
|
enabled: true,
|
||||||
resolutions: ConfigCommand.getCustomConfigResolutions(false),
|
resolutions: ConfigCommand.getCustomConfigResolutions(false),
|
||||||
|
|
||||||
webtorrent: {
|
webVideos: {
|
||||||
enabled: true
|
enabled: true
|
||||||
},
|
},
|
||||||
hls: {
|
hls: {
|
||||||
|
@ -201,7 +201,7 @@ function runTests (enableObjectStorage: boolean) {
|
||||||
enabled: true,
|
enabled: true,
|
||||||
resolutions: ConfigCommand.getCustomConfigResolutions(true),
|
resolutions: ConfigCommand.getCustomConfigResolutions(true),
|
||||||
|
|
||||||
webtorrent: {
|
webVideos: {
|
||||||
enabled: true
|
enabled: true
|
||||||
},
|
},
|
||||||
hls: {
|
hls: {
|
||||||
|
|
|
@ -136,7 +136,7 @@ describe('Test HLS videos', function () {
|
||||||
hls: {
|
hls: {
|
||||||
enabled: true
|
enabled: true
|
||||||
},
|
},
|
||||||
webtorrent: {
|
webVideos: {
|
||||||
enabled: false
|
enabled: false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,7 +31,7 @@ function updateConfigForTranscoding (server: PeerTubeServer) {
|
||||||
allowAdditionalExtensions: true,
|
allowAdditionalExtensions: true,
|
||||||
allowAudioFiles: true,
|
allowAudioFiles: true,
|
||||||
hls: { enabled: true },
|
hls: { enabled: true },
|
||||||
webtorrent: { enabled: true },
|
webVideos: { enabled: true },
|
||||||
resolutions: {
|
resolutions: {
|
||||||
'0p': false,
|
'0p': false,
|
||||||
'144p': true,
|
'144p': true,
|
||||||
|
@ -333,7 +333,7 @@ describe('Test video transcoding', function () {
|
||||||
newConfig: {
|
newConfig: {
|
||||||
transcoding: {
|
transcoding: {
|
||||||
hls: { enabled: true },
|
hls: { enabled: true },
|
||||||
webtorrent: { enabled: true },
|
webVideos: { enabled: true },
|
||||||
resolutions: {
|
resolutions: {
|
||||||
'0p': false,
|
'0p': false,
|
||||||
'144p': false,
|
'144p': false,
|
||||||
|
@ -405,7 +405,7 @@ describe('Test video transcoding', function () {
|
||||||
newConfig: {
|
newConfig: {
|
||||||
transcoding: {
|
transcoding: {
|
||||||
hls: { enabled: true },
|
hls: { enabled: true },
|
||||||
webtorrent: { enabled: true },
|
webVideos: { enabled: true },
|
||||||
resolutions: {
|
resolutions: {
|
||||||
'0p': true,
|
'0p': true,
|
||||||
'144p': false,
|
'144p': false,
|
||||||
|
@ -586,7 +586,7 @@ describe('Test video transcoding', function () {
|
||||||
'1440p': true,
|
'1440p': true,
|
||||||
'2160p': true
|
'2160p': true
|
||||||
},
|
},
|
||||||
webtorrent: { enabled: true },
|
web_videos: { enabled: true },
|
||||||
hls: { enabled: true }
|
hls: { enabled: true }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -728,7 +728,7 @@ describe('Test video transcoding', function () {
|
||||||
transcoding: {
|
transcoding: {
|
||||||
enabled: true,
|
enabled: true,
|
||||||
hls: { enabled: true },
|
hls: { enabled: true },
|
||||||
webtorrent: { enabled: true },
|
webVideos: { enabled: true },
|
||||||
resolutions: {
|
resolutions: {
|
||||||
'0p': false,
|
'0p': false,
|
||||||
'144p': false,
|
'144p': false,
|
||||||
|
|
|
@ -121,7 +121,7 @@ describe('Test update video privacy while transcoding', function () {
|
||||||
hls: {
|
hls: {
|
||||||
enabled: true
|
enabled: true
|
||||||
},
|
},
|
||||||
webtorrent: {
|
webVideos: {
|
||||||
enabled: false
|
enabled: false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -277,7 +277,7 @@ describe('Test video studio', function () {
|
||||||
await servers[0].config.updateExistingSubConfig({
|
await servers[0].config.updateExistingSubConfig({
|
||||||
newConfig: {
|
newConfig: {
|
||||||
transcoding: {
|
transcoding: {
|
||||||
webtorrent: {
|
webVideos: {
|
||||||
enabled: false
|
enabled: false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -189,7 +189,7 @@ describe('Test user videos', function () {
|
||||||
|
|
||||||
{
|
{
|
||||||
const config = await server.config.getCustomConfig()
|
const config = await server.config.getCustomConfig()
|
||||||
config.transcoding.webtorrent.enabled = false
|
config.transcoding.webVideos.enabled = false
|
||||||
config.transcoding.hls.enabled = true
|
config.transcoding.hls.enabled = true
|
||||||
config.transcoding.enabled = true
|
config.transcoding.enabled = true
|
||||||
await server.config.updateCustomSubConfig({ newConfig: config })
|
await server.config.updateCustomSubConfig({ newConfig: config })
|
||||||
|
|
|
@ -328,7 +328,7 @@ describe('Test video imports', function () {
|
||||||
'1440p': false,
|
'1440p': false,
|
||||||
'2160p': false
|
'2160p': false
|
||||||
},
|
},
|
||||||
webtorrent: { enabled: true },
|
webVideos: { enabled: true },
|
||||||
hls: { enabled: false }
|
hls: { enabled: false }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -47,7 +47,7 @@ describe('Test syndication feeds', () => {
|
||||||
serverHLSOnly = await createSingleServer(3, {
|
serverHLSOnly = await createSingleServer(3, {
|
||||||
transcoding: {
|
transcoding: {
|
||||||
enabled: true,
|
enabled: true,
|
||||||
webtorrent: { enabled: false },
|
web_videos: { enabled: false },
|
||||||
hls: { enabled: true }
|
hls: { enabled: true }
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
|
@ -493,7 +493,7 @@ describe('Test plugin filter hooks', function () {
|
||||||
await servers[0].config.updateCustomSubConfig({
|
await servers[0].config.updateCustomSubConfig({
|
||||||
newConfig: {
|
newConfig: {
|
||||||
transcoding: {
|
transcoding: {
|
||||||
webtorrent: {
|
webVideos: {
|
||||||
enabled: true
|
enabled: true
|
||||||
},
|
},
|
||||||
hls: {
|
hls: {
|
||||||
|
|
|
@ -35,7 +35,7 @@ function updateConf (server: PeerTubeServer, vodProfile: string, liveProfile: st
|
||||||
hls: {
|
hls: {
|
||||||
enabled: true
|
enabled: true
|
||||||
},
|
},
|
||||||
webtorrent: {
|
webVideos: {
|
||||||
enabled: true
|
enabled: true
|
||||||
},
|
},
|
||||||
resolutions: {
|
resolutions: {
|
||||||
|
|
|
@ -28,7 +28,7 @@ async function completeWebVideoFilesCheck (options: {
|
||||||
const serverConfig = await originServer.config.getConfig()
|
const serverConfig = await originServer.config.getConfig()
|
||||||
const requiresAuth = video.privacy.id === VideoPrivacy.PRIVATE || video.privacy.id === VideoPrivacy.INTERNAL
|
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) {
|
for (const attributeFile of files) {
|
||||||
const file = video.files.find(f => f.resolution.id === attributeFile.resolution)
|
const file = video.files.find(f => f.resolution.id === attributeFile.resolution)
|
||||||
|
|
|
@ -133,7 +133,7 @@ export interface CustomConfig {
|
||||||
|
|
||||||
alwaysTranscodeOriginalResolution: boolean
|
alwaysTranscodeOriginalResolution: boolean
|
||||||
|
|
||||||
webtorrent: {
|
webVideos: {
|
||||||
enabled: boolean
|
enabled: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -140,7 +140,7 @@ export interface ServerConfig {
|
||||||
enabled: boolean
|
enabled: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
webtorrent: {
|
web_videos: {
|
||||||
enabled: boolean
|
enabled: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -142,7 +142,7 @@ export class ConfigCommand extends AbstractCommand {
|
||||||
|
|
||||||
resolutions: ConfigCommand.getCustomConfigResolutions(true, with0p),
|
resolutions: ConfigCommand.getCustomConfigResolutions(true, with0p),
|
||||||
|
|
||||||
webtorrent: {
|
webVideos: {
|
||||||
enabled: webVideo
|
enabled: webVideo
|
||||||
},
|
},
|
||||||
hls: {
|
hls: {
|
||||||
|
@ -169,7 +169,7 @@ export class ConfigCommand extends AbstractCommand {
|
||||||
'240p': true
|
'240p': true
|
||||||
},
|
},
|
||||||
|
|
||||||
webtorrent: {
|
webVideos: {
|
||||||
enabled: webVideo
|
enabled: webVideo
|
||||||
},
|
},
|
||||||
hls: {
|
hls: {
|
||||||
|
@ -424,7 +424,7 @@ export class ConfigCommand extends AbstractCommand {
|
||||||
'2160p': false
|
'2160p': false
|
||||||
},
|
},
|
||||||
alwaysTranscodeOriginalResolution: true,
|
alwaysTranscodeOriginalResolution: true,
|
||||||
webtorrent: {
|
webVideos: {
|
||||||
enabled: true
|
enabled: true
|
||||||
},
|
},
|
||||||
hls: {
|
hls: {
|
||||||
|
|
|
@ -7768,7 +7768,7 @@ components:
|
||||||
properties:
|
properties:
|
||||||
enabled:
|
enabled:
|
||||||
type: boolean
|
type: boolean
|
||||||
webtorrent:
|
web_videos:
|
||||||
type: object
|
type: object
|
||||||
properties:
|
properties:
|
||||||
enabled:
|
enabled:
|
||||||
|
@ -8134,7 +8134,7 @@ components:
|
||||||
type: boolean
|
type: boolean
|
||||||
2160p:
|
2160p:
|
||||||
type: boolean
|
type: boolean
|
||||||
webtorrent:
|
web_videos:
|
||||||
type: object
|
type: object
|
||||||
description: Web Video specific settings
|
description: Web Video specific settings
|
||||||
properties:
|
properties:
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#
|
#
|
||||||
# This file will be read by node-config
|
# This file will be read by node-config
|
||||||
# See https://github.com/node-config/node-config/wiki/Environment-Variables#custom-environment-variables
|
# See https://github.com/node-config/node-config/wiki/Environment-Variables#custom-environment-variables
|
||||||
#
|
#
|
||||||
|
|
||||||
webserver:
|
webserver:
|
||||||
hostname: "PEERTUBE_WEBSERVER_HOSTNAME"
|
hostname: "PEERTUBE_WEBSERVER_HOSTNAME"
|
||||||
|
@ -177,9 +177,9 @@ transcoding:
|
||||||
2160p:
|
2160p:
|
||||||
__name: "PEERTUBE_TRANSCODING_2160P"
|
__name: "PEERTUBE_TRANSCODING_2160P"
|
||||||
__format: "json"
|
__format: "json"
|
||||||
webtorrent:
|
web_videos:
|
||||||
enabled:
|
enabled:
|
||||||
__name: "PEERTUBE_TRANSCODING_WEBTORRENT_ENABLED"
|
__name: "PEERTUBE_TRANSCODING_WEB_VIDEOS_ENABLED"
|
||||||
__format: "json"
|
__format: "json"
|
||||||
hls:
|
hls:
|
||||||
enabled:
|
enabled:
|
||||||
|
|
Loading…
Reference in New Issue