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