mirror of https://github.com/Chocobozzz/PeerTube
Remove difficult to maintain config update method
parent
5ef0430dfb
commit
817f754c22
|
@ -162,3 +162,7 @@ open_telemetry:
|
||||||
metrics:
|
metrics:
|
||||||
prometheus_exporter:
|
prometheus_exporter:
|
||||||
port: 9092
|
port: 9092
|
||||||
|
|
||||||
|
search:
|
||||||
|
search_index:
|
||||||
|
url: 'https://search.joinpeertube.org/'
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import merge from 'lodash-es/merge.js'
|
|
||||||
import { About, ActorImageType, ActorImageType_Type, CustomConfig, HttpStatusCode, ServerConfig } from '@peertube/peertube-models'
|
import { About, ActorImageType, ActorImageType_Type, CustomConfig, HttpStatusCode, ServerConfig } from '@peertube/peertube-models'
|
||||||
import { DeepPartial } from '@peertube/peertube-typescript-utils'
|
import { DeepPartial } from '@peertube/peertube-typescript-utils'
|
||||||
|
import merge from 'lodash-es/merge.js'
|
||||||
import { AbstractCommand, OverrideCommandOptions } from '../shared/abstract-command.js'
|
import { AbstractCommand, OverrideCommandOptions } from '../shared/abstract-command.js'
|
||||||
|
|
||||||
export class ConfigCommand extends AbstractCommand {
|
export class ConfigCommand extends AbstractCommand {
|
||||||
|
@ -43,7 +43,7 @@ export class ConfigCommand extends AbstractCommand {
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
|
|
||||||
enableSignup (requiresApproval: boolean, limit = -1) {
|
enableSignup (requiresApproval: boolean, limit = -1) {
|
||||||
return this.updateExistingSubConfig({
|
return this.updateExistingConfig({
|
||||||
newConfig: {
|
newConfig: {
|
||||||
signup: {
|
signup: {
|
||||||
enabled: true,
|
enabled: true,
|
||||||
|
@ -65,7 +65,7 @@ export class ConfigCommand extends AbstractCommand {
|
||||||
}
|
}
|
||||||
|
|
||||||
private setVideoImportsEnabled (enabled: boolean) {
|
private setVideoImportsEnabled (enabled: boolean) {
|
||||||
return this.updateExistingSubConfig({
|
return this.updateExistingConfig({
|
||||||
newConfig: {
|
newConfig: {
|
||||||
import: {
|
import: {
|
||||||
videos: {
|
videos: {
|
||||||
|
@ -93,7 +93,7 @@ export class ConfigCommand extends AbstractCommand {
|
||||||
}
|
}
|
||||||
|
|
||||||
private setFileUpdateEnabled (enabled: boolean) {
|
private setFileUpdateEnabled (enabled: boolean) {
|
||||||
return this.updateExistingSubConfig({
|
return this.updateExistingConfig({
|
||||||
newConfig: {
|
newConfig: {
|
||||||
videoFile: {
|
videoFile: {
|
||||||
update: {
|
update: {
|
||||||
|
@ -107,7 +107,7 @@ export class ConfigCommand extends AbstractCommand {
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
|
|
||||||
keepSourceFile () {
|
keepSourceFile () {
|
||||||
return this.updateExistingSubConfig({
|
return this.updateExistingConfig({
|
||||||
newConfig: {
|
newConfig: {
|
||||||
transcoding: {
|
transcoding: {
|
||||||
originalFile: {
|
originalFile: {
|
||||||
|
@ -128,7 +128,7 @@ export class ConfigCommand extends AbstractCommand {
|
||||||
}
|
}
|
||||||
|
|
||||||
private setChannelSyncEnabled (enabled: boolean) {
|
private setChannelSyncEnabled (enabled: boolean) {
|
||||||
return this.updateExistingSubConfig({
|
return this.updateExistingConfig({
|
||||||
newConfig: {
|
newConfig: {
|
||||||
import: {
|
import: {
|
||||||
videoChannelSynchronization: {
|
videoChannelSynchronization: {
|
||||||
|
@ -150,7 +150,7 @@ export class ConfigCommand extends AbstractCommand {
|
||||||
}
|
}
|
||||||
|
|
||||||
private setAutoblacklistEnabled (enabled: boolean) {
|
private setAutoblacklistEnabled (enabled: boolean) {
|
||||||
return this.updateExistingSubConfig({
|
return this.updateExistingConfig({
|
||||||
newConfig: {
|
newConfig: {
|
||||||
autoBlacklist: {
|
autoBlacklist: {
|
||||||
videos: {
|
videos: {
|
||||||
|
@ -174,7 +174,7 @@ export class ConfigCommand extends AbstractCommand {
|
||||||
}
|
}
|
||||||
|
|
||||||
private setUserImportEnabled (enabled: boolean) {
|
private setUserImportEnabled (enabled: boolean) {
|
||||||
return this.updateExistingSubConfig({
|
return this.updateExistingConfig({
|
||||||
newConfig: {
|
newConfig: {
|
||||||
import: {
|
import: {
|
||||||
users: {
|
users: {
|
||||||
|
@ -196,7 +196,7 @@ export class ConfigCommand extends AbstractCommand {
|
||||||
}
|
}
|
||||||
|
|
||||||
private setUserExportEnabled (enabled: boolean) {
|
private setUserExportEnabled (enabled: boolean) {
|
||||||
return this.updateExistingSubConfig({
|
return this.updateExistingConfig({
|
||||||
newConfig: {
|
newConfig: {
|
||||||
export: {
|
export: {
|
||||||
users: {
|
users: {
|
||||||
|
@ -216,7 +216,7 @@ export class ConfigCommand extends AbstractCommand {
|
||||||
} = {}) {
|
} = {}) {
|
||||||
const { allowReplay, transcoding, resolutions = 'max' } = options
|
const { allowReplay, transcoding, resolutions = 'max' } = options
|
||||||
|
|
||||||
return this.updateExistingSubConfig({
|
return this.updateExistingConfig({
|
||||||
newConfig: {
|
newConfig: {
|
||||||
live: {
|
live: {
|
||||||
enabled: true,
|
enabled: true,
|
||||||
|
@ -231,7 +231,7 @@ export class ConfigCommand extends AbstractCommand {
|
||||||
}
|
}
|
||||||
|
|
||||||
disableTranscoding () {
|
disableTranscoding () {
|
||||||
return this.updateExistingSubConfig({
|
return this.updateExistingConfig({
|
||||||
newConfig: {
|
newConfig: {
|
||||||
transcoding: {
|
transcoding: {
|
||||||
enabled: false
|
enabled: false
|
||||||
|
@ -251,7 +251,7 @@ export class ConfigCommand extends AbstractCommand {
|
||||||
} = {}) {
|
} = {}) {
|
||||||
const { webVideo = true, hls = true, with0p = false, keepOriginal = false } = options
|
const { webVideo = true, hls = true, with0p = false, keepOriginal = false } = options
|
||||||
|
|
||||||
return this.updateExistingSubConfig({
|
return this.updateExistingConfig({
|
||||||
newConfig: {
|
newConfig: {
|
||||||
transcoding: {
|
transcoding: {
|
||||||
enabled: true,
|
enabled: true,
|
||||||
|
@ -282,7 +282,7 @@ export class ConfigCommand extends AbstractCommand {
|
||||||
} = {}) {
|
} = {}) {
|
||||||
const { webVideo = true, hls = true, keepOriginal = false } = options
|
const { webVideo = true, hls = true, keepOriginal = false } = options
|
||||||
|
|
||||||
return this.updateExistingSubConfig({
|
return this.updateExistingConfig({
|
||||||
newConfig: {
|
newConfig: {
|
||||||
transcoding: {
|
transcoding: {
|
||||||
enabled: true,
|
enabled: true,
|
||||||
|
@ -311,7 +311,7 @@ export class ConfigCommand extends AbstractCommand {
|
||||||
}
|
}
|
||||||
|
|
||||||
enableRemoteTranscoding () {
|
enableRemoteTranscoding () {
|
||||||
return this.updateExistingSubConfig({
|
return this.updateExistingConfig({
|
||||||
newConfig: {
|
newConfig: {
|
||||||
transcoding: {
|
transcoding: {
|
||||||
remoteRunners: {
|
remoteRunners: {
|
||||||
|
@ -330,7 +330,7 @@ export class ConfigCommand extends AbstractCommand {
|
||||||
}
|
}
|
||||||
|
|
||||||
enableRemoteStudio () {
|
enableRemoteStudio () {
|
||||||
return this.updateExistingSubConfig({
|
return this.updateExistingConfig({
|
||||||
newConfig: {
|
newConfig: {
|
||||||
videoStudio: {
|
videoStudio: {
|
||||||
remoteRunners: {
|
remoteRunners: {
|
||||||
|
@ -344,7 +344,7 @@ export class ConfigCommand extends AbstractCommand {
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
|
|
||||||
enableStudio () {
|
enableStudio () {
|
||||||
return this.updateExistingSubConfig({
|
return this.updateExistingConfig({
|
||||||
newConfig: {
|
newConfig: {
|
||||||
videoStudio: {
|
videoStudio: {
|
||||||
enabled: true
|
enabled: true
|
||||||
|
@ -480,259 +480,11 @@ export class ConfigCommand extends AbstractCommand {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
async updateExistingSubConfig (options: OverrideCommandOptions & {
|
async updateExistingConfig (options: OverrideCommandOptions & {
|
||||||
newConfig: DeepPartial<CustomConfig>
|
newConfig: DeepPartial<CustomConfig>
|
||||||
}) {
|
}) {
|
||||||
const existing = await this.getCustomConfig({ ...options, expectedStatus: HttpStatusCode.OK_200 })
|
const existing = await this.getCustomConfig({ ...options, expectedStatus: HttpStatusCode.OK_200 })
|
||||||
|
|
||||||
return this.updateCustomConfig({ ...options, newCustomConfig: merge({}, existing, options.newConfig) })
|
return this.updateCustomConfig({ ...options, newCustomConfig: merge({}, existing, options.newConfig) })
|
||||||
}
|
}
|
||||||
|
|
||||||
updateCustomSubConfig (options: OverrideCommandOptions & {
|
|
||||||
newConfig: DeepPartial<CustomConfig>
|
|
||||||
}) {
|
|
||||||
const newCustomConfig: CustomConfig = {
|
|
||||||
instance: {
|
|
||||||
name: 'PeerTube updated',
|
|
||||||
shortDescription: 'my short description',
|
|
||||||
description: 'my super description',
|
|
||||||
terms: 'my super terms',
|
|
||||||
codeOfConduct: 'my super coc',
|
|
||||||
|
|
||||||
creationReason: 'my super creation reason',
|
|
||||||
moderationInformation: 'my super moderation information',
|
|
||||||
administrator: 'Kuja',
|
|
||||||
maintenanceLifetime: 'forever',
|
|
||||||
businessModel: 'my super business model',
|
|
||||||
hardwareInformation: '2vCore 3GB RAM',
|
|
||||||
|
|
||||||
languages: [ 'en', 'es' ],
|
|
||||||
categories: [ 1, 2 ],
|
|
||||||
|
|
||||||
isNSFW: true,
|
|
||||||
defaultNSFWPolicy: 'blur',
|
|
||||||
|
|
||||||
defaultClientRoute: '/videos/recently-added',
|
|
||||||
|
|
||||||
customizations: {
|
|
||||||
javascript: 'alert("coucou")',
|
|
||||||
css: 'body { background-color: red; }'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
theme: {
|
|
||||||
default: 'default'
|
|
||||||
},
|
|
||||||
services: {
|
|
||||||
twitter: {
|
|
||||||
username: '@MySuperUsername'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
client: {
|
|
||||||
videos: {
|
|
||||||
miniature: {
|
|
||||||
preferAuthorDisplayName: false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
menu: {
|
|
||||||
login: {
|
|
||||||
redirectOnSingleExternalAuth: false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
cache: {
|
|
||||||
previews: {
|
|
||||||
size: 2
|
|
||||||
},
|
|
||||||
captions: {
|
|
||||||
size: 3
|
|
||||||
},
|
|
||||||
torrents: {
|
|
||||||
size: 4
|
|
||||||
},
|
|
||||||
storyboards: {
|
|
||||||
size: 5
|
|
||||||
}
|
|
||||||
},
|
|
||||||
signup: {
|
|
||||||
enabled: false,
|
|
||||||
limit: 5,
|
|
||||||
requiresApproval: true,
|
|
||||||
requiresEmailVerification: false,
|
|
||||||
minimumAge: 16
|
|
||||||
},
|
|
||||||
admin: {
|
|
||||||
email: 'superadmin1@example.com'
|
|
||||||
},
|
|
||||||
contactForm: {
|
|
||||||
enabled: true
|
|
||||||
},
|
|
||||||
user: {
|
|
||||||
history: {
|
|
||||||
videos: {
|
|
||||||
enabled: true
|
|
||||||
}
|
|
||||||
},
|
|
||||||
videoQuota: 5242881,
|
|
||||||
videoQuotaDaily: 318742,
|
|
||||||
defaultChannelName: 'Main $1 channel'
|
|
||||||
},
|
|
||||||
videoChannels: {
|
|
||||||
maxPerUser: 20
|
|
||||||
},
|
|
||||||
transcoding: {
|
|
||||||
enabled: true,
|
|
||||||
originalFile: {
|
|
||||||
keep: false
|
|
||||||
},
|
|
||||||
remoteRunners: {
|
|
||||||
enabled: false
|
|
||||||
},
|
|
||||||
allowAdditionalExtensions: true,
|
|
||||||
allowAudioFiles: true,
|
|
||||||
threads: 1,
|
|
||||||
concurrency: 3,
|
|
||||||
profile: 'default',
|
|
||||||
resolutions: {
|
|
||||||
'0p': false,
|
|
||||||
'144p': false,
|
|
||||||
'240p': false,
|
|
||||||
'360p': true,
|
|
||||||
'480p': true,
|
|
||||||
'720p': false,
|
|
||||||
'1080p': false,
|
|
||||||
'1440p': false,
|
|
||||||
'2160p': false
|
|
||||||
},
|
|
||||||
alwaysTranscodeOriginalResolution: true,
|
|
||||||
webVideos: {
|
|
||||||
enabled: true
|
|
||||||
},
|
|
||||||
hls: {
|
|
||||||
enabled: false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
live: {
|
|
||||||
enabled: true,
|
|
||||||
allowReplay: false,
|
|
||||||
latencySetting: {
|
|
||||||
enabled: false
|
|
||||||
},
|
|
||||||
maxDuration: -1,
|
|
||||||
maxInstanceLives: -1,
|
|
||||||
maxUserLives: 50,
|
|
||||||
transcoding: {
|
|
||||||
enabled: true,
|
|
||||||
remoteRunners: {
|
|
||||||
enabled: false
|
|
||||||
},
|
|
||||||
threads: 4,
|
|
||||||
profile: 'default',
|
|
||||||
resolutions: {
|
|
||||||
'144p': true,
|
|
||||||
'240p': true,
|
|
||||||
'360p': true,
|
|
||||||
'480p': true,
|
|
||||||
'720p': true,
|
|
||||||
'1080p': true,
|
|
||||||
'1440p': true,
|
|
||||||
'2160p': true
|
|
||||||
},
|
|
||||||
alwaysTranscodeOriginalResolution: true
|
|
||||||
}
|
|
||||||
},
|
|
||||||
videoStudio: {
|
|
||||||
enabled: false,
|
|
||||||
remoteRunners: {
|
|
||||||
enabled: false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
videoFile: {
|
|
||||||
update: {
|
|
||||||
enabled: false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
import: {
|
|
||||||
videos: {
|
|
||||||
concurrency: 3,
|
|
||||||
http: {
|
|
||||||
enabled: false
|
|
||||||
},
|
|
||||||
torrent: {
|
|
||||||
enabled: false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
videoChannelSynchronization: {
|
|
||||||
enabled: false,
|
|
||||||
maxPerUser: 10
|
|
||||||
},
|
|
||||||
users: {
|
|
||||||
enabled: true
|
|
||||||
}
|
|
||||||
},
|
|
||||||
export: {
|
|
||||||
users: {
|
|
||||||
enabled: true,
|
|
||||||
maxUserVideoQuota: 5242881,
|
|
||||||
exportExpiration: 1000 * 3600
|
|
||||||
}
|
|
||||||
},
|
|
||||||
trending: {
|
|
||||||
videos: {
|
|
||||||
algorithms: {
|
|
||||||
enabled: [ 'hot', 'most-viewed', 'most-liked' ],
|
|
||||||
default: 'hot'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
autoBlacklist: {
|
|
||||||
videos: {
|
|
||||||
ofUsers: {
|
|
||||||
enabled: false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
followers: {
|
|
||||||
instance: {
|
|
||||||
enabled: true,
|
|
||||||
manualApproval: false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
followings: {
|
|
||||||
instance: {
|
|
||||||
autoFollowBack: {
|
|
||||||
enabled: false
|
|
||||||
},
|
|
||||||
autoFollowIndex: {
|
|
||||||
indexUrl: 'https://instances.joinpeertube.org/api/v1/instances/hosts',
|
|
||||||
enabled: false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
broadcastMessage: {
|
|
||||||
enabled: true,
|
|
||||||
level: 'warning',
|
|
||||||
message: 'hello',
|
|
||||||
dismissable: true
|
|
||||||
},
|
|
||||||
search: {
|
|
||||||
remoteUri: {
|
|
||||||
users: true,
|
|
||||||
anonymous: true
|
|
||||||
},
|
|
||||||
searchIndex: {
|
|
||||||
enabled: true,
|
|
||||||
url: 'https://search.joinpeertube.org',
|
|
||||||
disableLocalSearch: true,
|
|
||||||
isDefaultSearch: true
|
|
||||||
}
|
|
||||||
},
|
|
||||||
storyboards: {
|
|
||||||
enabled: true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
merge(newCustomConfig, options.newConfig)
|
|
||||||
|
|
||||||
return this.updateCustomConfig({ ...options, newCustomConfig })
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,20 +1,20 @@
|
||||||
/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
|
/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
|
||||||
|
|
||||||
import { expect } from 'chai'
|
|
||||||
import { omit } from '@peertube/peertube-core-utils'
|
import { omit } from '@peertube/peertube-core-utils'
|
||||||
import { HttpStatusCode, LiveVideoLatencyMode, VideoCreateResult, VideoPrivacy } from '@peertube/peertube-models'
|
import { HttpStatusCode, LiveVideoLatencyMode, VideoCreateResult, VideoPrivacy } from '@peertube/peertube-models'
|
||||||
import { buildAbsoluteFixturePath } from '@peertube/peertube-node-utils'
|
import { buildAbsoluteFixturePath } from '@peertube/peertube-node-utils'
|
||||||
import {
|
import {
|
||||||
|
LiveCommand,
|
||||||
|
PeerTubeServer,
|
||||||
cleanupTests,
|
cleanupTests,
|
||||||
createSingleServer,
|
createSingleServer,
|
||||||
LiveCommand,
|
|
||||||
makePostBodyRequest,
|
makePostBodyRequest,
|
||||||
makeUploadRequest,
|
makeUploadRequest,
|
||||||
PeerTubeServer,
|
|
||||||
sendRTMPStream,
|
sendRTMPStream,
|
||||||
setAccessTokensToServers,
|
setAccessTokensToServers,
|
||||||
stopFfmpeg
|
stopFfmpeg
|
||||||
} from '@peertube/peertube-server-commands'
|
} from '@peertube/peertube-server-commands'
|
||||||
|
import { expect } from 'chai'
|
||||||
|
|
||||||
describe('Test video lives API validator', function () {
|
describe('Test video lives API validator', function () {
|
||||||
const path = '/api/v1/videos/live'
|
const path = '/api/v1/videos/live'
|
||||||
|
@ -34,7 +34,8 @@ describe('Test video lives API validator', function () {
|
||||||
|
|
||||||
await setAccessTokensToServers([ server ])
|
await setAccessTokensToServers([ server ])
|
||||||
|
|
||||||
await server.config.updateCustomSubConfig({
|
await server.config.enableMinimumTranscoding()
|
||||||
|
await server.config.updateExistingConfig({
|
||||||
newConfig: {
|
newConfig: {
|
||||||
live: {
|
live: {
|
||||||
enabled: true,
|
enabled: true,
|
||||||
|
@ -85,7 +86,7 @@ describe('Test video lives API validator', function () {
|
||||||
channelId,
|
channelId,
|
||||||
saveReplay: false,
|
saveReplay: false,
|
||||||
replaySettings: undefined,
|
replaySettings: undefined,
|
||||||
permanentLive: false,
|
permanentLive: true,
|
||||||
latencyMode: LiveVideoLatencyMode.DEFAULT
|
latencyMode: LiveVideoLatencyMode.DEFAULT
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -246,7 +247,7 @@ describe('Test video lives API validator', function () {
|
||||||
})
|
})
|
||||||
|
|
||||||
it('Should forbid if live is disabled', async function () {
|
it('Should forbid if live is disabled', async function () {
|
||||||
await server.config.updateCustomSubConfig({
|
await server.config.updateExistingConfig({
|
||||||
newConfig: {
|
newConfig: {
|
||||||
live: {
|
live: {
|
||||||
enabled: false
|
enabled: false
|
||||||
|
@ -266,14 +267,7 @@ describe('Test video lives API validator', function () {
|
||||||
it('Should forbid to save replay if not enabled by the admin', async function () {
|
it('Should forbid to save replay if not enabled by the admin', async function () {
|
||||||
const fields = { ...baseCorrectParams, saveReplay: true, replaySettings: { privacy: VideoPrivacy.PUBLIC } }
|
const fields = { ...baseCorrectParams, saveReplay: true, replaySettings: { privacy: VideoPrivacy.PUBLIC } }
|
||||||
|
|
||||||
await server.config.updateCustomSubConfig({
|
await server.config.enableLive({ allowReplay: false, transcoding: false })
|
||||||
newConfig: {
|
|
||||||
live: {
|
|
||||||
enabled: true,
|
|
||||||
allowReplay: false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
await makePostBodyRequest({
|
await makePostBodyRequest({
|
||||||
url: server.url,
|
url: server.url,
|
||||||
|
@ -287,14 +281,7 @@ describe('Test video lives API validator', function () {
|
||||||
it('Should allow to save replay if enabled by the admin', async function () {
|
it('Should allow to save replay if enabled by the admin', async function () {
|
||||||
const fields = { ...baseCorrectParams, saveReplay: true, replaySettings: { privacy: VideoPrivacy.PUBLIC } }
|
const fields = { ...baseCorrectParams, saveReplay: true, replaySettings: { privacy: VideoPrivacy.PUBLIC } }
|
||||||
|
|
||||||
await server.config.updateCustomSubConfig({
|
await server.config.enableLive({ allowReplay: true, transcoding: false })
|
||||||
newConfig: {
|
|
||||||
live: {
|
|
||||||
enabled: true,
|
|
||||||
allowReplay: true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
await makePostBodyRequest({
|
await makePostBodyRequest({
|
||||||
url: server.url,
|
url: server.url,
|
||||||
|
@ -306,7 +293,7 @@ describe('Test video lives API validator', function () {
|
||||||
})
|
})
|
||||||
|
|
||||||
it('Should not allow live if max instance lives is reached', async function () {
|
it('Should not allow live if max instance lives is reached', async function () {
|
||||||
await server.config.updateCustomSubConfig({
|
await server.config.updateExistingConfig({
|
||||||
newConfig: {
|
newConfig: {
|
||||||
live: {
|
live: {
|
||||||
enabled: true,
|
enabled: true,
|
||||||
|
@ -325,7 +312,7 @@ describe('Test video lives API validator', function () {
|
||||||
})
|
})
|
||||||
|
|
||||||
it('Should not allow live if max user lives is reached', async function () {
|
it('Should not allow live if max user lives is reached', async function () {
|
||||||
await server.config.updateCustomSubConfig({
|
await server.config.updateExistingConfig({
|
||||||
newConfig: {
|
newConfig: {
|
||||||
live: {
|
live: {
|
||||||
enabled: true,
|
enabled: true,
|
||||||
|
@ -479,14 +466,7 @@ describe('Test video lives API validator', function () {
|
||||||
})
|
})
|
||||||
|
|
||||||
it('Should fail with save replay enabled but without replay settings', async function () {
|
it('Should fail with save replay enabled but without replay settings', async function () {
|
||||||
await server.config.updateCustomSubConfig({
|
await server.config.enableLive({ allowReplay: true, transcoding: false })
|
||||||
newConfig: {
|
|
||||||
live: {
|
|
||||||
enabled: true,
|
|
||||||
allowReplay: true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
const fields = { saveReplay: true }
|
const fields = { saveReplay: true }
|
||||||
|
|
||||||
|
@ -521,19 +501,12 @@ describe('Test video lives API validator', function () {
|
||||||
})
|
})
|
||||||
|
|
||||||
it('Should fail to update replay status if replay is not allowed on the instance', async function () {
|
it('Should fail to update replay status if replay is not allowed on the instance', async function () {
|
||||||
await server.config.updateCustomSubConfig({
|
await server.config.enableLive({ allowReplay: false, transcoding: false })
|
||||||
newConfig: {
|
|
||||||
live: {
|
|
||||||
enabled: true,
|
|
||||||
allowReplay: false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
await command.update({ videoId: video.id, fields: { saveReplay: true }, expectedStatus: HttpStatusCode.FORBIDDEN_403 })
|
await command.update({ videoId: video.id, fields: { saveReplay: true }, expectedStatus: HttpStatusCode.FORBIDDEN_403 })
|
||||||
})
|
})
|
||||||
|
|
||||||
it('Should fail to update a live if it has already started', async function () {
|
it('Should succeed to live attributes if it has already started', async function () {
|
||||||
this.timeout(40000)
|
this.timeout(40000)
|
||||||
|
|
||||||
const live = await command.get({ videoId: video.id })
|
const live = await command.get({ videoId: video.id })
|
||||||
|
@ -541,7 +514,7 @@ describe('Test video lives API validator', function () {
|
||||||
const ffmpegCommand = sendRTMPStream({ rtmpBaseUrl: live.rtmpUrl, streamKey: live.streamKey })
|
const ffmpegCommand = sendRTMPStream({ rtmpBaseUrl: live.rtmpUrl, streamKey: live.streamKey })
|
||||||
|
|
||||||
await command.waitUntilPublished({ videoId: video.id })
|
await command.waitUntilPublished({ videoId: video.id })
|
||||||
await command.update({ videoId: video.id, fields: {}, expectedStatus: HttpStatusCode.BAD_REQUEST_400 })
|
await command.update({ videoId: video.id, fields: { permanentLive: false }, expectedStatus: HttpStatusCode.BAD_REQUEST_400 })
|
||||||
|
|
||||||
await stopFfmpeg(ffmpegCommand)
|
await stopFfmpeg(ffmpegCommand)
|
||||||
})
|
})
|
||||||
|
|
|
@ -152,7 +152,7 @@ describe('Test registrations API validators', function () {
|
||||||
it('Should fail on a server with registration disabled', async function () {
|
it('Should fail on a server with registration disabled', async function () {
|
||||||
this.timeout(60000)
|
this.timeout(60000)
|
||||||
|
|
||||||
await server.config.updateExistingSubConfig({
|
await server.config.updateExistingConfig({
|
||||||
newConfig: {
|
newConfig: {
|
||||||
signup: {
|
signup: {
|
||||||
enabled: false
|
enabled: false
|
||||||
|
|
|
@ -11,7 +11,7 @@ import {
|
||||||
} from '@peertube/peertube-server-commands'
|
} from '@peertube/peertube-server-commands'
|
||||||
|
|
||||||
function updateSearchIndex (server: PeerTubeServer, enabled: boolean, disableLocalSearch = false) {
|
function updateSearchIndex (server: PeerTubeServer, enabled: boolean, disableLocalSearch = false) {
|
||||||
return server.config.updateCustomSubConfig({
|
return server.config.updateExistingConfig({
|
||||||
newConfig: {
|
newConfig: {
|
||||||
search: {
|
search: {
|
||||||
searchIndex: {
|
searchIndex: {
|
||||||
|
|
|
@ -86,7 +86,7 @@ describe('Test user export API validators', function () {
|
||||||
it('Should fail if user quota is too big', async function () {
|
it('Should fail if user quota is too big', async function () {
|
||||||
const { videoQuotaUsed } = await server.users.getMyQuotaUsed()
|
const { videoQuotaUsed } = await server.users.getMyQuotaUsed()
|
||||||
|
|
||||||
await server.config.updateExistingSubConfig({
|
await server.config.updateExistingConfig({
|
||||||
newConfig: {
|
newConfig: {
|
||||||
export: {
|
export: {
|
||||||
users: { maxUserVideoQuota: videoQuotaUsed - 1 }
|
users: { maxUserVideoQuota: videoQuotaUsed - 1 }
|
||||||
|
@ -101,7 +101,7 @@ describe('Test user export API validators', function () {
|
||||||
await server.userExports.waitForCreation({ userId: rootId })
|
await server.userExports.waitForCreation({ userId: rootId })
|
||||||
await server.userExports.deleteAllArchives({ userId: rootId })
|
await server.userExports.deleteAllArchives({ userId: rootId })
|
||||||
|
|
||||||
await server.config.updateExistingSubConfig({
|
await server.config.updateExistingConfig({
|
||||||
newConfig: {
|
newConfig: {
|
||||||
export: {
|
export: {
|
||||||
users: { maxUserVideoQuota: 1000 * 1000 * 1000 * 1000 }
|
users: { maxUserVideoQuota: 1000 * 1000 * 1000 * 1000 }
|
||||||
|
|
|
@ -36,7 +36,7 @@ describe('Test video channel sync API validator', () => {
|
||||||
async function withMaxSyncsPerUser<T> (maxSync: number, callback: () => Promise<T>): Promise<void> {
|
async function withMaxSyncsPerUser<T> (maxSync: number, callback: () => Promise<T>): Promise<void> {
|
||||||
const origConfig = await server.config.getCustomConfig()
|
const origConfig = await server.config.getCustomConfig()
|
||||||
|
|
||||||
await server.config.updateExistingSubConfig({
|
await server.config.updateExistingConfig({
|
||||||
newConfig: {
|
newConfig: {
|
||||||
import: {
|
import: {
|
||||||
videoChannelSynchronization: {
|
videoChannelSynchronization: {
|
||||||
|
|
|
@ -299,7 +299,7 @@ describe('Test video imports API validator', function () {
|
||||||
})
|
})
|
||||||
|
|
||||||
it('Should forbid to import http videos', async function () {
|
it('Should forbid to import http videos', async function () {
|
||||||
await server.config.updateCustomSubConfig({
|
await server.config.updateExistingConfig({
|
||||||
newConfig: {
|
newConfig: {
|
||||||
import: {
|
import: {
|
||||||
videos: {
|
videos: {
|
||||||
|
@ -324,7 +324,7 @@ describe('Test video imports API validator', function () {
|
||||||
})
|
})
|
||||||
|
|
||||||
it('Should forbid to import torrent videos', async function () {
|
it('Should forbid to import torrent videos', async function () {
|
||||||
await server.config.updateCustomSubConfig({
|
await server.config.updateExistingConfig({
|
||||||
newConfig: {
|
newConfig: {
|
||||||
import: {
|
import: {
|
||||||
videos: {
|
videos: {
|
||||||
|
|
|
@ -36,7 +36,7 @@ describe('Test video passwords validator', function () {
|
||||||
|
|
||||||
await setAccessTokensToServers([ server ])
|
await setAccessTokensToServers([ server ])
|
||||||
|
|
||||||
await server.config.updateCustomSubConfig({
|
await server.config.updateExistingConfig({
|
||||||
newConfig: {
|
newConfig: {
|
||||||
live: {
|
live: {
|
||||||
enabled: true,
|
enabled: true,
|
||||||
|
|
|
@ -41,7 +41,7 @@ describe('Test video studio API validator', function () {
|
||||||
describe('Config settings', function () {
|
describe('Config settings', function () {
|
||||||
|
|
||||||
it('Should fail if studio is disabled', async function () {
|
it('Should fail if studio is disabled', async function () {
|
||||||
await server.config.updateExistingSubConfig({
|
await server.config.updateExistingConfig({
|
||||||
newConfig: {
|
newConfig: {
|
||||||
videoStudio: {
|
videoStudio: {
|
||||||
enabled: false
|
enabled: false
|
||||||
|
@ -57,7 +57,7 @@ describe('Test video studio API validator', function () {
|
||||||
})
|
})
|
||||||
|
|
||||||
it('Should fail to enable studio if transcoding is disabled', async function () {
|
it('Should fail to enable studio if transcoding is disabled', async function () {
|
||||||
await server.config.updateExistingSubConfig({
|
await server.config.updateExistingConfig({
|
||||||
newConfig: {
|
newConfig: {
|
||||||
videoStudio: {
|
videoStudio: {
|
||||||
enabled: true
|
enabled: true
|
||||||
|
@ -71,7 +71,7 @@ describe('Test video studio API validator', function () {
|
||||||
})
|
})
|
||||||
|
|
||||||
it('Should succeed to enable video studio', async function () {
|
it('Should succeed to enable video studio', async function () {
|
||||||
await server.config.updateExistingSubConfig({
|
await server.config.updateExistingConfig({
|
||||||
newConfig: {
|
newConfig: {
|
||||||
videoStudio: {
|
videoStudio: {
|
||||||
enabled: true
|
enabled: true
|
||||||
|
|
|
@ -1,12 +1,11 @@
|
||||||
/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
|
/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
|
||||||
|
|
||||||
import { expect } from 'chai'
|
|
||||||
import { wait } from '@peertube/peertube-core-utils'
|
import { wait } from '@peertube/peertube-core-utils'
|
||||||
import { LiveVideoError, UserVideoQuota, VideoPrivacy } from '@peertube/peertube-models'
|
import { LiveVideoError, UserVideoQuota, VideoPrivacy } from '@peertube/peertube-models'
|
||||||
import {
|
import {
|
||||||
|
PeerTubeServer,
|
||||||
cleanupTests, createMultipleServers,
|
cleanupTests, createMultipleServers,
|
||||||
doubleFollow,
|
doubleFollow,
|
||||||
PeerTubeServer,
|
|
||||||
setAccessTokensToServers,
|
setAccessTokensToServers,
|
||||||
setDefaultVideoChannel,
|
setDefaultVideoChannel,
|
||||||
stopFfmpeg,
|
stopFfmpeg,
|
||||||
|
@ -14,6 +13,7 @@ import {
|
||||||
waitUntilLiveReplacedByReplayOnAllServers,
|
waitUntilLiveReplacedByReplayOnAllServers,
|
||||||
waitUntilLiveWaitingOnAllServers
|
waitUntilLiveWaitingOnAllServers
|
||||||
} from '@peertube/peertube-server-commands'
|
} from '@peertube/peertube-server-commands'
|
||||||
|
import { expect } from 'chai'
|
||||||
import { checkLiveCleanup } from '../../shared/live.js'
|
import { checkLiveCleanup } from '../../shared/live.js'
|
||||||
|
|
||||||
describe('Test live constraints', function () {
|
describe('Test live constraints', function () {
|
||||||
|
@ -65,17 +65,8 @@ describe('Test live constraints', function () {
|
||||||
await setAccessTokensToServers(servers)
|
await setAccessTokensToServers(servers)
|
||||||
await setDefaultVideoChannel(servers)
|
await setDefaultVideoChannel(servers)
|
||||||
|
|
||||||
await servers[0].config.updateCustomSubConfig({
|
await servers[0].config.enableMinimumTranscoding()
|
||||||
newConfig: {
|
await servers[0].config.enableLive({ allowReplay: true, transcoding: false })
|
||||||
live: {
|
|
||||||
enabled: true,
|
|
||||||
allowReplay: true,
|
|
||||||
transcoding: {
|
|
||||||
enabled: false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
{
|
{
|
||||||
const res = await servers[0].users.generate('user1')
|
const res = await servers[0].users.generate('user1')
|
||||||
|
@ -203,7 +194,7 @@ describe('Test live constraints', function () {
|
||||||
it('Should have max duration limit', async function () {
|
it('Should have max duration limit', async function () {
|
||||||
this.timeout(240000)
|
this.timeout(240000)
|
||||||
|
|
||||||
await servers[0].config.updateCustomSubConfig({
|
await servers[0].config.updateExistingConfig({
|
||||||
newConfig: {
|
newConfig: {
|
||||||
live: {
|
live: {
|
||||||
enabled: true,
|
enabled: true,
|
||||||
|
|
|
@ -1,20 +1,20 @@
|
||||||
/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
|
/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
|
||||||
|
|
||||||
import { expect } from 'chai'
|
|
||||||
import { wait } from '@peertube/peertube-core-utils'
|
import { wait } from '@peertube/peertube-core-utils'
|
||||||
import { LiveVideoCreate, VideoPrivacy, VideoState, VideoStateType } from '@peertube/peertube-models'
|
import { LiveVideoCreate, VideoPrivacy, VideoState, VideoStateType } from '@peertube/peertube-models'
|
||||||
import { checkLiveCleanup } from '@tests/shared/live.js'
|
|
||||||
import {
|
import {
|
||||||
cleanupTests,
|
|
||||||
ConfigCommand,
|
ConfigCommand,
|
||||||
|
PeerTubeServer,
|
||||||
|
cleanupTests,
|
||||||
createMultipleServers,
|
createMultipleServers,
|
||||||
doubleFollow,
|
doubleFollow,
|
||||||
PeerTubeServer,
|
|
||||||
setAccessTokensToServers,
|
setAccessTokensToServers,
|
||||||
setDefaultVideoChannel,
|
setDefaultVideoChannel,
|
||||||
stopFfmpeg,
|
stopFfmpeg,
|
||||||
waitJobs
|
waitJobs
|
||||||
} from '@peertube/peertube-server-commands'
|
} from '@peertube/peertube-server-commands'
|
||||||
|
import { checkLiveCleanup } from '@tests/shared/live.js'
|
||||||
|
import { expect } from 'chai'
|
||||||
|
|
||||||
describe('Permanent live', function () {
|
describe('Permanent live', function () {
|
||||||
let servers: PeerTubeServer[] = []
|
let servers: PeerTubeServer[] = []
|
||||||
|
@ -52,7 +52,8 @@ describe('Permanent live', function () {
|
||||||
// Server 1 and server 2 follow each other
|
// Server 1 and server 2 follow each other
|
||||||
await doubleFollow(servers[0], servers[1])
|
await doubleFollow(servers[0], servers[1])
|
||||||
|
|
||||||
await servers[0].config.updateCustomSubConfig({
|
await servers[0].config.enableMinimumTranscoding()
|
||||||
|
await servers[0].config.updateExistingConfig({
|
||||||
newConfig: {
|
newConfig: {
|
||||||
live: {
|
live: {
|
||||||
enabled: true,
|
enabled: true,
|
||||||
|
@ -143,7 +144,7 @@ describe('Permanent live', function () {
|
||||||
it('Should be able to stream again in the permanent live', async function () {
|
it('Should be able to stream again in the permanent live', async function () {
|
||||||
this.timeout(60000)
|
this.timeout(60000)
|
||||||
|
|
||||||
await servers[0].config.updateCustomSubConfig({
|
await servers[0].config.updateExistingConfig({
|
||||||
newConfig: {
|
newConfig: {
|
||||||
live: {
|
live: {
|
||||||
enabled: true,
|
enabled: true,
|
||||||
|
|
|
@ -1,8 +1,7 @@
|
||||||
/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
|
/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
|
||||||
|
|
||||||
import { expect } from 'chai'
|
|
||||||
import { buildAbsoluteFixturePath } from '@peertube/peertube-node-utils'
|
|
||||||
import { VideoPrivacy } from '@peertube/peertube-models'
|
import { VideoPrivacy } from '@peertube/peertube-models'
|
||||||
|
import { buildAbsoluteFixturePath } from '@peertube/peertube-node-utils'
|
||||||
import {
|
import {
|
||||||
cleanupTests,
|
cleanupTests,
|
||||||
createSingleServer,
|
createSingleServer,
|
||||||
|
@ -14,6 +13,7 @@ import {
|
||||||
testFfmpegStreamError,
|
testFfmpegStreamError,
|
||||||
waitUntilLivePublishedOnAllServers
|
waitUntilLivePublishedOnAllServers
|
||||||
} from '@peertube/peertube-server-commands'
|
} from '@peertube/peertube-server-commands'
|
||||||
|
import { expect } from 'chai'
|
||||||
|
|
||||||
describe('Test live RTMPS', function () {
|
describe('Test live RTMPS', function () {
|
||||||
let server: PeerTubeServer
|
let server: PeerTubeServer
|
||||||
|
@ -45,17 +45,8 @@ describe('Test live RTMPS', function () {
|
||||||
await setAccessTokensToServers([ server ])
|
await setAccessTokensToServers([ server ])
|
||||||
await setDefaultVideoChannel([ server ])
|
await setDefaultVideoChannel([ server ])
|
||||||
|
|
||||||
await server.config.updateCustomSubConfig({
|
await server.config.enableMinimumTranscoding()
|
||||||
newConfig: {
|
await server.config.enableLive({ allowReplay: true, transcoding: false })
|
||||||
live: {
|
|
||||||
enabled: true,
|
|
||||||
allowReplay: true,
|
|
||||||
transcoding: {
|
|
||||||
enabled: false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
rtmpUrl = 'rtmp://' + server.hostname + ':' + server.rtmpPort + '/live'
|
rtmpUrl = 'rtmp://' + server.hostname + ':' + server.rtmpPort + '/live'
|
||||||
rtmpsUrl = 'rtmps://' + server.hostname + ':' + server.rtmpsPort + '/live'
|
rtmpsUrl = 'rtmps://' + server.hostname + ':' + server.rtmpsPort + '/live'
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
|
/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
|
||||||
|
|
||||||
import { expect } from 'chai'
|
|
||||||
import { FfmpegCommand } from 'fluent-ffmpeg'
|
|
||||||
import { wait } from '@peertube/peertube-core-utils'
|
import { wait } from '@peertube/peertube-core-utils'
|
||||||
import {
|
import {
|
||||||
HttpStatusCode,
|
HttpStatusCode,
|
||||||
|
@ -13,14 +11,13 @@ import {
|
||||||
VideoState,
|
VideoState,
|
||||||
VideoStateType
|
VideoStateType
|
||||||
} from '@peertube/peertube-models'
|
} from '@peertube/peertube-models'
|
||||||
import { checkLiveCleanup } from '@tests/shared/live.js'
|
|
||||||
import {
|
import {
|
||||||
cleanupTests,
|
|
||||||
ConfigCommand,
|
ConfigCommand,
|
||||||
|
PeerTubeServer,
|
||||||
|
cleanupTests,
|
||||||
createMultipleServers,
|
createMultipleServers,
|
||||||
doubleFollow,
|
doubleFollow,
|
||||||
findExternalSavedVideo,
|
findExternalSavedVideo,
|
||||||
PeerTubeServer,
|
|
||||||
setAccessTokensToServers,
|
setAccessTokensToServers,
|
||||||
setDefaultVideoChannel,
|
setDefaultVideoChannel,
|
||||||
stopFfmpeg,
|
stopFfmpeg,
|
||||||
|
@ -30,6 +27,9 @@ import {
|
||||||
waitUntilLiveReplacedByReplayOnAllServers,
|
waitUntilLiveReplacedByReplayOnAllServers,
|
||||||
waitUntilLiveWaitingOnAllServers
|
waitUntilLiveWaitingOnAllServers
|
||||||
} from '@peertube/peertube-server-commands'
|
} from '@peertube/peertube-server-commands'
|
||||||
|
import { checkLiveCleanup } from '@tests/shared/live.js'
|
||||||
|
import { expect } from 'chai'
|
||||||
|
import { FfmpegCommand } from 'fluent-ffmpeg'
|
||||||
|
|
||||||
describe('Save replay setting', function () {
|
describe('Save replay setting', function () {
|
||||||
let servers: PeerTubeServer[] = []
|
let servers: PeerTubeServer[] = []
|
||||||
|
@ -146,7 +146,8 @@ describe('Save replay setting', function () {
|
||||||
// Server 1 and server 2 follow each other
|
// Server 1 and server 2 follow each other
|
||||||
await doubleFollow(servers[0], servers[1])
|
await doubleFollow(servers[0], servers[1])
|
||||||
|
|
||||||
await servers[0].config.updateCustomSubConfig({
|
await servers[0].config.enableMinimumTranscoding()
|
||||||
|
await servers[0].config.updateExistingConfig({
|
||||||
newConfig: {
|
newConfig: {
|
||||||
live: {
|
live: {
|
||||||
enabled: true,
|
enabled: true,
|
||||||
|
|
|
@ -1,19 +1,19 @@
|
||||||
/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
|
/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
|
||||||
|
|
||||||
import { expect } from 'chai'
|
|
||||||
import { wait } from '@peertube/peertube-core-utils'
|
import { wait } from '@peertube/peertube-core-utils'
|
||||||
import { LiveVideoEventPayload, VideoPrivacy, VideoState, VideoStateType } from '@peertube/peertube-models'
|
import { LiveVideoEventPayload, VideoPrivacy, VideoState, VideoStateType } from '@peertube/peertube-models'
|
||||||
import {
|
import {
|
||||||
|
PeerTubeServer,
|
||||||
cleanupTests,
|
cleanupTests,
|
||||||
createMultipleServers,
|
createMultipleServers,
|
||||||
doubleFollow,
|
doubleFollow,
|
||||||
PeerTubeServer,
|
|
||||||
setAccessTokensToServers,
|
setAccessTokensToServers,
|
||||||
setDefaultVideoChannel,
|
setDefaultVideoChannel,
|
||||||
stopFfmpeg,
|
stopFfmpeg,
|
||||||
waitJobs,
|
waitJobs,
|
||||||
waitUntilLivePublishedOnAllServers
|
waitUntilLivePublishedOnAllServers
|
||||||
} from '@peertube/peertube-server-commands'
|
} from '@peertube/peertube-server-commands'
|
||||||
|
import { expect } from 'chai'
|
||||||
|
|
||||||
describe('Test live socket messages', function () {
|
describe('Test live socket messages', function () {
|
||||||
let servers: PeerTubeServer[] = []
|
let servers: PeerTubeServer[] = []
|
||||||
|
@ -27,17 +27,8 @@ describe('Test live socket messages', function () {
|
||||||
await setAccessTokensToServers(servers)
|
await setAccessTokensToServers(servers)
|
||||||
await setDefaultVideoChannel(servers)
|
await setDefaultVideoChannel(servers)
|
||||||
|
|
||||||
await servers[0].config.updateCustomSubConfig({
|
await servers[0].config.enableMinimumTranscoding()
|
||||||
newConfig: {
|
await servers[0].config.enableLive({ allowReplay: true, transcoding: false })
|
||||||
live: {
|
|
||||||
enabled: true,
|
|
||||||
allowReplay: true,
|
|
||||||
transcoding: {
|
|
||||||
enabled: false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
// Server 1 and server 2 follow each other
|
// Server 1 and server 2 follow each other
|
||||||
await doubleFollow(servers[0], servers[1])
|
await doubleFollow(servers[0], servers[1])
|
||||||
|
|
|
@ -48,11 +48,13 @@ describe('Test live', function () {
|
||||||
await setAccessTokensToServers(servers)
|
await setAccessTokensToServers(servers)
|
||||||
await setDefaultVideoChannel(servers)
|
await setDefaultVideoChannel(servers)
|
||||||
|
|
||||||
await servers[0].config.updateCustomSubConfig({
|
await servers[0].config.enableMinimumTranscoding()
|
||||||
|
await servers[0].config.updateExistingConfig({
|
||||||
newConfig: {
|
newConfig: {
|
||||||
live: {
|
live: {
|
||||||
enabled: true,
|
enabled: true,
|
||||||
allowReplay: true,
|
allowReplay: true,
|
||||||
|
maxUserLives: -1,
|
||||||
latencySetting: {
|
latencySetting: {
|
||||||
enabled: true
|
enabled: true
|
||||||
},
|
},
|
||||||
|
@ -396,7 +398,7 @@ describe('Test live', function () {
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateConf (resolutions: number[]) {
|
function updateConf (resolutions: number[]) {
|
||||||
return servers[0].config.updateCustomSubConfig({
|
return servers[0].config.updateExistingConfig({
|
||||||
newConfig: {
|
newConfig: {
|
||||||
live: {
|
live: {
|
||||||
enabled: true,
|
enabled: true,
|
||||||
|
@ -602,7 +604,7 @@ describe('Test live', function () {
|
||||||
const resolutions = [ 240, 480 ]
|
const resolutions = [ 240, 480 ]
|
||||||
await updateConf(resolutions)
|
await updateConf(resolutions)
|
||||||
|
|
||||||
await servers[0].config.updateExistingSubConfig({
|
await servers[0].config.updateExistingConfig({
|
||||||
newConfig: {
|
newConfig: {
|
||||||
live: {
|
live: {
|
||||||
transcoding: {
|
transcoding: {
|
||||||
|
|
|
@ -380,7 +380,7 @@ describe('Test moderation notifications', function () {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
await servers[0].config.updateCustomSubConfig({ newConfig: config })
|
await servers[0].config.updateExistingConfig({ newConfig: config })
|
||||||
|
|
||||||
await servers[2].follows.follow({ hosts: [ servers[0].url ] })
|
await servers[2].follows.follow({ hosts: [ servers[0].url ] })
|
||||||
|
|
||||||
|
@ -394,7 +394,7 @@ describe('Test moderation notifications', function () {
|
||||||
await checkAutoInstanceFollowing({ ...baseParams, ...userOverride, followerHost, followingHost, checkType: 'absence' })
|
await checkAutoInstanceFollowing({ ...baseParams, ...userOverride, followerHost, followingHost, checkType: 'absence' })
|
||||||
|
|
||||||
config.followings.instance.autoFollowBack.enabled = false
|
config.followings.instance.autoFollowBack.enabled = false
|
||||||
await servers[0].config.updateCustomSubConfig({ newConfig: config })
|
await servers[0].config.updateExistingConfig({ newConfig: config })
|
||||||
await servers[0].follows.unfollow({ target: servers[2] })
|
await servers[0].follows.unfollow({ target: servers[2] })
|
||||||
await servers[2].follows.unfollow({ target: servers[0] })
|
await servers[2].follows.unfollow({ target: servers[0] })
|
||||||
})
|
})
|
||||||
|
@ -403,7 +403,7 @@ describe('Test moderation notifications', function () {
|
||||||
this.timeout(30000)
|
this.timeout(30000)
|
||||||
await servers[0].follows.unfollow({ target: servers[1] })
|
await servers[0].follows.unfollow({ target: servers[1] })
|
||||||
|
|
||||||
await servers[0].config.updateCustomSubConfig({ newConfig: config })
|
await servers[0].config.updateExistingConfig({ newConfig: config })
|
||||||
|
|
||||||
await wait(5000)
|
await wait(5000)
|
||||||
await waitJobs(servers)
|
await waitJobs(servers)
|
||||||
|
@ -413,7 +413,7 @@ describe('Test moderation notifications', function () {
|
||||||
await checkAutoInstanceFollowing({ ...baseParams, followerHost, followingHost, checkType: 'presence' })
|
await checkAutoInstanceFollowing({ ...baseParams, followerHost, followingHost, checkType: 'presence' })
|
||||||
|
|
||||||
config.followings.instance.autoFollowIndex.enabled = false
|
config.followings.instance.autoFollowIndex.enabled = false
|
||||||
await servers[0].config.updateCustomSubConfig({ newConfig: config })
|
await servers[0].config.updateExistingConfig({ newConfig: config })
|
||||||
await servers[0].follows.unfollow({ target: servers[1] })
|
await servers[0].follows.unfollow({ target: servers[1] })
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
|
@ -38,7 +38,7 @@ describe('Test index search', function () {
|
||||||
describe('Default search', async function () {
|
describe('Default search', async function () {
|
||||||
|
|
||||||
it('Should make a local videos search by default', async function () {
|
it('Should make a local videos search by default', async function () {
|
||||||
await server.config.updateCustomSubConfig({
|
await server.config.updateExistingConfig({
|
||||||
newConfig: {
|
newConfig: {
|
||||||
search: {
|
search: {
|
||||||
searchIndex: {
|
searchIndex: {
|
||||||
|
@ -65,7 +65,7 @@ describe('Test index search', function () {
|
||||||
})
|
})
|
||||||
|
|
||||||
it('Should make an index videos search by default', async function () {
|
it('Should make an index videos search by default', async function () {
|
||||||
await server.config.updateCustomSubConfig({
|
await server.config.updateExistingConfig({
|
||||||
newConfig: {
|
newConfig: {
|
||||||
search: {
|
search: {
|
||||||
searchIndex: {
|
searchIndex: {
|
||||||
|
@ -243,7 +243,7 @@ describe('Test index search', function () {
|
||||||
let nsfwUUID: string
|
let nsfwUUID: string
|
||||||
|
|
||||||
{
|
{
|
||||||
await server.config.updateCustomSubConfig({
|
await server.config.updateExistingConfig({
|
||||||
newConfig: {
|
newConfig: {
|
||||||
instance: { defaultNSFWPolicy: 'display' }
|
instance: { defaultNSFWPolicy: 'display' }
|
||||||
}
|
}
|
||||||
|
@ -259,7 +259,7 @@ describe('Test index search', function () {
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
await server.config.updateCustomSubConfig({
|
await server.config.updateExistingConfig({
|
||||||
newConfig: {
|
newConfig: {
|
||||||
instance: { defaultNSFWPolicy: 'do_not_list' }
|
instance: { defaultNSFWPolicy: 'do_not_list' }
|
||||||
}
|
}
|
||||||
|
|
|
@ -534,7 +534,7 @@ describe('Test videos search', function () {
|
||||||
},
|
},
|
||||||
live: { enabled: true }
|
live: { enabled: true }
|
||||||
}
|
}
|
||||||
await server.config.updateCustomSubConfig({ newConfig })
|
await server.config.updateExistingConfig({ newConfig })
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|
|
@ -77,7 +77,7 @@ describe('Test auto follows', function () {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
await servers[1].config.updateCustomSubConfig({ newConfig: config })
|
await servers[1].config.updateExistingConfig({ newConfig: config })
|
||||||
|
|
||||||
await server1Follows2(servers)
|
await server1Follows2(servers)
|
||||||
|
|
||||||
|
@ -102,7 +102,7 @@ describe('Test auto follows', function () {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
await servers[1].config.updateCustomSubConfig({ newConfig: config })
|
await servers[1].config.updateExistingConfig({ newConfig: config })
|
||||||
|
|
||||||
await server1Follows2(servers)
|
await server1Follows2(servers)
|
||||||
|
|
||||||
|
@ -119,7 +119,7 @@ describe('Test auto follows', function () {
|
||||||
|
|
||||||
config.followings.instance.autoFollowBack.enabled = false
|
config.followings.instance.autoFollowBack.enabled = false
|
||||||
config.followers.instance.manualApproval = false
|
config.followers.instance.manualApproval = false
|
||||||
await servers[1].config.updateCustomSubConfig({ newConfig: config })
|
await servers[1].config.updateExistingConfig({ newConfig: config })
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -156,7 +156,7 @@ describe('Test auto follows', function () {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
await servers[0].config.updateCustomSubConfig({ newConfig: config })
|
await servers[0].config.updateExistingConfig({ newConfig: config })
|
||||||
|
|
||||||
await wait(5000)
|
await wait(5000)
|
||||||
await waitJobs(servers)
|
await waitJobs(servers)
|
||||||
|
|
|
@ -212,7 +212,7 @@ describe('Test config defaults', function () {
|
||||||
|
|
||||||
describe('Default user attributes', function () {
|
describe('Default user attributes', function () {
|
||||||
it('Should create a user and register a user with the default config', async function () {
|
it('Should create a user and register a user with the default config', async function () {
|
||||||
await server.config.updateCustomSubConfig({
|
await server.config.updateExistingConfig({
|
||||||
newConfig: {
|
newConfig: {
|
||||||
user: {
|
user: {
|
||||||
history: {
|
history: {
|
||||||
|
@ -252,7 +252,7 @@ describe('Test config defaults', function () {
|
||||||
})
|
})
|
||||||
|
|
||||||
it('Should update config and create a user and register a user with the new default config', async function () {
|
it('Should update config and create a user and register a user with the new default config', async function () {
|
||||||
await server.config.updateCustomSubConfig({
|
await server.config.updateExistingConfig({
|
||||||
newConfig: {
|
newConfig: {
|
||||||
user: {
|
user: {
|
||||||
history: {
|
history: {
|
||||||
|
|
|
@ -133,7 +133,7 @@ describe('Test follows moderation', function () {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
await servers[1].config.updateCustomSubConfig({ newConfig: subConfig })
|
await servers[1].config.updateExistingConfig({ newConfig: subConfig })
|
||||||
|
|
||||||
await commands[0].follow({ hosts: [ servers[1].url ] })
|
await commands[0].follow({ hosts: [ servers[1].url ] })
|
||||||
await waitJobs(servers)
|
await waitJobs(servers)
|
||||||
|
@ -151,7 +151,7 @@ describe('Test follows moderation', function () {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
await servers[1].config.updateCustomSubConfig({ newConfig: subConfig })
|
await servers[1].config.updateExistingConfig({ newConfig: subConfig })
|
||||||
|
|
||||||
await commands[0].follow({ hosts: [ servers[1].url ] })
|
await commands[0].follow({ hosts: [ servers[1].url ] })
|
||||||
await waitJobs(servers)
|
await waitJobs(servers)
|
||||||
|
@ -177,8 +177,8 @@ describe('Test follows moderation', function () {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
await servers[1].config.updateCustomSubConfig({ newConfig: subConfig })
|
await servers[1].config.updateExistingConfig({ newConfig: subConfig })
|
||||||
await servers[2].config.updateCustomSubConfig({ newConfig: subConfig })
|
await servers[2].config.updateExistingConfig({ newConfig: subConfig })
|
||||||
|
|
||||||
await commands[0].follow({ hosts: [ servers[1].url ] })
|
await commands[0].follow({ hosts: [ servers[1].url ] })
|
||||||
await waitJobs(servers)
|
await waitJobs(servers)
|
||||||
|
@ -271,10 +271,10 @@ describe('Test follows moderation', function () {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
await servers[2].config.updateExistingSubConfig({ newConfig: { followers: { instance: { manualApproval: false } } } })
|
await servers[2].config.updateExistingConfig({ newConfig: { followers: { instance: { manualApproval: false } } } })
|
||||||
await run()
|
await run()
|
||||||
|
|
||||||
await servers[2].config.updateExistingSubConfig({ newConfig: { followers: { instance: { manualApproval: true } } } })
|
await servers[2].config.updateExistingConfig({ newConfig: { followers: { instance: { manualApproval: true } } } })
|
||||||
await run()
|
await run()
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
@ -111,7 +111,7 @@ describe('Test plugins', function () {
|
||||||
})
|
})
|
||||||
|
|
||||||
it('Should update the default theme in the configuration', async function () {
|
it('Should update the default theme in the configuration', async function () {
|
||||||
await server.config.updateCustomSubConfig({
|
await server.config.updateExistingConfig({
|
||||||
newConfig: {
|
newConfig: {
|
||||||
theme: { default: 'background-red' }
|
theme: { default: 'background-red' }
|
||||||
}
|
}
|
||||||
|
|
|
@ -206,7 +206,7 @@ describe('Test stats (excluding redundancy)', function () {
|
||||||
it('Should correctly count video file sizes if transcoding is enabled', async function () {
|
it('Should correctly count video file sizes if transcoding is enabled', async function () {
|
||||||
this.timeout(120000)
|
this.timeout(120000)
|
||||||
|
|
||||||
await servers[0].config.updateCustomSubConfig({
|
await servers[0].config.updateExistingConfig({
|
||||||
newConfig: {
|
newConfig: {
|
||||||
transcoding: {
|
transcoding: {
|
||||||
enabled: true,
|
enabled: true,
|
||||||
|
|
|
@ -160,7 +160,7 @@ function runTests (enableObjectStorage: boolean) {
|
||||||
it('Should correctly update HLS playlist on resolution change', async function () {
|
it('Should correctly update HLS playlist on resolution change', async function () {
|
||||||
this.timeout(120000)
|
this.timeout(120000)
|
||||||
|
|
||||||
await servers[0].config.updateExistingSubConfig({
|
await servers[0].config.updateExistingConfig({
|
||||||
newConfig: {
|
newConfig: {
|
||||||
transcoding: {
|
transcoding: {
|
||||||
enabled: true,
|
enabled: true,
|
||||||
|
@ -196,7 +196,7 @@ function runTests (enableObjectStorage: boolean) {
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
await servers[0].config.updateExistingSubConfig({
|
await servers[0].config.updateExistingConfig({
|
||||||
newConfig: {
|
newConfig: {
|
||||||
transcoding: {
|
transcoding: {
|
||||||
enabled: true,
|
enabled: true,
|
||||||
|
|
|
@ -119,7 +119,7 @@ describe('Test HLS videos', function () {
|
||||||
describe('With only HLS enabled', function () {
|
describe('With only HLS enabled', function () {
|
||||||
|
|
||||||
before(async function () {
|
before(async function () {
|
||||||
await servers[0].config.updateCustomSubConfig({
|
await servers[0].config.updateExistingConfig({
|
||||||
newConfig: {
|
newConfig: {
|
||||||
transcoding: {
|
transcoding: {
|
||||||
enabled: true,
|
enabled: true,
|
||||||
|
|
|
@ -26,7 +26,7 @@ import { generateVideoWithFramerate, generateHighBitrateVideo } from '@tests/sha
|
||||||
import { checkWebTorrentWorks } from '@tests/shared/webtorrent.js'
|
import { checkWebTorrentWorks } from '@tests/shared/webtorrent.js'
|
||||||
|
|
||||||
function updateConfigForTranscoding (server: PeerTubeServer) {
|
function updateConfigForTranscoding (server: PeerTubeServer) {
|
||||||
return server.config.updateCustomSubConfig({
|
return server.config.updateExistingConfig({
|
||||||
newConfig: {
|
newConfig: {
|
||||||
transcoding: {
|
transcoding: {
|
||||||
enabled: true,
|
enabled: true,
|
||||||
|
@ -331,7 +331,7 @@ describe('Test video transcoding', function () {
|
||||||
function runSuite (mode: 'legacy' | 'resumable') {
|
function runSuite (mode: 'legacy' | 'resumable') {
|
||||||
|
|
||||||
before(async function () {
|
before(async function () {
|
||||||
await servers[1].config.updateCustomSubConfig({
|
await servers[1].config.updateExistingConfig({
|
||||||
newConfig: {
|
newConfig: {
|
||||||
transcoding: {
|
transcoding: {
|
||||||
hls: { enabled: true },
|
hls: { enabled: true },
|
||||||
|
@ -403,7 +403,7 @@ describe('Test video transcoding', function () {
|
||||||
it('Should upload an audio file and create an audio version only', async function () {
|
it('Should upload an audio file and create an audio version only', async function () {
|
||||||
this.timeout(60_000)
|
this.timeout(60_000)
|
||||||
|
|
||||||
await servers[1].config.updateCustomSubConfig({
|
await servers[1].config.updateExistingConfig({
|
||||||
newConfig: {
|
newConfig: {
|
||||||
transcoding: {
|
transcoding: {
|
||||||
hls: { enabled: true },
|
hls: { enabled: true },
|
||||||
|
@ -592,7 +592,7 @@ describe('Test video transcoding', function () {
|
||||||
hls: { enabled: true }
|
hls: { enabled: true }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
await servers[1].config.updateCustomSubConfig({ newConfig })
|
await servers[1].config.updateExistingConfig({ newConfig })
|
||||||
|
|
||||||
const attributes = {
|
const attributes = {
|
||||||
name: 'low bitrate',
|
name: 'low bitrate',
|
||||||
|
@ -725,7 +725,7 @@ describe('Test video transcoding', function () {
|
||||||
it('Should not generate an upper resolution than original file', async function () {
|
it('Should not generate an upper resolution than original file', async function () {
|
||||||
this.timeout(120_000)
|
this.timeout(120_000)
|
||||||
|
|
||||||
await servers[0].config.updateExistingSubConfig({
|
await servers[0].config.updateExistingConfig({
|
||||||
newConfig: {
|
newConfig: {
|
||||||
transcoding: {
|
transcoding: {
|
||||||
enabled: true,
|
enabled: true,
|
||||||
|
@ -764,7 +764,7 @@ describe('Test video transcoding', function () {
|
||||||
it('Should only keep the original resolution if all resolutions are disabled', async function () {
|
it('Should only keep the original resolution if all resolutions are disabled', async function () {
|
||||||
this.timeout(120_000)
|
this.timeout(120_000)
|
||||||
|
|
||||||
await servers[0].config.updateExistingSubConfig({
|
await servers[0].config.updateExistingConfig({
|
||||||
newConfig: {
|
newConfig: {
|
||||||
transcoding: {
|
transcoding: {
|
||||||
resolutions: {
|
resolutions: {
|
||||||
|
|
|
@ -104,7 +104,7 @@ describe('Test update video privacy while transcoding', function () {
|
||||||
describe('With only HLS enabled', function () {
|
describe('With only HLS enabled', function () {
|
||||||
|
|
||||||
before(async function () {
|
before(async function () {
|
||||||
await servers[0].config.updateCustomSubConfig({
|
await servers[0].config.updateExistingConfig({
|
||||||
newConfig: {
|
newConfig: {
|
||||||
transcoding: {
|
transcoding: {
|
||||||
enabled: true,
|
enabled: true,
|
||||||
|
|
|
@ -276,7 +276,7 @@ describe('Test video studio', function () {
|
||||||
|
|
||||||
before(async function () {
|
before(async function () {
|
||||||
// Disable Web Videos
|
// Disable Web Videos
|
||||||
await servers[0].config.updateExistingSubConfig({
|
await servers[0].config.updateExistingConfig({
|
||||||
newConfig: {
|
newConfig: {
|
||||||
transcoding: {
|
transcoding: {
|
||||||
webVideos: {
|
webVideos: {
|
||||||
|
|
|
@ -791,7 +791,7 @@ function runTest (withObjectStorage: boolean) {
|
||||||
|
|
||||||
await checkExportFileExists({ exists: true, server, userExport, withObjectStorage, redirectedUrl })
|
await checkExportFileExists({ exists: true, server, userExport, withObjectStorage, redirectedUrl })
|
||||||
|
|
||||||
await server.config.updateCustomSubConfig({
|
await server.config.updateExistingConfig({
|
||||||
newConfig: {
|
newConfig: {
|
||||||
export: {
|
export: {
|
||||||
users: {
|
users: {
|
||||||
|
|
|
@ -192,7 +192,7 @@ describe('Test user videos', function () {
|
||||||
config.transcoding.webVideos.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.updateExistingConfig({ newConfig: config })
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|
|
@ -40,7 +40,7 @@ describe('Test users email verification', function () {
|
||||||
it('Should register user and send verification email if verification required', async function () {
|
it('Should register user and send verification email if verification required', async function () {
|
||||||
this.timeout(30000)
|
this.timeout(30000)
|
||||||
|
|
||||||
await server.config.updateExistingSubConfig({
|
await server.config.updateExistingConfig({
|
||||||
newConfig: {
|
newConfig: {
|
||||||
signup: {
|
signup: {
|
||||||
enabled: true,
|
enabled: true,
|
||||||
|
@ -126,7 +126,7 @@ describe('Test users email verification', function () {
|
||||||
|
|
||||||
it('Should register user not requiring email verification if setting not enabled', async function () {
|
it('Should register user not requiring email verification if setting not enabled', async function () {
|
||||||
this.timeout(5000)
|
this.timeout(5000)
|
||||||
await server.config.updateExistingSubConfig({
|
await server.config.updateExistingConfig({
|
||||||
newConfig: {
|
newConfig: {
|
||||||
signup: {
|
signup: {
|
||||||
requiresEmailVerification: false
|
requiresEmailVerification: false
|
||||||
|
@ -146,7 +146,7 @@ describe('Test users email verification', function () {
|
||||||
})
|
})
|
||||||
|
|
||||||
it('Should allow login for user with unverified email when setting later enabled', async function () {
|
it('Should allow login for user with unverified email when setting later enabled', async function () {
|
||||||
await server.config.updateCustomSubConfig({
|
await server.config.updateExistingConfig({
|
||||||
newConfig: {
|
newConfig: {
|
||||||
signup: {
|
signup: {
|
||||||
requiresEmailVerification: true
|
requiresEmailVerification: true
|
||||||
|
|
|
@ -39,7 +39,7 @@ describe('Test video change ownership - nominal', function () {
|
||||||
await setAccessTokensToServers(servers)
|
await setAccessTokensToServers(servers)
|
||||||
await setDefaultVideoChannel(servers)
|
await setDefaultVideoChannel(servers)
|
||||||
|
|
||||||
await servers[0].config.updateCustomSubConfig({
|
await servers[0].config.updateExistingConfig({
|
||||||
newConfig: {
|
newConfig: {
|
||||||
transcoding: {
|
transcoding: {
|
||||||
enabled: false
|
enabled: false
|
||||||
|
|
|
@ -553,7 +553,7 @@ describe('Test video channels', function () {
|
||||||
it('Should apply another default channel name', async function () {
|
it('Should apply another default channel name', async function () {
|
||||||
this.timeout(15000)
|
this.timeout(15000)
|
||||||
|
|
||||||
await servers[0].config.updateCustomSubConfig({
|
await servers[0].config.updateExistingConfig({
|
||||||
newConfig: {
|
newConfig: {
|
||||||
user: {
|
user: {
|
||||||
defaultChannelName: `$1's channel`
|
defaultChannelName: `$1's channel`
|
||||||
|
|
|
@ -1,18 +1,13 @@
|
||||||
/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
|
/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
|
||||||
|
|
||||||
import { expect } from 'chai'
|
|
||||||
import { pathExists, remove } from 'fs-extra/esm'
|
|
||||||
import { readdir } from 'fs/promises'
|
|
||||||
import { join } from 'path'
|
|
||||||
import { areHttpImportTestsDisabled } from '@peertube/peertube-node-utils'
|
|
||||||
import { CustomConfig, HttpStatusCode, Video, VideoImportState, VideoPrivacy, VideoResolution, VideoState } from '@peertube/peertube-models'
|
import { CustomConfig, HttpStatusCode, Video, VideoImportState, VideoPrivacy, VideoResolution, VideoState } from '@peertube/peertube-models'
|
||||||
|
import { areHttpImportTestsDisabled } from '@peertube/peertube-node-utils'
|
||||||
import {
|
import {
|
||||||
cleanupTests,
|
PeerTubeServer,
|
||||||
createMultipleServers,
|
cleanupTests, createMultipleServers,
|
||||||
createSingleServer,
|
createSingleServer,
|
||||||
doubleFollow,
|
doubleFollow,
|
||||||
getServerImportConfig,
|
getServerImportConfig,
|
||||||
PeerTubeServer,
|
|
||||||
setAccessTokensToServers,
|
setAccessTokensToServers,
|
||||||
setDefaultVideoChannel,
|
setDefaultVideoChannel,
|
||||||
waitJobs
|
waitJobs
|
||||||
|
@ -21,6 +16,10 @@ import { DeepPartial } from '@peertube/peertube-typescript-utils'
|
||||||
import { testCaptionFile } from '@tests/shared/captions.js'
|
import { testCaptionFile } from '@tests/shared/captions.js'
|
||||||
import { testImageGeneratedByFFmpeg } from '@tests/shared/checks.js'
|
import { testImageGeneratedByFFmpeg } from '@tests/shared/checks.js'
|
||||||
import { FIXTURE_URLS } from '@tests/shared/fixture-urls.js'
|
import { FIXTURE_URLS } from '@tests/shared/fixture-urls.js'
|
||||||
|
import { expect } from 'chai'
|
||||||
|
import { pathExists, remove } from 'fs-extra/esm'
|
||||||
|
import { readdir } from 'fs/promises'
|
||||||
|
import { join } from 'path'
|
||||||
|
|
||||||
async function checkVideosServer1 (server: PeerTubeServer, idHttp: string, idMagnet: string, idTorrent: string) {
|
async function checkVideosServer1 (server: PeerTubeServer, idHttp: string, idMagnet: string, idTorrent: string) {
|
||||||
const videoHttp = await server.videos.get({ id: idHttp })
|
const videoHttp = await server.videos.get({ id: idHttp })
|
||||||
|
@ -96,7 +95,7 @@ describe('Test video imports', function () {
|
||||||
await setDefaultVideoChannel(servers)
|
await setDefaultVideoChannel(servers)
|
||||||
|
|
||||||
for (const server of servers) {
|
for (const server of servers) {
|
||||||
await server.config.updateExistingSubConfig({
|
await server.config.updateExistingConfig({
|
||||||
newConfig: {
|
newConfig: {
|
||||||
transcoding: {
|
transcoding: {
|
||||||
alwaysTranscodeOriginalResolution: false
|
alwaysTranscodeOriginalResolution: false
|
||||||
|
@ -346,7 +345,7 @@ describe('Test video imports', function () {
|
||||||
hls: { enabled: false }
|
hls: { enabled: false }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
await servers[0].config.updateExistingSubConfig({ newConfig: config })
|
await servers[0].config.updateExistingConfig({ newConfig: config })
|
||||||
|
|
||||||
const attributes = {
|
const attributes = {
|
||||||
name: 'hdr video',
|
name: 'hdr video',
|
||||||
|
@ -386,7 +385,7 @@ describe('Test video imports', function () {
|
||||||
alwaysTranscodeOriginalResolution: false
|
alwaysTranscodeOriginalResolution: false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
await servers[0].config.updateExistingSubConfig({ newConfig: config })
|
await servers[0].config.updateExistingConfig({ newConfig: config })
|
||||||
|
|
||||||
const attributes = {
|
const attributes = {
|
||||||
name: 'small resolution video',
|
name: 'small resolution video',
|
||||||
|
@ -414,7 +413,7 @@ describe('Test video imports', function () {
|
||||||
alwaysTranscodeOriginalResolution: true
|
alwaysTranscodeOriginalResolution: true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
await servers[0].config.updateExistingSubConfig({ newConfig: config })
|
await servers[0].config.updateExistingConfig({ newConfig: config })
|
||||||
|
|
||||||
const attributes = {
|
const attributes = {
|
||||||
name: 'bigger resolution video',
|
name: 'bigger resolution video',
|
||||||
|
|
|
@ -213,7 +213,7 @@ describe('Test video storyboard', function () {
|
||||||
it('Should not generate storyboards if disabled by the admin', async function () {
|
it('Should not generate storyboards if disabled by the admin', async function () {
|
||||||
this.timeout(60000)
|
this.timeout(60000)
|
||||||
|
|
||||||
await servers[0].config.updateExistingSubConfig({
|
await servers[0].config.updateExistingConfig({
|
||||||
newConfig: {
|
newConfig: {
|
||||||
storyboards: {
|
storyboards: {
|
||||||
enabled: false
|
enabled: false
|
||||||
|
|
|
@ -50,7 +50,7 @@ describe('Test index HTML generation', function () {
|
||||||
})
|
})
|
||||||
|
|
||||||
it('Should update the customized configuration and have the correct index html tags', async function () {
|
it('Should update the customized configuration and have the correct index html tags', async function () {
|
||||||
await servers[0].config.updateCustomSubConfig({
|
await servers[0].config.updateExistingConfig({
|
||||||
newConfig: {
|
newConfig: {
|
||||||
instance: {
|
instance: {
|
||||||
name: 'PeerTube updated',
|
name: 'PeerTube updated',
|
||||||
|
|
|
@ -128,7 +128,7 @@ describe('Official plugin Akismet', function () {
|
||||||
describe('Signup', function () {
|
describe('Signup', function () {
|
||||||
|
|
||||||
before(async function () {
|
before(async function () {
|
||||||
await servers[0].config.updateExistingSubConfig({
|
await servers[0].config.updateExistingConfig({
|
||||||
newConfig: {
|
newConfig: {
|
||||||
signup: {
|
signup: {
|
||||||
enabled: true
|
enabled: true
|
||||||
|
|
|
@ -236,7 +236,7 @@ describe('Test VOD transcoding in peertube-runner program', function () {
|
||||||
it('Should not generate an upper resolution than original file', async function () {
|
it('Should not generate an upper resolution than original file', async function () {
|
||||||
this.timeout(120_000)
|
this.timeout(120_000)
|
||||||
|
|
||||||
await servers[0].config.updateExistingSubConfig({
|
await servers[0].config.updateExistingConfig({
|
||||||
newConfig: {
|
newConfig: {
|
||||||
transcoding: {
|
transcoding: {
|
||||||
enabled: true,
|
enabled: true,
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
|
/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
|
||||||
|
|
||||||
import { expect } from 'chai'
|
|
||||||
import {
|
import {
|
||||||
HttpStatusCode,
|
HttpStatusCode,
|
||||||
MyUser,
|
MyUser,
|
||||||
|
@ -12,20 +11,21 @@ import {
|
||||||
VideoPrivacy
|
VideoPrivacy
|
||||||
} from '@peertube/peertube-models'
|
} from '@peertube/peertube-models'
|
||||||
import {
|
import {
|
||||||
|
PeerTubeServer,
|
||||||
|
PluginsCommand,
|
||||||
cleanupTests,
|
cleanupTests,
|
||||||
createMultipleServers,
|
createMultipleServers,
|
||||||
doubleFollow,
|
doubleFollow,
|
||||||
makeActivityPubGetRequest,
|
makeActivityPubGetRequest,
|
||||||
makeGetRequest,
|
makeGetRequest,
|
||||||
makeRawRequest,
|
makeRawRequest,
|
||||||
PeerTubeServer,
|
|
||||||
PluginsCommand,
|
|
||||||
setAccessTokensToServers,
|
setAccessTokensToServers,
|
||||||
setDefaultVideoChannel,
|
setDefaultVideoChannel,
|
||||||
waitJobs
|
waitJobs
|
||||||
} from '@peertube/peertube-server-commands'
|
} from '@peertube/peertube-server-commands'
|
||||||
import { FIXTURE_URLS } from '../shared/fixture-urls.js'
|
|
||||||
import { expectEndWith } from '@tests/shared/checks.js'
|
import { expectEndWith } from '@tests/shared/checks.js'
|
||||||
|
import { expect } from 'chai'
|
||||||
|
import { FIXTURE_URLS } from '../shared/fixture-urls.js'
|
||||||
|
|
||||||
describe('Test plugin filter hooks', function () {
|
describe('Test plugin filter hooks', function () {
|
||||||
let servers: PeerTubeServer[]
|
let servers: PeerTubeServer[]
|
||||||
|
@ -63,7 +63,7 @@ describe('Test plugin filter hooks', function () {
|
||||||
const { data } = await servers[0].videos.list()
|
const { data } = await servers[0].videos.list()
|
||||||
videoUUID = data[0].uuid
|
videoUUID = data[0].uuid
|
||||||
|
|
||||||
await servers[0].config.updateCustomSubConfig({
|
await servers[0].config.updateExistingConfig({
|
||||||
newConfig: {
|
newConfig: {
|
||||||
live: { enabled: true },
|
live: { enabled: true },
|
||||||
signup: { enabled: true },
|
signup: { enabled: true },
|
||||||
|
@ -481,7 +481,7 @@ describe('Test plugin filter hooks', function () {
|
||||||
describe('Should run filter:api.user.signup.allowed.result', function () {
|
describe('Should run filter:api.user.signup.allowed.result', function () {
|
||||||
|
|
||||||
before(async function () {
|
before(async function () {
|
||||||
await servers[0].config.updateExistingSubConfig({ newConfig: { signup: { requiresApproval: false } } })
|
await servers[0].config.updateExistingConfig({ newConfig: { signup: { requiresApproval: false } } })
|
||||||
})
|
})
|
||||||
|
|
||||||
it('Should run on config endpoint', async function () {
|
it('Should run on config endpoint', async function () {
|
||||||
|
@ -506,7 +506,7 @@ describe('Test plugin filter hooks', function () {
|
||||||
describe('Should run filter:api.user.request-signup.allowed.result', function () {
|
describe('Should run filter:api.user.request-signup.allowed.result', function () {
|
||||||
|
|
||||||
before(async function () {
|
before(async function () {
|
||||||
await servers[0].config.updateExistingSubConfig({ newConfig: { signup: { requiresApproval: true } } })
|
await servers[0].config.updateExistingConfig({ newConfig: { signup: { requiresApproval: true } } })
|
||||||
})
|
})
|
||||||
|
|
||||||
it('Should run on config endpoint', async function () {
|
it('Should run on config endpoint', async function () {
|
||||||
|
@ -536,18 +536,7 @@ describe('Test plugin filter hooks', function () {
|
||||||
before(async function () {
|
before(async function () {
|
||||||
this.timeout(120000)
|
this.timeout(120000)
|
||||||
|
|
||||||
await servers[0].config.updateCustomSubConfig({
|
await servers[0].config.enableMinimumTranscoding({ hls: true, webVideo: true })
|
||||||
newConfig: {
|
|
||||||
transcoding: {
|
|
||||||
webVideos: {
|
|
||||||
enabled: true
|
|
||||||
},
|
|
||||||
hls: {
|
|
||||||
enabled: true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
const uuids: string[] = []
|
const uuids: string[] = []
|
||||||
|
|
||||||
|
@ -675,7 +664,7 @@ describe('Test plugin filter hooks', function () {
|
||||||
describe('Search filters', function () {
|
describe('Search filters', function () {
|
||||||
|
|
||||||
before(async function () {
|
before(async function () {
|
||||||
await servers[0].config.updateCustomSubConfig({
|
await servers[0].config.updateExistingConfig({
|
||||||
newConfig: {
|
newConfig: {
|
||||||
search: {
|
search: {
|
||||||
searchIndex: {
|
searchIndex: {
|
||||||
|
|
|
@ -27,7 +27,7 @@ async function createLiveWrapper (server: PeerTubeServer) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateConf (server: PeerTubeServer, vodProfile: string, liveProfile: string) {
|
function updateConf (server: PeerTubeServer, vodProfile: string, liveProfile: string) {
|
||||||
return server.config.updateCustomSubConfig({
|
return server.config.updateExistingConfig({
|
||||||
newConfig: {
|
newConfig: {
|
||||||
transcoding: {
|
transcoding: {
|
||||||
enabled: true,
|
enabled: true,
|
||||||
|
@ -46,6 +46,9 @@ function updateConf (server: PeerTubeServer, vodProfile: string, liveProfile: st
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
live: {
|
live: {
|
||||||
|
enabled: true,
|
||||||
|
maxInstanceLives: -1,
|
||||||
|
maxUserLives: -1,
|
||||||
transcoding: {
|
transcoding: {
|
||||||
profile: liveProfile,
|
profile: liveProfile,
|
||||||
enabled: true,
|
enabled: true,
|
||||||
|
|
Loading…
Reference in New Issue