diff options
Diffstat (limited to 'server/controllers/api/config.ts')
-rw-r--r-- | server/controllers/api/config.ts | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/server/controllers/api/config.ts b/server/controllers/api/config.ts index 12074a80e..f678e3c4a 100644 --- a/server/controllers/api/config.ts +++ b/server/controllers/api/config.ts | |||
@@ -4,7 +4,7 @@ import { ServerConfig, UserRight } from '../../../shared' | |||
4 | import { About } from '../../../shared/models/server/about.model' | 4 | import { About } from '../../../shared/models/server/about.model' |
5 | import { CustomConfig } from '../../../shared/models/server/custom-config.model' | 5 | import { CustomConfig } from '../../../shared/models/server/custom-config.model' |
6 | import { unlinkPromise, writeFilePromise } from '../../helpers/core-utils' | 6 | import { unlinkPromise, writeFilePromise } from '../../helpers/core-utils' |
7 | import { isSignupAllowed } from '../../helpers/utils' | 7 | import { isSignupAllowed, isSignupAllowedForCurrentIP } from '../../helpers/utils' |
8 | import { CONFIG, CONSTRAINTS_FIELDS, reloadConfig } from '../../initializers' | 8 | import { CONFIG, CONSTRAINTS_FIELDS, reloadConfig } from '../../initializers' |
9 | import { asyncMiddleware, authenticate, ensureUserHasRight } from '../../middlewares' | 9 | import { asyncMiddleware, authenticate, ensureUserHasRight } from '../../middlewares' |
10 | import { customConfigUpdateValidator } from '../../middlewares/validators/config' | 10 | import { customConfigUpdateValidator } from '../../middlewares/validators/config' |
@@ -36,6 +36,7 @@ configRouter.delete('/custom', | |||
36 | 36 | ||
37 | async function getConfig (req: express.Request, res: express.Response, next: express.NextFunction) { | 37 | async function getConfig (req: express.Request, res: express.Response, next: express.NextFunction) { |
38 | const allowed = await isSignupAllowed() | 38 | const allowed = await isSignupAllowed() |
39 | const allowedForCurrentIP = isSignupAllowedForCurrentIP(req.ip) | ||
39 | 40 | ||
40 | const enabledResolutions = Object.keys(CONFIG.TRANSCODING.RESOLUTIONS) | 41 | const enabledResolutions = Object.keys(CONFIG.TRANSCODING.RESOLUTIONS) |
41 | .filter(key => CONFIG.TRANSCODING.RESOLUTIONS[key] === true) | 42 | .filter(key => CONFIG.TRANSCODING.RESOLUTIONS[key] === true) |
@@ -54,7 +55,8 @@ async function getConfig (req: express.Request, res: express.Response, next: exp | |||
54 | }, | 55 | }, |
55 | serverVersion: packageJSON.version, | 56 | serverVersion: packageJSON.version, |
56 | signup: { | 57 | signup: { |
57 | allowed | 58 | allowed, |
59 | allowedForCurrentIP | ||
58 | }, | 60 | }, |
59 | transcoding: { | 61 | transcoding: { |
60 | enabledResolutions | 62 | enabledResolutions |