-import { CronRepeatOptions, EveryRepeatOptions } from 'bull'
+import { RepeatOptions } from 'bullmq'
import { randomBytes } from 'crypto'
import { invert } from 'lodash'
import { join } from 'path'
-import { randomInt } from '../../shared/core-utils/common/miscs'
+import { randomInt, root } from '@shared/core-utils'
import {
AbuseState,
JobType,
+ VideoChannelSyncState,
VideoImportState,
VideoPrivacy,
VideoRateType,
VideoTranscodingFPS
} from '../../shared/models'
import { ActivityPubActorType } from '../../shared/models/activitypub'
-import { FollowState } from '../../shared/models/actors'
+import { ActorImageType, FollowState } from '../../shared/models/actors'
import { NSFWPolicyType } from '../../shared/models/videos/nsfw-policy.type'
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 { isTestInstance, isTestOrDevInstance, parseDurationToMs, sanitizeHost, sanitizeUrl } from '../helpers/core-utils'
import { CONFIG, registerConfigChangedHandler } from './config'
// ---------------------------------------------------------------------------
-const LAST_MIGRATION_VERSION = 670
+const LAST_MIGRATION_VERSION = 735
// ---------------------------------------------------------------------------
// Sortable columns per schema
const SORTABLE_COLUMNS = {
- USERS: [ 'id', 'username', 'videoQuotaUsed', 'createdAt', 'lastLoginDate', 'role' ],
+ ADMIN_USERS: [ 'id', 'username', 'videoQuotaUsed', 'createdAt', 'lastLoginDate', 'role' ],
USER_SUBSCRIPTIONS: [ 'id', 'createdAt' ],
ACCOUNTS: [ 'createdAt' ],
JOBS: [ 'createdAt' ],
VIDEO_CHANNELS: [ 'id', 'name', 'updatedAt', 'createdAt' ],
VIDEO_IMPORTS: [ 'createdAt' ],
+ VIDEO_CHANNEL_SYNCS: [ 'externalChannelUrl', 'videoChannel', 'createdAt', 'lastSyncAt', 'state' ],
VIDEO_COMMENT_THREADS: [ 'createdAt', 'totalReplies' ],
VIDEO_COMMENTS: [ 'createdAt' ],
const FOLLOW_STATES: { [ id: string ]: FollowState } = {
PENDING: 'pending',
- ACCEPTED: 'accepted'
+ ACCEPTED: 'accepted',
+ REJECTED: 'rejected'
}
const REMOTE_SCHEME = {
const JOB_ATTEMPTS: { [id in JobType]: number } = {
'activitypub-http-broadcast': 1,
+ 'activitypub-http-broadcast-parallel': 1,
'activitypub-http-unicast': 1,
'activitypub-http-fetcher': 2,
'activitypub-follow': 5,
'activitypub-refresher': 1,
'video-redundancy': 1,
'video-live-ending': 1,
- 'move-to-object-storage': 3
+ 'video-studio-edition': 1,
+ 'manage-video-torrent': 1,
+ 'video-channel-import': 1,
+ 'after-video-channel-import': 1,
+ 'move-to-object-storage': 3,
+ 'notify': 1,
+ 'federate-video': 1
}
// Excluded keys are jobs that can be configured by admins
const JOB_CONCURRENCY: { [id in Exclude<JobType, 'video-transcoding' | 'video-import'>]: number } = {
'activitypub-http-broadcast': 1,
+ 'activitypub-http-broadcast-parallel': 30,
'activitypub-http-unicast': 10,
'activitypub-http-fetcher': 3,
'activitypub-cleaner': 1,
'activitypub-refresher': 1,
'video-redundancy': 1,
'video-live-ending': 10,
- 'move-to-object-storage': 1
+ 'video-studio-edition': 1,
+ 'manage-video-torrent': 1,
+ 'move-to-object-storage': 1,
+ 'video-channel-import': 1,
+ 'after-video-channel-import': 1,
+ 'notify': 5,
+ 'federate-video': 3
}
const JOB_TTL: { [id in JobType]: number } = {
'activitypub-http-broadcast': 60000 * 10, // 10 minutes
+ 'activitypub-http-broadcast-parallel': 60000 * 10, // 10 minutes
'activitypub-http-unicast': 60000 * 10, // 10 minutes
'activitypub-http-fetcher': 1000 * 3600 * 10, // 10 hours
'activitypub-follow': 60000 * 10, // 10 minutes
'activitypub-cleaner': 1000 * 3600, // 1 hour
'video-file-import': 1000 * 3600, // 1 hour
'video-transcoding': 1000 * 3600 * 48, // 2 days, transcoding could be long
- 'video-import': 1000 * 3600 * 2, // 2 hours
+ 'video-studio-edition': 1000 * 3600 * 10, // 10 hours
+ 'video-import': CONFIG.IMPORT.VIDEOS.TIMEOUT,
'email': 60000 * 10, // 10 minutes
'actor-keys': 60000 * 20, // 20 minutes
'videos-views-stats': undefined, // Unlimited
'activitypub-refresher': 60000 * 10, // 10 minutes
'video-redundancy': 1000 * 3600 * 3, // 3 hours
'video-live-ending': 1000 * 60 * 10, // 10 minutes
- 'move-to-object-storage': 1000 * 60 * 60 * 3 // 3 hours
-}
-const REPEAT_JOBS: { [ id in JobType ]?: EveryRepeatOptions | CronRepeatOptions } = {
+ 'manage-video-torrent': 1000 * 3600 * 3, // 3 hours
+ 'move-to-object-storage': 1000 * 60 * 60 * 3, // 3 hours
+ 'video-channel-import': 1000 * 60 * 60 * 4, // 4 hours
+ 'after-video-channel-import': 60000 * 5, // 5 minutes
+ 'notify': 60000 * 5, // 5 minutes
+ 'federate-video': 60000 * 5 // 5 minutes
+}
+const REPEAT_JOBS: { [ id in JobType ]?: RepeatOptions } = {
'videos-views-stats': {
cron: randomInt(1, 20) + ' * * * *' // Between 1-20 minutes past the hour
},
}
const BROADCAST_CONCURRENCY = 30 // How many requests in parallel we do in activitypub-http-broadcast job
-const AP_CLEANER_CONCURRENCY = 10 // How many requests in parallel we do in activitypub-cleaner job
const CRAWL_REQUEST_CONCURRENCY = 1 // How many requests in parallel to fetch remote data (likes, shares...)
-const REQUEST_TIMEOUT = 7000 // 7 seconds
+
+const AP_CLEANER = {
+ CONCURRENCY: 10, // How many requests in parallel we do in activitypub-cleaner job
+ UNAVAILABLE_TRESHOLD: 3, // How many attempts we do before removing an unavailable remote resource
+ PERIOD: parseDurationToMs('1 week') // /!\ Has to be sync with REPEAT_JOBS
+}
+
+const REQUEST_TIMEOUTS = {
+ DEFAULT: 7000, // 7 seconds
+ FILE: 30000, // 30 seconds
+ REDUNDANCY: JOB_TTL['video-redundancy']
+}
+
const JOB_COMPLETED_LIFETIME = 60000 * 60 * 24 * 2 // 2 days
-const VIDEO_IMPORT_TIMEOUT = 1000 * 3600 // 1 hour
+const VIDEO_IMPORT_TIMEOUT = Math.floor(JOB_TTL['video-import'] * 0.9)
const SCHEDULER_INTERVALS_MS = {
ACTOR_FOLLOW_SCORES: 60000 * 60, // 1 hour
REMOVE_OLD_JOBS: 60000 * 60, // 1 hour
UPDATE_VIDEOS: 60000, // 1 minute
YOUTUBE_DL_UPDATE: 60000 * 60 * 24, // 1 day
+ GEO_IP_UPDATE: 60000 * 60 * 24, // 1 day
VIDEO_VIEWS_BUFFER_UPDATE: CONFIG.VIEWS.VIDEOS.LOCAL_BUFFER_UPDATE_INTERVAL,
CHECK_PLUGINS: CONFIG.PLUGINS.INDEX.CHECK_LATEST_VERSIONS_INTERVAL,
CHECK_PEERTUBE_VERSION: 60000 * 60 * 24, // 1 day
REMOVE_OLD_VIEWS: 60000 * 60 * 24, // 1 day
REMOVE_OLD_HISTORY: 60000 * 60 * 24, // 1 day
UPDATE_INBOX_STATS: 1000 * 60, // 1 minute
- REMOVE_DANGLING_RESUMABLE_UPLOADS: 60000 * 60 * 16 // 16 hours
+ REMOVE_DANGLING_RESUMABLE_UPLOADS: 60000 * 60, // 1 hour
+ CHANNEL_SYNC_CHECK_INTERVAL: CONFIG.IMPORT.VIDEO_CHANNEL_SYNCHRONIZATION.CHECK_INTERVAL
}
// ---------------------------------------------------------------------------
NAME: { min: 1, max: 120 }, // Length
DESCRIPTION: { min: 3, max: 1000 }, // Length
SUPPORT: { min: 3, max: 1000 }, // Length
+ EXTERNAL_CHANNEL_URL: { min: 3, max: 2000 }, // Length
URL: { min: 3, max: 2000 } // Length
},
+ VIDEO_CHANNEL_SYNCS: {
+ EXTERNAL_CHANNEL_URL: { min: 3, max: 2000 } // Length
+ },
VIDEO_CAPTIONS: {
CAPTION_FILE: {
EXTNAME: [ '.vtt', '.srt' ],
FILE_SIZE: {
- max: 4 * 1024 * 1024 // 4MB
+ max: 20 * 1024 * 1024 // 20MB
}
}
},
},
COMMONS: {
URL: { min: 5, max: 2000 } // Length
+ },
+ VIDEO_STUDIO: {
+ TASKS: { min: 1, max: 10 }, // Number of tasks
+ CUT_TIME: { min: 0 } // Value
+ },
+ LOGS: {
+ CLIENT_MESSAGE: { min: 1, max: 1000 }, // Length
+ CLIENT_STACK_TRACE: { min: 1, max: 15000 }, // Length
+ CLIENT_META: { min: 1, max: 5000 }, // Length
+ CLIENT_USER_AGENT: { min: 1, max: 200 } // Length
}
}
const VIEW_LIFETIME = {
VIEW: CONFIG.VIEWS.VIDEOS.IP_VIEW_EXPIRATION,
- VIEWER: 60000 * 5 // 5 minutes
+ VIEWER_COUNTER: 60000 * 2, // 2 minutes
+ VIEWER_STATS: 60000 * 60 // 1 hour
}
+const MAX_LOCAL_VIEWER_WATCH_SECTIONS = 100
+
let CONTACT_FORM_LIFETIME = 60000 * 60 // 1 hour
const VIDEO_TRANSCODING_FPS: VideoTranscodingFPS = {
MIN: 1,
STANDARD: [ 24, 25, 30 ],
HD_STANDARD: [ 50, 60 ],
+ AUDIO_MERGE: 25,
AVERAGE: 30,
MAX: 60,
KEEP_ORIGIN_FPS_RESOLUTION_MIN: 720 // We keep the original FPS on high resolutions (720 minimum)
[VideoState.WAITING_FOR_LIVE]: 'Waiting for livestream',
[VideoState.LIVE_ENDED]: 'Livestream ended',
[VideoState.TO_MOVE_TO_EXTERNAL_STORAGE]: 'To move to an external storage',
- [VideoState.TRANSCODING_FAILED]: 'Transcoding failed'
+ [VideoState.TRANSCODING_FAILED]: 'Transcoding failed',
+ [VideoState.TO_MOVE_TO_EXTERNAL_STORAGE_FAILED]: 'External storage move failed',
+ [VideoState.TO_EDIT]: 'To edit*'
}
const VIDEO_IMPORT_STATES: { [ id in VideoImportState ]: string } = {
[VideoImportState.FAILED]: 'Failed',
[VideoImportState.PENDING]: 'Pending',
[VideoImportState.SUCCESS]: 'Success',
- [VideoImportState.REJECTED]: 'Rejected'
+ [VideoImportState.REJECTED]: 'Rejected',
+ [VideoImportState.CANCELLED]: 'Cancelled',
+ [VideoImportState.PROCESSING]: 'Processing'
+}
+
+const VIDEO_CHANNEL_SYNC_STATE: { [ id in VideoChannelSyncState ]: string } = {
+ [VideoChannelSyncState.FAILED]: 'Failed',
+ [VideoChannelSyncState.SYNCED]: 'Synchronized',
+ [VideoChannelSyncState.PROCESSING]: 'Processing',
+ [VideoChannelSyncState.WAITING_FIRST_RUN]: 'Waiting first run'
}
const ABUSE_STATES: { [ id in AbuseState ]: string } = {
MIMETYPE_EXT: {
'audio/mpeg': '.mp3',
'audio/mp3': '.mp3',
+
'application/ogg': '.ogg',
'audio/ogg': '.ogg',
+
'audio/x-ms-wma': '.wma',
'audio/wav': '.wav',
'audio/x-wav': '.wav',
+
'audio/x-flac': '.flac',
'audio/flac': '.flac',
+
+ 'audio/vnd.dlna.adts': '.aac',
'audio/aac': '.aac',
+
'audio/m4a': '.m4a',
'audio/mp4': '.m4a',
'audio/x-m4a': '.m4a',
+
+ 'audio/vnd.dolby.dd-raw': '.ac3',
'audio/ac3': '.ac3'
},
EXT_MIMETYPE: null as { [ id: string ]: string }
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
}
height: 480,
minWidth: 400
}
-const ACTOR_IMAGES_SIZE = {
- AVATARS: {
- width: 120,
- height: 120
- },
- BANNERS: {
- width: 1920,
- height: 317 // 6/1 ratio
- }
+const ACTOR_IMAGES_SIZE: { [key in ActorImageType]: { width: number, height: number }[]} = {
+ [ActorImageType.AVATAR]: [
+ {
+ width: 120,
+ height: 120
+ },
+ {
+ width: 48,
+ height: 48
+ }
+ ],
+ [ActorImageType.BANNER]: [
+ {
+ width: 1920,
+ height: 317 // 6/1 ratio
+ }
+ ]
}
const EMBED_SIZE = {
const VIDEO_LIVE = {
EXTENSION: '.ts',
CLEANUP_DELAY: 1000 * 60 * 5, // 5 minutes
- SEGMENT_TIME_SECONDS: 4, // 4 seconds
+ SEGMENT_TIME_SECONDS: {
+ DEFAULT_LATENCY: 4, // 4 seconds
+ SMALL_LATENCY: 2 // 2 seconds
+ },
SEGMENTS_LIST_SIZE: 15, // 15 maximum segments in live playlist
REPLAY_DIRECTORY: 'replay',
EDGE_LIVE_DELAY_SEGMENTS_NOTIFICATION: 4,
const MEMOIZE_TTL = {
OVERVIEWS_SAMPLE: 1000 * 3600 * 4, // 4 hours
INFO_HASH_EXISTS: 1000 * 3600 * 12, // 12 hours
+ VIDEO_DURATION: 1000 * 10, // 10 seconds
LIVE_ABLE_TO_UPLOAD: 1000 * 60, // 1 minute
- LIVE_CHECK_SOCKET_HEALTH: 1000 * 60 // 1 minute
+ LIVE_CHECK_SOCKET_HEALTH: 1000 * 60, // 1 minute
+ GET_STATS_FOR_OPEN_TELEMETRY_METRICS: 1000 * 60 // 1 minute
}
const MEMOIZE_LENGTH = {
- INFO_HASH_EXISTS: 200
+ INFO_HASH_EXISTS: 200,
+ VIDEO_DURATION: 200
}
-const QUEUE_CONCURRENCY = {
- ACTOR_PROCESS_IMAGE: 3
+const WORKER_THREADS = {
+ DOWNLOAD_IMAGE: {
+ CONCURRENCY: 3,
+ MAX_THREADS: 1
+ },
+ PROCESS_IMAGE: {
+ CONCURRENCY: 1,
+ MAX_THREADS: 5
+ }
}
const REDUNDANCY = {
SERVER_CONFIG: '<!-- server config -->'
}
-// ---------------------------------------------------------------------------
-
-const FEEDS = {
- COUNT: 20
-}
-
const MAX_LOGS_OUTPUT_CHARACTERS = 10 * 1000 * 1000
const LOG_FILENAME = 'peertube.log'
const AUDIT_LOG_FILENAME = 'peertube-audit.log'
// ---------------------------------------------------------------------------
+const STATS_TIMESERIE = {
+ MAX_DAYS: 365 * 10 // Around 10 years
+}
+
+// ---------------------------------------------------------------------------
+
// Special constants for a test instance
-if (isTestInstance() === true) {
- PRIVATE_RSA_KEY_SIZE = 1024
+if (process.env.PRODUCTION_CONSTANTS !== 'true') {
+ if (isTestOrDevInstance()) {
+ PRIVATE_RSA_KEY_SIZE = 1024
+
+ ACTOR_FOLLOW_SCORE.BASE = 20
- ACTOR_FOLLOW_SCORE.BASE = 20
+ REMOTE_SCHEME.HTTP = 'http'
+ REMOTE_SCHEME.WS = 'ws'
- REMOTE_SCHEME.HTTP = 'http'
- REMOTE_SCHEME.WS = 'ws'
+ STATIC_MAX_AGE.SERVER = '0'
- STATIC_MAX_AGE.SERVER = '0'
+ SCHEDULER_INTERVALS_MS.ACTOR_FOLLOW_SCORES = 1000
+ SCHEDULER_INTERVALS_MS.REMOVE_OLD_JOBS = 10000
+ SCHEDULER_INTERVALS_MS.REMOVE_OLD_HISTORY = 5000
+ SCHEDULER_INTERVALS_MS.REMOVE_OLD_VIEWS = 5000
+ SCHEDULER_INTERVALS_MS.UPDATE_VIDEOS = 5000
+ SCHEDULER_INTERVALS_MS.AUTO_FOLLOW_INDEX_INSTANCES = 5000
+ SCHEDULER_INTERVALS_MS.UPDATE_INBOX_STATS = 5000
+ SCHEDULER_INTERVALS_MS.CHECK_PEERTUBE_VERSION = 2000
- ACTIVITY_PUB.COLLECTION_ITEMS_PER_PAGE = 2
- ACTIVITY_PUB.ACTOR_REFRESH_INTERVAL = 10 * 1000 // 10 seconds
- ACTIVITY_PUB.VIDEO_REFRESH_INTERVAL = 10 * 1000 // 10 seconds
- ACTIVITY_PUB.VIDEO_PLAYLIST_REFRESH_INTERVAL = 10 * 1000 // 10 seconds
+ REPEAT_JOBS['videos-views-stats'] = { every: 5000 }
- CONSTRAINTS_FIELDS.ACTORS.IMAGE.FILE_SIZE.max = 100 * 1024 // 100KB
- CONSTRAINTS_FIELDS.VIDEOS.IMAGE.FILE_SIZE.max = 400 * 1024 // 400KB
+ REPEAT_JOBS['activitypub-cleaner'] = { every: 5000 }
+ AP_CLEANER.PERIOD = 5000
- SCHEDULER_INTERVALS_MS.ACTOR_FOLLOW_SCORES = 1000
- SCHEDULER_INTERVALS_MS.REMOVE_OLD_JOBS = 10000
- SCHEDULER_INTERVALS_MS.REMOVE_OLD_HISTORY = 5000
- SCHEDULER_INTERVALS_MS.REMOVE_OLD_VIEWS = 5000
- SCHEDULER_INTERVALS_MS.UPDATE_VIDEOS = 5000
- SCHEDULER_INTERVALS_MS.AUTO_FOLLOW_INDEX_INSTANCES = 5000
- SCHEDULER_INTERVALS_MS.UPDATE_INBOX_STATS = 5000
- SCHEDULER_INTERVALS_MS.CHECK_PEERTUBE_VERSION = 2000
- REPEAT_JOBS['videos-views-stats'] = { every: 5000 }
- REPEAT_JOBS['activitypub-cleaner'] = { every: 5000 }
+ REDUNDANCY.VIDEOS.RANDOMIZED_FACTOR = 1
- REDUNDANCY.VIDEOS.RANDOMIZED_FACTOR = 1
+ CONTACT_FORM_LIFETIME = 1000 // 1 second
- VIEW_LIFETIME.VIEWER = 1000 * 5 // 5 second
- CONTACT_FORM_LIFETIME = 1000 // 1 second
+ JOB_ATTEMPTS['email'] = 1
+
+ FILES_CACHE.VIDEO_CAPTIONS.MAX_AGE = 3000
+ MEMOIZE_TTL.OVERVIEWS_SAMPLE = 3000
+ MEMOIZE_TTL.LIVE_ABLE_TO_UPLOAD = 3000
+ OVERVIEWS.VIDEOS.SAMPLE_THRESHOLD = 2
+
+ PLUGIN_EXTERNAL_AUTH_TOKEN_LIFETIME = 5000
+ }
- JOB_ATTEMPTS['email'] = 1
+ if (isTestInstance()) {
+ ACTIVITY_PUB.COLLECTION_ITEMS_PER_PAGE = 2
+ ACTIVITY_PUB.ACTOR_REFRESH_INTERVAL = 10 * 1000 // 10 seconds
+ ACTIVITY_PUB.VIDEO_REFRESH_INTERVAL = 10 * 1000 // 10 seconds
+ ACTIVITY_PUB.VIDEO_PLAYLIST_REFRESH_INTERVAL = 10 * 1000 // 10 seconds
- FILES_CACHE.VIDEO_CAPTIONS.MAX_AGE = 3000
- MEMOIZE_TTL.OVERVIEWS_SAMPLE = 3000
- MEMOIZE_TTL.LIVE_ABLE_TO_UPLOAD = 3000
- OVERVIEWS.VIDEOS.SAMPLE_THRESHOLD = 2
+ CONSTRAINTS_FIELDS.ACTORS.IMAGE.FILE_SIZE.max = 100 * 1024 // 100KB
+ CONSTRAINTS_FIELDS.VIDEOS.IMAGE.FILE_SIZE.max = 400 * 1024 // 400KB
- PLUGIN_EXTERNAL_AUTH_TOKEN_LIFETIME = 5000
+ VIEW_LIFETIME.VIEWER_COUNTER = 1000 * 5 // 5 second
+ VIEW_LIFETIME.VIEWER_STATS = 1000 * 5 // 5 second
- VIDEO_LIVE.CLEANUP_DELAY = 5000
- VIDEO_LIVE.SEGMENT_TIME_SECONDS = 2
- VIDEO_LIVE.EDGE_LIVE_DELAY_SEGMENTS_NOTIFICATION = 1
+ VIDEO_LIVE.CLEANUP_DELAY = getIntEnv('PEERTUBE_TEST_CONSTANTS_VIDEO_LIVE_CLEANUP_DELAY') ?? 5000
+ VIDEO_LIVE.SEGMENT_TIME_SECONDS.DEFAULT_LATENCY = 2
+ VIDEO_LIVE.SEGMENT_TIME_SECONDS.SMALL_LATENCY = 1
+ VIDEO_LIVE.EDGE_LIVE_DELAY_SEGMENTS_NOTIFICATION = 1
+ }
}
updateWebserverUrls()
// ---------------------------------------------------------------------------
+const VIDEO_FILTERS = {
+ WATERMARK: {
+ SIZE_RATIO: 1 / 10,
+ HORIZONTAL_MARGIN_RATIO: 1 / 20,
+ VERTICAL_MARGIN_RATIO: 1 / 20
+ }
+}
+
+// ---------------------------------------------------------------------------
+
export {
WEBSERVER,
API_VERSION,
REDUNDANCY,
JOB_CONCURRENCY,
JOB_ATTEMPTS,
- AP_CLEANER_CONCURRENCY,
+ AP_CLEANER,
LAST_MIGRATION_VERSION,
OAUTH_LIFETIME,
CUSTOM_HTML_TAG_COMMENTS,
+ STATS_TIMESERIE,
BROADCAST_CONCURRENCY,
AUDIT_LOG_FILENAME,
PAGINATION,
PLUGIN_GLOBAL_CSS_FILE_NAME,
PLUGIN_GLOBAL_CSS_PATH,
PRIVATE_RSA_KEY_SIZE,
+ VIDEO_FILTERS,
ROUTE_CACHE_LIFETIME,
SORTABLE_COLUMNS,
HLS_STREAMING_PLAYLIST_DIRECTORY,
- FEEDS,
JOB_TTL,
DEFAULT_THEME_NAME,
NSFW_POLICY_TYPES,
VIDEO_PRIVACIES,
VIDEO_LICENCES,
VIDEO_STATES,
- QUEUE_CONCURRENCY,
+ WORKER_THREADS,
VIDEO_RATE_TYPES,
JOB_PRIORITY,
VIDEO_TRANSCODING_FPS,
FFMPEG_NICE,
ABUSE_STATES,
LRU_CACHE,
- REQUEST_TIMEOUT,
+ REQUEST_TIMEOUTS,
+ MAX_LOCAL_VIEWER_WATCH_SECTIONS,
USER_PASSWORD_RESET_LIFETIME,
USER_PASSWORD_CREATE_LIFETIME,
MEMOIZE_TTL,
JOB_COMPLETED_LIFETIME,
HTTP_SIGNATURE,
VIDEO_IMPORT_STATES,
+ VIDEO_CHANNEL_SYNC_STATE,
VIEW_LIFETIME,
CONTACT_FORM_LIFETIME,
VIDEO_PLAYLIST_PRIVACIES,
// The standard video format used by many Sony and Panasonic HD camcorders.
// It is also used for storing high definition video on Blu-ray discs.
'video/mp2t': '.mts',
+ 'video/vnd.dlna.mpeg-tts': '.mts',
+
'video/m2ts': '.m2ts',
// Old formats reliant on MPEG-1/MPEG-2
WEBSERVER.HOSTNAME = CONFIG.WEBSERVER.HOSTNAME
WEBSERVER.PORT = CONFIG.WEBSERVER.PORT
- WEBSERVER.RTMP_URL = 'rtmp://' + CONFIG.WEBSERVER.HOSTNAME + ':' + CONFIG.LIVE.RTMP.PORT + '/' + VIDEO_LIVE.RTMP.BASE_PATH
- WEBSERVER.RTMPS_URL = 'rtmps://' + CONFIG.WEBSERVER.HOSTNAME + ':' + CONFIG.LIVE.RTMPS.PORT + '/' + VIDEO_LIVE.RTMP.BASE_PATH
+ const rtmpHostname = CONFIG.LIVE.RTMP.PUBLIC_HOSTNAME || CONFIG.WEBSERVER.HOSTNAME
+ const rtmpsHostname = CONFIG.LIVE.RTMPS.PUBLIC_HOSTNAME || CONFIG.WEBSERVER.HOSTNAME
+
+ WEBSERVER.RTMP_URL = 'rtmp://' + rtmpHostname + ':' + CONFIG.LIVE.RTMP.PORT + '/' + VIDEO_LIVE.RTMP.BASE_PATH
+ WEBSERVER.RTMPS_URL = 'rtmps://' + rtmpsHostname + ':' + CONFIG.LIVE.RTMPS.PORT + '/' + VIDEO_LIVE.RTMP.BASE_PATH
}
function updateWebserverConfig () {
epo: true, // Esperanto
tlh: true, // Klingon
jbo: true, // Lojban
- avk: true // Kotava
+ avk: true, // Kotava
+
+ zxx: true // No linguistic content (ISO-639-2)
}
// Only add ISO639-1 languages and some sign languages (ISO639-3)
// Override Occitan label
languages['oc'] = 'Occitan'
languages['el'] = 'Greek'
+ languages['tok'] = 'Toki Pona'
+
+ // Chinese languages
+ languages['zh-Hans'] = 'Simplified Chinese'
+ languages['zh-Hant'] = 'Traditional Chinese'
return languages
}
function generateContentHash () {
return randomBytes(20).toString('hex')
}
+
+function getIntEnv (path: string) {
+ if (process.env[path]) return parseInt(process.env[path])
+
+ return undefined
+}