-import { join } from 'path'
+import { randomInt } from '../../shared/core-utils/miscs/miscs'
+import { CronRepeatOptions, EveryRepeatOptions } from 'bull'
import { randomBytes } from 'crypto'
-import { ActivityPubActorType } from '../../shared/models/activitypub'
-import { FollowState } from '../../shared/models/actors'
+import { invert } from 'lodash'
+import { join } from 'path'
import {
AbuseState,
+ JobType,
VideoImportState,
VideoPrivacy,
- VideoTranscodingFPS,
- JobType,
VideoRateType,
VideoResolution,
- VideoState
+ VideoState,
+ VideoTranscodingFPS
} from '../../shared/models'
-// Do not use barrels, remain constants as independent as possible
-import { isTestInstance, sanitizeHost, sanitizeUrl, root } from '../helpers/core-utils'
+import { ActivityPubActorType } from '../../shared/models/activitypub'
+import { FollowState } from '../../shared/models/actors'
import { NSFWPolicyType } from '../../shared/models/videos/nsfw-policy.type'
-import { invert } from 'lodash'
-import { CronRepeatOptions, EveryRepeatOptions } from 'bull'
import { VideoPlaylistPrivacy } from '../../shared/models/videos/playlist/video-playlist-privacy.model'
import { VideoPlaylistType } from '../../shared/models/videos/playlist/video-playlist-type.model'
+// Do not use barrels, remain constants as independent as possible
+import { isTestInstance, root, sanitizeHost, sanitizeUrl } from '../helpers/core-utils'
import { CONFIG, registerConfigChangedHandler } from './config'
// ---------------------------------------------------------------------------
-const LAST_MIGRATION_VERSION = 540
+const LAST_MIGRATION_VERSION = 550
// ---------------------------------------------------------------------------
JOBS: [ 'createdAt' ],
VIDEO_CHANNELS: [ 'id', 'name', 'updatedAt', 'createdAt' ],
VIDEO_IMPORTS: [ 'createdAt' ],
+
VIDEO_COMMENT_THREADS: [ 'createdAt', 'totalReplies' ],
+ VIDEO_COMMENTS: [ 'createdAt' ],
+
VIDEO_RATES: [ 'createdAt' ],
BLACKLISTS: [ 'id', 'name', 'duration', 'views', 'likes', 'dislikes', 'uuid', 'createdAt' ],
FOLLOWERS: [ 'createdAt', 'state', 'score' ],
}
const REPEAT_JOBS: { [ id: string ]: EveryRepeatOptions | CronRepeatOptions } = {
'videos-views': {
- cron: '1 * * * *' // At 1 minute past the hour
+ cron: randomInt(1, 20) + ' * * * *' // Between 1-20 minutes past the hour
}
}
}
}
-let VIEW_LIFETIME = {
+const VIEW_LIFETIME = {
VIDEO: 60000 * 60, // 1 hour
LIVE: 60000 * 5 // 5 minutes
}
HEADER_NAME: 'signature',
ALGORITHM: 'rsa-sha256',
HEADERS_TO_SIGN: [ '(request-target)', 'host', 'date', 'digest' ],
+ REQUIRED_HEADERS: {
+ ALL: [ '(request-target)', 'host', 'date' ],
+ POST: [ '(request-target)', 'host', 'date', 'digest' ]
+ },
CLOCK_SKEW_SECONDS: 1800
}
CLEANUP_DELAY: 1000 * 60 * 5, // 5 minutes
SEGMENT_TIME_SECONDS: 4, // 4 seconds
SEGMENTS_LIST_SIZE: 15, // 15 maximum segments in live playlist
+ EDGE_LIVE_DELAY_SEGMENTS_NOTIFICATION: 3,
RTMP: {
CHUNK_SIZE: 60000,
GOP_CACHE: true,
VIDEO_LIVE.CLEANUP_DELAY = 5000
VIDEO_LIVE.SEGMENT_TIME_SECONDS = 2
+ VIDEO_LIVE.EDGE_LIVE_DELAY_SEGMENTS_NOTIFICATION = 1
}
updateWebserverUrls()