X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Finitializers%2Fconstants.ts;h=5a7d91160d8fd495323e9a512fabe1d916de8036;hb=136cce4d6744bef7fd316b929157c1e4e3984fe3;hp=6556aa168b52e330c81c2ce34a339245d2f4be79;hpb=bf696869538eaef27e5a8445035967c01f214501;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/initializers/constants.ts b/server/initializers/constants.ts index 6556aa168..5a7d91160 100644 --- a/server/initializers/constants.ts +++ b/server/initializers/constants.ts @@ -13,7 +13,7 @@ let config: IConfig = require('config') // --------------------------------------------------------------------------- -const LAST_MIGRATION_VERSION = 210 +const LAST_MIGRATION_VERSION = 215 // --------------------------------------------------------------------------- @@ -30,7 +30,7 @@ const SORTABLE_COLUMNS = { JOBS: [ 'createdAt' ], VIDEO_ABUSES: [ 'id', 'createdAt' ], VIDEO_CHANNELS: [ 'id', 'name', 'updatedAt', 'createdAt' ], - VIDEOS: [ 'name', 'duration', 'createdAt', 'views', 'likes' ], + VIDEOS: [ 'name', 'duration', 'createdAt', 'publishedAt', 'views', 'likes' ], VIDEO_COMMENT_THREADS: [ 'createdAt' ], BLACKLISTS: [ 'id', 'name', 'duration', 'views', 'likes', 'dislikes', 'uuid', 'createdAt' ], FOLLOWERS: [ 'createdAt' ], @@ -42,6 +42,13 @@ const OAUTH_LIFETIME = { REFRESH_TOKEN: 1209600 // 2 weeks } +const ROUTE_CACHE_LIFETIME = { + FEEDS: 1000 * 60 * 15, // 15 minutes + ACTIVITY_PUB: { + VIDEOS: 1000 // 1 second, cache concurrent requests after a broadcast for example + } +} + // --------------------------------------------------------------------------- // Number of points we add/remove after a successful/bad request @@ -174,6 +181,12 @@ const CONFIG = { get JAVASCRIPT () { return config.get('instance.customizations.javascript') }, get CSS () { return config.get('instance.customizations.css') } } + }, + SERVICES: { + TWITTER: { + get USERNAME () { return config.get('services.twitter.username') }, + get WHITELISTED () { return config.get('services.twitter.whitelisted') } + } } } @@ -192,8 +205,8 @@ const CONSTRAINTS_FIELDS = { }, VIDEO_CHANNELS: { NAME: { min: 3, max: 120 }, // Length - DESCRIPTION: { min: 3, max: 250 }, // Length - SUPPORT: { min: 3, max: 300 }, // Length + DESCRIPTION: { min: 3, max: 500 }, // Length + SUPPORT: { min: 3, max: 500 }, // Length URL: { min: 3, max: 2000 } // Length }, VIDEOS: { @@ -201,7 +214,7 @@ const CONSTRAINTS_FIELDS = { LANGUAGE: { min: 1, max: 10 }, // Length TRUNCATED_DESCRIPTION: { min: 3, max: 250 }, // Length DESCRIPTION: { min: 3, max: 10000 }, // Length - SUPPORT: { min: 3, max: 300 }, // Length + SUPPORT: { min: 3, max: 500 }, // Length IMAGE: { EXTNAME: [ '.jpg', '.jpeg' ], FILE_SIZE: { @@ -407,8 +420,7 @@ const OPENGRAPH_AND_OEMBED_COMMENT = '' // --------------------------------------------------------------------------- const FEEDS = { - COUNT: 20, - CACHE_LIFETIME: 1000 * 60 * 15 // 15 minutes + COUNT: 20 } // --------------------------------------------------------------------------- @@ -452,6 +464,7 @@ export { FOLLOW_STATES, SERVER_ACTOR_NAME, PRIVATE_RSA_KEY_SIZE, + ROUTE_CACHE_LIFETIME, SORTABLE_COLUMNS, FEEDS, NSFW_POLICY_TYPES,