+function getAbout (req: express.Request, res: express.Response, next: express.NextFunction) {
+ const about: About = {
+ instance: {
+ name: CONFIG.INSTANCE.NAME,
+ shortDescription: CONFIG.INSTANCE.SHORT_DESCRIPTION,
+ description: CONFIG.INSTANCE.DESCRIPTION,
+ terms: CONFIG.INSTANCE.TERMS
+ }
+ }
+
+ return res.json(about).end()
+}
+
+async function getCustomConfig (req: express.Request, res: express.Response, next: express.NextFunction) {
+ const data = customConfig()
+
+ return res.json(data).end()
+}
+
+async function deleteCustomConfig (req: express.Request, res: express.Response, next: express.NextFunction) {
+ await unlinkPromise(CONFIG.CUSTOM_FILE)
+
+ reloadConfig()
+
+ const data = customConfig()
+
+ return res.json(data).end()
+}
+
+async function updateCustomConfig (req: express.Request, res: express.Response, next: express.NextFunction) {
+ const toUpdate: CustomConfig = req.body
+
+ // Need to change the videoQuota key a little bit
+ const toUpdateJSON = omit(toUpdate, 'videoQuota')
+ toUpdateJSON.user['video_quota'] = toUpdate.user.videoQuota
+ toUpdateJSON.instance['default_client_route'] = toUpdate.instance.defaultClientRoute
+ toUpdateJSON.instance['short_description'] = toUpdate.instance.shortDescription
+ delete toUpdate.user.videoQuota
+ delete toUpdate.instance.defaultClientRoute
+ delete toUpdate.instance.shortDescription
+
+ await writeFilePromise(CONFIG.CUSTOM_FILE, JSON.stringify(toUpdateJSON, undefined, 2))
+
+ reloadConfig()
+
+ const data = customConfig()
+ return res.json(data).end()
+}
+