aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/initializers/constants.ts
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2017-11-10 14:34:45 +0100
committerChocobozzz <florian.bigard@gmail.com>2017-11-27 19:40:51 +0100
commit0d0e8dd0904b380b70e19ebcb4763d65601c4632 (patch)
treeacb625d7c88fbe863fa14bf6783fafe4a8e35137 /server/initializers/constants.ts
parente4f97babf701481b55cc10fb3448feab5f97c867 (diff)
downloadPeerTube-0d0e8dd0904b380b70e19ebcb4763d65601c4632.tar.gz
PeerTube-0d0e8dd0904b380b70e19ebcb4763d65601c4632.tar.zst
PeerTube-0d0e8dd0904b380b70e19ebcb4763d65601c4632.zip
Continue activitypub
Diffstat (limited to 'server/initializers/constants.ts')
-rw-r--r--server/initializers/constants.ts56
1 files changed, 16 insertions, 40 deletions
diff --git a/server/initializers/constants.ts b/server/initializers/constants.ts
index cb838cf16..e1f877e80 100644
--- a/server/initializers/constants.ts
+++ b/server/initializers/constants.ts
@@ -203,6 +203,12 @@ const VIDEO_PRIVACIES = {
203 [VideoPrivacy.PRIVATE]: 'Private' 203 [VideoPrivacy.PRIVATE]: 'Private'
204} 204}
205 205
206const VIDEO_MIMETYPE_EXT = {
207 'video/webm': 'webm',
208 'video/ogg': 'ogv',
209 'video/mp4': 'mp4'
210}
211
206// --------------------------------------------------------------------------- 212// ---------------------------------------------------------------------------
207 213
208// Score a pod has when we create it as a friend 214// Score a pod has when we create it as a friend
@@ -212,7 +218,14 @@ const FRIEND_SCORE = {
212} 218}
213 219
214const ACTIVITY_PUB = { 220const ACTIVITY_PUB = {
215 COLLECTION_ITEMS_PER_PAGE: 10 221 COLLECTION_ITEMS_PER_PAGE: 10,
222 VIDEO_URL_MIME_TYPES: [
223 'video/mp4',
224 'video/webm',
225 'video/ogg',
226 'application/x-bittorrent',
227 'application/x-bittorrent;x-scheme-handler/magnet'
228 ]
216} 229}
217 230
218// --------------------------------------------------------------------------- 231// ---------------------------------------------------------------------------
@@ -245,42 +258,6 @@ const REQUESTS_VIDEO_EVENT_LIMIT_PER_POD = 50
245// Number of requests to retry for replay requests module 258// Number of requests to retry for replay requests module
246const RETRY_REQUESTS = 5 259const RETRY_REQUESTS = 5
247 260
248const REQUEST_ENDPOINTS: { [ id: string ]: RequestEndpoint } = {
249 VIDEOS: 'videos'
250}
251
252const REQUEST_ENDPOINT_ACTIONS: {
253 [ id: string ]: {
254 [ id: string ]: RemoteVideoRequestType
255 }
256} = {}
257REQUEST_ENDPOINT_ACTIONS[REQUEST_ENDPOINTS.VIDEOS] = {
258 ADD_VIDEO: 'add-video',
259 UPDATE_VIDEO: 'update-video',
260 REMOVE_VIDEO: 'remove-video',
261 ADD_CHANNEL: 'add-channel',
262 UPDATE_CHANNEL: 'update-channel',
263 REMOVE_CHANNEL: 'remove-channel',
264 ADD_AUTHOR: 'add-author',
265 REMOVE_AUTHOR: 'remove-author',
266 REPORT_ABUSE: 'report-abuse'
267}
268
269const REQUEST_VIDEO_QADU_ENDPOINT = 'videos/qadu'
270const REQUEST_VIDEO_EVENT_ENDPOINT = 'videos/events'
271
272const REQUEST_VIDEO_QADU_TYPES: { [ id: string ]: RequestVideoQaduType } = {
273 LIKES: 'likes',
274 DISLIKES: 'dislikes',
275 VIEWS: 'views'
276}
277
278const REQUEST_VIDEO_EVENT_TYPES: { [ id: string ]: RequestVideoEventType } = {
279 LIKES: 'likes',
280 DISLIKES: 'dislikes',
281 VIEWS: 'views'
282}
283
284const REMOTE_SCHEME = { 261const REMOTE_SCHEME = {
285 HTTP: 'https', 262 HTTP: 'https',
286 WS: 'wss' 263 WS: 'wss'
@@ -306,8 +283,6 @@ let JOBS_FETCHING_INTERVAL = 60000
306 283
307// --------------------------------------------------------------------------- 284// ---------------------------------------------------------------------------
308 285
309// const SIGNATURE_ALGORITHM = 'RSA-SHA256'
310// const SIGNATURE_ENCODING = 'hex'
311const PRIVATE_RSA_KEY_SIZE = 2048 286const PRIVATE_RSA_KEY_SIZE = 2048
312 287
313// Password encryption 288// Password encryption
@@ -412,5 +387,6 @@ export {
412 VIDEO_LANGUAGES, 387 VIDEO_LANGUAGES,
413 VIDEO_PRIVACIES, 388 VIDEO_PRIVACIES,
414 VIDEO_LICENCES, 389 VIDEO_LICENCES,
415 VIDEO_RATE_TYPES 390 VIDEO_RATE_TYPES,
391 VIDEO_MIMETYPE_EXT
416} 392}