aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/initializers/checker.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/initializers/checker.ts')
-rw-r--r--server/initializers/checker.ts25
1 files changed, 24 insertions, 1 deletions
diff --git a/server/initializers/checker.ts b/server/initializers/checker.ts
index 6259c7b6c..d5402098f 100644
--- a/server/initializers/checker.ts
+++ b/server/initializers/checker.ts
@@ -3,6 +3,28 @@ import { promisify0 } 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'
7import { CONFIG } from './constants'
8import { logger } from '../helpers/logger'
9import { getServerActor } from '../helpers/utils'
10
11async function checkActivityPubUrls () {
12 const actor = await getServerActor()
13
14 const parsed = parse(actor.url)
15 if (CONFIG.WEBSERVER.HOST !== parsed.host) {
16 const NODE_ENV = config.util.getEnv('NODE_ENV')
17 const NODE_CONFIG_DIR = config.util.getEnv('NODE_CONFIG_DIR')
18
19 logger.warn(
20 'It seems PeerTube was started (and created some data) with another domain name. ' +
21 'This means you will not be able to federate! ' +
22 'Please use %s %s npm run update-host to fix this.',
23 NODE_CONFIG_DIR ? `NODE_CONFIG_DIR=${NODE_CONFIG_DIR}` : '',
24 NODE_ENV ? `NODE_ENV=${NODE_ENV}` : ''
25 )
26 }
27}
6 28
7// Some checks on configuration files 29// Some checks on configuration files
8// Return an error message, or null if everything is okay 30// Return an error message, or null if everything is okay
@@ -95,5 +117,6 @@ export {
95 checkMissedConfig, 117 checkMissedConfig,
96 clientsExist, 118 clientsExist,
97 usersExist, 119 usersExist,
98 applicationExist 120 applicationExist,
121 checkActivityPubUrls
99} 122}