X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=shared%2Fextra-utils%2Fserver%2Fconfig.ts;h=35b08477f9a83976d7ad8812d3d001670386b18a;hb=5c7d650827cc471a03e7fa18362bcbcbe5d30838;hp=deb77e9c0e1067f98a9a73a2b94711022dd3a056;hpb=97567dd81f508dd6295ac4d73d849aa2ce0a6549;p=github%2FChocobozzz%2FPeerTube.git diff --git a/shared/extra-utils/server/config.ts b/shared/extra-utils/server/config.ts index deb77e9c0..35b08477f 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', @@ -91,13 +108,19 @@ function updateCustomSubConfig (url: string, token: string, newConfig: any) { transcoding: { enabled: true, allowAdditionalExtensions: true, + allowAudioFiles: true, threads: 1, resolutions: { + '0p': false, '240p': false, '360p': true, '480p': true, '720p': false, - '1080p': false + '1080p': false, + '2160p': false + }, + webtorrent: { + enabled: true }, hls: { enabled: false @@ -125,10 +148,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) }