server-config.model.ts 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286
  1. import { VideoPrivacy } from '../videos/video-privacy.enum'
  2. import { ClientScriptJSON } from '../plugins/plugin-package-json.model'
  3. import { NSFWPolicyType } from '../videos/nsfw-policy.type'
  4. import { BroadcastMessageLevel } from './broadcast-message-level.type'
  5. export interface ServerConfigPlugin {
  6. name: string
  7. npmName: string
  8. version: string
  9. description: string
  10. clientScripts: { [name: string]: ClientScriptJSON }
  11. }
  12. export interface ServerConfigTheme extends ServerConfigPlugin {
  13. css: string[]
  14. }
  15. export interface RegisteredExternalAuthConfig {
  16. npmName: string
  17. name: string
  18. version: string
  19. authName: string
  20. authDisplayName: string
  21. }
  22. export interface RegisteredIdAndPassAuthConfig {
  23. npmName: string
  24. name: string
  25. version: string
  26. authName: string
  27. weight: number
  28. }
  29. export interface ServerConfig {
  30. serverVersion: string
  31. serverCommit?: string
  32. client: {
  33. videos: {
  34. miniature: {
  35. displayAuthorAvatar: boolean
  36. preferAuthorDisplayName: boolean
  37. }
  38. resumableUpload: {
  39. maxChunkSize: number
  40. }
  41. }
  42. menu: {
  43. login: {
  44. redirectOnSingleExternalAuth: boolean
  45. }
  46. }
  47. }
  48. defaults: {
  49. publish: {
  50. downloadEnabled: boolean
  51. commentsEnabled: boolean
  52. privacy: VideoPrivacy
  53. licence: number
  54. }
  55. p2p: {
  56. webapp: {
  57. enabled: boolean
  58. }
  59. embed: {
  60. enabled: boolean
  61. }
  62. }
  63. }
  64. webadmin: {
  65. configuration: {
  66. edition: {
  67. allowed: boolean
  68. }
  69. }
  70. }
  71. instance: {
  72. name: string
  73. shortDescription: string
  74. isNSFW: boolean
  75. defaultNSFWPolicy: NSFWPolicyType
  76. defaultClientRoute: string
  77. customizations: {
  78. javascript: string
  79. css: string
  80. }
  81. }
  82. search: {
  83. remoteUri: {
  84. users: boolean
  85. anonymous: boolean
  86. }
  87. searchIndex: {
  88. enabled: boolean
  89. url: string
  90. disableLocalSearch: boolean
  91. isDefaultSearch: boolean
  92. }
  93. }
  94. plugin: {
  95. registered: ServerConfigPlugin[]
  96. registeredExternalAuths: RegisteredExternalAuthConfig[]
  97. registeredIdAndPassAuths: RegisteredIdAndPassAuthConfig[]
  98. }
  99. theme: {
  100. registered: ServerConfigTheme[]
  101. default: string
  102. }
  103. email: {
  104. enabled: boolean
  105. }
  106. contactForm: {
  107. enabled: boolean
  108. }
  109. signup: {
  110. allowed: boolean
  111. allowedForCurrentIP: boolean
  112. requiresEmailVerification: boolean
  113. minimumAge: number
  114. }
  115. transcoding: {
  116. hls: {
  117. enabled: boolean
  118. }
  119. webtorrent: {
  120. enabled: boolean
  121. }
  122. enabledResolutions: number[]
  123. profile: string
  124. availableProfiles: string[]
  125. }
  126. live: {
  127. enabled: boolean
  128. allowReplay: boolean
  129. latencySetting: {
  130. enabled: boolean
  131. }
  132. maxDuration: number
  133. maxInstanceLives: number
  134. maxUserLives: number
  135. transcoding: {
  136. enabled: boolean
  137. enabledResolutions: number[]
  138. profile: string
  139. availableProfiles: string[]
  140. }
  141. rtmp: {
  142. port: number
  143. }
  144. }
  145. videoStudio: {
  146. enabled: boolean
  147. }
  148. import: {
  149. videos: {
  150. http: {
  151. enabled: boolean
  152. }
  153. torrent: {
  154. enabled: boolean
  155. }
  156. }
  157. videoChannelSynchronization: {
  158. enabled: boolean
  159. }
  160. }
  161. autoBlacklist: {
  162. videos: {
  163. ofUsers: {
  164. enabled: boolean
  165. }
  166. }
  167. }
  168. avatar: {
  169. file: {
  170. size: {
  171. max: number
  172. }
  173. extensions: string[]
  174. }
  175. }
  176. banner: {
  177. file: {
  178. size: {
  179. max: number
  180. }
  181. extensions: string[]
  182. }
  183. }
  184. video: {
  185. image: {
  186. size: {
  187. max: number
  188. }
  189. extensions: string[]
  190. }
  191. file: {
  192. extensions: string[]
  193. }
  194. }
  195. videoCaption: {
  196. file: {
  197. size: {
  198. max: number
  199. }
  200. extensions: string[]
  201. }
  202. }
  203. user: {
  204. videoQuota: number
  205. videoQuotaDaily: number
  206. }
  207. videoChannels: {
  208. maxPerUser: number
  209. }
  210. trending: {
  211. videos: {
  212. intervalDays: number
  213. algorithms: {
  214. enabled: string[]
  215. default: string
  216. }
  217. }
  218. }
  219. tracker: {
  220. enabled: boolean
  221. }
  222. followings: {
  223. instance: {
  224. autoFollowIndex: {
  225. indexUrl: string
  226. }
  227. }
  228. }
  229. broadcastMessage: {
  230. enabled: boolean
  231. message: string
  232. level: BroadcastMessageLevel
  233. dismissable: boolean
  234. }
  235. homepage: {
  236. enabled: boolean
  237. }
  238. }
  239. export type HTMLServerConfig = Omit<ServerConfig, 'signup'>