Skip to content

Commit

Permalink
Merge branch 'nightly' into 'master'
Browse files Browse the repository at this point in the history
0.9.6 Release

See merge request osp-group/flask-nginx-rtmp-manager!373
  • Loading branch information
deamos committed Aug 6, 2022
2 parents 43f69b9 + 22c4f54 commit 2fd0b61
Show file tree
Hide file tree
Showing 18 changed files with 523 additions and 316 deletions.
1 change: 1 addition & 0 deletions ATTRIBUTION
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
- Bootstrap-Toggle - Used to Build Toggle Buttons with Bootstrap
- NGINX - Open-Source, high-performance HTTP server and reverse proxy
- NGINX-RTMP-Module - NGINX Module for RTMP/HLS/MPEG-DASH live streaming
- winshining/nginx-http-flv-module - Replacement Nginx Module for RTMP/HLS Live Streaming
- Socket.io - Real-Time Communications Engine Between Client and Server
- Flask Socket.io - Interface Socket.io with Flask
- Video.js - Handles the HTML5 Video Playback of HLS video streams and MP4 Files
Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
0.9.6
==============================================
Nginx-OSP: Moved Core Code of Nginx RTMP to winshining/nginx-http-flv-module. New Installs will use the new backend. Existing can be migrated using Reset Nginx via osp-config.sh
OSP-Core: Hourly Task of Cleaning up Guests which have not logged in within the last 3 months
OSP-Core: Hourly Task of Cleaning up Read/Unread Notifications in DB (90 days for read, 180 days for unread)
OSP-Core: Optimized RTMP Stage 1, Stage 2, and RTMP Restream API Queries which were causing an issue with Starting a Stream on larger channels
OSP-Core: Optimized User Channels Settings Page to load and post faster

0.9.5
==============================================
OSP-Core: Upgrade Cachelib == 0.8.0
Expand Down
27 changes: 22 additions & 5 deletions blueprints/apis/channel_ns.py
Original file line number Diff line number Diff line change
Expand Up @@ -356,12 +356,29 @@ def get(self, channelEndpointID):
channelData = cachedDbCalls.getChannelByLoc(channelEndpointID)

if channelData is not None:
restreamDestinationQuery = Channel.restreamDestinations.query.filter_by(
channel=channelData.id
).all()
restreamDestinations = restreamDestinationQuery
restreamDestinationQuery = (
Channel.restreamDestinations.query.filter_by(channel=channelData.id)
.with_entities(
Channel.restreamDestinations.id,
Channel.restreamDestinations.channel,
Channel.restreamDestinations.name,
Channel.restreamDestinations.enabled,
Channel.restreamDestinations.url,
)
.all()
)
restreamDestinations = []
for entry in restreamDestinationQuery:
serialized = {
"id": entry.id,
"channel": templateFilters.get_channelLocationFromID(entry.channel),
"name": entry.name,
"enabled": entry.enabled,
"url": entry.url,
}
restreamDestinations.append(serialized)
db.session.commit()
return {"results": [ob.serialize() for ob in restreamDestinations]}
return {"results": restreamDestinations}

else:
db.session.commit()
Expand Down
57 changes: 57 additions & 0 deletions blueprints/apis/rtmp_ns.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import datetime
import socket
import hashlib
import logging

from classes import settings
from classes import Channel
Expand All @@ -13,6 +14,8 @@
from functions import system
from functions import securityFunc

log = logging.getLogger("app.blueprints.apis.rtmp_ns")


def checkRTMPAuthIP(requestData):
authorized = False
Expand Down Expand Up @@ -94,6 +97,12 @@ def post(self):
# Perform RTMP IP Authorization Check
authorized = checkRTMPAuthIP(request)
if authorized[0] is False:
log.warning(
{
"level": "warning",
"message": "Unauthorized RTMP Server - " + authorized[1],
}
)
return {
"results": {"message": "Unauthorized RTMP Server - " + authorized[1]}
}, 400
Expand All @@ -105,10 +114,28 @@ def post(self):
addr = args["addr"]
results = rtmpFunc.rtmp_stage1_streamkey_check(name, addr)
if results["success"] is True:
log.info(
{
"level": "info",
"message": "Stage 1 Auth Complete - " + results["channelLoc"],
}
)
return {"results": results}, 200
else:
log.warning(
{
"level": "warning",
"message": "Stage 1 Auth Failed - " + results["channelLoc"],
}
)
return {"results": results}, 400
else:
log.warning(
{
"level": "warning",
"message": "Stage 1 Auth Failed - Missing Required Data",
}
)
return {
"results": {
"time": str(datetime.datetime.utcnow()),
Expand Down Expand Up @@ -140,6 +167,12 @@ def post(self):
# Perform RTMP IP Authorization Check
authorized = checkRTMPAuthIP(request)
if authorized[0] is False:
log.warning(
{
"level": "warning",
"message": "Unauthorized RTMP Server - " + authorized[1],
}
)
return {
"results": {"message": "Unauthorized RTMP Server - " + authorized[1]}
}, 400
Expand All @@ -152,10 +185,28 @@ def post(self):
rtmpServer = authorized[2]
results = rtmpFunc.rtmp_stage2_user_auth_check(name, addr, rtmpServer)
if results["success"] is True:
log.info(
{
"level": "info",
"message": "Stage 2 Auth Complete - " + results["channelLoc"],
}
)
return {"results": results}, 200
else:
log.warning(
{
"level": "warning",
"message": "Stage 2 Auth Failed - " + results["channelLoc"],
}
)
return {"results": results}, 400
else:
log.warning(
{
"level": "warning",
"message": "Stage 2 Auth Failed - Missing Required Data",
}
)
return {
"results": {
"time": str(datetime.datetime.utcnow()),
Expand All @@ -182,6 +233,12 @@ def post(self):
# Perform RTMP IP Authorization Check
authorized = checkRTMPAuthIP(request)
if authorized[0] is False:
log.warning(
{
"level": "warning",
"message": "Unauthorized RTMP Server - " + authorized[1],
}
)
return {
"results": {"message": "Unauthorized RTMP Server - " + authorized[1]}
}, 400
Expand Down
Loading

0 comments on commit 2fd0b61

Please sign in to comment.