diff options
Diffstat (limited to 'server/initializers/checker-after-init.ts')
-rw-r--r-- | server/initializers/checker-after-init.ts | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/server/initializers/checker-after-init.ts b/server/initializers/checker-after-init.ts index 955d55206..db3115085 100644 --- a/server/initializers/checker-after-init.ts +++ b/server/initializers/checker-after-init.ts | |||
@@ -4,19 +4,20 @@ import { UserModel } from '../models/account/user' | |||
4 | import { ApplicationModel } from '../models/application/application' | 4 | import { ApplicationModel } from '../models/application/application' |
5 | import { OAuthClientModel } from '../models/oauth/oauth-client' | 5 | import { OAuthClientModel } from '../models/oauth/oauth-client' |
6 | import { parse } from 'url' | 6 | import { parse } from 'url' |
7 | import { CONFIG } from './constants' | 7 | import { CONFIG } from './config' |
8 | import { logger } from '../helpers/logger' | 8 | import { logger } from '../helpers/logger' |
9 | import { getServerActor } from '../helpers/utils' | 9 | import { getServerActor } from '../helpers/utils' |
10 | import { RecentlyAddedStrategy } from '../../shared/models/redundancy' | 10 | import { RecentlyAddedStrategy } from '../../shared/models/redundancy' |
11 | import { isArray } from '../helpers/custom-validators/misc' | 11 | import { isArray } from '../helpers/custom-validators/misc' |
12 | import { uniq } from 'lodash' | 12 | import { uniq } from 'lodash' |
13 | import { Emailer } from '../lib/emailer' | 13 | import { Emailer } from '../lib/emailer' |
14 | import { WEBSERVER } from './constants' | ||
14 | 15 | ||
15 | async function checkActivityPubUrls () { | 16 | async function checkActivityPubUrls () { |
16 | const actor = await getServerActor() | 17 | const actor = await getServerActor() |
17 | 18 | ||
18 | const parsed = parse(actor.url) | 19 | const parsed = parse(actor.url) |
19 | if (CONFIG.WEBSERVER.HOST !== parsed.host) { | 20 | if (WEBSERVER.HOST !== parsed.host) { |
20 | const NODE_ENV = config.util.getEnv('NODE_ENV') | 21 | const NODE_ENV = config.util.getEnv('NODE_ENV') |
21 | const NODE_CONFIG_DIR = config.util.getEnv('NODE_CONFIG_DIR') | 22 | const NODE_CONFIG_DIR = config.util.getEnv('NODE_CONFIG_DIR') |
22 | 23 | ||
@@ -34,6 +35,12 @@ async function checkActivityPubUrls () { | |||
34 | // Return an error message, or null if everything is okay | 35 | // Return an error message, or null if everything is okay |
35 | function checkConfig () { | 36 | function checkConfig () { |
36 | 37 | ||
38 | // Moved configuration keys | ||
39 | if (config.has('services.csp-logger')) { | ||
40 | logger.warn('services.csp-logger configuration has been renamed to csp.report_uri. Please update your configuration file.') | ||
41 | } | ||
42 | |||
43 | // Email verification | ||
37 | if (!Emailer.isEnabled()) { | 44 | if (!Emailer.isEnabled()) { |
38 | if (CONFIG.SIGNUP.ENABLED && CONFIG.SIGNUP.REQUIRES_EMAIL_VERIFICATION) { | 45 | if (CONFIG.SIGNUP.ENABLED && CONFIG.SIGNUP.REQUIRES_EMAIL_VERIFICATION) { |
39 | return 'Emailer is disabled but you require signup email verification.' | 46 | return 'Emailer is disabled but you require signup email verification.' |
@@ -77,6 +84,8 @@ function checkConfig () { | |||
77 | if (recentlyAddedStrategy && isNaN(recentlyAddedStrategy.minViews)) { | 84 | if (recentlyAddedStrategy && isNaN(recentlyAddedStrategy.minViews)) { |
78 | return 'Min views in recently added strategy is not a number' | 85 | return 'Min views in recently added strategy is not a number' |
79 | } | 86 | } |
87 | } else { | ||
88 | return 'Videos redundancy should be an array (you must uncomment lines containing - too)' | ||
80 | } | 89 | } |
81 | 90 | ||
82 | // Check storage directory locations | 91 | // Check storage directory locations |