From d3e56c0c4b307c99e83fbafb7f2c5884cbc20055 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 10 Jan 2019 11:12:41 +0100 Subject: Implement contact form in the client --- server/initializers/checker-after-init.ts | 14 +++++++++++++- server/initializers/checker-before-init.ts | 2 +- 2 files changed, 14 insertions(+), 2 deletions(-) (limited to 'server/initializers') diff --git a/server/initializers/checker-after-init.ts b/server/initializers/checker-after-init.ts index 72d846957..955d55206 100644 --- a/server/initializers/checker-after-init.ts +++ b/server/initializers/checker-after-init.ts @@ -10,6 +10,7 @@ import { getServerActor } from '../helpers/utils' import { RecentlyAddedStrategy } from '../../shared/models/redundancy' import { isArray } from '../helpers/custom-validators/misc' import { uniq } from 'lodash' +import { Emailer } from '../lib/emailer' async function checkActivityPubUrls () { const actor = await getServerActor() @@ -32,9 +33,19 @@ async function checkActivityPubUrls () { // Some checks on configuration files // Return an error message, or null if everything is okay function checkConfig () { - const defaultNSFWPolicy = CONFIG.INSTANCE.DEFAULT_NSFW_POLICY + + if (!Emailer.isEnabled()) { + if (CONFIG.SIGNUP.ENABLED && CONFIG.SIGNUP.REQUIRES_EMAIL_VERIFICATION) { + return 'Emailer is disabled but you require signup email verification.' + } + + if (CONFIG.CONTACT_FORM.ENABLED) { + logger.warn('Emailer is disabled so the contact form will not work.') + } + } // NSFW policy + const defaultNSFWPolicy = CONFIG.INSTANCE.DEFAULT_NSFW_POLICY { const available = [ 'do_not_list', 'blur', 'display' ] if (available.indexOf(defaultNSFWPolicy) === -1) { @@ -68,6 +79,7 @@ function checkConfig () { } } + // Check storage directory locations if (isProdInstance()) { const configStorage = config.get('storage') for (const key of Object.keys(configStorage)) { diff --git a/server/initializers/checker-before-init.ts b/server/initializers/checker-before-init.ts index a7bc7eec8..7905d9ffa 100644 --- a/server/initializers/checker-before-init.ts +++ b/server/initializers/checker-before-init.ts @@ -15,7 +15,7 @@ function checkMissedConfig () { 'storage.redundancy', 'storage.tmp', 'log.level', 'user.video_quota', 'user.video_quota_daily', - 'cache.previews.size', 'admin.email', + 'cache.previews.size', 'admin.email', 'contact_form.enabled', 'signup.enabled', 'signup.limit', 'signup.requires_email_verification', 'signup.filters.cidr.whitelist', 'signup.filters.cidr.blacklist', 'redundancy.videos.strategies', 'redundancy.videos.check_interval', -- cgit v1.2.3