Skip to content

Commit

Permalink
Merge pull request #15 from red5pro/feature/webhook
Browse files Browse the repository at this point in the history
Feature/webhook
  • Loading branch information
iolesyk authored Mar 4, 2024
2 parents a372d7b + bf2f592 commit fa2a878
Show file tree
Hide file tree
Showing 6 changed files with 102 additions and 1 deletion.
2 changes: 2 additions & 0 deletions examples/autoscaling/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ module "red5pro" {
origin_image_red5pro_socialpusher_enable = false # true - enable Red5 Pro server socialpusher, false - disable Red5 Pro server socialpusher (https://www.red5.net/docs/special/social-media-plugin/overview/)
origin_image_red5pro_suppressor_enable = false # true - enable Red5 Pro server suppressor, false - disable Red5 Pro server suppressor
origin_image_red5pro_hls_enable = false # true - enable Red5 Pro server HLS, false - disable Red5 Pro server HLS (https://www.red5.net/docs/protocols/hls-plugin/hls-vod/)
origin_image_red5pro_webhooks_enable = false # true - enable Red5 Pro server webhooks, false - disable Red5 Pro server webhooks (https://www.red5.net/docs/special/webhooks/overview/)
origin_image_red5pro_webhooks_endpoint = "https://example.com/red5/status" # Red5 Pro server webhooks endpoint
origin_image_red5pro_round_trip_auth_enable = false # true - enable Red5 Pro server round trip authentication, false - disable Red5 Pro server round trip authentication (https://www.red5.net/docs/special/round-trip-auth/overview/)
origin_image_red5pro_round_trip_auth_host = "round-trip-auth.example.com" # Round trip authentication server host
origin_image_red5pro_round_trip_auth_port = 3000 # Round trip authentication server port
Expand Down
2 changes: 2 additions & 0 deletions examples/cluster/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ module "red5pro" {
origin_image_red5pro_socialpusher_enable = false # true - enable Red5 Pro server socialpusher, false - disable Red5 Pro server socialpusher (https://www.red5.net/docs/special/social-media-plugin/overview/)
origin_image_red5pro_suppressor_enable = false # true - enable Red5 Pro server suppressor, false - disable Red5 Pro server suppressor
origin_image_red5pro_hls_enable = false # true - enable Red5 Pro server HLS, false - disable Red5 Pro server HLS (https://www.red5.net/docs/protocols/hls-plugin/hls-vod/)
origin_image_red5pro_webhooks_enable = false # true - enable Red5 Pro server webhooks, false - disable Red5 Pro server webhooks (https://www.red5.net/docs/special/webhooks/overview/)
origin_image_red5pro_webhooks_endpoint = "https://example.com/red5/status" # Red5 Pro server webhooks endpoint
origin_image_red5pro_round_trip_auth_enable = false # true - enable Red5 Pro server round trip authentication, false - disable Red5 Pro server round trip authentication (https://www.red5.net/docs/special/round-trip-auth/overview/)
origin_image_red5pro_round_trip_auth_host = "round-trip-auth.example.com" # Round trip authentication server host
origin_image_red5pro_round_trip_auth_port = 3000 # Round trip authentication server port
Expand Down
2 changes: 2 additions & 0 deletions examples/single/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ module "red5pro" {
red5pro_socialpusher_enable = false # true - enable Red5 Pro server socialpusher, false - disable Red5 Pro server socialpusher (https://www.red5.net/docs/special/social-media-plugin/overview/)
red5pro_suppressor_enable = false # true - enable Red5 Pro server suppressor, false - disable Red5 Pro server suppressor
red5pro_hls_enable = false # true - enable Red5 Pro server HLS, false - disable Red5 Pro server HLS (https://www.red5.net/docs/protocols/hls-plugin/hls-vod/)
red5pro_webhooks_enable = false # true - enable Red5 Pro server webhooks, false - disable Red5 Pro server webhooks (https://www.red5.net/docs/special/webhooks/overview/)
red5pro_webhooks_endpoint = "https://example.com/red5/status" # Red5 Pro server webhooks endpoint
red5pro_round_trip_auth_enable = false # true - enable Red5 Pro server round trip authentication, false - disable Red5 Pro server round trip authentication (https://www.red5.net/docs/special/round-trip-auth/overview/)
red5pro_round_trip_auth_host = "round-trip-auth.example.com" # Round trip authentication server host
red5pro_round_trip_auth_port = 3000 # Round trip authentication server port
Expand Down
14 changes: 14 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -687,6 +687,10 @@ resource "aws_instance" "red5pro_node_origin" {
"export NODE_SOCIALPUSHER_ENABLE='${var.origin_image_red5pro_socialpusher_enable}'",
"export NODE_SUPPRESSOR_ENABLE='${var.origin_image_red5pro_suppressor_enable}'",
"export NODE_HLS_ENABLE='${var.origin_image_red5pro_hls_enable}'",
"export NODE_HLS_OUTPUT_FORMAT='${var.origin_image_red5pro_hls_output_format}'",
"export NODE_HLS_DVR_PLAYLIST='${var.origin_image_red5pro_hls_dvr_playlist}'",
"export NODE_WEBHOOKS_ENABLE='${var.origin_image_red5pro_webhooks_enable}'",
"export NODE_WEBHOOKS_ENDPOINT='${var.origin_image_red5pro_webhooks_endpoint}'",
"export NODE_ROUND_TRIP_AUTH_ENABLE='${var.origin_image_red5pro_round_trip_auth_enable}'",
"export NODE_ROUND_TRIP_AUTH_HOST='${var.origin_image_red5pro_round_trip_auth_host}'",
"export NODE_ROUND_TRIP_AUTH_PORT='${var.origin_image_red5pro_round_trip_auth_port}'",
Expand Down Expand Up @@ -772,6 +776,8 @@ resource "aws_instance" "red5pro_node_edge" {
"export NODE_SOCIALPUSHER_ENABLE='${var.edge_image_red5pro_socialpusher_enable}'",
"export NODE_SUPPRESSOR_ENABLE='${var.edge_image_red5pro_suppressor_enable}'",
"export NODE_HLS_ENABLE='${var.edge_image_red5pro_hls_enable}'",
"export NODE_WEBHOOKS_ENABLE='${var.edge_image_red5pro_webhooks_enable}'",
"export NODE_WEBHOOKS_ENDPOINT='${var.edge_image_red5pro_webhooks_endpoint}'",
"export NODE_ROUND_TRIP_AUTH_ENABLE='${var.edge_image_red5pro_round_trip_auth_enable}'",
"export NODE_ROUND_TRIP_AUTH_HOST='${var.edge_image_red5pro_round_trip_auth_host}'",
"export NODE_ROUND_TRIP_AUTH_PORT='${var.edge_image_red5pro_round_trip_auth_port}'",
Expand Down Expand Up @@ -846,6 +852,10 @@ resource "aws_instance" "red5pro_node_transcoder" {
"export NODE_SOCIALPUSHER_ENABLE='${var.transcoder_image_red5pro_socialpusher_enable}'",
"export NODE_SUPPRESSOR_ENABLE='${var.transcoder_image_red5pro_suppressor_enable}'",
"export NODE_HLS_ENABLE='${var.transcoder_image_red5pro_hls_enable}'",
"export NODE_HLS_OUTPUT_FORMAT='${var.transcoder_image_red5pro_hls_output_format}'",
"export NODE_HLS_DVR_PLAYLIST='${var.transcoder_image_red5pro_hls_dvr_playlist}'",
"export NODE_WEBHOOKS_ENABLE='${var.transcoder_image_red5pro_webhooks_enable}'",
"export NODE_WEBHOOKS_ENDPOINT='${var.transcoder_image_red5pro_webhooks_endpoint}'",
"export NODE_ROUND_TRIP_AUTH_ENABLE='${var.transcoder_image_red5pro_round_trip_auth_enable}'",
"export NODE_ROUND_TRIP_AUTH_HOST='${var.transcoder_image_red5pro_round_trip_auth_host}'",
"export NODE_ROUND_TRIP_AUTH_PORT='${var.transcoder_image_red5pro_round_trip_auth_port}'",
Expand Down Expand Up @@ -1008,6 +1018,10 @@ resource "aws_instance" "red5pro_single" {
"export NODE_SOCIALPUSHER_ENABLE='${var.red5pro_socialpusher_enable}'",
"export NODE_SUPPRESSOR_ENABLE='${var.red5pro_suppressor_enable}'",
"export NODE_HLS_ENABLE='${var.red5pro_hls_enable}'",
"export NODE_HLS_OUTPUT_FORMAT='${var.red5pro_hls_output_format}'",
"export NODE_HLS_DVR_PLAYLIST='${var.red5pro_hls_dvr_playlist}'",
"export NODE_WEBHOOKS_ENABLE='${var.red5pro_webhooks_enable}'",
"export NODE_WEBHOOKS_ENDPOINT='${var.red5pro_webhooks_endpoint}'",
"export NODE_ROUND_TRIP_AUTH_ENABLE='${var.red5pro_round_trip_auth_enable}'",
"export NODE_ROUND_TRIP_AUTH_HOST='${var.red5pro_round_trip_auth_host}'",
"export NODE_ROUND_TRIP_AUTH_PORT='${var.red5pro_round_trip_auth_port}'",
Expand Down
13 changes: 12 additions & 1 deletion red5pro-installer/r5p_config_node_apps_plugins.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
# NODE_SOCIALPUSHER_ENABLE=true
# NODE_SUPPRESSOR_ENABLE=true
# NODE_HLS_ENABLE=true
# NODE_HLS_OUTPUT_FORMAT=TS #(TS,FMP4,SMP4)
# NODE_HLS_DVR_PLAYLIST=true
# NODE_CLOUDSTORAGE_ENABLE=true
# NODE_CLOUDSTORAGE_AWS_ACCESS_KEY
# NODE_CLOUDSTORAGE_AWS_SECRET_KEY
Expand Down Expand Up @@ -98,9 +100,17 @@ config_node_apps_plugins(){
rm $RED5_HOME/plugins/inspector.jar
fi
fi

### Red5Pro HLS
if [[ "$NODE_HLS_ENABLE" == "true" ]]; then
log_i "Red5Pro HLS - enable"
log_i "Red5Pro HLS - enable. Output format: $NODE_HLS_OUTPUT_FORMAT, DVR playlist: $NODE_HLS_DVR_PLAYLIST"

hls_output_format='<property name="outputFormat" value="TS"/>'
hls_output_format_new='<property name="outputFormat" value="'$NODE_HLS_OUTPUT_FORMAT'"/>'

hls_dvr_playlist='<property name="dvrPlaylist" value="false"/>'
hls_dvr_playlist_new='<property name="dvrPlaylist" value="'$NODE_HLS_DVR_PLAYLIST'"/>'
sed -i -e "s|$hls_output_format|$hls_output_format_new|" -e "s|$hls_dvr_playlist|$hls_dvr_playlist_new|" "$RED5_HOME/conf/hlsconfig.xml"
else
log_d "Red5Pro HLS - disable"
if ls $RED5_HOME/plugins/red5pro-mpegts-plugin* >/dev/null 2>&1; then
Expand Down Expand Up @@ -210,6 +220,7 @@ config_node_apps_plugins(){
log_e "Parameter NODE_WEBHOOKS_ENDPOINT is empty. EXIT."
exit 1
fi
echo "" >> $RED5_HOME/webapps/live/WEB-INF/red5-web.properties
echo "webhooks.endpoint=$NODE_WEBHOOKS_ENDPOINT" >> $RED5_HOME/webapps/live/WEB-INF/red5-web.properties
fi
### Red5Pro Round-trip-auth
Expand Down
70 changes: 70 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,26 @@ variable "red5pro_hls_enable" {
type = bool
default = false
}
variable "red5pro_hls_output_format" {
description = "Red5 Pro Single server - HLS output format. Options: TS, FMP4, SMP4"
type = string
default = "TS"
}
variable "red5pro_hls_dvr_playlist" {
description = "Red5 Pro Single server - HLS DVR playlist"
type = string
default = "false"
}
variable "red5pro_webhooks_enable" {
description = "Red5 Pro Single server Webhooks enable/disable (https://www.red5.net/docs/special/webhooks/overview/)"
type = bool
default = false
}
variable "red5pro_webhooks_endpoint" {
description = "Red5 Pro Single server Webhooks endpoint"
type = string
default = ""
}
variable "red5pro_round_trip_auth_enable" {
description = "Round trip authentication on the red5pro server enable/disable - Auth server should be deployed separately (https://www.red5.net/docs/special/round-trip-auth/overview/)"
type = bool
Expand Down Expand Up @@ -394,6 +414,26 @@ variable "origin_image_red5pro_hls_enable" {
type = bool
default = false
}
variable "origin_image_red5pro_webhooks_enable" {
description = "Origin node image - Webhooks enable/disable (https://www.red5.net/docs/special/webhooks/overview/)"
type = bool
default = false
}
variable "origin_image_red5pro_hls_output_format" {
description = "Origin node image - HLS output format. Options: TS, FMP4, SMP4"
type = string
default = "TS"
}
variable "origin_image_red5pro_hls_dvr_playlist" {
description = "Origin node image - HLS DVR playlist"
type = string
default = "false"
}
variable "origin_image_red5pro_webhooks_endpoint" {
description = "Origin node image - Webhooks endpoint"
type = string
default = ""
}
variable "origin_image_red5pro_round_trip_auth_enable" {
description = "Origin node image - Round trip authentication on the enable/disable - Auth server should be deployed separately (https://www.red5.net/docs/special/round-trip-auth/overview/)"
type = bool
Expand Down Expand Up @@ -516,6 +556,16 @@ variable "edge_image_red5pro_hls_enable" {
type = bool
default = false
}
variable "edge_image_red5pro_webhooks_enable" {
description = "Edge node image - Webhooks enable/disable (https://www.red5.net/docs/special/webhooks/overview/)"
type = bool
default = false
}
variable "edge_image_red5pro_webhooks_endpoint" {
description = "Edge node image - Webhooks endpoint"
type = string
default = ""
}
variable "edge_image_red5pro_round_trip_auth_enable" {
description = "Edge node image - Round trip authentication on the enable/disable - Auth server should be deployed separately (https://www.red5.net/docs/special/round-trip-auth/overview/)"
type = bool
Expand Down Expand Up @@ -588,6 +638,26 @@ variable "transcoder_image_red5pro_hls_enable" {
type = bool
default = false
}
variable "transcoder_image_red5pro_hls_output_format" {
description = "Transcoder node image - HLS output format. Options: TS, FMP4, SMP4"
type = string
default = "TS"
}
variable "transcoder_image_red5pro_hls_dvr_playlist" {
description = "Transcoder node image - HLS DVR playlist"
type = string
default = "false"
}
variable "transcoder_image_red5pro_webhooks_enable" {
description = "Transcoder node image - Webhooks enable/disable (https://www.red5.net/docs/special/webhooks/overview/)"
type = bool
default = false
}
variable "transcoder_image_red5pro_webhooks_endpoint" {
description = "Transcoder node image - Webhooks endpoint"
type = string
default = ""
}
variable "transcoder_image_red5pro_round_trip_auth_enable" {
description = "Transcoder node image - Round trip authentication on the enable/disable - Auth server should be deployed separately (https://www.red5.net/docs/special/round-trip-auth/overview/)"
type = bool
Expand Down

0 comments on commit fa2a878

Please sign in to comment.