RequestVideoEventType,
RequestVideoQaduType,
RemoteVideoRequestType,
- JobState
+ JobState,
+ JobCategory
} from '../../shared/models'
+import { VideoPrivacy } from '../../shared/models/videos/video-privacy.enum'
// ---------------------------------------------------------------------------
-const LAST_MIGRATION_VERSION = 85
+const LAST_MIGRATION_VERSION = 95
// ---------------------------------------------------------------------------
PASSWORD: config.get<string>('database.password')
},
STORAGE: {
- CERT_DIR: join(root(), config.get<string>('storage.certs')),
LOG_DIR: join(root(), config.get<string>('storage.logs')),
VIDEOS_DIR: join(root(), config.get<string>('storage.videos')),
THUMBNAILS_DIR: join(root(), config.get<string>('storage.thumbnails')),
},
VIDEOS: {
NAME: { min: 3, max: 120 }, // Length
- DESCRIPTION: { min: 3, max: 250 }, // Length
+ TRUNCATED_DESCRIPTION: { min: 3, max: 250 }, // Length
+ DESCRIPTION: { min: 3, max: 3000 }, // Length
EXTNAME: [ '.mp4', '.ogv', '.webm' ],
INFO_HASH: { min: 40, max: 40 }, // Length, info hash is 20 bytes length but we represent it in hexadecimal so 20 * 2
DURATION: { min: 1, max: 7200 }, // Number
14: 'Italian'
}
+const VIDEO_PRIVACIES = {
+ [VideoPrivacy.PUBLIC]: 'Public',
+ [VideoPrivacy.UNLISTED]: 'Unlisted',
+ [VideoPrivacy.PRIVATE]: 'Private'
+}
+
+const VIDEO_MIMETYPE_EXT = {
+ 'video/webm': 'webm',
+ 'video/ogg': 'ogv',
+ 'video/mp4': 'mp4'
+}
+
// ---------------------------------------------------------------------------
// Score a pod has when we create it as a friend
MAX: 1000
}
+const ACTIVITY_PUB = {
+ COLLECTION_ITEMS_PER_PAGE: 10,
+ VIDEO_URL_MIME_TYPES: [
+ 'video/mp4',
+ 'video/webm',
+ 'video/ogg',
+ 'application/x-bittorrent',
+ 'application/x-bittorrent;x-scheme-handler/magnet'
+ ]
+}
+
// ---------------------------------------------------------------------------
// Number of points we add/remove from a friend after a successful/bad request
// Number of requests to retry for replay requests module
const RETRY_REQUESTS = 5
-const REQUEST_ENDPOINTS: { [ id: string ]: RequestEndpoint } = {
- VIDEOS: 'videos'
-}
-
-const REQUEST_ENDPOINT_ACTIONS: {
- [ id: string ]: {
- [ id: string ]: RemoteVideoRequestType
- }
-} = {}
-REQUEST_ENDPOINT_ACTIONS[REQUEST_ENDPOINTS.VIDEOS] = {
- ADD_VIDEO: 'add-video',
- UPDATE_VIDEO: 'update-video',
- REMOVE_VIDEO: 'remove-video',
- ADD_CHANNEL: 'add-channel',
- UPDATE_CHANNEL: 'update-channel',
- REMOVE_CHANNEL: 'remove-channel',
- ADD_AUTHOR: 'add-author',
- REMOVE_AUTHOR: 'remove-author',
- REPORT_ABUSE: 'report-abuse'
-}
-
-const REQUEST_VIDEO_QADU_ENDPOINT = 'videos/qadu'
-const REQUEST_VIDEO_EVENT_ENDPOINT = 'videos/events'
-
-const REQUEST_VIDEO_QADU_TYPES: { [ id: string ]: RequestVideoQaduType } = {
- LIKES: 'likes',
- DISLIKES: 'dislikes',
- VIEWS: 'views'
-}
-
-const REQUEST_VIDEO_EVENT_TYPES: { [ id: string ]: RequestVideoEventType } = {
- LIKES: 'likes',
- DISLIKES: 'dislikes',
- VIEWS: 'views'
-}
-
const REMOTE_SCHEME = {
HTTP: 'https',
WS: 'wss'
ERROR: 'error',
SUCCESS: 'success'
}
+const JOB_CATEGORIES: { [ id: string ]: JobCategory } = {
+ TRANSCODING: 'transcoding',
+ HTTP_REQUEST: 'http-request'
+}
// How many maximum jobs we fetch from the database per cycle
-const JOBS_FETCH_LIMIT_PER_CYCLE = 10
+const JOBS_FETCH_LIMIT_PER_CYCLE = {
+ transcoding: 10,
+ httpRequest: 20
+}
// 1 minutes
let JOBS_FETCHING_INTERVAL = 60000
// ---------------------------------------------------------------------------
-const PRIVATE_CERT_NAME = 'peertube.key.pem'
-const PUBLIC_CERT_NAME = 'peertube.pub'
-const SIGNATURE_ALGORITHM = 'RSA-SHA256'
-const SIGNATURE_ENCODING = 'hex'
+const PRIVATE_RSA_KEY_SIZE = 2048
// Password encryption
const BCRYPT_SALT_SIZE = 10
JOB_STATES,
JOBS_FETCH_LIMIT_PER_CYCLE,
JOBS_FETCHING_INTERVAL,
+ JOB_CATEGORIES,
LAST_MIGRATION_VERSION,
OAUTH_LIFETIME,
OPENGRAPH_AND_OEMBED_COMMENT,
PAGINATION_COUNT_DEFAULT,
PODS_SCORE,
PREVIEWS_SIZE,
- PRIVATE_CERT_NAME,
- PUBLIC_CERT_NAME,
REMOTE_SCHEME,
REQUEST_ENDPOINT_ACTIONS,
REQUEST_ENDPOINTS,
REQUESTS_VIDEO_QADU_LIMIT_PODS,
RETRY_REQUESTS,
SEARCHABLE_COLUMNS,
- SIGNATURE_ALGORITHM,
- SIGNATURE_ENCODING,
+ PRIVATE_RSA_KEY_SIZE,
SORTABLE_COLUMNS,
STATIC_MAX_AGE,
STATIC_PATHS,
+ ACTIVITY_PUB,
THUMBNAILS_SIZE,
VIDEO_CATEGORIES,
VIDEO_LANGUAGES,
+ VIDEO_PRIVACIES,
VIDEO_LICENCES,
- VIDEO_RATE_TYPES
+ VIDEO_RATE_TYPES,
+ VIDEO_MIMETYPE_EXT
}