|
@@ -10,6 +10,10 @@ import {
|
|
|
NSFWPolicyType,
|
|
|
RunnerJobState,
|
|
|
RunnerJobStateType,
|
|
|
+ UserExportState,
|
|
|
+ UserExportStateType,
|
|
|
+ UserImportState,
|
|
|
+ UserImportStateType,
|
|
|
UserRegistrationState,
|
|
|
UserRegistrationStateType,
|
|
|
VideoChannelSyncState,
|
|
@@ -41,7 +45,7 @@ import { cpus } from 'os'
|
|
|
|
|
|
// ---------------------------------------------------------------------------
|
|
|
|
|
|
-const LAST_MIGRATION_VERSION = 805
|
|
|
+const LAST_MIGRATION_VERSION = 815
|
|
|
|
|
|
// ---------------------------------------------------------------------------
|
|
|
|
|
@@ -191,7 +195,9 @@ const JOB_ATTEMPTS: { [id in JobType]: number } = {
|
|
|
'transcoding-job-builder': 1,
|
|
|
'generate-video-storyboard': 1,
|
|
|
'notify': 1,
|
|
|
- 'federate-video': 1
|
|
|
+ 'federate-video': 1,
|
|
|
+ 'create-user-export': 1,
|
|
|
+ 'import-user-archive': 1
|
|
|
}
|
|
|
// Excluded keys are jobs that can be configured by admins
|
|
|
const JOB_CONCURRENCY: { [id in Exclude<JobType, 'video-transcoding' | 'video-import'>]: number } = {
|
|
@@ -217,7 +223,9 @@ const JOB_CONCURRENCY: { [id in Exclude<JobType, 'video-transcoding' | 'video-im
|
|
|
'transcoding-job-builder': 1,
|
|
|
'generate-video-storyboard': 1,
|
|
|
'notify': 5,
|
|
|
- 'federate-video': 3
|
|
|
+ 'federate-video': 3,
|
|
|
+ 'create-user-export': 1,
|
|
|
+ 'import-user-archive': 1
|
|
|
}
|
|
|
const JOB_TTL: { [id in JobType]: number } = {
|
|
|
'activitypub-http-broadcast': 60000 * 10, // 10 minutes
|
|
@@ -244,7 +252,9 @@ const JOB_TTL: { [id in JobType]: number } = {
|
|
|
'after-video-channel-import': 60000 * 5, // 5 minutes
|
|
|
'transcoding-job-builder': 60000, // 1 minute
|
|
|
'notify': 60000 * 5, // 5 minutes
|
|
|
- 'federate-video': 60000 * 5 // 5 minutes
|
|
|
+ 'federate-video': 60000 * 5, // 5 minutes,
|
|
|
+ 'create-user-export': 60000 * 60 * 24, // 24 hours
|
|
|
+ 'import-user-archive': 60000 * 60 * 24 // 24 hours
|
|
|
}
|
|
|
const REPEAT_JOBS: { [ id in JobType ]?: RepeatOptions } = {
|
|
|
'videos-views-stats': {
|
|
@@ -313,6 +323,7 @@ const SCHEDULER_INTERVALS_MS = {
|
|
|
AUTO_FOLLOW_INDEX_INSTANCES: 60000 * 60 * 24, // 1 day
|
|
|
REMOVE_OLD_VIEWS: 60000 * 60 * 24, // 1 day
|
|
|
REMOVE_OLD_HISTORY: 60000 * 60 * 24, // 1 day
|
|
|
+ REMOVE_EXPIRED_USER_EXPORTS: 1000 * 3600, // 1 hour
|
|
|
UPDATE_INBOX_STATS: 1000 * 60, // 1 minute
|
|
|
REMOVE_DANGLING_RESUMABLE_UPLOADS: 60000 * 60, // 1 hour
|
|
|
CHANNEL_SYNC_CHECK_INTERVAL: CONFIG.IMPORT.VIDEO_CHANNEL_SYNCHRONIZATION.CHECK_INTERVAL
|
|
@@ -503,6 +514,10 @@ const VIDEO_RATE_TYPES: { [ id: string ]: VideoRateType } = {
|
|
|
DISLIKE: 'dislike'
|
|
|
}
|
|
|
|
|
|
+const USER_IMPORT = {
|
|
|
+ MAX_PLAYLIST_ELEMENTS: 1000
|
|
|
+}
|
|
|
+
|
|
|
const FFMPEG_NICE = {
|
|
|
// parent process defaults to niceness = 0
|
|
|
// reminder: lower = higher priority, max value is 19, lowest is -20
|
|
@@ -618,6 +633,20 @@ const RUNNER_JOB_STATES: { [ id in RunnerJobStateType ]: string } = {
|
|
|
[RunnerJobState.PARENT_CANCELLED]: 'Parent job cancelled'
|
|
|
}
|
|
|
|
|
|
+const USER_EXPORT_STATES: { [ id in UserExportStateType ]: string } = {
|
|
|
+ [UserExportState.PENDING]: 'Pending',
|
|
|
+ [UserExportState.PROCESSING]: 'Processing',
|
|
|
+ [UserExportState.COMPLETED]: 'Completed',
|
|
|
+ [UserExportState.ERRORED]: 'Failed'
|
|
|
+}
|
|
|
+
|
|
|
+const USER_IMPORT_STATES: { [ id in UserImportStateType ]: string } = {
|
|
|
+ [UserImportState.PENDING]: 'Pending',
|
|
|
+ [UserImportState.PROCESSING]: 'Processing',
|
|
|
+ [UserImportState.COMPLETED]: 'Completed',
|
|
|
+ [UserImportState.ERRORED]: 'Failed'
|
|
|
+}
|
|
|
+
|
|
|
const MIMETYPES = {
|
|
|
AUDIO: {
|
|
|
MIMETYPE_EXT: {
|
|
@@ -773,6 +802,7 @@ const USER_PASSWORD_RESET_LIFETIME = 60000 * 60 // 60 minutes
|
|
|
const USER_PASSWORD_CREATE_LIFETIME = 60000 * 60 * 24 * 7 // 7 days
|
|
|
|
|
|
const TWO_FACTOR_AUTH_REQUEST_TOKEN_LIFETIME = 60000 * 10 // 10 minutes
|
|
|
+let JWT_TOKEN_USER_EXPORT_FILE_LIFETIME = '15 minutes'
|
|
|
|
|
|
const EMAIL_VERIFY_LIFETIME = 60000 * 60 // 60 minutes
|
|
|
|
|
@@ -807,7 +837,8 @@ const STATIC_PATHS = {
|
|
|
const STATIC_DOWNLOAD_PATHS = {
|
|
|
TORRENTS: '/download/torrents/',
|
|
|
VIDEOS: '/download/videos/',
|
|
|
- HLS_VIDEOS: '/download/streaming-playlists/hls/videos/'
|
|
|
+ HLS_VIDEOS: '/download/streaming-playlists/hls/videos/',
|
|
|
+ USER_EXPORT: '/download/user-export/'
|
|
|
}
|
|
|
const LAZY_STATIC_PATHS = {
|
|
|
THUMBNAILS: '/lazy-static/thumbnails/',
|
|
@@ -1125,6 +1156,8 @@ if (process.env.PRODUCTION_CONSTANTS !== 'true') {
|
|
|
VIDEO_LIVE.EDGE_LIVE_DELAY_SEGMENTS_NOTIFICATION = 1
|
|
|
|
|
|
RUNNER_JOBS.LAST_CONTACT_UPDATE_INTERVAL = 2000
|
|
|
+
|
|
|
+ JWT_TOKEN_USER_EXPORT_FILE_LIFETIME = '2 seconds'
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -1168,6 +1201,8 @@ export {
|
|
|
DIRECTORIES,
|
|
|
RESUMABLE_UPLOAD_SESSION_LIFETIME,
|
|
|
RUNNER_JOB_STATES,
|
|
|
+ USER_EXPORT_STATES,
|
|
|
+ USER_IMPORT_STATES,
|
|
|
P2P_MEDIA_LOADER_PEER_VERSION,
|
|
|
STORYBOARD,
|
|
|
ACTOR_IMAGES_SIZE,
|
|
@@ -1187,6 +1222,7 @@ export {
|
|
|
STATS_TIMESERIE,
|
|
|
BROADCAST_CONCURRENCY,
|
|
|
AUDIT_LOG_FILENAME,
|
|
|
+ USER_IMPORT,
|
|
|
PAGINATION,
|
|
|
ACTOR_FOLLOW_SCORE,
|
|
|
PREVIEWS_SIZE,
|
|
@@ -1195,6 +1231,7 @@ export {
|
|
|
DEFAULT_USER_THEME_NAME,
|
|
|
SERVER_ACTOR_NAME,
|
|
|
TWO_FACTOR_AUTH_REQUEST_TOKEN_LIFETIME,
|
|
|
+ JWT_TOKEN_USER_EXPORT_FILE_LIFETIME,
|
|
|
PLUGIN_GLOBAL_CSS_FILE_NAME,
|
|
|
PLUGIN_GLOBAL_CSS_PATH,
|
|
|
PRIVATE_RSA_KEY_SIZE,
|