X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;ds=sidebyside;f=server%2Finitializers%2Fconstants.ts;h=13456071717889718ca6e48179a40da48778de83;hb=3cc665f48fd233d09f778d7e887488dde6f03ef6;hp=3da06402c760801c2198fb525454147011752c55;hpb=4c1def5fd8e9f483238eb38e221f555e2e6bbf07;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/initializers/constants.ts b/server/initializers/constants.ts index 3da06402c..134560717 100644 --- a/server/initializers/constants.ts +++ b/server/initializers/constants.ts @@ -14,7 +14,7 @@ import { CONFIG, registerConfigChangedHandler } from './config' // --------------------------------------------------------------------------- -const LAST_MIGRATION_VERSION = 480 +const LAST_MIGRATION_VERSION = 505 // --------------------------------------------------------------------------- @@ -59,9 +59,9 @@ const SORTABLE_COLUMNS = { FOLLOWERS: [ 'createdAt', 'state', 'score' ], FOLLOWING: [ 'createdAt', 'redundancyAllowed', 'state' ], - VIDEOS: [ 'name', 'duration', 'createdAt', 'publishedAt', 'views', 'likes', 'trending' ], + VIDEOS: [ 'name', 'duration', 'createdAt', 'publishedAt', 'originallyPublishedAt', 'views', 'likes', 'trending' ], - VIDEOS_SEARCH: [ 'name', 'duration', 'createdAt', 'publishedAt', 'views', 'likes', 'match' ], + VIDEOS_SEARCH: [ 'name', 'duration', 'createdAt', 'publishedAt', 'originallyPublishedAt', 'views', 'likes', 'match' ], VIDEO_CHANNELS_SEARCH: [ 'match', 'displayName', 'createdAt' ], ACCOUNTS_BLOCKLIST: [ 'createdAt' ], @@ -90,9 +90,6 @@ const ROUTE_CACHE_LIFETIME = { SECURITYTXT: '2 hours', NODEINFO: '10 minutes', DNT_POLICY: '1 week', - OVERVIEWS: { - VIDEOS: '1 hour' - }, ACTIVITY_PUB: { VIDEOS: '1 second' // 1 second, cache concurrent requests after a broadcast for example }, @@ -148,11 +145,11 @@ const JOB_CONCURRENCY: { [id in JobType]: number } = { const JOB_TTL: { [id in JobType]: number } = { 'activitypub-http-broadcast': 60000 * 10, // 10 minutes 'activitypub-http-unicast': 60000 * 10, // 10 minutes - 'activitypub-http-fetcher': 60000 * 10, // 10 minutes + 'activitypub-http-fetcher': 1000 * 3600 * 10, // 10 hours 'activitypub-follow': 60000 * 10, // 10 minutes 'video-file-import': 1000 * 3600, // 1 hour 'video-transcoding': 1000 * 3600 * 48, // 2 days, transcoding could be long - 'video-import': 1000 * 3600 * 2, // hours + 'video-import': 1000 * 3600 * 2, // 2 hours 'email': 60000 * 10, // 10 minutes 'videos-views': undefined, // Unlimited 'activitypub-refresher': 60000 * 10, // 10 minutes @@ -286,7 +283,7 @@ const CONSTRAINTS_FIELDS = { COUNT: { min: 0 } }, VIDEO_COMMENTS: { - TEXT: { min: 1, max: 3000 }, // Length + TEXT: { min: 1, max: 10000 }, // Length URL: { min: 3, max: 2000 } // Length }, VIDEO_SHARE: { @@ -446,7 +443,7 @@ MIMETYPES.IMAGE.EXT_MIMETYPE = invert(MIMETYPES.IMAGE.MIMETYPE_EXT) const OVERVIEWS = { VIDEOS: { SAMPLE_THRESHOLD: 6, - SAMPLES_COUNT: 2 + SAMPLES_COUNT: 20 } } @@ -467,7 +464,7 @@ const ACTIVITY_PUB = { ACCEPT_HEADER: 'application/activity+json, application/ld+json', PUBLIC: 'https://www.w3.org/ns/activitystreams#Public', COLLECTION_ITEMS_PER_PAGE: 10, - FETCH_PAGE_LIMIT: 100, + FETCH_PAGE_LIMIT: 2000, URL_MIME_TYPES: { VIDEO: [] as string[], TORRENT: [ 'application/x-bittorrent' ], @@ -648,6 +645,8 @@ const P2P_MEDIA_LOADER_PEER_VERSION = 2 const PLUGIN_GLOBAL_CSS_FILE_NAME = 'plugins-global.css' const PLUGIN_GLOBAL_CSS_PATH = join(CONFIG.STORAGE.TMP_DIR, PLUGIN_GLOBAL_CSS_FILE_NAME) +let PLUGIN_EXTERNAL_AUTH_TOKEN_LIFETIME = 1000 * 60 * 5 // 5 minutes + const DEFAULT_THEME_NAME = 'default' const DEFAULT_USER_THEME_NAME = 'instance-default' @@ -687,8 +686,10 @@ if (isTestInstance() === true) { JOB_ATTEMPTS['email'] = 1 FILES_CACHE.VIDEO_CAPTIONS.MAX_AGE = 3000 - MEMOIZE_TTL.OVERVIEWS_SAMPLE = 1 - ROUTE_CACHE_LIFETIME.OVERVIEWS.VIDEOS = '0ms' + MEMOIZE_TTL.OVERVIEWS_SAMPLE = 3000 + OVERVIEWS.VIDEOS.SAMPLE_THRESHOLD = 2 + + PLUGIN_EXTERNAL_AUTH_TOKEN_LIFETIME = 5000 } updateWebserverUrls() @@ -781,6 +782,7 @@ export { VIDEO_VIEW_LIFETIME, CONTACT_FORM_LIFETIME, VIDEO_PLAYLIST_PRIVACIES, + PLUGIN_EXTERNAL_AUTH_TOKEN_LIFETIME, ASSETS_PATH, loadLanguages, buildLanguages