allow limiting video-comments rss feeds to an account or video channel
[oweals/peertube.git] / server.ts
index 5cfa09445537215fd3f9c772955d45a02ddd1b9a..1286cf521ef15deedb6b9d735c0ff1553d3cdd21 100644 (file)
--- 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<express.Request>('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<express.Request>('user-agent', req => {
   if (req.get('DNT') === '1') {
     return useragent.parse(req.get('user-agent')).family
   }