forked from extern/docker
Merge branch 'develop' into prometheus-exporter-optimization
This commit is contained in:
commit
a94572a2b4
@ -1,3 +1,6 @@
|
||||
<img width="1012" alt="bbb-docker-banner" src="https://user-images.githubusercontent.com/1273169/141153216-0386cd4e-0aaf-473a-8f42-a048e52ed0d7.png">
|
||||
|
||||
|
||||
# 📦 BigBlueButton 2.3 Docker
|
||||
|
||||
Version: 2.3.14 | [Changelog](CHANGELOG.md) | [Issues](https://github.com/bigbluebutton/docker/issues)
|
||||
|
@ -258,6 +258,12 @@ services:
|
||||
volumes:
|
||||
- /var/run/docker.sock:/var/run/docker.sock
|
||||
- bigbluebutton:/var/bigbluebutton
|
||||
tmpfs:
|
||||
- /var/log/bigbluebutton
|
||||
environment:
|
||||
ENABLE_RECORDING: ${ENABLE_RECORDING}
|
||||
REMOVE_OLD_RECORDING: ${REMOVE_OLD_RECORDING}
|
||||
RECORDING_MAX_AGE_DAYS: ${RECORDING_MAX_AGE_DAYS}
|
||||
networks:
|
||||
bbb-net:
|
||||
ipv4_address: 10.7.7.12
|
||||
|
@ -10,6 +10,8 @@ RUN apt-get update \
|
||||
# -- install docker cli
|
||||
COPY --from=library/docker:latest /usr/local/bin/docker /usr/bin/docker
|
||||
|
||||
COPY bbb-restart-kms bbb-resync-freeswitch entrypoint.sh /
|
||||
COPY bbb-remove-old-recordings bbb-restart-kms bbb-resync-freeswitch entrypoint.sh /
|
||||
|
||||
RUN chmod +x bbb-remove-old-recordings
|
||||
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
41
mod/periodic/bbb-remove-old-recordings
Executable file
41
mod/periodic/bbb-remove-old-recordings
Executable file
@ -0,0 +1,41 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Source: https://docs.bigbluebutton.org/admin/customize.html#delete-recordings-older-than-n-days
|
||||
|
||||
set -e
|
||||
LOGFILE=/var/log/bigbluebutton/bbb-recording-cleanup-$(date --iso-8601='seconds' -u).log
|
||||
shopt -s nullglob
|
||||
NOW=$(date +%s)
|
||||
|
||||
echo "$(date --rfc-3339=seconds) Deleting recordings older than ${RECORDING_MAX_AGE_DAYS} days" >"${LOGFILE}"
|
||||
|
||||
# Find the name of recordings container in order to access `bbb-record` utility
|
||||
BBB_RECORDINGS_CONTAINER_NAME=$(docker ps --filter "name=recordings" --filter "status=running" --format "{{.Names}}")
|
||||
if [ $BBB_RECORDINGS_CONTAINER_NAME == "" ]; then
|
||||
echo "$(date --rfc-3339=seconds) ERROR: recordings container is not running" >>"${LOGFILE}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
for donefile in /var/bigbluebutton/recording/status/published/*-presentation.done ; do
|
||||
MTIME=$(stat -c %Y "${donefile}")
|
||||
# Check the age of the recording
|
||||
if [ $(( ( $NOW - $MTIME ) / 86400 )) -gt $RECORDING_MAX_AGE_DAYS ]; then
|
||||
MEETING_ID=$(basename "${donefile}")
|
||||
MEETING_ID=${MEETING_ID%-presentation.done}
|
||||
echo "${MEETING_ID}" >> "${LOGFILE}"
|
||||
|
||||
docker exec "$BBB_RECORDINGS_CONTAINER_NAME" bbb-record --delete "${MEETING_ID}" >>"${LOGFILE}"
|
||||
fi
|
||||
done
|
||||
|
||||
for eventsfile in /var/bigbluebutton/recording/raw/*/events.xml ; do
|
||||
MTIME=$(stat -c %Y "${eventsfile}")
|
||||
# Check the age of the recording
|
||||
if [ $(( ( $NOW - $MTIME ) / 86400 )) -gt $RECORDING_MAX_AGE_DAYS ]; then
|
||||
MEETING_ID="${eventsfile%/events.xml}"
|
||||
MEETING_ID="${MEETING_ID##*/}"
|
||||
echo "${MEETING_ID}" >> "${LOGFILE}"
|
||||
|
||||
docker exec "$BBB_RECORDINGS_CONTAINER_NAME" bbb-record --delete "${MEETING_ID}" >>"${LOGFILE}"
|
||||
fi
|
||||
done
|
@ -16,5 +16,10 @@ do
|
||||
# delete presentations older than N days
|
||||
find /var/bigbluebutton/ -maxdepth 1 -type d -name "*-*" -mtime +$history -exec rm -rf '{}' +
|
||||
|
||||
# delete recordings older than $RECORDING_MAX_AGE_DAYS
|
||||
if [ "$ENABLE_RECORDING" == true ] && [ "$REMOVE_OLD_RECORDING" == true ]; then
|
||||
/bbb-remove-old-recordings
|
||||
fi
|
||||
|
||||
sleep 30m
|
||||
done
|
@ -35,6 +35,8 @@ ENABLE_GREENLIGHT=true
|
||||
# https://github.com/bigbluebutton/bigbluebutton/issues/9202
|
||||
# make sure that you get peoples consent, before they join a room
|
||||
#ENABLE_RECORDING=true
|
||||
#REMOVE_OLD_RECORDING=false
|
||||
#RECORDING_MAX_AGE_DAYS=14
|
||||
|
||||
# ====================================
|
||||
# SECRETS
|
||||
|
@ -38,6 +38,8 @@ docker run \
|
||||
-v $(pwd)/docker-compose.tmpl.yml:/docker-compose.tmpl.yml \
|
||||
-e DEV_MODE=${DEV_MODE:-false} \
|
||||
-e ENABLE_RECORDING=${ENABLE_RECORDING:-false} \
|
||||
-e REMOVE_OLD_RECORDING=${REMOVE_OLD_RECORDING:-false} \
|
||||
-e RECORDING_MAX_AGE_DAYS=${RECORDING_MAX_AGE_DAYS:-14} \
|
||||
-e ENABLE_HTTPS_PROXY=${ENABLE_HTTPS_PROXY:-false} \
|
||||
-e ENABLE_WEBHOOKS=${ENABLE_WEBHOOKS:-false} \
|
||||
-e ENABLE_COTURN=${ENABLE_COTURN:-false} \
|
||||
|
@ -95,6 +95,7 @@ then
|
||||
read -p "Please enter max age(days) for keeping recordings: " recording_max_age_days
|
||||
done
|
||||
fi
|
||||
|
||||
fi
|
||||
|
||||
ip_correct=""
|
||||
|
Loading…
Reference in New Issue
Block a user