aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/initializers/checker-after-init.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/initializers/checker-after-init.ts')
-rw-r--r--server/initializers/checker-after-init.ts9
1 files changed, 4 insertions, 5 deletions
diff --git a/server/initializers/checker-after-init.ts b/server/initializers/checker-after-init.ts
index 44efd346c..e01609eef 100644
--- a/server/initializers/checker-after-init.ts
+++ b/server/initializers/checker-after-init.ts
@@ -3,20 +3,19 @@ import { isProdInstance, isTestInstance } from '../helpers/core-utils'
3import { UserModel } from '../models/account/user' 3import { UserModel } from '../models/account/user'
4import { ApplicationModel } from '../models/application/application' 4import { ApplicationModel } from '../models/application/application'
5import { OAuthClientModel } from '../models/oauth/oauth-client' 5import { OAuthClientModel } from '../models/oauth/oauth-client'
6import { parse } from 'url' 6import { URL } from 'url'
7import { CONFIG } from './config' 7import { CONFIG, isEmailEnabled } from './config'
8import { logger } from '../helpers/logger' 8import { logger } from '../helpers/logger'
9import { getServerActor } from '../helpers/utils' 9import { getServerActor } from '../helpers/utils'
10import { RecentlyAddedStrategy } from '../../shared/models/redundancy' 10import { RecentlyAddedStrategy } from '../../shared/models/redundancy'
11import { isArray } from '../helpers/custom-validators/misc' 11import { isArray } from '../helpers/custom-validators/misc'
12import { uniq } from 'lodash' 12import { uniq } from 'lodash'
13import { Emailer } from '../lib/emailer'
14import { WEBSERVER } from './constants' 13import { WEBSERVER } from './constants'
15 14
16async function checkActivityPubUrls () { 15async function checkActivityPubUrls () {
17 const actor = await getServerActor() 16 const actor = await getServerActor()
18 17
19 const parsed = parse(actor.url) 18 const parsed = new URL(actor.url)
20 if (WEBSERVER.HOST !== parsed.host) { 19 if (WEBSERVER.HOST !== parsed.host) {
21 const NODE_ENV = config.util.getEnv('NODE_ENV') 20 const NODE_ENV = config.util.getEnv('NODE_ENV')
22 const NODE_CONFIG_DIR = config.util.getEnv('NODE_CONFIG_DIR') 21 const NODE_CONFIG_DIR = config.util.getEnv('NODE_CONFIG_DIR')
@@ -41,7 +40,7 @@ function checkConfig () {
41 } 40 }
42 41
43 // Email verification 42 // Email verification
44 if (!Emailer.isEnabled()) { 43 if (!isEmailEnabled()) {
45 if (CONFIG.SIGNUP.ENABLED && CONFIG.SIGNUP.REQUIRES_EMAIL_VERIFICATION) { 44 if (CONFIG.SIGNUP.ENABLED && CONFIG.SIGNUP.REQUIRES_EMAIL_VERIFICATION) {
46 return 'Emailer is disabled but you require signup email verification.' 45 return 'Emailer is disabled but you require signup email verification.'
47 } 46 }