From a4101923e699e49ceb9ff36e971c75417fafc9f0 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 9 Jan 2019 15:14:29 +0100 Subject: Implement contact form on server side --- server/initializers/constants.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'server/initializers') diff --git a/server/initializers/constants.ts b/server/initializers/constants.ts index 91e74f6c7..4a88aef87 100644 --- a/server/initializers/constants.ts +++ b/server/initializers/constants.ts @@ -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 } -- cgit v1.2.3