diff options
Diffstat (limited to 'server.ts')
-rw-r--r-- | server.ts | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -1,6 +1,4 @@ | |||
1 | // FIXME: https://github.com/nodejs/node/pull/16853 | 1 | // FIXME: https://github.com/nodejs/node/pull/16853 |
2 | import { VideosCaptionCache } from './server/lib/cache/videos-caption-cache' | ||
3 | |||
4 | require('tls').DEFAULT_ECDH_CURVE = 'auto' | 2 | require('tls').DEFAULT_ECDH_CURVE = 'auto' |
5 | 3 | ||
6 | import { isTestInstance } from './server/helpers/core-utils' | 4 | import { isTestInstance } from './server/helpers/core-utils' |
@@ -17,7 +15,7 @@ import * as cors from 'cors' | |||
17 | import * as cookieParser from 'cookie-parser' | 15 | import * as cookieParser from 'cookie-parser' |
18 | import * as helmet from 'helmet' | 16 | import * as helmet from 'helmet' |
19 | import * as useragent from 'useragent' | 17 | import * as useragent from 'useragent' |
20 | import * as anonymise from 'ip-anonymize' | 18 | import * as anonymize from 'ip-anonymize' |
21 | 19 | ||
22 | process.title = 'peertube' | 20 | process.title = 'peertube' |
23 | 21 | ||
@@ -25,7 +23,7 @@ process.title = 'peertube' | |||
25 | const app = express() | 23 | const app = express() |
26 | 24 | ||
27 | // ----------- Core checker ----------- | 25 | // ----------- Core checker ----------- |
28 | import { checkMissedConfig, checkFFmpeg, checkConfig, checkActivityPubUrls } from './server/initializers/checker' | 26 | import { 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) |
31 | import { logger } from './server/helpers/logger' | 29 | import { logger } from './server/helpers/logger' |
@@ -43,6 +41,8 @@ checkFFmpeg(CONFIG) | |||
43 | process.exit(-1) | 41 | process.exit(-1) |
44 | }) | 42 | }) |
45 | 43 | ||
44 | import { checkConfig, checkActivityPubUrls } from './server/initializers/checker-after-init' | ||
45 | |||
46 | const errorMessage = checkConfig() | 46 | const errorMessage = checkConfig() |
47 | if (errorMessage !== null) { | 47 | if (errorMessage !== null) { |
48 | throw new Error(errorMessage) | 48 | throw new Error(errorMessage) |
@@ -76,7 +76,7 @@ migrate() | |||
76 | import { installApplication } from './server/initializers' | 76 | import { installApplication } from './server/initializers' |
77 | import { Emailer } from './server/lib/emailer' | 77 | import { Emailer } from './server/lib/emailer' |
78 | import { JobQueue } from './server/lib/job-queue' | 78 | import { JobQueue } from './server/lib/job-queue' |
79 | import { VideosPreviewCache } from './server/lib/cache' | 79 | import { VideosPreviewCache, VideosCaptionCache } from './server/lib/cache' |
80 | import { | 80 | import { |
81 | activityPubRouter, | 81 | activityPubRouter, |
82 | apiRouter, | 82 | apiRouter, |
@@ -111,7 +111,7 @@ if (isTestInstance()) { | |||
111 | // For the logger | 111 | // For the logger |
112 | morgan.token('remote-addr', req => { | 112 | morgan.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 | ) : |