'use strict'
const config = require('config')
-const maxBy = require('lodash/maxBy')
const path = require('path')
// ---------------------------------------------------------------------------
// Sortable columns per schema
const SEARCHABLE_COLUMNS = {
- VIDEOS: [ 'name', 'magnetUri', 'podHost', 'author', 'tags' ]
+ VIDEOS: [ 'name', 'magnetUri', 'host', 'author', 'tags' ]
}
// Sortable columns per schema
const SORTABLE_COLUMNS = {
- USERS: [ 'username', '-username', 'createdDate', '-createdDate' ],
- VIDEOS: [ 'name', '-name', 'duration', '-duration', 'createdDate', '-createdDate' ]
+ USERS: [ 'username', '-username', 'createdAt', '-createdAt' ],
+ VIDEOS: [ 'name', '-name', 'duration', '-duration', 'createdAt', '-createdAt' ]
}
const OAUTH_LIFETIME = {
DATABASE: {
DBNAME: 'peertube' + config.get('database.suffix'),
HOSTNAME: config.get('database.hostname'),
- PORT: config.get('database.port')
+ PORT: config.get('database.port'),
+ USERNAME: config.get('database.username'),
+ PASSWORD: config.get('database.password')
},
STORAGE: {
CERT_DIR: path.join(__dirname, '..', '..', config.get('storage.certs')),
VIDEOS: {
NAME: { min: 3, max: 50 }, // Length
DESCRIPTION: { min: 3, max: 250 }, // Length
- MAGNET: {
- INFO_HASH: { min: 10, max: 50 } // Length
- },
+ EXTNAME: [ '.mp4', '.ogv', '.webm' ],
+ INFO_HASH: { min: 40, max: 40 }, // Length, infohash is 20 bytes length but we represent it in hexa so 20 * 2
DURATION: { min: 1, max: 7200 }, // Number
TAGS: { min: 1, max: 3 }, // Number of total tags
TAG: { min: 2, max: 10 }, // Length
// ---------------------------------------------------------------------------
-const MONGO_MIGRATION_SCRIPTS = [
- {
- script: '0005-create-application',
- version: 5
- },
- {
- script: '0010-users-password',
- version: 10
- },
- {
- script: '0015-admin-role',
- version: 15
- },
- {
- script: '0020-requests-endpoint',
- version: 20
- }
-]
-const LAST_MONGO_SCHEMA_VERSION = (maxBy(MONGO_MIGRATION_SCRIPTS, 'version'))['version']
+const LAST_MIGRATION_VERSION = 0
// ---------------------------------------------------------------------------
const REMOTE_SCHEME = {
HTTP: 'https',
- WS: 'WS'
+ WS: 'wss'
}
// Password encryption
CONFIG,
CONSTRAINTS_FIELDS,
FRIEND_SCORE,
- LAST_MONGO_SCHEMA_VERSION,
- MONGO_MIGRATION_SCRIPTS,
+ LAST_MIGRATION_VERSION,
OAUTH_LIFETIME,
PAGINATION_COUNT_DEFAULT,
PODS_SCORE,
// ---------------------------------------------------------------------------
+// This method exists in utils module but we want to let the constants module independent
function isTestInstance () {
return (process.env.NODE_ENV === 'test')
}