Merge pull request #10 from alangecker/develop

This commit is contained in:
chandi 2020-06-07 00:56:50 +02:00 committed by GitHub
commit f86cb29df5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
17 changed files with 393 additions and 113 deletions

View File

@ -1,8 +1,5 @@
# BigBlueButton Docker
## Please note
- Not well tested, can be still really buggy. Don't use for production!
## Install
1. Install docker-ce & docker-compose
1. follow instructions
@ -18,31 +15,18 @@
$ git clone --recurse-submodules https://github.com/alangecker/bigbluebutton-docker.git bbb-docker
$ cd bbb-docker
```
6. Create `.env` with `$ cp sample.env .env`
7. Adjust the values in `.env`
- **Important:** don't forget to change `ETHERPAD_API_KEY`, `SHARED_SECRET` and `RAILS_SECRET` to any random values! For example generated with `pwgen 40 3`
- `DOMAIN` and `EXTERNAL_IP` are also required. For example, use `dig +short <DOMAIN>` to get your external ip address.
8. Start container. either...
- **Most common setup**: BigBlueButton with automatic HTTPS certificate retrieval and Greenlight
```bash
$ docker-compose \
-f docker-compose.yml \
-f docker-compose.https.yml \
-f docker-compose.greenlight.yml \
up --detach
```
- **Individual parts**:
- BigBlueButton `$ docker-compose up -d`
- HTTPS reverse proxy
- `$ docker-compose -f docker-compose.https.yml up -d`
- API demos
- `$ docker-compose -f docker-compose.demo.yml up -d`
- Access https://bbb.example.com/demo/
- Greenlight
- `$ docker-compose -f docker-compose.greenlight.yml up -d`
- Create an administrator account \
`$ docker exec greenlight-v2 bundle exec rake admin:create`
- Access https://bbb.example.com/b
6. Run setup:
```bash
$ ./scripts/setup
```
7. Start containers:
```bash
$ ./scripts/compose up -d
```
8. If you use greenlight, you can create an admin account with:
```bash
$ ./scripts/compose exec greenlight bundle exec rake admin:create
```
@ -65,53 +49,32 @@ Also don't forget to forward all necassary ports listed in http://docs.bigbluebu
## Upgrading
### Upgrade BigBlueButton
```bash
cd bbb-docker
# pull repo changes
git pull
# update bbb-webrtc-sfu
git submodule update --remote
# rebuild images
docker-compose build --pull --no-cache
# recreate updated services
docker-compose up -d
```
### Upgrade Greenlight
**Important:** especially with a version before 2020-05-17 create a database backup first, otherwise the data will not be persistent between container recreations.
```bash
cd bbb-docker
# if you use greenlight:
# create a database backup
docker exec -t docker_postgres_1 pg_dumpall -c -U postgres > /root/greenlight_`date +%d-%m-%Y"_"%H_%M_%S`.sql
# pull repo changes
git pull
# upgrade!
./scripts/upgrade
# pull image updates
docker-compose -f docker-compose.greenlight.yml pull
# recreate & restart services if necessary
docker-compose -f docker-compose.greenlight.yml up -d
# restart updated services
./scripts/compose up -d
```
### Upgrade HTTPS Proxy
[to be written]
If you're on an old version, you might get following error: \
`no such file or directory: ./scripts/upgrade` \
A simple `$ git pull` resolves that, by fetching a newer version which includes the upgrade script.
## Special thanks to
- @dkrenn, whos dockerized version (bigbluebutton#8858)(https://github.com/bigbluebutton/bigbluebutton/pull/8858) helped me a lot in understand and some configs.
## Open Tasks
- add support for recording
- further separate bbb-core into individual container
- add coturn
- add prometheus exporter
- further separate `bbb-core` into individual container
- enable IPv6 support
- fix captions (they don't appear, `readOnlyPadId` is missing)
- switch to `node:12-buster-slim` for `html5`
- switch to `node:12-buster-slim` for `webrtc-sfu`
- drop root privileges in `webrtc-sfu`
- drop root privileges in `kurento`
- switch `html5` to node v12
- drop root privileges in `webrtc-sfu`

View File

@ -2,8 +2,9 @@ version: '3.6'
services:
greenlight:
container_name: greenlight-v2
container_name: greenlight
image: bigbluebutton/greenlight:v2
restart: unless-stopped
env_file: .env
environment:
DB_ADAPTER: postgresql
@ -18,6 +19,7 @@ services:
- 10.7.7.1:5000:80
postgres:
image: postgres:12
restart: unless-stopped
environment:
POSTGRES_DB: greenlight
POSTGRES_USER: postgres

View File

@ -2,7 +2,7 @@ version: '3.6'
services:
https_proxy:
image: valian/docker-nginx-auto-ssl
restart: on-failure
restart: unless-stopped
ports:
- 80:80
- 443:443

View File

@ -11,8 +11,8 @@ services:
SHARED_SECRET: ${SHARED_SECRET}
WELCOME_FOOTER: ${WELCOME_FOOTER}
STUN_SERVER: stun:${STUN_IP}:${STUN_PORT}
TURN_SERVER: ${TURN_SERVER}
TURN_SECRET: ${TURN_SECRET}
TURN_SERVER: ${TURN_SERVER:-}
TURN_SECRET: ${TURN_SECRET:-}
volumes:
- bigbluebutton:/var/bigbluebutton
networks:
@ -21,6 +21,7 @@ services:
freeswitch:
build: mod/freeswitch
restart: unless-stopped
cap_add:
- IPC_LOCK
- NET_ADMIN
@ -51,21 +52,18 @@ services:
- ./mod/nginx/bigbluebutton:/etc/nginx/conf.d/default.conf
- ${DEFAULT_PRESENTATION:-/dev/null}:/etc/nginx/html/default.pdf
networks:
- bbb-net
bbb-net:
ipv4_address: 10.7.7.13
extra_hosts:
- "host.docker.internal:10.7.7.1"
etherpad:
image: etherpad/etherpad:1.8.4
build: mod/etherpad
restart: unless-stopped
depends_on:
- redis
environment:
ETHERPAD_API_KEY: ${ETHERPAD_API_KEY}
volumes:
- ./mod/pad/settings.json:/opt/etherpad-lite/settings.json
- ./mod/pad/entrypoint.sh:/entrypoint.sh
entrypoint: /entrypoint.sh
networks:
bbb-net:
ipv4_address: 10.7.7.4
@ -81,12 +79,13 @@ services:
mongodb:
image: mongo:4.2
restart: unless-stopped
networks:
bbb-net:
ipv4_address: 10.7.7.6
kurento:
image: kurento/kurento-media-server:6.13
image: kurento/kurento-media-server:6.13.2
restart: unless-stopped
environment:
KMS_STUN_IP: ${STUN_IP}
@ -122,7 +121,8 @@ services:
- host.docker.internal:10.7.7.1
- kurento:10.7.7.1
networks:
- bbb-net
bbb-net:
ipv4_address: 10.7.7.10
html5:
build: mod/html5
@ -134,11 +134,10 @@ services:
environment:
DOMAIN: ${DOMAIN}
CLIENT_TITLE: ${CLIENT_TITLE}
SCREENSHARE_EXTENSION_KEY: ${SCREENSHARE_EXTENSION_KEY}
SCREENSHARE_EXTENSION_LINK: ${SCREENSHARE_EXTENSION_LINK}
ETHERPAD_API_KEY: ${ETHERPAD_API_KEY}
networks:
- bbb-net
bbb-net:
ipv4_address: 10.7.7.11
periodic:
build: mod/periodic
@ -149,7 +148,8 @@ services:
- /var/run/docker.sock:/var/run/docker.sock
- bigbluebutton:/var/bigbluebutton
networks:
- bbb-net
bbb-net:
ipv4_address: 10.7.7.12
volumes:
bigbluebutton:

View File

@ -1,5 +1,6 @@
#!/bin/bash
export LANG=en_US.UTF-8
# generate bbb folders
mkdir -p /var/bigbluebutton/recording/raw

21
mod/etherpad/Dockerfile Normal file
View File

@ -0,0 +1,21 @@
FROM etherpad/etherpad:1.8.4
USER root
# install etherpad plugins
# - ep_delete_after_delay_lite
# - ep_redis_publisher
RUN apt-get update \
&& apt-get install -y git \
&& npm install ep_delete_after_delay_lite git+https://git@github.com/pedrobmarin/ep_redis_publisher.git
# apply "Including more data at pad update event"
# https://github.com/mconf/etherpad-lite/commit/5bc37fc92714e82165386dc0a5dd467609169a87
# this is a necessary patch for the closed captions
RUN sed -i "s|hooks\.callAll(\"padUpdate\".*)|hooks\.callAll(\"padUpdate\", {'pad':this, 'author': author, 'revs': newRev, 'changeset': aChangeset});|" /opt/etherpad-lite/src/node/db/Pad.js
COPY settings.json /opt/etherpad-lite/settings.json
COPY entrypoint.sh /entrypoint.sh
USER etherpad
ENTRYPOINT ["/entrypoint.sh"]

View File

@ -1,4 +1,5 @@
#!/bin/bash
echo $ETHERPAD_API_KEY > /tmp/apikey
export NODE_ENV=production
node /opt/etherpad-lite/node_modules/ep_etherpad-lite/node/server.js --apikey /tmp/apikey

View File

@ -1,33 +1,54 @@
# TODO: build from github repo with node:12
FROM node:8-stretch
FROM node:8-buster-slim AS builder
ENV NODE_ENV production
RUN apt-get update && apt-get install -y wget curl subversion python2 python3 build-essential
RUN groupadd -g 2000 meteor && useradd -m -u 2001 -g meteor meteor
# download dockerize
ENV DOCKERIZE_VERSION v0.6.1
# install dockerize
RUN wget https://github.com/jwilder/dockerize/releases/download/$DOCKERIZE_VERSION/dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz \
&& tar -C /usr/local/bin -xzvf dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz \
&& rm dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz
RUN apt-get update && apt-get install -y wget binutils
RUN useradd -m meteor
# download & install bbb-html5 package manually
RUN PACKAGE_PATH=$(curl -s https://packages-eu.bigbluebutton.org/xenial-22/dists/bigbluebutton-xenial/main/binary-amd64/Packages | grep -E 'Filename.*html5' | awk '{print $2}') \
&& wget https://packages-eu.bigbluebutton.org/xenial-22/$PACKAGE_PATH \
&& ar x bbb-html5_*.deb \
&& tar -zxf data.tar.gz ./usr/share/meteor/bundle \
&& mv /usr/share/meteor/bundle /app \
&& rm -rf /app/programs/server/node_modules \
&& chown meteor:meteor /app/programs/server \
&& chown -R meteor:meteor /app/programs/server/assets/app/config \
&& rm /*.deb /*.tar.gz
USER meteor
RUN cd /app/programs/server && npm install && npm cache clear --force
ENV METEOR_VERSION 1.8.1
RUN curl -sL https://install.meteor.com?release=$METEOR_VERSION | sed s/--progress-bar/-sL/g | /bin/sh
ENV TAG v2.2.16
RUN cd ~ \
&& svn checkout https://github.com/bigbluebutton/bigbluebutton/tags/$TAG/bigbluebutton-html5 \
&& mv ~/bigbluebutton-html5 ~/source \
&& rm -rf ~/source/.svn
# source modifications for node v12 support:
# - remove memwatch since it is not available for node v12 and disabled anyway
# - set meteor release to 1.9
# - install newer fibers version (4.0.3) which supports node v12
# RUN sed -i -r 's/import (memwatch|heapdump).*//g' ~/source/imports/startup/server/index.js \
# && sed -i -r 's/.*(memwatch|heapdump).*//g' ~/source/package.json \
# && echo "METEOR@$METEOR_VERSION" > ~/source/.meteor/release \
# && cat ~/source/.meteor/release
RUN cd ~/source \
&& ~/.meteor/meteor npm install --production \
&& ~/.meteor/meteor build --directory ~/app \
&& rm -r ~/source
RUN cd ~/app/bundle/programs/server \
&& npm install --production
# ------------------------------
FROM node:8-alpine
RUN addgroup -g 2000 meteor && adduser -D -u 2001 -G meteor meteor
COPY --from=builder /usr/local/bin/dockerize /usr/local/bin/dockerize
COPY --from=builder --chown=meteor:meteor /home/meteor/app/bundle /app
COPY entrypoint.sh /entrypoint.sh
COPY settings.yml /app/programs/server/assets/app/config/settings.yml.tmpl
USER meteor
ENTRYPOINT ["/entrypoint.sh"]
# lets set the tag again, so that it is include in the image for later version retrieval
ENV TAG v2.2.14

View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/sh
cd /app
export ROOT_URL=http://127.0.0.1/html5client
@ -6,8 +6,9 @@ export MONGO_URL=mongodb://10.7.7.6/meteor
export NODE_ENV=production
export ENVIRONMENT_TYPE=production
export PORT=3000
export LANG=en_US.UTF-8
rm /app/programs/server/assets/app/config/settings.yml
rm -f /app/programs/server/assets/app/config/settings.yml
dockerize \
-template /app/programs/server/assets/app/config/settings.yml.tmpl:/app/programs/server/assets/app/config/settings.yml \
node main.js

View File

@ -83,8 +83,8 @@ public:
packetLostThreshold: 10
kurento:
wsUrl: wss://{{ .Env.DOMAIN }}/bbb-webrtc-sfu
chromeDefaultExtensionKey: {{ .Env.SCREENSHARE_EXTENSION_KEY }}
chromeDefaultExtensionLink: {{ .Env.SCREENSHARE_EXTENSION_LINK }}
chromeDefaultExtensionKey: akgoaoikmbmhcopjgakkcepdgdgkjfbc
chromeDefaultExtensionLink: https://chrome.google.com/webstore/detail/bigbluebutton-screenshare/akgoaoikmbmhcopjgakkcepdgdgkjfbc
chromeExtensionKey: KEY
chromeExtensionLink: LINK
screenshare:

View File

@ -1,4 +1,6 @@
FROM node:12
FROM node:12-alpine
RUN apk update && apk add git
ADD . app
@ -17,5 +19,10 @@ RUN cp config/default.example.yml config/production.yml \
EXPOSE 3008
# remove automatic IP detection (broken in alpine)
# and use sh instead of bash
RUN sed -i 's/CONTAINER_IP=.*/CONTAINER_IP=10.7.7.10/' /app/docker-entrypoint.sh \
&& sed -i 's/bash/sh/' /app/docker-entrypoint.sh
ENTRYPOINT [ "./docker-entrypoint.sh" ]
CMD [ "npm", "start" ]

View File

@ -1,8 +1,31 @@
# important! change these to random values
ETHERPAD_API_KEY=NEQKi2eFXSBce4kyGjwAzMn2jeF66peNYQmyFVRr
# ====================================
# ADDITIONS to BigBlueButton
# ====================================
# (place a '#' before to disable them)
# HTTPS Proxy
# fully automated Lets Encrypt certificates
ENABLE_HTTPS_PROXY=true
# Greenlight Frontend
# https://docs.bigbluebutton.org/greenlight/gl-overview.html
ENABLE_GREENLIGHT=true
# ====================================
# SECRETS
# ====================================
# important! change these to any random values
SHARED_SECRET=w6y7nycPafjPhVz3gZdBpQhR4H4MvEQzcZzia5LT
ETHERPAD_API_KEY=NEQKi2eFXSBce4kyGjwAzMn2jeF66peNYQmyFVRr
RAILS_SECRET=cdfbae48b197805a435ab7881da31c642ac1a7d4d5c006441efa8125ae63865ce7c915c651117e0f14358cd98f5287c431929e0f796f4100b2b1c3eb5baad1b0
# ====================================
# CONNECTION
# ====================================
DOMAIN=bbb.example.com
EXTERNAL_IP=144.76.97.10
@ -20,8 +43,10 @@ STUN_PORT=3478
#TURN_SERVER=turns:turn.example.com:443?transport=tcp
#TURN_SECRET=
SCREENSHARE_EXTENSION_KEY=akgoaoikmbmhcopjgakkcepdgdgkjfbc
SCREENSHARE_EXTENSION_LINK=https://chrome.google.com/webstore/detail/bigbluebutton-screenshare/akgoaoikmbmhcopjgakkcepdgdgkjfbc
# ====================================
# CUSTOMIZATION
# ====================================
CLIENT_TITLE=BigBlueButton
@ -35,9 +60,9 @@ WELCOME_FOOTER=This server is running <a href="http://docs.bigbluebutton.org/" t
DEFAULT_PRESENTATION=./mod/nginx/default.pdf
# -------------------------------
# greenlight configuration
# -------------------------------
# ====================================
# GREENLIGHT CONFIGURATION
# ====================================
# Microsoft Office365 Login Provider (optional)
#
@ -66,17 +91,21 @@ OAUTH2_REDIRECT=
# LDAP_METHOD=plain
# LDAP_UID=uid
# LDAP_BASE=dc=example,dc=com
# LDAP_AUTH=simple
# LDAP_BIND_DN=cn=admin,dc=example,dc=com
# LDAP_PASSWORD=password
# LDAP_ROLE_FIELD=ou
# LDAP_FILTER=(&(attr1=value1)(attr2=value2))
LDAP_SERVER=
LDAP_PORT=
LDAP_METHOD=
LDAP_UID=
LDAP_BASE=
LDAP_BIND_DN=
LDAP_AUTH=
LDAP_PASSWORD=
LDAP_ROLE_FIELD=
LDAP_FILTER=
# Set this to true if you want GreenLight to support user signup and login without
# Omniauth. For more information, see:
@ -85,7 +114,6 @@ LDAP_ROLE_FIELD=
#
ALLOW_GREENLIGHT_ACCOUNTS=true
# Set this to true if you want GreenLight to send verification emails upon
# the creation of a new account
#
@ -102,6 +130,10 @@ ALLOW_GREENLIGHT_ACCOUNTS=true
# SMTP_AUTH=plain
# SMTP_STARTTLS_AUTO=true
#
# If your mail server has a self-signed certificate, you'll also need to include the line below.
# Please note that enable this presents its own security risks and should not be done unless necessary.
# SMTP_OPENSSL_VERIFY_MODE=none
#
SMTP_SERVER=
SMTP_PORT=
SMTP_DOMAIN=
@ -141,6 +173,10 @@ PAGINATION_NUMBER=25
# Default is set to 25 rows
NUMBER_OF_ROWS=25
# Specify if you want to display the Google Calendar button
# ENABLE_GOOGLE_CALENDAR_BUTTON=true|false
ENABLE_GOOGLE_CALENDAR_BUTTON=
# Set the application into Maintenance Mode
#
# Current options supported:
@ -158,7 +194,14 @@ MAINTENANCE_WINDOW=
#
# Defaults to the Github Issues Page for Greenlight
# Button can be disabled by setting the value to blank
REPORT_ISSUE_URL=https://github.com/bigbluebutton/greenlight/issues/new
#
# REPORT_ISSUE_URL=https://github.com/bigbluebutton/greenlight/issues/new
# The link to the Need help? button that appears on the Account Dropdown
#
# Defaults to the Greenlight documentation
# Button can be disabled by setting the value to blank
HELP_URL=https://docs.bigbluebutton.org/greenlight/gl-overview.html
# Comment this out to send logs to STDOUT in production instead of log/production.log .
#

22
scripts/compose Executable file
View File

@ -0,0 +1,22 @@
#!/bin/bash
set -e
cd $(dirname $0)/..
# load .env
if [ -f .env ]
then
# exclude WELCOME_FOOTER because it may contain invalid characters
export $(cat .env | sed 's/#.*//g' | grep -v "WELCOME_FOOTER" | xargs)
fi
# concatenate docker-compose file
COMPOSE_FILES="-f docker-compose.yml"
if [ "$ENABLE_HTTPS_PROXY" == true ]; then
COMPOSE_FILES="$COMPOSE_FILES -f docker-compose.https.yml"
fi
if [ "$ENABLE_GREENLIGHT" == true ]; then
COMPOSE_FILES="$COMPOSE_FILES -f docker-compose.greenlight.yml"
fi
docker-compose $COMPOSE_FILES $@

73
scripts/print-versions Executable file
View File

@ -0,0 +1,73 @@
#!/bin/bash
set -e
CORE_IMAGE=$(docker-compose images -q core)
FREESWITCH_IMAGE=$(docker-compose images -q freeswitch)
HTML5_IMAGE=$(docker-compose images -q html5)
KURENTO_IMAGE=$(docker-compose images -q kurento)
ETHERPAD_IMAGE=$(docker-compose images -q etherpad)
MONGO_IMAGE=$(docker-compose images -q mongodb)
REDIS_IMAGE=$(docker-compose images -q redis)
if [[ -z $CORE_IMAGE ]]
then
echo "this script only works if containers are created"
echo "either start BigBlueButton with"
echo " $ docker-compose up -d"
echo "or at least create the containers with"
echo " $ docker-compose create"
exit 1
fi
echo "bigbluebutton-docker"
echo " commit: $(git rev-parse --short HEAD) ($(git log -1 --pretty=%B | head -n 1))"
echo " branch: $(git rev-parse --abbrev-ref HEAD)"
echo ""
echo "core"
docker run --rm --entrypoint /bin/sh $CORE_IMAGE -c "dpkg -l 'bbb-*' | grep ii | cut -c 5-42 | sed 's/bbb-/ bbb-/g'"
echo ""
echo "etherpad"
ETHERPAD_VERSION=$(docker run --rm --entrypoint cat $ETHERPAD_IMAGE /opt/etherpad-lite/src/package.json | grep version | awk -F'"' '{print $4}')
echo " version: $ETHERPAD_VERSION"
echo ""
echo "freeswitch"
FREESWITCH_VERSION=$(docker run --rm --entrypoint freeswitch $FREESWITCH_IMAGE -version | cut -c 21-)
FREESWTICH_CONFIG_VERSION=$(docker image inspect $FREESWITCH_IMAGE | grep GIT_TAG= | head -n 1 | xargs | cut -c 9-)
echo " build: $FREESWITCH_VERSION"
echo " config: $FREESWTICH_CONFIG_VERSION"
echo ""
echo "html5"
HTML5_VERSION=$(docker image inspect $HTML5_IMAGE | grep TAG= | head -n 1 | xargs | cut -c 5-)
echo " version: $HTML5_VERSION"
echo ""
echo "kurento"
KURENTO_VERSION=$(docker run --rm --entrypoint kurento-media-server $KURENTO_IMAGE --version | grep Kurento | sed 's/Kurento Media Server version: //')
echo " version: $KURENTO_VERSION"
echo ""
echo "mongodb"
MONGO_VERSION=$(docker image inspect $MONGO_IMAGE | grep MONGO_VERSION | head -n 1 | xargs | cut -c 15-)
echo " version: $MONGO_VERSION"
echo ""
# TODO:
# - nginx
# - periodic
echo "redis"
REDIS_VERSION=$(docker image inspect $REDIS_IMAGE | grep REDIS_VERSION | head -n 1 | xargs | cut -c 15-)
echo " version: $REDIS_VERSION"
echo ""
echo "webrtc-sfu"
SFU_VERSION=$(cd bbb-webrtc-sfu && cat package.json | grep version | awk -F\" '{print $4}')
SFU_COMMIT=$(cd bbb-webrtc-sfu && git rev-parse --short HEAD)
echo " version: $SFU_VERSION"
echo " commit: $SFU_COMMIT"

84
scripts/setup Executable file
View File

@ -0,0 +1,84 @@
#!/bin/bash
set -e
cd $(dirname $0)/..
if ! [ -x "$(command -v curl)" ]; then
echo "Error: curl is not installed, but the setup script relies on it."
echo "on debian based operating systems try following command:"
echo " $ sudo apt-get install curl"
exit 1
fi
# load .env
if [ -f .env ]
then
echo "Error: the configuration file .env already exists."
echo "either edit variables manually in there or remove the file and try this script again"
exit 1
fi
EXTERNAL_IP=$(curl -s http://whatismyip.akamai.com)
greenlight=""
while [[ ! $greenlight =~ ^(y|n)$ ]]; do
read -p "Should greenlight be included? (y/n): " greenlight
done
https_proxy=""
while [[ ! $https_proxy =~ ^(y|n)$ ]]; do
read -p "Should an automatic HTTPS Proxy be included? (y/n): " https_proxy
done
DOMAIN=""
while [[ -z "$DOMAIN" ]]; do
read -p "Please enter the domain name: " DOMAIN
done
ip_correct=""
while [[ ! $ip_correct =~ ^(y|n)$ ]]; do
read -p "Is $EXTERNAL_IP your external IPv4 address? (y/n): " ip_correct
done
if [ ! "$ip_correct" == "y" ]
then
EXTERNAL_IP=""
while [[ ! $EXTERNAL_IP =~ ^[1-9][0-9]{0,2}\.[1-9][0-9]{0,2}\.[1-9][0-9]{0,2}\.[1-9][0-9]{0,2}$ ]]; do
read -p "Please enter correct IPv4 address: " EXTERNAL_IP
done
fi
# write settings
cp sample.env .env
sed -i "s/EXTERNAL_IP=.*/EXTERNAL_IP=$EXTERNAL_IP/" .env
sed -i "s/DOMAIN=.*/DOMAIN=$DOMAIN/" .env
if [ ! "$greenlight" == "y" ]
then
sed -i "s/ENABLE_GREENLIGHT.*/#ENABLE_GREENLIGHT=true/" .env
fi
if [ ! "$https_proxy" == "y" ]
then
sed -i "s/ENABLE_HTTPS_PROXY.*/#ENABLE_HTTPS_PROXY=true/" .env
fi
# change secrets
RANDOM_1=$(head /dev/urandom | tr -dc A-Za-z0-9 | head -c 40)
RANDOM_2=$(head /dev/urandom | tr -dc A-Za-z0-9 | head -c 40)
RANDOM_3=$(head /dev/urandom | tr -dc a-f0-9 | head -c 128)
sed -i "s/SHARED_SECRET=.*/SHARED_SECRET=$RANDOM_1/" .env
sed -i "s/ETHERPAD_API_KEY=.*/ETHERPAD_API_KEY=$RANDOM_2/" .env
sed -i "s/RAILS_SECRET=.*/RAILS_SECRET=$RANDOM_3/" .env
echo "--------------------------------------------------"
echo "configuration file .env got successfully created!"
echo ""
echo "you can look through it for further adjusments"
echo " $ nano .env"
echo ""
echo "to start bigbluebutton run"
echo " $ ./scripts/compose up -d"

41
scripts/upgrade Executable file
View File

@ -0,0 +1,41 @@
#!/bin/bash
set -e
cd $(dirname $0)/..
if [ -z $RESTARTED ]
then
echo "# pull newest bigblugbutton-docker.git"
git pull
# restart script, since it might have changed.
RESTARTED=1 ./scripts/upgrade
else
echo ""
echo "# pull newest bbb-webrtc-sfu"
git submodule update --remote
echo ""
echo "# pull newest images"
./scripts/compose pull
echo ""
echo "# rebuild images"
./scripts/compose build --pull --no-cache
COMMIT_HASH=$(git rev-parse --short HEAD)
BRANCH_NAME=$(git rev-parse --abbrev-ref HEAD)
echo ""
echo "-------------------------------------"
echo "images successfully rebuilt!"
echo "we are on $COMMIT_HASH ($BRANCH_NAME)"
echo ""
echo "use following command for restarting:"
echo " $ ./scripts/compose up -d"
echo "-------------------------------------"
fi