X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Fcontrollers%2Fapi%2Fconfig.ts;h=8a00f9835a319c834fe2419206c9c5d451f641dc;hb=6ad88df896e359e428259ff511f6fca3675cb4af;hp=39a124fc5382dd7efa08406a00885f0c6afb10c7;hpb=be04c6fdab5d91a7a57fa3ff36cde22a549c29da;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/controllers/api/config.ts b/server/controllers/api/config.ts index 39a124fc5..8a00f9835 100644 --- a/server/controllers/api/config.ts +++ b/server/controllers/api/config.ts @@ -17,6 +17,7 @@ import { objectConverter } from '../../helpers/core-utils' import { CONFIG, reloadConfig } from '../../initializers/config' import { PluginManager } from '../../lib/plugins/plugin-manager' import { getThemeOrDefault } from '../../lib/plugins/theme-utils' +import { Hooks } from '@server/lib/plugins/hooks' const configRouter = express.Router() @@ -47,7 +48,12 @@ configRouter.delete('/custom', let serverCommit: string async function getConfig (req: express.Request, res: express.Response) { - const allowed = await isSignupAllowed() + const { allowed } = await Hooks.wrapPromiseFun( + isSignupAllowed, + {}, + 'filter:api.user.signup.allowed.result' + ) + const allowedForCurrentIP = isSignupAllowedForCurrentIP(req.ip) const defaultTheme = getThemeOrDefault(CONFIG.THEME.DEFAULT, DEFAULT_THEME_NAME) @@ -89,6 +95,9 @@ async function getConfig (req: express.Request, res: express.Response) { hls: { enabled: CONFIG.TRANSCODING.HLS.ENABLED }, + webtorrent: { + enabled: CONFIG.TRANSCODING.WEBTORRENT.ENABLED + }, enabledResolutions: getEnabledResolutions() }, import: { @@ -291,6 +300,7 @@ function customConfig (): CustomConfig { allowAudioFiles: CONFIG.TRANSCODING.ALLOW_AUDIO_FILES, threads: CONFIG.TRANSCODING.THREADS, resolutions: { + '0p': CONFIG.TRANSCODING.RESOLUTIONS[ '0p' ], '240p': CONFIG.TRANSCODING.RESOLUTIONS[ '240p' ], '360p': CONFIG.TRANSCODING.RESOLUTIONS[ '360p' ], '480p': CONFIG.TRANSCODING.RESOLUTIONS[ '480p' ], @@ -298,6 +308,9 @@ function customConfig (): CustomConfig { '1080p': CONFIG.TRANSCODING.RESOLUTIONS[ '1080p' ], '2160p': CONFIG.TRANSCODING.RESOLUTIONS[ '2160p' ] }, + webtorrent: { + enabled: CONFIG.TRANSCODING.WEBTORRENT.ENABLED + }, hls: { enabled: CONFIG.TRANSCODING.HLS.ENABLED } @@ -344,6 +357,7 @@ function convertCustomConfigBody (body: CustomConfig) { function keyConverter (k: string) { // Transcoding resolutions exception if (/^\d{3,4}p$/.exec(k)) return k + if (/^0p$/.exec(k)) return k return snakeCase(k) }