Admin API to change in-memory streaming key. Closes #212

This commit is contained in:
Gabe Kangas
2020-10-01 23:17:27 -07:00
parent 7b64fc7c30
commit 48c8cf5ed2
4 changed files with 47 additions and 5 deletions

View File

@@ -8,6 +8,8 @@ import (
"github.com/gabek/owncast/config"
"github.com/gabek/owncast/controllers"
"github.com/gabek/owncast/controllers/admin"
"github.com/gabek/owncast/core/chat"
"github.com/gabek/owncast/core/rtmp"
"github.com/gabek/owncast/router/middleware"
@@ -47,7 +49,10 @@ func Start() error {
// Authenticated admin requests
// Disconnect inbound stream
http.HandleFunc("/api/admin/disconnect", middleware.RequireAdminAuth(controllers.DisconnectInboundConnection))
http.HandleFunc("/api/admin/disconnect", middleware.RequireAdminAuth(admin.DisconnectInboundConnection))
// Change the current streaming key in memory
http.HandleFunc("/api/admin/changekey", middleware.RequireAdminAuth(admin.ChangeStreamKey))
port := config.Config.GetPublicWebServerPort()