server-config.model.ts 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. import { NSFWPolicyType } from '../videos/nsfw-policy.type'
  2. import { ClientScript } from '../plugins/plugin-package-json.model'
  3. export interface ServerConfigPlugin {
  4. name: string
  5. version: string
  6. description: string
  7. clientScripts: { [name: string]: ClientScript }
  8. }
  9. export interface ServerConfigTheme extends ServerConfigPlugin {
  10. css: string[]
  11. }
  12. export interface RegisteredExternalAuthConfig {
  13. npmName: string
  14. authName: string
  15. authDisplayName: string
  16. }
  17. export interface RegisteredIdAndPassAuthConfig {
  18. npmName: string
  19. authName: string
  20. weight: number
  21. }
  22. export interface ServerConfig {
  23. serverVersion: string
  24. serverCommit?: string
  25. instance: {
  26. name: string
  27. shortDescription: string
  28. defaultClientRoute: string
  29. isNSFW: boolean
  30. defaultNSFWPolicy: NSFWPolicyType
  31. customizations: {
  32. javascript: string
  33. css: string
  34. }
  35. }
  36. search: {
  37. remoteUri: {
  38. users: boolean
  39. anonymous: boolean
  40. }
  41. }
  42. plugin: {
  43. registered: ServerConfigPlugin[]
  44. registeredExternalAuths: RegisteredExternalAuthConfig[]
  45. registeredIdAndPassAuths: RegisteredIdAndPassAuthConfig[]
  46. }
  47. theme: {
  48. registered: ServerConfigTheme[]
  49. default: string
  50. }
  51. email: {
  52. enabled: boolean
  53. }
  54. contactForm: {
  55. enabled: boolean
  56. }
  57. signup: {
  58. allowed: boolean
  59. allowedForCurrentIP: boolean
  60. requiresEmailVerification: boolean
  61. }
  62. transcoding: {
  63. hls: {
  64. enabled: boolean
  65. }
  66. webtorrent: {
  67. enabled: boolean
  68. }
  69. enabledResolutions: number[]
  70. }
  71. import: {
  72. videos: {
  73. http: {
  74. enabled: boolean
  75. }
  76. torrent: {
  77. enabled: boolean
  78. }
  79. }
  80. }
  81. autoBlacklist: {
  82. videos: {
  83. ofUsers: {
  84. enabled: boolean
  85. }
  86. }
  87. }
  88. avatar: {
  89. file: {
  90. size: {
  91. max: number
  92. }
  93. extensions: string[]
  94. }
  95. }
  96. video: {
  97. image: {
  98. size: {
  99. max: number
  100. }
  101. extensions: string[]
  102. }
  103. file: {
  104. extensions: string[]
  105. }
  106. }
  107. videoCaption: {
  108. file: {
  109. size: {
  110. max: number
  111. }
  112. extensions: string[]
  113. }
  114. }
  115. user: {
  116. videoQuota: number
  117. videoQuotaDaily: number
  118. }
  119. trending: {
  120. videos: {
  121. intervalDays: number
  122. }
  123. }
  124. tracker: {
  125. enabled: boolean
  126. }
  127. followings: {
  128. instance: {
  129. autoFollowIndex: {
  130. indexUrl: string
  131. }
  132. }
  133. }
  134. }