mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-03 09:49:20 +02:00
Add ability to customize instance logo
This commit is contained in:
parent
f5fd593976
commit
c0f4de6077
96 changed files with 1910 additions and 532 deletions
|
@ -1,4 +1,4 @@
|
|||
import { About, ActorImageType, ActorImageType_Type, CustomConfig, HttpStatusCode, ServerConfig } from '@peertube/peertube-models'
|
||||
import { About, ActorImageType, ActorImageType_Type, CustomConfig, HttpStatusCode, LogoType, ServerConfig } from '@peertube/peertube-models'
|
||||
import { DeepPartial } from '@peertube/peertube-typescript-utils'
|
||||
import merge from 'lodash-es/merge.js'
|
||||
import { AbstractCommand, OverrideCommandOptions } from '../shared/abstract-command.js'
|
||||
|
@ -539,6 +539,45 @@ export class ConfigCommand extends AbstractCommand {
|
|||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
updateInstanceLogo (
|
||||
options: OverrideCommandOptions & {
|
||||
fixture: string
|
||||
type: LogoType
|
||||
}
|
||||
) {
|
||||
const { fixture, type } = options
|
||||
|
||||
return this.updateImageRequest({
|
||||
...options,
|
||||
|
||||
path: '/api/v1/config/instance-logo/' + type + '/pick',
|
||||
fixture,
|
||||
fieldname: 'logofile',
|
||||
|
||||
implicitToken: true,
|
||||
defaultExpectedStatus: HttpStatusCode.NO_CONTENT_204
|
||||
})
|
||||
}
|
||||
|
||||
deleteInstanceLogo (
|
||||
options: OverrideCommandOptions & {
|
||||
type: LogoType
|
||||
}
|
||||
) {
|
||||
const { type } = options
|
||||
|
||||
return this.deleteRequest({
|
||||
...options,
|
||||
|
||||
path: '/api/v1/config/instance-logo/' + type,
|
||||
|
||||
implicitToken: true,
|
||||
defaultExpectedStatus: HttpStatusCode.NO_CONTENT_204
|
||||
})
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
getCustomConfig (options: OverrideCommandOptions = {}) {
|
||||
const path = '/api/v1/config/custom'
|
||||
|
||||
|
|
|
@ -65,7 +65,7 @@ export type RunServerOptions = {
|
|||
hideLogs?: boolean
|
||||
nodeArgs?: string[]
|
||||
peertubeArgs?: string[]
|
||||
env?: { [ id: string ]: string }
|
||||
env?: { [id: string]: string }
|
||||
}
|
||||
|
||||
export class PeerTubeServer {
|
||||
|
@ -400,6 +400,7 @@ export class PeerTubeServer {
|
|||
captions: this.getDirectoryPath('captions') + '/',
|
||||
cache: this.getDirectoryPath('cache') + '/',
|
||||
plugins: this.getDirectoryPath('plugins') + '/',
|
||||
uploads: this.getDirectoryPath('uploads') + '/',
|
||||
well_known: this.getDirectoryPath('well-known') + '/'
|
||||
},
|
||||
admin: {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue