X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server.ts;h=1286cf521ef15deedb6b9d735c0ff1553d3cdd21;hb=85e0e0e66bf3e347bac44209f30117eca73f1148;hp=5cfa09445537215fd3f9c772955d45a02ddd1b9a;hpb=00aab0666c6f772548c160fdfa871a8843b88f37;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server.ts b/server.ts index 5cfa09445..1286cf521 100644 --- a/server.ts +++ b/server.ts @@ -1,12 +1,7 @@ -require('module-alias/register') - -// FIXME: https://github.com/nodejs/node/pull/16853 -import { PluginManager } from './server/lib/plugins/plugin-manager' - -require('tls').DEFAULT_ECDH_CURVE = 'auto' +import { registerTSPaths } from './server/helpers/register-ts-paths' +registerTSPaths() import { isTestInstance } from './server/helpers/core-utils' - if (isTestInstance()) { require('source-map-support').install() } @@ -89,7 +84,7 @@ migrate() loadLanguages() // ----------- PeerTube modules ----------- -import { installApplication } from './server/initializers' +import { installApplication } from './server/initializers/installer' import { Emailer } from './server/lib/emailer' import { JobQueue } from './server/lib/job-queue' import { VideosPreviewCache, VideosCaptionCache } from './server/lib/files-cache' @@ -121,6 +116,7 @@ import { PeerTubeSocket } from './server/lib/peertube-socket' import { updateStreamingPlaylistsInfohashesIfNeeded } from './server/lib/hls' import { PluginsCheckScheduler } from './server/lib/schedulers/plugins-check-scheduler' import { Hooks } from './server/lib/plugins/hooks' +import { PluginManager } from './server/lib/plugins/plugin-manager' // ----------- Command line ----------- @@ -141,14 +137,14 @@ if (isTestInstance()) { } // For the logger -morgan.token('remote-addr', req => { - if (req.get('DNT') === '1') { +morgan.token('remote-addr', req => { + if (CONFIG.LOG.ANONYMIZE_IP === true || req.get('DNT') === '1') { return anonymize(req.ip, 16, 16) } return req.ip }) -morgan.token('user-agent', req => { +morgan.token('user-agent', req => { if (req.get('DNT') === '1') { return useragent.parse(req.get('user-agent')).family }