diff options
Diffstat (limited to 'server/initializers/constants.ts')
-rw-r--r-- | server/initializers/constants.ts | 60 |
1 files changed, 45 insertions, 15 deletions
diff --git a/server/initializers/constants.ts b/server/initializers/constants.ts index 1c47d43f0..3069e2353 100644 --- a/server/initializers/constants.ts +++ b/server/initializers/constants.ts | |||
@@ -14,7 +14,7 @@ import { | |||
14 | VideoTranscodingFPS | 14 | VideoTranscodingFPS |
15 | } from '../../shared/models' | 15 | } from '../../shared/models' |
16 | import { ActivityPubActorType } from '../../shared/models/activitypub' | 16 | import { ActivityPubActorType } from '../../shared/models/activitypub' |
17 | import { FollowState } from '../../shared/models/actors' | 17 | import { ActorImageType, FollowState } from '../../shared/models/actors' |
18 | import { NSFWPolicyType } from '../../shared/models/videos/nsfw-policy.type' | 18 | import { NSFWPolicyType } from '../../shared/models/videos/nsfw-policy.type' |
19 | import { VideoPlaylistPrivacy } from '../../shared/models/videos/playlist/video-playlist-privacy.model' | 19 | import { VideoPlaylistPrivacy } from '../../shared/models/videos/playlist/video-playlist-privacy.model' |
20 | import { VideoPlaylistType } from '../../shared/models/videos/playlist/video-playlist-type.model' | 20 | import { VideoPlaylistType } from '../../shared/models/videos/playlist/video-playlist-type.model' |
@@ -24,7 +24,7 @@ import { CONFIG, registerConfigChangedHandler } from './config' | |||
24 | 24 | ||
25 | // --------------------------------------------------------------------------- | 25 | // --------------------------------------------------------------------------- |
26 | 26 | ||
27 | const LAST_MIGRATION_VERSION = 680 | 27 | const LAST_MIGRATION_VERSION = 685 |
28 | 28 | ||
29 | // --------------------------------------------------------------------------- | 29 | // --------------------------------------------------------------------------- |
30 | 30 | ||
@@ -152,6 +152,7 @@ const JOB_ATTEMPTS: { [id in JobType]: number } = { | |||
152 | 'activitypub-refresher': 1, | 152 | 'activitypub-refresher': 1, |
153 | 'video-redundancy': 1, | 153 | 'video-redundancy': 1, |
154 | 'video-live-ending': 1, | 154 | 'video-live-ending': 1, |
155 | 'video-edition': 1, | ||
155 | 'move-to-object-storage': 3 | 156 | 'move-to-object-storage': 3 |
156 | } | 157 | } |
157 | // Excluded keys are jobs that can be configured by admins | 158 | // Excluded keys are jobs that can be configured by admins |
@@ -168,6 +169,7 @@ const JOB_CONCURRENCY: { [id in Exclude<JobType, 'video-transcoding' | 'video-im | |||
168 | 'activitypub-refresher': 1, | 169 | 'activitypub-refresher': 1, |
169 | 'video-redundancy': 1, | 170 | 'video-redundancy': 1, |
170 | 'video-live-ending': 10, | 171 | 'video-live-ending': 10, |
172 | 'video-edition': 1, | ||
171 | 'move-to-object-storage': 1 | 173 | 'move-to-object-storage': 1 |
172 | } | 174 | } |
173 | const JOB_TTL: { [id in JobType]: number } = { | 175 | const JOB_TTL: { [id in JobType]: number } = { |
@@ -178,6 +180,7 @@ const JOB_TTL: { [id in JobType]: number } = { | |||
178 | 'activitypub-cleaner': 1000 * 3600, // 1 hour | 180 | 'activitypub-cleaner': 1000 * 3600, // 1 hour |
179 | 'video-file-import': 1000 * 3600, // 1 hour | 181 | 'video-file-import': 1000 * 3600, // 1 hour |
180 | 'video-transcoding': 1000 * 3600 * 48, // 2 days, transcoding could be long | 182 | 'video-transcoding': 1000 * 3600 * 48, // 2 days, transcoding could be long |
183 | 'video-edition': 1000 * 3600 * 10, // 10 hours | ||
181 | 'video-import': 1000 * 3600 * 2, // 2 hours | 184 | 'video-import': 1000 * 3600 * 2, // 2 hours |
182 | 'email': 60000 * 10, // 10 minutes | 185 | 'email': 60000 * 10, // 10 minutes |
183 | 'actor-keys': 60000 * 20, // 20 minutes | 186 | 'actor-keys': 60000 * 20, // 20 minutes |
@@ -351,6 +354,10 @@ const CONSTRAINTS_FIELDS = { | |||
351 | }, | 354 | }, |
352 | COMMONS: { | 355 | COMMONS: { |
353 | URL: { min: 5, max: 2000 } // Length | 356 | URL: { min: 5, max: 2000 } // Length |
357 | }, | ||
358 | VIDEO_EDITOR: { | ||
359 | TASKS: { min: 1, max: 10 }, // Number of tasks | ||
360 | CUT_TIME: { min: 0 } // Value | ||
354 | } | 361 | } |
355 | } | 362 | } |
356 | 363 | ||
@@ -365,6 +372,7 @@ const VIDEO_TRANSCODING_FPS: VideoTranscodingFPS = { | |||
365 | MIN: 1, | 372 | MIN: 1, |
366 | STANDARD: [ 24, 25, 30 ], | 373 | STANDARD: [ 24, 25, 30 ], |
367 | HD_STANDARD: [ 50, 60 ], | 374 | HD_STANDARD: [ 50, 60 ], |
375 | AUDIO_MERGE: 25, | ||
368 | AVERAGE: 30, | 376 | AVERAGE: 30, |
369 | MAX: 60, | 377 | MAX: 60, |
370 | KEEP_ORIGIN_FPS_RESOLUTION_MIN: 720 // We keep the original FPS on high resolutions (720 minimum) | 378 | KEEP_ORIGIN_FPS_RESOLUTION_MIN: 720 // We keep the original FPS on high resolutions (720 minimum) |
@@ -434,7 +442,8 @@ const VIDEO_STATES: { [ id in VideoState ]: string } = { | |||
434 | [VideoState.LIVE_ENDED]: 'Livestream ended', | 442 | [VideoState.LIVE_ENDED]: 'Livestream ended', |
435 | [VideoState.TO_MOVE_TO_EXTERNAL_STORAGE]: 'To move to an external storage', | 443 | [VideoState.TO_MOVE_TO_EXTERNAL_STORAGE]: 'To move to an external storage', |
436 | [VideoState.TRANSCODING_FAILED]: 'Transcoding failed', | 444 | [VideoState.TRANSCODING_FAILED]: 'Transcoding failed', |
437 | [VideoState.TO_MOVE_TO_EXTERNAL_STORAGE_FAILED]: 'External storage move failed' | 445 | [VideoState.TO_MOVE_TO_EXTERNAL_STORAGE_FAILED]: 'External storage move failed', |
446 | [VideoState.TO_EDIT]: 'To edit*' | ||
438 | } | 447 | } |
439 | 448 | ||
440 | const VIDEO_IMPORT_STATES: { [ id in VideoImportState ]: string } = { | 449 | const VIDEO_IMPORT_STATES: { [ id in VideoImportState ]: string } = { |
@@ -633,15 +642,23 @@ const PREVIEWS_SIZE = { | |||
633 | height: 480, | 642 | height: 480, |
634 | minWidth: 400 | 643 | minWidth: 400 |
635 | } | 644 | } |
636 | const ACTOR_IMAGES_SIZE = { | 645 | const ACTOR_IMAGES_SIZE: { [key in ActorImageType]: { width: number, height: number }[]} = { |
637 | AVATARS: { | 646 | [ActorImageType.AVATAR]: [ |
638 | width: 120, | 647 | { |
639 | height: 120 | 648 | width: 120, |
640 | }, | 649 | height: 120 |
641 | BANNERS: { | 650 | }, |
642 | width: 1920, | 651 | { |
643 | height: 317 // 6/1 ratio | 652 | width: 48, |
644 | } | 653 | height: 48 |
654 | } | ||
655 | ], | ||
656 | [ActorImageType.BANNER]: [ | ||
657 | { | ||
658 | width: 1920, | ||
659 | height: 317 // 6/1 ratio | ||
660 | } | ||
661 | ] | ||
645 | } | 662 | } |
646 | 663 | ||
647 | const EMBED_SIZE = { | 664 | const EMBED_SIZE = { |
@@ -701,10 +718,12 @@ const MEMOIZE_TTL = { | |||
701 | OVERVIEWS_SAMPLE: 1000 * 3600 * 4, // 4 hours | 718 | OVERVIEWS_SAMPLE: 1000 * 3600 * 4, // 4 hours |
702 | INFO_HASH_EXISTS: 1000 * 3600 * 12, // 12 hours | 719 | INFO_HASH_EXISTS: 1000 * 3600 * 12, // 12 hours |
703 | LIVE_ABLE_TO_UPLOAD: 1000 * 60, // 1 minute | 720 | LIVE_ABLE_TO_UPLOAD: 1000 * 60, // 1 minute |
704 | LIVE_CHECK_SOCKET_HEALTH: 1000 * 60 // 1 minute | 721 | LIVE_CHECK_SOCKET_HEALTH: 1000 * 60, // 1 minute |
722 | MD_TO_PLAIN_TEXT_CLIENT_HTML: 1000 * 60 // 1 minute | ||
705 | } | 723 | } |
706 | 724 | ||
707 | const MEMOIZE_LENGTH = { | 725 | const MEMOIZE_LENGTH = { |
726 | MD_TO_PLAIN_TEXT_CLIENT_HTML: 100, | ||
708 | INFO_HASH_EXISTS: 200 | 727 | INFO_HASH_EXISTS: 200 |
709 | } | 728 | } |
710 | 729 | ||
@@ -847,6 +866,16 @@ const FILES_CONTENT_HASH = { | |||
847 | 866 | ||
848 | // --------------------------------------------------------------------------- | 867 | // --------------------------------------------------------------------------- |
849 | 868 | ||
869 | const VIDEO_FILTERS = { | ||
870 | WATERMARK: { | ||
871 | SIZE_RATIO: 1 / 10, | ||
872 | HORIZONTAL_MARGIN_RATIO: 1 / 20, | ||
873 | VERTICAL_MARGIN_RATIO: 1 / 20 | ||
874 | } | ||
875 | } | ||
876 | |||
877 | // --------------------------------------------------------------------------- | ||
878 | |||
850 | export { | 879 | export { |
851 | WEBSERVER, | 880 | WEBSERVER, |
852 | API_VERSION, | 881 | API_VERSION, |
@@ -885,6 +914,7 @@ export { | |||
885 | PLUGIN_GLOBAL_CSS_FILE_NAME, | 914 | PLUGIN_GLOBAL_CSS_FILE_NAME, |
886 | PLUGIN_GLOBAL_CSS_PATH, | 915 | PLUGIN_GLOBAL_CSS_PATH, |
887 | PRIVATE_RSA_KEY_SIZE, | 916 | PRIVATE_RSA_KEY_SIZE, |
917 | VIDEO_FILTERS, | ||
888 | ROUTE_CACHE_LIFETIME, | 918 | ROUTE_CACHE_LIFETIME, |
889 | SORTABLE_COLUMNS, | 919 | SORTABLE_COLUMNS, |
890 | HLS_STREAMING_PLAYLIST_DIRECTORY, | 920 | HLS_STREAMING_PLAYLIST_DIRECTORY, |
@@ -1016,8 +1046,8 @@ function updateWebserverUrls () { | |||
1016 | WEBSERVER.HOSTNAME = CONFIG.WEBSERVER.HOSTNAME | 1046 | WEBSERVER.HOSTNAME = CONFIG.WEBSERVER.HOSTNAME |
1017 | WEBSERVER.PORT = CONFIG.WEBSERVER.PORT | 1047 | WEBSERVER.PORT = CONFIG.WEBSERVER.PORT |
1018 | 1048 | ||
1019 | WEBSERVER.RTMP_URL = 'rtmp://' + CONFIG.WEBSERVER.HOSTNAME + ':' + CONFIG.LIVE.RTMP.PORT + '/' + VIDEO_LIVE.RTMP.BASE_PATH | 1049 | WEBSERVER.RTMP_URL = 'rtmp://' + CONFIG.LIVE.RTMP.HOSTNAME + ':' + CONFIG.LIVE.RTMP.PORT + '/' + VIDEO_LIVE.RTMP.BASE_PATH |
1020 | WEBSERVER.RTMPS_URL = 'rtmps://' + CONFIG.WEBSERVER.HOSTNAME + ':' + CONFIG.LIVE.RTMPS.PORT + '/' + VIDEO_LIVE.RTMP.BASE_PATH | 1050 | WEBSERVER.RTMPS_URL = 'rtmps://' + CONFIG.LIVE.RTMPS.HOSTNAME + ':' + CONFIG.LIVE.RTMPS.PORT + '/' + VIDEO_LIVE.RTMP.BASE_PATH |
1021 | } | 1051 | } |
1022 | 1052 | ||
1023 | function updateWebserverConfig () { | 1053 | function updateWebserverConfig () { |