aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/initializers
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2019-01-09 15:14:29 +0100
committerChocobozzz <me@florianbigard.com>2019-01-10 11:32:37 +0100
commita4101923e699e49ceb9ff36e971c75417fafc9f0 (patch)
treec098a87ac5a85e1bc7454facbb59ecbd6c7dac82 /server/initializers
parent8d00889b6038c38d9c86cbeca88a9f3c23962c48 (diff)
downloadPeerTube-a4101923e699e49ceb9ff36e971c75417fafc9f0.tar.gz
PeerTube-a4101923e699e49ceb9ff36e971c75417fafc9f0.tar.zst
PeerTube-a4101923e699e49ceb9ff36e971c75417fafc9f0.zip
Implement contact form on server side
Diffstat (limited to 'server/initializers')
-rw-r--r--server/initializers/constants.ts11
1 files changed, 11 insertions, 0 deletions
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 = {
231 ADMIN: { 231 ADMIN: {
232 get EMAIL () { return config.get<string>('admin.email') } 232 get EMAIL () { return config.get<string>('admin.email') }
233 }, 233 },
234 CONTACT_FORM: {
235 get ENABLED () { return config.get<boolean>('contact_form.enabled') }
236 },
234 SIGNUP: { 237 SIGNUP: {
235 get ENABLED () { return config.get<boolean>('signup.enabled') }, 238 get ENABLED () { return config.get<boolean>('signup.enabled') },
236 get LIMIT () { return config.get<number>('signup.limit') }, 239 get LIMIT () { return config.get<number>('signup.limit') },
@@ -394,6 +397,10 @@ let CONSTRAINTS_FIELDS = {
394 }, 397 },
395 VIDEO_SHARE: { 398 VIDEO_SHARE: {
396 URL: { min: 3, max: 2000 } // Length 399 URL: { min: 3, max: 2000 } // Length
400 },
401 CONTACT_FORM: {
402 FROM_NAME: { min: 1, max: 120 }, // Length
403 BODY: { min: 3, max: 5000 } // Length
397 } 404 }
398} 405}
399 406
@@ -409,6 +416,8 @@ const RATES_LIMIT = {
409} 416}
410 417
411let VIDEO_VIEW_LIFETIME = 60000 * 60 // 1 hour 418let VIDEO_VIEW_LIFETIME = 60000 * 60 // 1 hour
419let CONTACT_FORM_LIFETIME = 60000 * 60 // 1 hour
420
412const VIDEO_TRANSCODING_FPS: VideoTranscodingFPS = { 421const VIDEO_TRANSCODING_FPS: VideoTranscodingFPS = {
413 MIN: 10, 422 MIN: 10,
414 AVERAGE: 30, 423 AVERAGE: 30,
@@ -685,6 +694,7 @@ if (isTestInstance() === true) {
685 REDUNDANCY.VIDEOS.RANDOMIZED_FACTOR = 1 694 REDUNDANCY.VIDEOS.RANDOMIZED_FACTOR = 1
686 695
687 VIDEO_VIEW_LIFETIME = 1000 // 1 second 696 VIDEO_VIEW_LIFETIME = 1000 // 1 second
697 CONTACT_FORM_LIFETIME = 1000 // 1 second
688 698
689 JOB_ATTEMPTS['email'] = 1 699 JOB_ATTEMPTS['email'] = 1
690 700
@@ -756,6 +766,7 @@ export {
756 HTTP_SIGNATURE, 766 HTTP_SIGNATURE,
757 VIDEO_IMPORT_STATES, 767 VIDEO_IMPORT_STATES,
758 VIDEO_VIEW_LIFETIME, 768 VIDEO_VIEW_LIFETIME,
769 CONTACT_FORM_LIFETIME,
759 buildLanguages 770 buildLanguages
760} 771}
761 772