]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server.ts
Add retries to travis mocha
[github/Chocobozzz/PeerTube.git] / server.ts
index ac373b041b4f2fe3b9bcfff7a36aaa8f77a69457..abfeeed2e02ad5a2f17b2f56a347bdebbdc88570 100644 (file)
--- a/server.ts
+++ b/server.ts
@@ -97,7 +97,6 @@ import {
   staticRouter,
   servicesRouter,
   pluginsRouter,
-  themesRouter,
   webfingerRouter,
   trackerRouter,
   createWebsocketTrackerServer, botsRouter
@@ -114,11 +113,14 @@ import { RemoveOldHistoryScheduler } from './server/lib/schedulers/remove-old-hi
 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'
 
 // ----------- Command line -----------
 
 cli
   .option('--no-client', 'Start PeerTube without client interface')
+  .option('--no-plugins', 'Start PeerTube without plugins/themes enabled')
   .parse(process.argv)
 
 // ----------- App -----------
@@ -178,8 +180,7 @@ app.use(apiRoute, apiRouter)
 app.use('/services', servicesRouter)
 
 // Plugins & themes
-app.use('/plugins', pluginsRouter)
-app.use('/themes', themesRouter)
+app.use('/', pluginsRouter)
 
 app.use('/', activityPubRouter)
 app.use('/', feedsRouter)
@@ -252,6 +253,7 @@ async function startApplication () {
   VideosRedundancyScheduler.Instance.enable()
   RemoveOldHistoryScheduler.Instance.enable()
   RemoveOldViewsScheduler.Instance.enable()
+  PluginsCheckScheduler.Instance.enable()
 
   // Redis initialization
   Redis.Instance.init()
@@ -261,14 +263,14 @@ async function startApplication () {
   updateStreamingPlaylistsInfohashesIfNeeded()
     .catch(err => logger.error('Cannot update streaming playlist infohashes.', { err }))
 
-  await PluginManager.Instance.registerPlugins()
+  if (cli.plugins) await PluginManager.Instance.registerPluginsAndThemes()
 
   // Make server listening
   server.listen(port, hostname, () => {
     logger.info('Server listening on %s:%d', hostname, port)
     logger.info('Web server: %s', WEBSERVER.URL)
 
-    PluginManager.Instance.runHook('action:application.listening')
+    Hooks.runAction('action:application.listening')
   })
 
   process.on('exit', () => {