mirror of
				https://github.com/owncast/owncast.git
				synced 2025-11-01 02:44:31 +08:00 
			
		
		
		
	Do not support stream key UI or any persisted stream keys when overridden via cli flag. Closes #2749
This commit is contained in:
		| @ -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() | ||||
|  | ||||
		Reference in New Issue
	
	Block a user
	 Gabe Kangas
					Gabe Kangas