aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-03-01 13:57:29 +0100
committerChocobozzz <me@florianbigard.com>2018-03-01 13:57:29 +0100
commit901637bb87f5eb0518fb7ca69d98b53ed918339e (patch)
treea8e8943fef7a109ba269d33029174cbdf4dde6d2 /server/controllers
parenta73c582e5b6f5c52427b38aaf55b3afbead24053 (diff)
downloadPeerTube-901637bb87f5eb0518fb7ca69d98b53ed918339e.tar.gz
PeerTube-901637bb87f5eb0518fb7ca69d98b53ed918339e.tar.zst
PeerTube-901637bb87f5eb0518fb7ca69d98b53ed918339e.zip
Add ability to change the homepage
Diffstat (limited to 'server/controllers')
-rw-r--r--server/controllers/api/config.ts4
1 files changed, 4 insertions, 0 deletions
diff --git a/server/controllers/api/config.ts b/server/controllers/api/config.ts
index 427125810..a25d7a157 100644
--- a/server/controllers/api/config.ts
+++ b/server/controllers/api/config.ts
@@ -44,6 +44,7 @@ async function getConfig (req: express.Request, res: express.Response, next: exp
44 const json: ServerConfig = { 44 const json: ServerConfig = {
45 instance: { 45 instance: {
46 name: CONFIG.INSTANCE.NAME, 46 name: CONFIG.INSTANCE.NAME,
47 defaultClientRoute: CONFIG.INSTANCE.DEFAULT_CLIENT_ROUTE,
47 customizations: { 48 customizations: {
48 javascript: CONFIG.INSTANCE.CUSTOMIZATIONS.JAVASCRIPT, 49 javascript: CONFIG.INSTANCE.CUSTOMIZATIONS.JAVASCRIPT,
49 css: CONFIG.INSTANCE.CUSTOMIZATIONS.CSS 50 css: CONFIG.INSTANCE.CUSTOMIZATIONS.CSS
@@ -114,7 +115,9 @@ async function updateCustomConfig (req: express.Request, res: express.Response,
114 // Need to change the videoQuota key a little bit 115 // Need to change the videoQuota key a little bit
115 const toUpdateJSON = omit(toUpdate, 'videoQuota') 116 const toUpdateJSON = omit(toUpdate, 'videoQuota')
116 toUpdateJSON.user['video_quota'] = toUpdate.user.videoQuota 117 toUpdateJSON.user['video_quota'] = toUpdate.user.videoQuota
118 toUpdateJSON.instance['default_client_route'] = toUpdate.instance.defaultClientRoute
117 delete toUpdate.user.videoQuota 119 delete toUpdate.user.videoQuota
120 delete toUpdate.instance.defaultClientRoute
118 121
119 await writeFilePromise(CONFIG.CUSTOM_FILE, JSON.stringify(toUpdateJSON, undefined, 2)) 122 await writeFilePromise(CONFIG.CUSTOM_FILE, JSON.stringify(toUpdateJSON, undefined, 2))
120 123
@@ -138,6 +141,7 @@ function customConfig (): CustomConfig {
138 name: CONFIG.INSTANCE.NAME, 141 name: CONFIG.INSTANCE.NAME,
139 description: CONFIG.INSTANCE.DESCRIPTION, 142 description: CONFIG.INSTANCE.DESCRIPTION,
140 terms: CONFIG.INSTANCE.TERMS, 143 terms: CONFIG.INSTANCE.TERMS,
144 defaultClientRoute: CONFIG.INSTANCE.DEFAULT_CLIENT_ROUTE,
141 customizations: { 145 customizations: {
142 css: CONFIG.INSTANCE.CUSTOMIZATIONS.CSS, 146 css: CONFIG.INSTANCE.CUSTOMIZATIONS.CSS,
143 javascript: CONFIG.INSTANCE.CUSTOMIZATIONS.JAVASCRIPT 147 javascript: CONFIG.INSTANCE.CUSTOMIZATIONS.JAVASCRIPT