+import { parse } from 'url'
+import { CONFIG } from './constants'
+import { logger } from '../helpers/logger'
+import { getServerActor } from '../helpers/utils'
+import { RecentlyAddedStrategy, VideosRedundancy } from '../../shared/models/redundancy'
+import { isArray } from '../helpers/custom-validators/misc'
+import { uniq } from 'lodash'
+
+async function checkActivityPubUrls () {
+ const actor = await getServerActor()
+
+ const parsed = parse(actor.url)
+ if (CONFIG.WEBSERVER.HOST !== parsed.host) {
+ const NODE_ENV = config.util.getEnv('NODE_ENV')
+ const NODE_CONFIG_DIR = config.util.getEnv('NODE_CONFIG_DIR')
+
+ logger.warn(
+ 'It seems PeerTube was started (and created some data) with another domain name. ' +
+ 'This means you will not be able to federate! ' +
+ 'Please use %s %s npm run update-host to fix this.',
+ NODE_CONFIG_DIR ? `NODE_CONFIG_DIR=${NODE_CONFIG_DIR}` : '',
+ NODE_ENV ? `NODE_ENV=${NODE_ENV}` : ''
+ )
+ }
+}