Add ability to change the homepage

This commit is contained in:
Chocobozzz
2018-03-01 13:57:29 +01:00
parent a73c582e5b
commit 901637bb87
18 changed files with 108 additions and 18 deletions

View File

@@ -44,6 +44,7 @@ async function getConfig (req: express.Request, res: express.Response, next: exp
const json: ServerConfig = {
instance: {
name: CONFIG.INSTANCE.NAME,
defaultClientRoute: CONFIG.INSTANCE.DEFAULT_CLIENT_ROUTE,
customizations: {
javascript: CONFIG.INSTANCE.CUSTOMIZATIONS.JAVASCRIPT,
css: CONFIG.INSTANCE.CUSTOMIZATIONS.CSS
@@ -114,7 +115,9 @@ async function updateCustomConfig (req: express.Request, res: express.Response,
// 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
delete toUpdate.user.videoQuota
delete toUpdate.instance.defaultClientRoute
await writeFilePromise(CONFIG.CUSTOM_FILE, JSON.stringify(toUpdateJSON, undefined, 2))
@@ -138,6 +141,7 @@ function customConfig (): CustomConfig {
name: CONFIG.INSTANCE.NAME,
description: CONFIG.INSTANCE.DESCRIPTION,
terms: CONFIG.INSTANCE.TERMS,
defaultClientRoute: CONFIG.INSTANCE.DEFAULT_CLIENT_ROUTE,
customizations: {
css: CONFIG.INSTANCE.CUSTOMIZATIONS.CSS,
javascript: CONFIG.INSTANCE.CUSTOMIZATIONS.JAVASCRIPT