X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=shared%2Fextra-utils%2Fserver%2Fconfig.ts;h=578dd35cf16c33a6fe14757d534d59694f1a8a82;hb=be04c6fdab5d91a7a57fa3ff36cde22a549c29da;hp=a5f5989e099f7bc0cb0ef2c81e2d09f2eed624af;hpb=a41b9da1a9ce49df82ea10c82de4c2fbc6d1b189;p=github%2FChocobozzz%2FPeerTube.git diff --git a/shared/extra-utils/server/config.ts b/shared/extra-utils/server/config.ts index a5f5989e0..578dd35cf 100644 --- a/shared/extra-utils/server/config.ts +++ b/shared/extra-utils/server/config.ts @@ -1,5 +1,7 @@ import { makeDeleteRequest, makeGetRequest, makePutBodyRequest } from '../requests/requests' import { CustomConfig } from '../../models/server/custom-config.model' +import { DeepPartial } from '@server/typings/utils' +import { merge } from 'lodash' function getConfig (url: string) { const path = '/api/v1/config' @@ -44,13 +46,25 @@ function updateCustomConfig (url: string, token: string, newCustomConfig: Custom }) } -function updateCustomSubConfig (url: string, token: string, newConfig: any) { +function updateCustomSubConfig (url: string, token: string, newConfig: DeepPartial) { const updateParams: CustomConfig = { instance: { name: 'PeerTube updated', shortDescription: 'my short description', description: 'my super description', terms: 'my super terms', + codeOfConduct: 'my super coc', + + creationReason: 'my super creation reason', + moderationInformation: 'my super moderation information', + administrator: 'Kuja', + maintenanceLifetime: 'forever', + businessModel: 'my super business model', + hardwareInformation: '2vCore 3GB RAM', + + languages: [ 'en', 'es' ], + categories: [ 1, 2 ], + defaultClientRoute: '/videos/recently-added', isNSFW: true, defaultNSFWPolicy: 'blur', @@ -59,6 +73,9 @@ function updateCustomSubConfig (url: string, token: string, newConfig: any) { css: 'body { background-color: red; }' } }, + theme: { + default: 'default' + }, services: { twitter: { username: '@MySuperUsername', @@ -98,7 +115,8 @@ function updateCustomSubConfig (url: string, token: string, newConfig: any) { '360p': true, '480p': true, '720p': false, - '1080p': false + '1080p': false, + '2160p': false }, hls: { enabled: false @@ -126,10 +144,21 @@ function updateCustomSubConfig (url: string, token: string, newConfig: any) { enabled: true, manualApproval: false } + }, + followings: { + instance: { + autoFollowBack: { + enabled: false + }, + autoFollowIndex: { + indexUrl: 'https://instances.joinpeertube.org', + enabled: false + } + } } } - Object.assign(updateParams, newConfig) + merge(updateParams, newConfig) return updateCustomConfig(url, token, updateParams) }