diff options
Diffstat (limited to 'server/controllers/api/config.ts')
-rw-r--r-- | server/controllers/api/config.ts | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/server/controllers/api/config.ts b/server/controllers/api/config.ts index 25ddd1fa6..6edbe4820 100644 --- a/server/controllers/api/config.ts +++ b/server/controllers/api/config.ts | |||
@@ -60,7 +60,8 @@ async function getConfig (req: express.Request, res: express.Response, next: exp | |||
60 | serverVersion: packageJSON.version, | 60 | serverVersion: packageJSON.version, |
61 | signup: { | 61 | signup: { |
62 | allowed, | 62 | allowed, |
63 | allowedForCurrentIP | 63 | allowedForCurrentIP, |
64 | requiresEmailVerification: CONFIG.SIGNUP.REQUIRES_EMAIL_VERIFICATION | ||
64 | }, | 65 | }, |
65 | transcoding: { | 66 | transcoding: { |
66 | enabledResolutions | 67 | enabledResolutions |
@@ -159,12 +160,20 @@ async function updateCustomConfig (req: express.Request, res: express.Response, | |||
159 | toUpdate.transcoding.threads = parseInt('' + toUpdate.transcoding.threads, 10) | 160 | toUpdate.transcoding.threads = parseInt('' + toUpdate.transcoding.threads, 10) |
160 | 161 | ||
161 | // camelCase to snake_case key | 162 | // camelCase to snake_case key |
162 | const toUpdateJSON = omit(toUpdate, 'user.videoQuota', 'instance.defaultClientRoute', 'instance.shortDescription', 'cache.videoCaptions') | 163 | const toUpdateJSON = omit( |
164 | toUpdate, | ||
165 | 'user.videoQuota', | ||
166 | 'instance.defaultClientRoute', | ||
167 | 'instance.shortDescription', | ||
168 | 'cache.videoCaptions', | ||
169 | 'signup.requiresEmailVerification' | ||
170 | ) | ||
163 | toUpdateJSON.user['video_quota'] = toUpdate.user.videoQuota | 171 | toUpdateJSON.user['video_quota'] = toUpdate.user.videoQuota |
164 | toUpdateJSON.user['video_quota_daily'] = toUpdate.user.videoQuotaDaily | 172 | toUpdateJSON.user['video_quota_daily'] = toUpdate.user.videoQuotaDaily |
165 | toUpdateJSON.instance['default_client_route'] = toUpdate.instance.defaultClientRoute | 173 | toUpdateJSON.instance['default_client_route'] = toUpdate.instance.defaultClientRoute |
166 | toUpdateJSON.instance['short_description'] = toUpdate.instance.shortDescription | 174 | toUpdateJSON.instance['short_description'] = toUpdate.instance.shortDescription |
167 | toUpdateJSON.instance['default_nsfw_policy'] = toUpdate.instance.defaultNSFWPolicy | 175 | toUpdateJSON.instance['default_nsfw_policy'] = toUpdate.instance.defaultNSFWPolicy |
176 | toUpdateJSON.signup['requires_email_verification'] = toUpdate.signup.requiresEmailVerification | ||
168 | 177 | ||
169 | await writeJSON(CONFIG.CUSTOM_FILE, toUpdateJSON, { spaces: 2 }) | 178 | await writeJSON(CONFIG.CUSTOM_FILE, toUpdateJSON, { spaces: 2 }) |
170 | 179 | ||
@@ -220,7 +229,8 @@ function customConfig (): CustomConfig { | |||
220 | }, | 229 | }, |
221 | signup: { | 230 | signup: { |
222 | enabled: CONFIG.SIGNUP.ENABLED, | 231 | enabled: CONFIG.SIGNUP.ENABLED, |
223 | limit: CONFIG.SIGNUP.LIMIT | 232 | limit: CONFIG.SIGNUP.LIMIT, |
233 | requiresEmailVerification: CONFIG.SIGNUP.REQUIRES_EMAIL_VERIFICATION | ||
224 | }, | 234 | }, |
225 | admin: { | 235 | admin: { |
226 | email: CONFIG.ADMIN.EMAIL | 236 | email: CONFIG.ADMIN.EMAIL |