import * as config from 'config'
import { join } from 'path'
-
+import { JobCategory, JobState, VideoRateType } from '../../shared/models'
+import { FollowState } from '../../shared/models/actors'
+import { ActivityPubActorType } from '../../shared/models/activitypub'
+import { VideoPrivacy } from '../../shared/models/videos'
// Do not use barrels, remain constants as independent as possible
-import { root, isTestInstance } from '../helpers/core-utils'
-
-import {
- VideoRateType,
- JobState,
- JobCategory
-} from '../../shared/models'
-import { VideoPrivacy } from '../../shared/models/videos/video-privacy.enum'
-import { FollowState } from '../../shared/models/accounts/follow.model'
+import { isTestInstance, root } from '../helpers/core-utils'
// ---------------------------------------------------------------------------
-const LAST_MIGRATION_VERSION = 110
+const LAST_MIGRATION_VERSION = 135
// ---------------------------------------------------------------------------
// Number of results by default for the pagination
const PAGINATION_COUNT_DEFAULT = 15
-// Sortable columns per schema
-const SEARCHABLE_COLUMNS = {
- VIDEOS: [ 'name', 'magnetUri', 'host', 'account', 'tags' ]
-}
-
// Sortable columns per schema
const SORTABLE_COLUMNS = {
USERS: [ 'id', 'username', 'createdAt' ],
PASSWORD: config.get<string>('database.password')
},
STORAGE: {
+ AVATARS_DIR: join(root(), config.get<string>('storage.avatars')),
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')),
CONFIG.WEBSERVER.URL = CONFIG.WEBSERVER.SCHEME + '://' + CONFIG.WEBSERVER.HOSTNAME + ':' + CONFIG.WEBSERVER.PORT
CONFIG.WEBSERVER.HOST = CONFIG.WEBSERVER.HOSTNAME + ':' + CONFIG.WEBSERVER.PORT
+const AVATARS_DIR = {
+ ACCOUNT: join(CONFIG.STORAGE.AVATARS_DIR, 'account')
+}
// ---------------------------------------------------------------------------
const CONSTRAINTS_FIELDS = {
FILE_SIZE: { min: 10 },
URL: { min: 3, max: 2000 } // Length
},
- ACCOUNTS: {
+ ACTOR: {
PUBLIC_KEY: { min: 10, max: 5000 }, // Length
PRIVATE_KEY: { min: 10, max: 5000 }, // Length
URL: { min: 3, max: 2000 } // Length
// ---------------------------------------------------------------------------
-const SERVER_ACCOUNT_NAME = 'peertube'
+const SERVER_ACTOR_NAME = 'peertube'
const ACTIVITY_PUB = {
POTENTIAL_ACCEPT_HEADERS: [
}
}
+const ACTIVITY_PUB_ACTOR_TYPES: { [ id: string ]: ActivityPubActorType } = {
+ GROUP: 'Group',
+ PERSON: 'Person',
+ APPLICATION: 'Application'
+}
+
// ---------------------------------------------------------------------------
// Number of points we add/remove from a friend after a successful/bad request
}
}
+const ACCEPT_HEADERS = [ 'html', 'application/json' ].concat(ACTIVITY_PUB.POTENTIAL_ACCEPT_HEADERS)
+
// ---------------------------------------------------------------------------
const OPENGRAPH_AND_OEMBED_COMMENT = '<!-- open graph and oembed tags -->'
export {
API_VERSION,
+ ACCEPT_HEADERS,
BCRYPT_SALT_SIZE,
CACHE,
CONFIG,
PREVIEWS_SIZE,
REMOTE_SCHEME,
FOLLOW_STATES,
- SEARCHABLE_COLUMNS,
- SERVER_ACCOUNT_NAME,
+ AVATARS_DIR,
+ SERVER_ACTOR_NAME,
PRIVATE_RSA_KEY_SIZE,
SORTABLE_COLUMNS,
STATIC_MAX_AGE,
STATIC_PATHS,
ACTIVITY_PUB,
+ ACTIVITY_PUB_ACTOR_TYPES,
THUMBNAILS_SIZE,
VIDEO_CATEGORIES,
VIDEO_LANGUAGES,