diff --git a/config/config.go b/config/config.go index 8ed64f610..48f1cdb20 100644 --- a/config/config.go +++ b/config/config.go @@ -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. diff --git a/controllers/admin/serverConfig.go b/controllers/admin/serverConfig.go index 9c99aa9ea..166ea4a5a 100644 --- a/controllers/admin/serverConfig.go +++ b/controllers/admin/serverConfig.go @@ -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 { diff --git a/openapi.yaml b/openapi.yaml index b599d1190..5b3eb479f 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -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: