X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server.ts;h=b49d10344bb5a38b83739afe30fe7b350a85322d;hb=2be68ab979b23c29177ac0e3e8c4677e5401f1ee;hp=d5f8f0b2b872398594694ae5fc71280e4362b1be;hpb=8424c4026afd7304880a4ce8138a04ffb3d8c938;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server.ts b/server.ts index d5f8f0b2b..b49d10344 100644 --- a/server.ts +++ b/server.ts @@ -1,12 +1,18 @@ -require('module-alias/register') +import { resolve } from 'path' -// FIXME: https://github.com/nodejs/node/pull/16853 -import { PluginManager } from './server/lib/plugins/plugin-manager' +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 { isTestInstance } from './server/helpers/core-utils' - if (isTestInstance()) { require('source-map-support').install() } @@ -115,11 +121,13 @@ import { UpdateVideosScheduler } from './server/lib/schedulers/update-videos-sch import { YoutubeDlUpdateScheduler } from './server/lib/schedulers/youtube-dl-update-scheduler' import { VideosRedundancyScheduler } from './server/lib/schedulers/videos-redundancy-scheduler' import { RemoveOldHistoryScheduler } from './server/lib/schedulers/remove-old-history-scheduler' +import { AutoFollowIndexInstances } from './server/lib/schedulers/auto-follow-index-instances' import { isHTTPSignatureDigestValid } from './server/helpers/peertube-crypto' 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 ----------- @@ -260,6 +268,7 @@ async function startApplication () { RemoveOldHistoryScheduler.Instance.enable() RemoveOldViewsScheduler.Instance.enable() PluginsCheckScheduler.Instance.enable() + AutoFollowIndexInstances.Instance.enable() // Redis initialization Redis.Instance.init()