added script for init recordings on bigbluebutton and scalelite

This commit is contained in:
jfederico
2020-11-25 22:35:59 -05:00
parent 512de4019e
commit 11d9cab98d
3 changed files with 72 additions and 0 deletions

View File

@@ -5,6 +5,11 @@ if ! [ -x "$(command -v docker-compose)" ]; then
exit 1
fi
if [[ ! -f ./.env ]]; then
echo ".env file does not exist on your filesystem."
exit 1
fi
URL_HOST=$(grep URL_HOST .env | cut -d '=' -f2)
echo $URL_HOST

View File

@@ -0,0 +1,33 @@
#!/bin/bash
if [[ ! -f ./.env ]]; then
echo ".env file does not exist on your filesystem."
exit 1
fi
URL_HOST=$(grep URL_HOST .env | cut -d '=' -f2)
echo $URL_HOST
echo 'Create a new group with GID 2000...'
groupadd -g 2000 scalelite-spool
echo 'Add the bigbluebutton user to the group...'
usermod -a -G scalelite-spool bigbluebutton
echo 'Add recording transfer scripts...'
cd /usr/local/bigbluebutton/core/scripts/post_publish
wget -O post_publish_scalelite.rb https://raw.githubusercontent.com/blindsidenetworks/scalelite/master/bigbluebutton/scalelite_post_publish.rb
echo 'Add recording transfer settings...'
cd /usr/local/bigbluebutton/core/scripts
wget https://raw.githubusercontent.com/blindsidenetworks/scalelite/master/bigbluebutton/scalelite.yml
echo "spool_dir: bigbluebutton@$URL_HOST:/var/bigbluebutton/spool" | tee -a /usr/local/bigbluebutton/core/scripts
echo 'Generate ssh key pair...'
mkdir /home/bigbluebutton
chown bigbluebutton.bigbluebutton /home/bigbluebutton/
su - bigbluebutton -s /bin/bash -c "ssh-keygen -t ed25519 -N '' -f ~/.ssh/id_rsa"
echo 'Add this key to /home/bigbluebutton/.ssh/authorized_keys in scalelite:'
cat /home/bigbluebutton/.ssh/scalelite.pub
echo 'done'

34
init-recordings-scalelite.sh Executable file
View File

@@ -0,0 +1,34 @@
#!/bin/bash
echo 'Add the bigbluebutton user...'
useradd -m -d /home/bigbluebutton -s /bin/bash bigbluebutton
su - bigbluebutton -s /bin/bash -c 'mkdir ~/.ssh && touch ~/.ssh/authorized_keys'
echo 'Create a new group with GID 2000...'
groupadd -g 2000 scalelite-spool
echo 'Add the bigbluebutton user to the group...'
usermod -a -G scalelite-spool bigbluebutton
echo 'Create the spool directory for recording transfer from BigBlueButton...'
mkdir -p /mnt/scalelite-recordings/var/bigbluebutton/spool
chown 1000:2000 /mnt/scalelite-recordings/var/bigbluebutton/spool
chmod 0775 /mnt/scalelite-recordings/var/bigbluebutton/spool
mkdir /var/bigbluebutton/
ln -s /mnt/scalelite-recordings/var/bigbluebutton/spool /var/bigbluebutton/spool
echo 'Create the temporary (working) directory for recording import...'
mkdir -p /mnt/scalelite-recordings/var/bigbluebutton/recording/scalelite
chown 1000:1000 /mnt/scalelite-recordings/var/bigbluebutton/recording/scalelite
chmod 0775 /mnt/scalelite-recordings/var/bigbluebutton/recording/scalelite
echo 'Create the directory for published recordings...'
mkdir -p /mnt/scalelite-recordings/var/bigbluebutton/published
chown 1000:1000 /mnt/scalelite-recordings/var/bigbluebutton/published
chmod 0775 /mnt/scalelite-recordings/var/bigbluebutton/published
echo 'Create the directory for unpublished recordings...'
mkdir -p /mnt/scalelite-recordings/var/bigbluebutton/unpublished
chown 1000:1000 /mnt/scalelite-recordings/var/bigbluebutton/unpublished
chmod 0775 /mnt/scalelite-recordings/var/bigbluebutton/unpublished