aboutsummaryrefslogtreecommitdiffhomepage
path: root/server.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server.ts')
-rw-r--r--server.ts12
1 files changed, 6 insertions, 6 deletions
diff --git a/server.ts b/server.ts
index 8bc5e5f32..59fb820b4 100644
--- a/server.ts
+++ b/server.ts
@@ -1,6 +1,4 @@
1// FIXME: https://github.com/nodejs/node/pull/16853 1// FIXME: https://github.com/nodejs/node/pull/16853
2import { VideosCaptionCache } from './server/lib/cache/videos-caption-cache'
3
4require('tls').DEFAULT_ECDH_CURVE = 'auto' 2require('tls').DEFAULT_ECDH_CURVE = 'auto'
5 3
6import { isTestInstance } from './server/helpers/core-utils' 4import { isTestInstance } from './server/helpers/core-utils'
@@ -17,7 +15,7 @@ import * as cors from 'cors'
17import * as cookieParser from 'cookie-parser' 15import * as cookieParser from 'cookie-parser'
18import * as helmet from 'helmet' 16import * as helmet from 'helmet'
19import * as useragent from 'useragent' 17import * as useragent from 'useragent'
20import * as anonymise from 'ip-anonymize' 18import * as anonymize from 'ip-anonymize'
21 19
22process.title = 'peertube' 20process.title = 'peertube'
23 21
@@ -25,7 +23,7 @@ process.title = 'peertube'
25const app = express() 23const app = express()
26 24
27// ----------- Core checker ----------- 25// ----------- Core checker -----------
28import { checkMissedConfig, checkFFmpeg, checkConfig, checkActivityPubUrls } from './server/initializers/checker' 26import { checkMissedConfig, checkFFmpeg } from './server/initializers/checker-before-init'
29 27
30// Do not use barrels because we don't want to load all modules here (we need to initialize database first) 28// Do not use barrels because we don't want to load all modules here (we need to initialize database first)
31import { logger } from './server/helpers/logger' 29import { logger } from './server/helpers/logger'
@@ -43,6 +41,8 @@ checkFFmpeg(CONFIG)
43 process.exit(-1) 41 process.exit(-1)
44 }) 42 })
45 43
44import { checkConfig, checkActivityPubUrls } from './server/initializers/checker-after-init'
45
46const errorMessage = checkConfig() 46const errorMessage = checkConfig()
47if (errorMessage !== null) { 47if (errorMessage !== null) {
48 throw new Error(errorMessage) 48 throw new Error(errorMessage)
@@ -76,7 +76,7 @@ migrate()
76import { installApplication } from './server/initializers' 76import { installApplication } from './server/initializers'
77import { Emailer } from './server/lib/emailer' 77import { Emailer } from './server/lib/emailer'
78import { JobQueue } from './server/lib/job-queue' 78import { JobQueue } from './server/lib/job-queue'
79import { VideosPreviewCache } from './server/lib/cache' 79import { VideosPreviewCache, VideosCaptionCache } from './server/lib/cache'
80import { 80import {
81 activityPubRouter, 81 activityPubRouter,
82 apiRouter, 82 apiRouter,
@@ -111,7 +111,7 @@ if (isTestInstance()) {
111// For the logger 111// For the logger
112morgan.token('remote-addr', req => { 112morgan.token('remote-addr', req => {
113 return (req.get('DNT') === '1') ? 113 return (req.get('DNT') === '1') ?
114 anonymise(req.ip || (req.connection && req.connection.remoteAddress) || undefined, 114 anonymize(req.ip || (req.connection && req.connection.remoteAddress) || undefined,
115 16, // bitmask for IPv4 115 16, // bitmask for IPv4
116 16 // bitmask for IPv6 116 16 // bitmask for IPv6
117 ) : 117 ) :