aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/plugins/plugin-helpers.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/lib/plugins/plugin-helpers.ts')
-rw-r--r--server/lib/plugins/plugin-helpers.ts14
1 files changed, 13 insertions, 1 deletions
diff --git a/server/lib/plugins/plugin-helpers.ts b/server/lib/plugins/plugin-helpers.ts
index e91beffba..608207e05 100644
--- a/server/lib/plugins/plugin-helpers.ts
+++ b/server/lib/plugins/plugin-helpers.ts
@@ -2,6 +2,7 @@ import { PeerTubeHelpers } from '@server/typings/plugins'
2import { sequelizeTypescript } from '@server/initializers/database' 2import { sequelizeTypescript } from '@server/initializers/database'
3import { buildLogger } from '@server/helpers/logger' 3import { buildLogger } from '@server/helpers/logger'
4import { VideoModel } from '@server/models/video/video' 4import { VideoModel } from '@server/models/video/video'
5import { WEBSERVER } from '@server/initializers/constants'
5 6
6function buildPluginHelpers (npmName: string): PeerTubeHelpers { 7function buildPluginHelpers (npmName: string): PeerTubeHelpers {
7 const logger = buildPluginLogger(npmName) 8 const logger = buildPluginLogger(npmName)
@@ -9,10 +10,13 @@ function buildPluginHelpers (npmName: string): PeerTubeHelpers {
9 const database = buildDatabaseHelpers() 10 const database = buildDatabaseHelpers()
10 const videos = buildVideosHelpers() 11 const videos = buildVideosHelpers()
11 12
13 const config = buildConfigHelpers()
14
12 return { 15 return {
13 logger, 16 logger,
14 database, 17 database,
15 videos 18 videos,
19 config
16 } 20 }
17} 21}
18 22
@@ -43,3 +47,11 @@ function buildVideosHelpers () {
43 } 47 }
44 } 48 }
45} 49}
50
51function buildConfigHelpers () {
52 return {
53 getWebserverUrl () {
54 return WEBSERVER.URL
55 }
56 }
57}