Show YP configuration in the config API

This commit is contained in:
Gabe Kangas 2020-10-07 22:42:14 -07:00
parent 268085e41f
commit aac7fa2476
3 changed files with 23 additions and 6 deletions

View File

@ -23,7 +23,7 @@ type config struct {
VersionInfo string `yaml:"-"` // For storing the version/build number
VideoSettings videoSettings `yaml:"videoSettings"`
WebServerPort int `yaml:"webServerPort"`
YP yp `yaml:"yp"`
YP YP `yaml:"yp"`
}
// InstanceDetails defines the user-visible information about this particular instance.
@ -57,11 +57,11 @@ type videoSettings struct {
HighestQualityStreamIndex int `yaml:"-"`
}
// Registration to the central Owncast YP (Yellow pages) service operating as a directory.
type yp struct {
Enabled bool `yaml:"enabled"`
InstanceURL string `yaml:"instanceURL"` // The public URL the directory should link to
YPServiceURL string `yaml:"ypServiceURL"` // The base URL to the YP API to register with (optional)
// YP allows registration to the central Owncast YP (Yellow pages) service operating as a directory.
type YP struct {
Enabled bool `yaml:"enabled" json:"enabled"`
InstanceURL string `yaml:"instanceURL" json:"instanceUrl"` // The public URL the directory should link to
YPServiceURL string `yaml:"ypServiceURL" json:"-"` // The base URL to the YP API to register with (optional)
}
// StreamQuality defines the specifics of a single HLS stream variant.

View File

@ -18,6 +18,7 @@ func GetServerConfig(w http.ResponseWriter, r *http.Request) {
SegmentLengthSeconds: config.Config.GetVideoSegmentSecondsLength(),
NumberOfPlaylistItems: config.Config.GetMaxNumberOfReferencedSegmentsInPlaylist(),
},
YP: config.Config.YP,
S3: config.Config.S3,
}
@ -31,6 +32,7 @@ type serverConfigAdminResponse struct {
WebServerPort int `json:"webServerPort"`
S3 config.S3 `json:"s3"`
VideoSettings videoSettings `json:"videoSettings"`
YP config.YP `json:"yp"`
}
type videoSettings struct {

View File

@ -118,6 +118,19 @@ components:
version:
type: string
example: Owncast v0.0.2-macOS (ef3796a033b32a312ebf5b334851cbf9959e7ecb)
YP:
type: object
description: Configuration of the instance's registration to the Owncast Directory (YP API)
properties:
enabled:
type: boolean
description: If YP support is on or off. Must be enabled to show in the directory.
default: false
instanceUrl:
type: string
description: The public URL of this owncast server, used for registration and linking with the directory. Must be publicly available.
S3:
type: object
description: Configuration of external storage using S3-compatible providers.
@ -537,6 +550,8 @@ paths:
numberOfPlaylistItems:
type: integer
description: The maximum number of HLS video segments we will keep referenced in the playlist.
yp:
$ref: "#/components/schemas/YP"
/api/admin/viewersOverTime:
get: