X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Finitializers%2Fconstants.ts;h=4a88aef87153fd471c8aec656ee10c603cd24895;hb=a4101923e699e49ceb9ff36e971c75417fafc9f0;hp=fcfaf71a01e2ae8ee28555b1cb853726065e3aac;hpb=cef534ed53e4518fe0acf581bfe880788d42fc36;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/initializers/constants.ts b/server/initializers/constants.ts index fcfaf71a0..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 // --------------------------------------------------------------------------- @@ -231,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') }, @@ -394,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 } } @@ -409,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, @@ -685,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 @@ -756,6 +766,7 @@ export { HTTP_SIGNATURE, VIDEO_IMPORT_STATES, VIDEO_VIEW_LIFETIME, + CONTACT_FORM_LIFETIME, buildLanguages }