-import { getServerCommit } from '@server/helpers/utils'
+import { getServerCommit } from '@server/helpers/version'
import { CONFIG, isEmailEnabled } from '@server/initializers/config'
import { CONSTRAINTS_FIELDS, DEFAULT_THEME_NAME, PEERTUBE_VERSION } from '@server/initializers/constants'
import { isSignupAllowed, isSignupAllowedForCurrentIP } from '@server/lib/signup'
import { ActorCustomPageModel } from '@server/models/account/actor-custom-page'
+import { PluginModel } from '@server/models/server/plugin'
import { HTMLServerConfig, RegisteredExternalAuthConfig, RegisteredIdAndPassAuthConfig, ServerConfig } from '@shared/models'
import { Hooks } from './plugins/hooks'
import { PluginManager } from './plugins/plugin-manager'
import { getThemeOrDefault } from './plugins/theme-utils'
-import { VideoTranscodingProfilesManager } from './transcoding/video-transcoding-profiles'
+import { VideoTranscodingProfilesManager } from './transcoding/default-transcoding-profiles'
/**
*
client: {
videos: {
miniature: {
+ displayAuthorAvatar: CONFIG.CLIENT.VIDEOS.MINIATURE.DISPLAY_AUTHOR_AVATAR,
preferAuthorDisplayName: CONFIG.CLIENT.VIDEOS.MINIATURE.PREFER_AUTHOR_DISPLAY_NAME
+ },
+ resumableUpload: {
+ maxChunkSize: CONFIG.CLIENT.VIDEOS.RESUMABLE_UPLOAD.MAX_CHUNK_SIZE
}
},
menu: {
serverVersion: PEERTUBE_VERSION,
serverCommit: this.serverCommit,
transcoding: {
+ remoteRunners: {
+ enabled: CONFIG.TRANSCODING.ENABLED && CONFIG.TRANSCODING.REMOTE_RUNNERS.ENABLED
+ },
hls: {
- enabled: CONFIG.TRANSCODING.HLS.ENABLED
+ enabled: CONFIG.TRANSCODING.ENABLED && CONFIG.TRANSCODING.HLS.ENABLED
},
webtorrent: {
- enabled: CONFIG.TRANSCODING.WEBTORRENT.ENABLED
+ enabled: CONFIG.TRANSCODING.ENABLED && CONFIG.TRANSCODING.WEBTORRENT.ENABLED
},
enabledResolutions: this.getEnabledResolutions('vod'),
profile: CONFIG.TRANSCODING.PROFILE,
enabled: CONFIG.LIVE.ENABLED,
allowReplay: CONFIG.LIVE.ALLOW_REPLAY,
+ latencySetting: {
+ enabled: CONFIG.LIVE.LATENCY_SETTING.ENABLED
+ },
+
maxDuration: CONFIG.LIVE.MAX_DURATION,
maxInstanceLives: CONFIG.LIVE.MAX_INSTANCE_LIVES,
maxUserLives: CONFIG.LIVE.MAX_USER_LIVES,
transcoding: {
enabled: CONFIG.LIVE.TRANSCODING.ENABLED,
+ remoteRunners: {
+ enabled: CONFIG.LIVE.TRANSCODING.ENABLED && CONFIG.LIVE.TRANSCODING.REMOTE_RUNNERS.ENABLED
+ },
enabledResolutions: this.getEnabledResolutions('live'),
profile: CONFIG.LIVE.TRANSCODING.PROFILE,
availableProfiles: VideoTranscodingProfilesManager.Instance.getAvailableProfiles('live')
port: CONFIG.LIVE.RTMP.PORT
}
},
+ videoStudio: {
+ enabled: CONFIG.VIDEO_STUDIO.ENABLED,
+ remoteRunners: {
+ enabled: CONFIG.VIDEO_STUDIO.REMOTE_RUNNERS.ENABLED
+ }
+ },
import: {
videos: {
http: {
torrent: {
enabled: CONFIG.IMPORT.VIDEOS.TORRENT.ENABLED
}
+ },
+ videoChannelSynchronization: {
+ enabled: CONFIG.IMPORT.VIDEO_CHANNEL_SYNCHRONIZATION.ENABLED
}
},
autoBlacklist: {
async getServerConfig (ip?: string): Promise<ServerConfig> {
const { allowed } = await Hooks.wrapPromiseFun(
isSignupAllowed,
+
{
- ip
+ ip,
+ signupMode: CONFIG.SIGNUP.REQUIRES_APPROVAL
+ ? 'request-registration'
+ : 'direct-registration'
},
- 'filter:api.user.signup.allowed.result'
+
+ CONFIG.SIGNUP.REQUIRES_APPROVAL
+ ? 'filter:api.user.request-signup.allowed.result'
+ : 'filter:api.user.signup.allowed.result'
)
const allowedForCurrentIP = isSignupAllowedForCurrentIP(ip)
allowed,
allowedForCurrentIP,
minimumAge: CONFIG.SIGNUP.MINIMUM_AGE,
+ requiresApproval: CONFIG.SIGNUP.REQUIRES_APPROVAL,
requiresEmailVerification: CONFIG.SIGNUP.REQUIRES_EMAIL_VERIFICATION
}
getRegisteredThemes () {
return PluginManager.Instance.getRegisteredThemes()
.map(t => ({
+ npmName: PluginModel.buildNpmName(t.name, t.type),
name: t.name,
version: t.version,
description: t.description,
getRegisteredPlugins () {
return PluginManager.Instance.getRegisteredPlugins()
.map(p => ({
+ npmName: PluginModel.buildNpmName(p.name, p.type),
name: p.name,
version: p.version,
description: p.description,