aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-10-13 08:44:34 +0200
committerChocobozzz <me@florianbigard.com>2021-10-13 08:44:34 +0200
commitd41a3805502fdec0d6a075027e447b7b39b09c2b (patch)
treefe120975a25dc5adb44bf0a3c467958d9c8cfec8
parent87699a09ce714ceb79dbd846fac0de37a57fe6e3 (diff)
downloadPeerTube-d41a3805502fdec0d6a075027e447b7b39b09c2b.tar.gz
PeerTube-d41a3805502fdec0d6a075027e447b7b39b09c2b.tar.zst
PeerTube-d41a3805502fdec0d6a075027e447b7b39b09c2b.zip
Fix check after init script
-rw-r--r--server/initializers/checker-after-init.ts12
-rw-r--r--server/lib/files-cache/actor-follow-score-cache.ts5
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 @@
1import { util, has, get } from 'config' 1import config from 'config'
2import { uniq } from 'lodash' 2import { uniq } from 'lodash'
3import { URL } from 'url' 3import { URL } from 'url'
4import { getFFmpegVersion } from '@server/helpers/ffmpeg-utils' 4import { getFFmpegVersion } from '@server/helpers/ffmpeg-utils'
@@ -7,9 +7,9 @@ import { RecentlyAddedStrategy } from '../../shared/models/redundancy'
7import { isProdInstance, isTestInstance, parseSemVersion } from '../helpers/core-utils' 7import { isProdInstance, isTestInstance, parseSemVersion } from '../helpers/core-utils'
8import { isArray } from '../helpers/custom-validators/misc' 8import { isArray } from '../helpers/custom-validators/misc'
9import { logger } from '../helpers/logger' 9import { logger } from '../helpers/logger'
10import { UserModel } from '../models/user/user'
11import { ApplicationModel, getServerActor } from '../models/application/application' 10import { ApplicationModel, getServerActor } from '../models/application/application'
12import { OAuthClientModel } from '../models/oauth/oauth-client' 11import { OAuthClientModel } from '../models/oauth/oauth-client'
12import { UserModel } from '../models/user/user'
13import { CONFIG, isEmailEnabled } from './config' 13import { CONFIG, isEmailEnabled } from './config'
14import { WEBSERVER } from './constants' 14import { 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 () {
36function checkConfig () { 36function 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