diff --git a/packages/server-commands/src/server/server.ts b/packages/server-commands/src/server/server.ts index 2cea695f6..a30ba6ecf 100644 --- a/packages/server-commands/src/server/server.ts +++ b/packages/server-commands/src/server/server.ts @@ -61,6 +61,7 @@ import { StatsCommand } from './stats-command.js' import merge from 'lodash-es/merge.js' export type RunServerOptions = { + autoEnableImportProxy?: boolean hideLogs?: boolean nodeArgs?: string[] peertubeArgs?: string[] @@ -241,7 +242,7 @@ export class PeerTubeServer { await this.assignCustomConfigFile() - let configOverride = this.buildConfigOverride() + let configOverride = this.buildConfigOverride(options) if (configOverrideArg !== undefined) { configOverride = merge(configOverride, configOverrideArg) @@ -363,8 +364,8 @@ export class PeerTubeServer { this.customConfigFile = tmpConfigFile } - private buildConfigOverride () { - const base = process.env.YOUTUBE_DL_PROXY + private buildConfigOverride (options: RunServerOptions) { + const base = options.autoEnableImportProxy !== false && process.env.YOUTUBE_DL_PROXY ? { import: { videos: { http: { proxies: [ process.env.YOUTUBE_DL_PROXY ] } } } } : {} diff --git a/packages/tests/src/api/server/proxy.ts b/packages/tests/src/api/server/proxy.ts index 071175943..2f4bd76a1 100644 --- a/packages/tests/src/api/server/proxy.ts +++ b/packages/tests/src/api/server/proxy.ts @@ -114,7 +114,7 @@ describe('Test proxy', function () { this.timeout(240000) await servers[0].kill() - await servers[0].run(getProxyConfig(null), { env: goodEnv }) + await servers[0].run({}, { env: goodEnv, autoEnableImportProxy: false }) await quickImport() @@ -129,7 +129,7 @@ describe('Test proxy', function () { this.timeout(120000) await servers[0].kill() - await servers[0].run(getProxyConfig(null), { env: badEnv }) + await servers[0].run({}, { env: badEnv, autoEnableImportProxy: false }) await quickImport(HttpStatusCode.BAD_REQUEST_400) }) @@ -138,7 +138,7 @@ describe('Test proxy', function () { this.timeout(120000) await servers[0].kill() - await servers[0].run(getProxyConfig('http://localhost:9000')) + await servers[0].run(getProxyConfig('http://localhost:9000'), { autoEnableImportProxy: false }) await quickImport(HttpStatusCode.BAD_REQUEST_400) }) diff --git a/packages/tests/src/peertube-runner/vod-transcoding.ts b/packages/tests/src/peertube-runner/vod-transcoding.ts index 6e909dc9a..2a55b9c4c 100644 --- a/packages/tests/src/peertube-runner/vod-transcoding.ts +++ b/packages/tests/src/peertube-runner/vod-transcoding.ts @@ -269,7 +269,7 @@ describe('Test VOD transcoding in peertube-runner program', function () { describe('Web video only enabled', function () { before(async function () { - await servers[0].config.enableTranscoding({ webVideo: true, hls: false, with0p: true }) + await servers[0].config.enableTranscoding({ resolutions: 'max', webVideo: true, hls: false, with0p: true }) }) runSpecificSuite({ webVideoEnabled: true, hlsEnabled: false, objectStorage })