X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Finitializers%2Fconstants.ts;h=4a88aef87153fd471c8aec656ee10c603cd24895;hb=a4101923e699e49ceb9ff36e971c75417fafc9f0;hp=c3df2383adeea17e7f29a60a0b8fdb3b5ae602e6;hpb=439b1744f5f50b8530cded9398d51aa4bb5ed4ff;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/initializers/constants.ts b/server/initializers/constants.ts index c3df2383a..4a88aef87 100644 --- a/server/initializers/constants.ts +++ b/server/initializers/constants.ts @@ -16,7 +16,7 @@ let config: IConfig = require('config') // --------------------------------------------------------------------------- -const LAST_MIGRATION_VERSION = 310 +const LAST_MIGRATION_VERSION = 315 // --------------------------------------------------------------------------- @@ -50,7 +50,9 @@ const SORTABLE_COLUMNS = { VIDEO_CHANNELS_SEARCH: [ 'match', 'displayName', 'createdAt' ], ACCOUNTS_BLOCKLIST: [ 'createdAt' ], - SERVERS_BLOCKLIST: [ 'createdAt' ] + SERVERS_BLOCKLIST: [ 'createdAt' ], + + USER_NOTIFICATIONS: [ 'createdAt' ] } const OAUTH_LIFETIME = { @@ -229,6 +231,9 @@ const CONFIG = { ADMIN: { get EMAIL () { return config.get('admin.email') } }, + CONTACT_FORM: { + get ENABLED () { return config.get('contact_form.enabled') } + }, SIGNUP: { get ENABLED () { return config.get('signup.enabled') }, get LIMIT () { return config.get('signup.limit') }, @@ -392,6 +397,10 @@ let CONSTRAINTS_FIELDS = { }, VIDEO_SHARE: { URL: { min: 3, max: 2000 } // Length + }, + CONTACT_FORM: { + FROM_NAME: { min: 1, max: 120 }, // Length + BODY: { min: 3, max: 5000 } // Length } } @@ -407,6 +416,8 @@ const RATES_LIMIT = { } let VIDEO_VIEW_LIFETIME = 60000 * 60 // 1 hour +let CONTACT_FORM_LIFETIME = 60000 * 60 // 1 hour + const VIDEO_TRANSCODING_FPS: VideoTranscodingFPS = { MIN: 10, AVERAGE: 30, @@ -683,6 +694,7 @@ if (isTestInstance() === true) { REDUNDANCY.VIDEOS.RANDOMIZED_FACTOR = 1 VIDEO_VIEW_LIFETIME = 1000 // 1 second + CONTACT_FORM_LIFETIME = 1000 // 1 second JOB_ATTEMPTS['email'] = 1 @@ -754,6 +766,7 @@ export { HTTP_SIGNATURE, VIDEO_IMPORT_STATES, VIDEO_VIEW_LIFETIME, + CONTACT_FORM_LIFETIME, buildLanguages }