Use local search for recommended videos
[oweals/peertube.git] / server.ts
index b49d10344bb5a38b83739afe30fe7b350a85322d..e18e2be5c305c68a8fa8b74c4b899682ea3377c6 100644 (file)
--- a/server.ts
+++ b/server.ts
@@ -1,16 +1,5 @@
-import { resolve } from 'path'
-
-const tsConfig = require('./tsconfig.json')
-const tsConfigPaths = require('tsconfig-paths')
-
-// Thanks: https://github.com/dividab/tsconfig-paths/issues/75#issuecomment-458936883
-tsConfigPaths.register({
-  baseUrl: resolve(tsConfig.compilerOptions.baseUrl || '', tsConfig.compilerOptions.outDir || ''),
-  paths: tsConfig.compilerOptions.paths
-})
-
-// FIXME: https://github.com/nodejs/node/pull/16853
-require('tls').DEFAULT_ECDH_CURVE = 'auto'
+import { registerTSPaths } from './server/helpers/register-ts-paths'
+registerTSPaths()
 
 import { isTestInstance } from './server/helpers/core-utils'
 if (isTestInstance()) {
@@ -95,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'
@@ -149,7 +138,7 @@ if (isTestInstance()) {
 
 // For the logger
 morgan.token('remote-addr', req => {
-  if (req.get('DNT') === '1') {
+  if (CONFIG.LOG.ANONYMIZE_IP === true || req.get('DNT') === '1') {
     return anonymize(req.ip, 16, 16)
   }