https://github.com/adel-bz/bbb-recordings-post-script
A Ruby code to send Published recordings on BBB to AWS S3
https://github.com/adel-bz/bbb-recordings-post-script
aws-s3 bigbluebutton discord-aler
Last synced: 3 months ago
JSON representation
A Ruby code to send Published recordings on BBB to AWS S3
- Host: GitHub
- URL: https://github.com/adel-bz/bbb-recordings-post-script
- Owner: adel-bz
- Created: 2024-04-30T09:59:17.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-05-20T08:12:21.000Z (12 months ago)
- Last Synced: 2025-01-01T04:35:05.854Z (5 months ago)
- Topics: aws-s3, bigbluebutton, discord-aler
- Language: Ruby
- Homepage:
- Size: 6.84 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# BigBlueButton S3 Uploader and Discord Notifier
This script automates the process of uploading recorded video files from a BigBlueButton server to an AWS S3 bucket and then notifying a Discord channel about the upload.# Prerequisites
Before using this script, make sure you have the following:- Ruby installed on your system
- Required Ruby gems installed (optimist, zip, net-http, json)
- An AWS Account and configured with appropriate permissions
- Access to a Discord webhook URL for sending notifications
- Access to the BigBlueButton server with the recordings you want to upload# Usage
1. Clone this repository to your local machine:
```
git clone https://github.com/adel-bz/BBB-Recordings-Post-Script.git
```2. Move `post_publish.rb` to `/usr/local/bigbluebutton/core/scripts/post_publish`
```
cd BBB-Recordings-Post-Script
mv post_publish.rb /usr/local/bigbluebutton/core/scripts/post_publish
```3. Install required gems:
```
gem install zip
```# Configuration
1. Before running the script, make sure to configure the following environment variables:- `AWS_ACCESS_KEY_ID:` Your AWS access key ID
- `AWS_SECRET_ACCESS_KEY:` Your AWS secret access key
- `AWS_REGION:` The AWS region where your S3 bucket is located
- `bucket_name:` The name of your S3 bucket
- `discord_webhook_url:` The URL of your Discord webhook
- `bbb_domain:` The domain of your BigBlueButton serverTo change Environments edit post_publish.rb
```
nano post_publish.rb
```2. choosing the recording format as you need:
> **Note:**
> If you are using video format for recording, skip this session.If you are using presentation format for recordings, you have to change ` published_files = "/var/bigbluebutton/published/video/#{meeting_id}"` to `published_files = "/var/bigbluebutton/published/presentation/#{meeting_id}"`
to install additional recording processing formats see here:
https://docs.bigbluebutton.org/administration/customize/#install-additional-recording-processing-formats3. Write a bucket policy to access AWS S3 with specific IPs to download recording files:
```
# If you want to access to s3 bucket with all IPs, you can delete the condition section: "Not Recommended"
{
"Version": "2012-10-17",
"Id": "S3PolicyId1",
"Statement": [
{
"Sid": "IPAllow",
"Effect": "Allow",
"Principal": "*",
"Action": [
"s3:GetObject",
"s3:PutObject"
],
"Resource": "arn:aws:s3:::bbb-records/*",
"Condition": {
"IpAddress": {
"aws:SourceIp": [
"ip1/32",
"ip2/32",
"ip3/32"
]
```If everything is right after each publish recording, recording files are sent to S3, Also some information such as `meeting_id` and `download link` are sent to your Discord channel automatically.
# References
https://docs.bigbluebutton.org/development/recording/#writing-post-scripts
# Contributing
Contributions are welcome! If you find any bugs or have suggestions for improvement, please open an issue or submit a pull request.