aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers/api
diff options
context:
space:
mode:
Diffstat (limited to 'server/controllers/api')
-rw-r--r--server/controllers/api/config.ts19
1 files changed, 18 insertions, 1 deletions
diff --git a/server/controllers/api/config.ts b/server/controllers/api/config.ts
index 1d12f701b..8563b7437 100644
--- a/server/controllers/api/config.ts
+++ b/server/controllers/api/config.ts
@@ -1,6 +1,6 @@
1import * as express from 'express' 1import * as express from 'express'
2import { snakeCase } from 'lodash' 2import { snakeCase } from 'lodash'
3import { ServerConfig, UserRight } from '../../../shared' 3import { ServerConfig, ServerConfigPlugin, UserRight } from '../../../shared'
4import { About } from '../../../shared/models/server/about.model' 4import { About } from '../../../shared/models/server/about.model'
5import { CustomConfig } from '../../../shared/models/server/custom-config.model' 5import { CustomConfig } from '../../../shared/models/server/custom-config.model'
6import { isSignupAllowed, isSignupAllowedForCurrentIP } from '../../helpers/signup' 6import { isSignupAllowed, isSignupAllowedForCurrentIP } from '../../helpers/signup'
@@ -15,6 +15,8 @@ import { Emailer } from '../../lib/emailer'
15import { isNumeric } from 'validator' 15import { isNumeric } from 'validator'
16import { objectConverter } from '../../helpers/core-utils' 16import { objectConverter } from '../../helpers/core-utils'
17import { CONFIG, reloadConfig } from '../../initializers/config' 17import { CONFIG, reloadConfig } from '../../initializers/config'
18import { PluginManager } from '../../lib/plugins/plugin-manager'
19import { PluginType } from '../../../shared/models/plugins/plugin.type'
18 20
19const packageJSON = require('../../../../package.json') 21const packageJSON = require('../../../../package.json')
20const configRouter = express.Router() 22const configRouter = express.Router()
@@ -54,6 +56,20 @@ async function getConfig (req: express.Request, res: express.Response) {
54 .filter(key => CONFIG.TRANSCODING.ENABLED && CONFIG.TRANSCODING.RESOLUTIONS[key] === true) 56 .filter(key => CONFIG.TRANSCODING.ENABLED && CONFIG.TRANSCODING.RESOLUTIONS[key] === true)
55 .map(r => parseInt(r, 10)) 57 .map(r => parseInt(r, 10))
56 58
59 const plugins: ServerConfigPlugin[] = []
60 const registeredPlugins = PluginManager.Instance.getRegisteredPlugins()
61 for (const pluginName of Object.keys(registeredPlugins)) {
62 const plugin = registeredPlugins[ pluginName ]
63 if (plugin.type !== PluginType.PLUGIN) continue
64
65 plugins.push({
66 name: plugin.name,
67 version: plugin.version,
68 description: plugin.description,
69 clientScripts: plugin.clientScripts
70 })
71 }
72
57 const json: ServerConfig = { 73 const json: ServerConfig = {
58 instance: { 74 instance: {
59 name: CONFIG.INSTANCE.NAME, 75 name: CONFIG.INSTANCE.NAME,
@@ -66,6 +82,7 @@ async function getConfig (req: express.Request, res: express.Response) {
66 css: CONFIG.INSTANCE.CUSTOMIZATIONS.CSS 82 css: CONFIG.INSTANCE.CUSTOMIZATIONS.CSS
67 } 83 }
68 }, 84 },
85 plugins,
69 email: { 86 email: {
70 enabled: Emailer.isEnabled() 87 enabled: Emailer.isEnabled()
71 }, 88 },