diff options
author | Chocobozzz <me@florianbigard.com> | 2021-10-13 08:44:34 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-10-13 08:44:34 +0200 |
commit | d41a3805502fdec0d6a075027e447b7b39b09c2b (patch) | |
tree | fe120975a25dc5adb44bf0a3c467958d9c8cfec8 | |
parent | 87699a09ce714ceb79dbd846fac0de37a57fe6e3 (diff) | |
download | PeerTube-d41a3805502fdec0d6a075027e447b7b39b09c2b.tar.gz PeerTube-d41a3805502fdec0d6a075027e447b7b39b09c2b.tar.zst PeerTube-d41a3805502fdec0d6a075027e447b7b39b09c2b.zip |
Fix check after init script
-rw-r--r-- | server/initializers/checker-after-init.ts | 12 | ||||
-rw-r--r-- | server/lib/files-cache/actor-follow-score-cache.ts | 5 |
2 files changed, 10 insertions, 7 deletions
diff --git a/server/initializers/checker-after-init.ts b/server/initializers/checker-after-init.ts index c0a6c41ab..7a9e07482 100644 --- a/server/initializers/checker-after-init.ts +++ b/server/initializers/checker-after-init.ts | |||
@@ -1,4 +1,4 @@ | |||
1 | import { util, has, get } from 'config' | 1 | import config from 'config' |
2 | import { uniq } from 'lodash' | 2 | import { uniq } from 'lodash' |
3 | import { URL } from 'url' | 3 | import { URL } from 'url' |
4 | import { getFFmpegVersion } from '@server/helpers/ffmpeg-utils' | 4 | import { getFFmpegVersion } from '@server/helpers/ffmpeg-utils' |
@@ -7,9 +7,9 @@ import { RecentlyAddedStrategy } from '../../shared/models/redundancy' | |||
7 | import { isProdInstance, isTestInstance, parseSemVersion } from '../helpers/core-utils' | 7 | import { isProdInstance, isTestInstance, parseSemVersion } from '../helpers/core-utils' |
8 | import { isArray } from '../helpers/custom-validators/misc' | 8 | import { isArray } from '../helpers/custom-validators/misc' |
9 | import { logger } from '../helpers/logger' | 9 | import { logger } from '../helpers/logger' |
10 | import { UserModel } from '../models/user/user' | ||
11 | import { ApplicationModel, getServerActor } from '../models/application/application' | 10 | import { ApplicationModel, getServerActor } from '../models/application/application' |
12 | import { OAuthClientModel } from '../models/oauth/oauth-client' | 11 | import { OAuthClientModel } from '../models/oauth/oauth-client' |
12 | import { UserModel } from '../models/user/user' | ||
13 | import { CONFIG, isEmailEnabled } from './config' | 13 | import { CONFIG, isEmailEnabled } from './config' |
14 | import { WEBSERVER } from './constants' | 14 | import { WEBSERVER } from './constants' |
15 | 15 | ||
@@ -18,8 +18,8 @@ async function checkActivityPubUrls () { | |||
18 | 18 | ||
19 | const parsed = new URL(actor.url) | 19 | const parsed = new URL(actor.url) |
20 | if (WEBSERVER.HOST !== parsed.host) { | 20 | if (WEBSERVER.HOST !== parsed.host) { |
21 | const NODE_ENV = util.getEnv('NODE_ENV') | 21 | const NODE_ENV = config.util.getEnv('NODE_ENV') |
22 | const NODE_CONFIG_DIR = util.getEnv('NODE_CONFIG_DIR') | 22 | const NODE_CONFIG_DIR = config.util.getEnv('NODE_CONFIG_DIR') |
23 | 23 | ||
24 | logger.warn( | 24 | logger.warn( |
25 | 'It seems PeerTube was started (and created some data) with another domain name. ' + | 25 | 'It seems PeerTube was started (and created some data) with another domain name. ' + |
@@ -36,7 +36,7 @@ async function checkActivityPubUrls () { | |||
36 | function checkConfig () { | 36 | function checkConfig () { |
37 | 37 | ||
38 | // Moved configuration keys | 38 | // Moved configuration keys |
39 | if (has('services.csp-logger')) { | 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.') | 40 | logger.warn('services.csp-logger configuration has been renamed to csp.report_uri. Please update your configuration file.') |
41 | } | 41 | } |
42 | 42 | ||
@@ -97,7 +97,7 @@ function checkConfig () { | |||
97 | 97 | ||
98 | // Check storage directory locations | 98 | // Check storage directory locations |
99 | if (isProdInstance()) { | 99 | if (isProdInstance()) { |
100 | const configStorage = get('storage') | 100 | const configStorage = config.get('storage') |
101 | for (const key of Object.keys(configStorage)) { | 101 | for (const key of Object.keys(configStorage)) { |
102 | if (configStorage[key].startsWith('storage/')) { | 102 | if (configStorage[key].startsWith('storage/')) { |
103 | logger.warn( | 103 | logger.warn( |
diff --git a/server/lib/files-cache/actor-follow-score-cache.ts b/server/lib/files-cache/actor-follow-score-cache.ts index 086605726..465080e72 100644 --- a/server/lib/files-cache/actor-follow-score-cache.ts +++ b/server/lib/files-cache/actor-follow-score-cache.ts | |||
@@ -19,7 +19,10 @@ class ActorFollowScoreCache { | |||
19 | updateActorFollowsScore (goodInboxes: string[], badInboxes: string[]) { | 19 | updateActorFollowsScore (goodInboxes: string[], badInboxes: string[]) { |
20 | if (goodInboxes.length === 0 && badInboxes.length === 0) return | 20 | if (goodInboxes.length === 0 && badInboxes.length === 0) return |
21 | 21 | ||
22 | logger.info('Updating %d good actor follows and %d bad actor follows scores in cache.', goodInboxes.length, badInboxes.length) | 22 | logger.info( |
23 | 'Updating %d good actor follows and %d bad actor follows scores in cache.', | ||
24 | goodInboxes.length, badInboxes.length, { badInboxes } | ||
25 | ) | ||
23 | 26 | ||
24 | for (const goodInbox of goodInboxes) { | 27 | for (const goodInbox of goodInboxes) { |
25 | if (this.pendingFollowsScore[goodInbox] === undefined) this.pendingFollowsScore[goodInbox] = 0 | 28 | if (this.pendingFollowsScore[goodInbox] === undefined) this.pendingFollowsScore[goodInbox] = 0 |