docker-dev/README.md

216 lines
6.5 KiB
Markdown
Raw Normal View History

2021-06-16 04:40:51 +08:00
# docker-dev
2021-06-16 04:40:51 +08:00
How to use Docker to setup a development environment for BigBlueButton
2023-02-19 14:01:14 +08:00
```
2023-02-19 14:03:19 +08:00
docker run -d --name=$NAME --hostname=$HOSTNAME $NETWORKPARAMS \
-env="container=docker" \
--env="PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" \
--env="DEBIAN_FRONTEND=noninteractive" \
-v "/var/run/docker.sock:/docker.sock:rw" \
--cap-add="NET_ADMIN" \
--privileged \
-v "$HOME/$NAME/certs/:/local/certs:rw" \
--cgroupns=host \
-v "$BBB_SRC_FOLDER:/home/bigbluebutton/src:rw" \
-v "/tmp:/tmp:rw" \
-v "$HOME/.m2/repository/org/bigbluebutton:/home/bigbluebutton/.m2/repository/org/bigbluebutton:rw" \
-v "$HOME/.ivy2/local/org.bigbluebutton:/home/bigbluebutton/.ivy2/local/org.bigbluebutton:rw" \
-t $IMAGE
2023-02-19 14:01:14 +08:00
```
2023-02-19 19:50:15 +08:00
```
2023-02-19 19:53:37 +08:00
docker run --name=bbb26 --hostname=bbb.jingweiht.com \
2023-02-19 19:50:15 +08:00
--network host \
--cap-add="NET_ADMIN" \
2023-02-19 19:53:37 +08:00
--rm \
-it imdt/bigbluebutton:2.6.x-develop_build_869
2023-02-19 19:50:15 +08:00
```
2023-02-19 14:01:14 +08:00
## Environment
We're considering you are using a [Ubuntu 20.04 LTS](https://ubuntu.com/download/desktop) but other versions/distributions can work too.
An internet connection is required. It can be a shared network ( no need to forward ports in your router ).
## SSL certificate
2022-09-08 20:38:56 +08:00
Running a BigBlueButton server requires a SSL certificate. The install script will automatically generate an self-signed certificate or you can rather specify a folder which contains a previous generated certificate.
2022-09-08 20:38:56 +08:00
## Docker setup
2022-09-08 20:38:56 +08:00
The next script depends on having docker available to your user, so before proceeding, run the following command (note that a computer reboot is required):
2022-09-08 20:38:56 +08:00
```sh
sudo usermod -aG docker `whoami`
sudo reboot
```
2022-09-08 20:38:56 +08:00
## Container setup
1. Save (right click, save as) the creation script in home directory (`~`): [create_bbb.sh](create_bbb.sh?raw=1)
2022-09-08 20:38:56 +08:00
2. Add permissions to the script:
```sh
2022-09-08 20:38:56 +08:00
chmod +x create_bbb.sh
```
2022-09-08 20:38:56 +08:00
3. Run the script ( it will remove previously created dockers and create a new one):
Docker **bbb 2.6**
```
./create_bbb.sh --image=imdt/bigbluebutton:2.6.x-develop --update bbb26
2022-09-08 20:38:56 +08:00
```
Docker **bbb 2.5**
```
./create_bbb.sh --image=imdt/bigbluebutton:2.5.x-develop --update bbb25
2022-09-08 20:38:56 +08:00
```
Docker **bbb 2.4**
```
./create_bbb.sh --image=imdt/bigbluebutton:2.4.x-develop --update bbb24
2022-09-08 20:38:56 +08:00
```
2022-09-08 20:38:56 +08:00
Parameters:
`./create_bbb.sh [--update] [--fork=github_user] [--domain=domain_name] [--ip=ip_address] [--image=docker_image] [--cert=certificate_dir] [--custom-script=path/script.sh] {name}`
2022-09-08 20:38:56 +08:00
- {name}: Name of the container (e.g `bbb26`) **(REQUIRED)**
- --update: check for new image version `--update`
- --domain: set the host domain (e.g `--domain=test`), default: `test`. BBB URL will be `https://{NAME} + {DOMAIN}`
- --cert: specify the directory which contains a certificate (`fullchain.pem` and `privkey.pem`) (e.g `--cert=/tmp`) *(if absent a new certificate will be created)*
- --custom-script: path of a shell script file to be executed immediately when the container is created (useful for setting some personal preferences for configs)
2022-09-08 20:38:56 +08:00
- --ip: force container IP (e.g `--ip=172.17.0.2`)
- --fork: Username in Github with bbb Fork `--fork=bigbluebutton`
- --image: Force an image different than default `--image=imdt/bigbluebutton:2.6.x-develop`
## Using the container
### SSH session within the container
2022-09-08 20:38:56 +08:00
```
ssh bbb26
```
Replace **bbb26** with the {name} param of `create_bbb.sh`
### Use `/tmp` to exchange files
The directory `/tmp` is shared between the host and the container. So you can use this directory to exchange files between them.
### Start using BigBlueButton
That's all, open https://bbb26.test (or your custom `https://{name}.{domain}`) in your browser and enjoy.
2022-09-08 20:38:56 +08:00
PS: if you see certificate error in your browser, you need to add the CA certificate in it's trusted certificates. Instructions for Chrome and Firefox can be found [here](https://github.com/bigbluebutton/docker-dev/issues/1)
## Removing an existing container
```
./create_bbb.sh --remove {container_name}
```
or rather you can remove a BBB docker image using `docker image rm imdt/bigbluebutton:2.6.x-develop --force`
2022-09-08 20:38:56 +08:00
---
## BBB-Conf
Link to the API-Mate: `bbb-conf --salt`
2022-09-08 20:38:56 +08:00
Restart BBB: `sudo bbb-conf --restart`
2022-09-08 20:38:56 +08:00
Check configs: `sudo bbb-conf --check`
2022-09-08 20:38:56 +08:00
---
## Troubleshooting
In case of problems, you can update the packages by running:
```sh
2022-09-08 20:38:56 +08:00
sudo apt update
sudo apt dist-upgrade -y
```
2022-09-08 20:38:56 +08:00
---
# Instructions to run BigBlueButton from source (via command-line)
- **HTML5 - bigbluebutton-html5**: the Front-End (users meeting interface) [*Meteor*]
- **AKKA - akka-bbb-apps**: Backend that exchange msgs with Frontend through Redis pub/sub msgs (stores the meeting state and execute validations for Html5, *e.g: Can John send a message?*) [*Scala*]
- **API - bigbluebutton-web**: Receives requests e.g: Create room, Enter room (when someone asks to enter the room, enters the API and then is redirected to html5) [*Grails*]
- **-bbb-common-web**: Contains useful functions that are used by the API [*JAVA*]
- **bbb-common-message**: Contains all Redis messages! Akka and the API import this project to know the existing messages [*JAVA*]
2022-09-08 20:38:56 +08:00
Further informations in https://docs.bigbluebutton.org/2.6/dev.html
2022-09-08 20:38:56 +08:00
---
## HTML5 client
2022-09-08 20:38:56 +08:00
#### Running HTML5
```
cd ~/src/bigbluebutton-html5/
./run-dev.sh
```
2022-09-08 20:38:56 +08:00
#### Running HTML5 with **Full RESET** (needed sometimes)
```
2022-09-08 20:38:56 +08:00
cd ~/src/bigbluebutton-html5/
./run-dev.sh --reset
```
---
## Common-Message (required for BBB-Web and Akka)
```
cd ~/src/bbb-common-message
./deploy.sh
```
2022-09-08 20:38:56 +08:00
---
## BBB-Web (API)
#### Running Bigbluebutton-web
```
cd ~/src/bigbluebutton-web/
./run-dev.sh
```
2022-09-08 20:38:56 +08:00
**If `bbb-common-web` was changed run:**
```
cd ~/src/bbb-common-web
./deploy.sh
cd ~/src/bigbluebutton-web/
./build.sh
```
2022-09-08 20:38:56 +08:00
---
## Akka-apps
2022-09-08 20:38:56 +08:00
#### Running Akka within **bbb-docker-dev**
```bash
cd ~/src/akka-bbb-apps/
./run-dev.sh
```
2022-09-08 20:38:56 +08:00
#### Running Akka on **IntelliJ IDEA**
2022-09-08 20:51:59 +08:00
- [Requires Common-Message](#common-message-required-for-bbb-web-and-akka)
2022-09-08 20:38:56 +08:00
- Open bbb-docker-dev SSH connection appending `-with-ports` to the command *(it will create tunnel for Redis port 6379)*
```bash
ssh {container_name}-with-ports
```
- Run Akka within Docker once, to set the configs
```bash
cd ~/src/akka-bbb-apps/
./run-dev.sh
```
2022-09-08 20:38:56 +08:00
- If everything is working, press `Ctrl + C` to stop
2022-09-08 20:38:56 +08:00
- Open IDEA, open the Sbt tab and run:
```
~reStart
```
![image](https://user-images.githubusercontent.com/5660191/158892260-8356d117-3be8-424a-aa24-ca405511f4e5.png)
2022-09-08 20:38:56 +08:00
---
## Redis
- To track the exchange of messages between applications
```
redis-cli psubscribe "*" | grep --line-buffered -v 'pmessage\|CheckRunningAndRecording\|MeetingInfoAnalyticsServiceMsg\|CheckAliveP\|GetUsersStatusToVoiceConfSysMsg\|SendCursorPosition\|DoLatencyTracerMsg'
```