Do not support stream key UI or any persisted stream keys when overridden via cli flag. Closes #2749

This commit is contained in:
Gabe Kangas
2023-02-27 17:08:52 -08:00
parent 48dd490a50
commit 23a721857f
6 changed files with 25 additions and 9 deletions

View File

@ -81,6 +81,11 @@ func HandleConn(c *rtmp.Conn, nc net.Conn) {
accessGranted := false
validStreamingKeys := data.GetStreamKeys()
// If a stream key override was specified then use that instead.
if config.TemporaryStreamKey != "" {
validStreamingKeys = []models.StreamKey{{Key: config.TemporaryStreamKey}}
}
for _, key := range validStreamingKeys {
if secretMatch(key.Key, c.URL.Path) {
accessGranted = true
@ -88,11 +93,6 @@ 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()