]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/lib/server-config-manager.ts
Channel sync (#5135)
[github/Chocobozzz/PeerTube.git] / server / lib / server-config-manager.ts
index d759f85e17c3ee1187eb56dc1e41bb3620224fb9..78a9546ae6e85afdb5e89e9f5db3ff276d118c3c 100644 (file)
@@ -1,13 +1,14 @@
-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'
 
 /**
  *
@@ -45,7 +46,11 @@ class ServerConfigManager {
       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: {
@@ -63,7 +68,12 @@ class ServerConfigManager {
           licence: CONFIG.DEFAULTS.PUBLISH.LICENCE
         },
         p2p: {
-          enabled: CONFIG.DEFAULTS.P2P.ENABLED
+          webapp: {
+            enabled: CONFIG.DEFAULTS.P2P.WEBAPP.ENABLED
+          },
+          embed: {
+            enabled: CONFIG.DEFAULTS.P2P.EMBED.ENABLED
+          }
         }
       },
 
@@ -130,6 +140,10 @@ class ServerConfigManager {
         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,
@@ -145,6 +159,9 @@ class ServerConfigManager {
           port: CONFIG.LIVE.RTMP.PORT
         }
       },
+      videoStudio: {
+        enabled: CONFIG.VIDEO_STUDIO.ENABLED
+      },
       import: {
         videos: {
           http: {
@@ -153,6 +170,9 @@ class ServerConfigManager {
           torrent: {
             enabled: CONFIG.IMPORT.VIDEOS.TORRENT.ENABLED
           }
+        },
+        videoChannelSynchronization: {
+          enabled: CONFIG.IMPORT.VIDEO_CHANNEL_SYNCHRONIZATION.ENABLED
         }
       },
       autoBlacklist: {
@@ -264,6 +284,7 @@ class ServerConfigManager {
   getRegisteredThemes () {
     return PluginManager.Instance.getRegisteredThemes()
                         .map(t => ({
+                          npmName: PluginModel.buildNpmName(t.name, t.type),
                           name: t.name,
                           version: t.version,
                           description: t.description,
@@ -275,6 +296,7 @@ class ServerConfigManager {
   getRegisteredPlugins () {
     return PluginManager.Instance.getRegisteredPlugins()
                         .map(p => ({
+                          npmName: PluginModel.buildNpmName(p.name, p.type),
                           name: p.name,
                           version: p.version,
                           description: p.description,