Support setting admin password and temp stream key via cli flag

This commit is contained in:
Gabe Kangas
2022-11-28 21:32:11 -08:00
parent 5d51c73cd9
commit 842bdcc808
3 changed files with 20 additions and 5 deletions

View File

@ -11,6 +11,7 @@ import (
log "github.com/sirupsen/logrus"
"github.com/nareix/joy5/format/rtmp"
"github.com/owncast/owncast/config"
"github.com/owncast/owncast/core/data"
"github.com/owncast/owncast/models"
)
@ -87,6 +88,11 @@ func HandleConn(c *rtmp.Conn, nc net.Conn) {
}
}
// Test against the temporary key if it was set at runtime.
if config.TemporaryStreamKey != "" && secretMatch(config.TemporaryStreamKey, c.URL.Path) {
accessGranted = true
}
if !accessGranted {
log.Errorln("invalid streaming key; rejecting incoming stream")
_ = nc.Close()