bigbluebutton-Github/DEVELOPMENT.md

436 lines
13 KiB
Markdown
Raw Normal View History

2016-04-28 05:29:11 +08:00
This document provides instructions for developers to setup their
2017-05-31 21:50:13 +08:00
environment and work on the upcoming BBB 2.0 (tentative release version).
2016-04-28 05:29:11 +08:00
2017-05-31 21:50:13 +08:00
## Install BBB 1.1
2016-04-28 05:29:11 +08:00
2020-04-03 18:02:02 +08:00
Follow the [install instructions](http://docs.bigbluebutton.org/install/install.html) for 1.1.
2016-04-28 05:29:11 +08:00
2017-05-31 21:50:13 +08:00
Make sure you have a working BBB 1.1 before you proceed with the instructions below.
2017-05-31 21:50:13 +08:00
## Setup development environment
2020-04-03 18:02:02 +08:00
Setup your development environment following these [instructions](http://docs.bigbluebutton.org/dev/setup.html)
2017-05-31 21:50:13 +08:00
## Checkout development branch
2020-04-03 18:02:02 +08:00
Checkout the development branch `move-java-classes-from-bbb-web-to-bbb-common-web` from this [repository](https://github.com/ritzalam/bigbluebutton)
2017-05-31 21:50:13 +08:00
Open nine (9) terminal windows so you will dedicate one window for each bbb-component.
You can name them client, bbb-apps, apps-common, red5, akka-apps, akka-fsesl, bbb-web, common-web, and messages.
## Building the client
2017-05-31 21:50:13 +08:00
On you bbb-client terminal, run the following commands.
2016-04-28 05:29:11 +08:00
```
cd ~/dev/bigbluebutton/bigbluebutton-client
2016-04-28 05:29:11 +08:00
```
Build build a specific locale (en_US default)
2016-04-28 05:29:11 +08:00
```
ant locale -DLOCALE=en_US
```
To build all locales
```
ant locales
```
This will take about 10 minutes (depending on the speed of your computer). Next, let's build the client
```
ant
```
This will create a build of the BigBlueButton client in the `/home/firstuser/dev/bigbluebutton/bigbluebutton-client/client` directory.
## Build BBB Red5 Applications
2017-05-31 21:50:13 +08:00
On your red5 terminal, turn off red5 service
```
2017-05-31 21:50:13 +08:00
sudo systemctl stop red5
```
You need to make `red5/webapps` writeable. Otherwise, you will get a permission error when you try to deploy into Red5.
```
sudo chmod -R 777 /usr/share/red5/webapps
```
### Build common-message
2017-05-31 21:50:13 +08:00
On your message terminal, run the following commands. Other components depends on this, so build this first.
```
cd ~/dev/bigbluebutton/bbb-common-message/
2017-06-01 21:58:38 +08:00
sbt clean
sbt publish
sbt publishLocal
```
### Build bbb-apps
2017-05-31 21:50:13 +08:00
We've split bbb-apps into bbb-apps-common and bigbluebutton-apps. We need to build bbb-apps-common first.
2017-05-31 21:50:13 +08:00
On your apps-common terminal, build the bbb-apps-common component.
```
2017-06-01 21:58:38 +08:00
cd ~/dev/bigbluebutton/bbb-apps-common/
2017-05-31 21:50:13 +08:00
# Force updating of bbb-commons-message
sbt clean
2017-05-31 21:50:13 +08:00
# Build and share library
sbt publish publishLocal
```
2017-05-31 21:50:13 +08:00
On your bbb-apps terminal, run the following commands.
```
2017-05-31 21:50:13 +08:00
cd ~/dev/bigbluebutton/bigbluebutton-apps/
2017-06-02 22:17:01 +08:00
# To make sure the lib folder is clean of old dependencies especially if you've used this
# dev environment for BBB 1.1, delete the contents of the lib directory. You can only to
# do once.
rm lib/*
2017-05-31 21:50:13 +08:00
# Force updating dependencies (bbb-apps-common)
gradle clean
gradle resolveDeps
2017-05-31 21:50:13 +08:00
gradle war deploy
2016-04-28 05:29:11 +08:00
```
## Manually start services
### Run Red5
2017-05-31 21:50:13 +08:00
On your red5 terminal, start red5.
2016-04-28 05:29:11 +08:00
```
cd /usr/share/red5
sudo -u red5 ./red5.sh
```
### Run Akka Apps
2017-05-31 21:50:13 +08:00
On your akka-apps terminal, start akka-apps
2016-04-28 05:29:11 +08:00
```
cd ~/dev/bigbluebutton/akka-bbb-apps
2017-06-02 22:17:01 +08:00
# To make sure the lib folder is clean of old dependencies especially if you've used this
# dev environment for BBB 1.1, delete the contents of the lib directory. You can only to
# do once.
rm lib_managed/*
# We need to stop the existing packaged akka-apps
sudo systemctl stop bbb-apps-akka
# Now we can run our own
2017-06-02 22:17:01 +08:00
sbt clean
2016-04-28 05:29:11 +08:00
sbt run
```
### Run Akka FSESL App
2017-05-31 21:50:13 +08:00
On your akka-fsesl terminal, start akka-fsesl
2016-04-28 05:29:11 +08:00
```
cd ~/dev/bigbluebutton/akka-bbb-fsesl
2017-06-02 22:17:01 +08:00
# To make sure the lib folder is clean of old dependencies especially if you've used this
# dev environment for BBB 1.1, delete the contents of the lib directory. You can only to
# do once.
rm lib_managed/*
# We need to stop the existing packaged akka-fsesl
sudo systemctl stop bbb-fsesl-akka
# Now we can run our own
2017-06-01 02:50:59 +08:00
sbt clean
2016-04-28 05:29:11 +08:00
sbt run
```
2017-05-31 21:50:13 +08:00
### Build bbb-web
We've split up bbb-web into bbb-common-web and bigbluebutton-web. We need to build
bbb-common-web first.
On your common-web terminal, run these commands
```
2017-06-01 21:58:38 +08:00
cd ~/dev/bigbluebutton/bbb-common-web/
2017-05-31 21:50:13 +08:00
2017-06-02 22:17:01 +08:00
# To make sure the lib folder is clean of old dependencies especially if you've used this
# dev environment for BBB 1.1, delete the contents of the lib directory. You can only to
# do once.
rm lib_managed/*
2017-05-31 21:50:13 +08:00
# Force updating of dependencies especially bbb-commons-message
sbt clean
sbt publish publishLocal
```
2016-04-28 05:29:11 +08:00
### Run bbb-web
First we need to remove the old `bbb-web` app from tomcat to avoid duplicate messages
```
sudo cp /var/lib/tomcat7/webapps/bigbluebutton.war /var/lib/tomcat7/webapps/bigbluebutton.war-packaged
sudo rm -r /var/lib/tomcat7/webapps/bigbluebutton
```
2017-05-31 21:50:13 +08:00
On your bbb-web terminal, start bbb-web
2016-04-28 05:29:11 +08:00
```
cd ~/dev/bigbluebutton/bigbluebutton-web
```
Get the salt and BBB URL from `/var/lib/tomcat7/webapps/demo/bbb_api_conf.jsp`
Edit `grails-app/conf/bigbluebutton.properties` and change the following with
the salt and IP you got from above.
```
bigbluebutton.web.serverURL=http://192.168.74.128
securitySalt=856d5e0197b1aa0cf79897841142a5f6
```
Start bbb-web
```
2017-06-02 22:17:01 +08:00
# To make sure the lib folder is clean of old dependencies especially if you've used this
# dev environment for BBB 1.1, delete the contents of the lib directory. You can only to
# do once.
rm lib/*
2017-05-31 21:50:13 +08:00
gradle clean
2016-04-28 05:29:11 +08:00
gradle resolveDeps
2016-04-28 05:34:35 +08:00
grails clean
2017-06-01 21:58:38 +08:00
sudo chmod -R ugo+rwx /var/log/bigbluebutton
2016-04-28 05:29:11 +08:00
grails -Dserver.port=8888 run-war
```
If things started without errors, congrats!
## Converting and Adding new messages
2016-04-28 05:29:11 +08:00
In bigbluebutton-apps, from [InMessages.scala](https://github.com/bigbluebutton/bigbluebutton/blob/bbb-2x-mconf/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/api/InMessages.scala) choose the message to convert.
2016-04-28 05:29:11 +08:00
```
case class UserShareWebcam(meetingID: String, userId: String, stream: String) extends InMessage
```
In bbb-apps-common, add new message in [BbbCoreEnvelope.scala](https://github.com/bigbluebutton/bigbluebutton/blob/bbb-2x-mconf/bbb-common-message/src/main/scala/org/bigbluebutton/common2/messages/BbbCoreEnvelope.scala)
```
object UserShareWebcamMsg { val NAME = "UserShareWebcamMsg" }
case class UserShareWebcamMsg(header: BbbClientMsgHeader, body: UserShareWebcamMsgBody)
```
Define `UserShareWebcamMsgBody` in `MessageBody.scala`
```
case class UserShareWebcamMsgBody(userId: String, stream: String)
```
From the client, send message as
```
{
"header": {
"name": "UserShareWebcamMsg",
"meetingId": "foo-meetingId",
"userId": "bar-userId"
},
"body": {
"streamId": "my-webcam-stream"
}
}
```
In [ReceivedJsonMsgHandlerActor](https://github.com/bigbluebutton/bigbluebutton/blob/bbb-2x-mconf/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/pubsub/senders/ReceivedJsonMsgHandlerActor.scala), deserialize the message with implementation in [ReceivedJsonMsgDeserializer](https://github.com/bigbluebutton/bigbluebutton/blob/bbb-2x-mconf/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/pubsub/senders/ReceivedJsonMsgDeserializer.scala).
```
case UserShareWebcamMsg.NAME =>
for {
m <- routeUserShareWebcamMsg(jsonNode)
} yield {
send(envelope, m)
}
```
Route the message in [ReceivedMessageRouter](https://github.com/bigbluebutton/bigbluebutton/blob/bbb-2x-mconf/akka-bbb-apps/src/main/scala/org/bigbluebutton/core2/ReceivedMessageRouter.scala).
```
def send(envelope: BbbCoreEnvelope, msg: UserShareWebcamMsg): Unit = {
val event = BbbMsgEvent(msg.header.meetingId, BbbCommonEnvCoreMsg(envelope, msg))
publish(event)
}
```
Handle the message in [MeestingActor](https://github.com/bigbluebutton/bigbluebutton/blob/bbb-2x-mconf/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/running/MeetingActor.scala) replacing the old implementation.
A complete example would be the `ValidateAuthTokenReqMsg`.
2017-10-20 23:53:42 +08:00
## Installing Flex SDK 4.16.0 and Playerglobal 23.0 for version 2.1 development
In the next step, you need to get the Apache Flex 4.16.0 SDK package.
Next, you need to make a directory to hold the tools needed for BigBlueButton development.
~~~
mkdir -p ~/dev/tools
cd ~/dev/tools
~~~
First, you need to download the SDK tarball from an Apache mirror site and then unpack it.
~~~
wget https://archive.apache.org/dist/flex/4.16.0/binaries/apache-flex-sdk-4.16.0-bin.tar.gz
tar xvfz apache-flex-sdk-4.16.0-bin.tar.gz
~~~
Next, create a linked directory with a shortened name for easier referencing.
~~~
ln -s ~/dev/tools/apache-flex-sdk-4.16.0-bin ~/dev/tools/flex
~~~
Once the Apache Flex SDK is unpacked, you need to download one of the dependencies manually because the file was moved from its original URL.
~~~
wget --content-disposition https://github.com/swfobject/swfobject/archive/2.2.tar.gz
tar xvfz swfobject-2.2.tar.gz
cp -r swfobject-2.2/swfobject flex/templates/
~~~
Now that we've finished with the first dependency we need to download the Adobe Flex SDK. We'll do this step manually in case the download fails (if it does, remove the incomplete file and issue the `wget` command again).
~~~
cd flex/
mkdir -p in/
wget http://download.macromedia.com/pub/flex/sdk/builds/flex4.6/flex_sdk_4.6.0.23201B.zip -P in/
~~~
Once the supplementary SDK has downloaded, we can use its `build.xml` script to automatically download the remaining third-party tools.
~~~
ant -f frameworks/build.xml thirdparty-downloads
~~~
After Flex downloads the remaining third-party tools, you need to modify their permissions.
~~~
find ~/dev/tools/flex -type d -exec chmod o+rx '{}' \;
chmod 755 ~/dev/tools/flex/bin/*
chmod -R +r ~/dev/tools/flex
~~~
The next step in setting up the Flex SDK environment is to download a Flex library for video.
~~~
mkdir -p ~/dev/tools/flex/frameworks/libs/player/23.0
cd ~/dev/tools/flex/frameworks/libs/player/23.0
wget http://fpdownload.macromedia.com/get/flashplayer/installers/archive/playerglobal/playerglobal23_0.swc
mv -f playerglobal23_0.swc playerglobal.swc
~~~
The last step to have a working Flex SDK is to configure it to work with playerglobal 23.0
~~~
cd ~/dev/tools/flex
sed -i "s/11.1/23.0/g" frameworks/flex-config.xml
sed -i "s/<swf-version>14<\/swf-version>/<swf-version>34<\/swf-version>/g" frameworks/flex-config.xml
sed -i "s/{playerglobalHome}\/{targetPlayerMajorVersion}.{targetPlayerMinorVersion}/libs\/player\/23.0/g" frameworks/flex-config.xml
~~~
With the tools installed, you need to add a set of environment variables to your `.profile` to access these tools.
~~~
vi ~/.profile
~~~
Copy-and-paste the following text at bottom of `.profile`.
~~~
export FLEX_HOME=$HOME/dev/tools/flex
export PATH=$PATH:$FLEX_HOME/bin
export ANT_OPTS="-Xmx512m -XX:MaxPermSize=512m"
~~~
Reload your profile to use these tools (this will happen automatically when you next login).
~~~
source ~/.profile
~~~
Check that the tools are now in your path by running the following command.
~~~
$ mxmlc -version
Version 4.16.0 build 20170305
~~~
## Configure the client to use CDN
It is possible to load the SWF application, modules and and locales from an external server; a CDN as a example. Let's suppose that our eternal domain is `cdn.company.org`
1.First create a `crossdomain.xml` file into `/var/www/bigbluebutton-default/`
~~~xml
<?xml version="1.0"?>
<!DOCTYPE cross-domain-policy SYSTEM "http://www.adobe.com/xml/dtds/cross-domain-policy.dtd">
<cross-domain-policy>
<site-control permitted-cross-domain-policies="master-only"/>
<allow-access-from domain="cdn.company.org"/>
</cross-domain-policy>
~~~
For more information about crossdomain policy please visit this link http://www.adobe.com/devnet/articles/crossdomain_policy_file_spec.html
2.In config.xml you can configure some assets to be loaded from an external server. The same can also be done for every `url` property for `module` tag. Please check the example below
~~~xml
<language ... localesConfig="http://cdn.company.org/client/conf/locales.xml"
localesDirectory="http://cdn.company.org/client/locale/" />
<skinning url="http://cdn.company.org/client/branding/css/V2Theme.css.swf" />
<branding logo="http://cdn.company.org/client/logo.swf" ...
background="http://cdn.company.org/client/background.png" />
...
<module name="ChatModule" url="http://cdn.company.org/client/ChatModule.swf" ... />
~~~
3.Then in `BigBlueButton.html` make sure you load the main swf from your remote URL. You can make the same with all other assets.
~~~js
content.innerHTML = '<object type="application/x-shockwave-flash" id="BigBlueButton" name="BigBlueButton" tabindex="0" data="http://cdn.company.org/client/BigBlueButton.swf" style="position: relative; top: 0.5px;" width="100%" height="100%" align="middle"><param name="quality" value="high"><param name="bgcolor" value="#FFFFFF"><param name="allowfullscreen" value="true"><param name="allowfullscreeninteractive" value="true"><param name="wmode" value="window"><param name="allowscriptaccess" value="always"><param name="seamlesstabbing" value="true"></object>';
}
};
} else {
swfobject.embedSWF("http://cdn.company.org/client/BigBlueButton.swf", "altFlash", "100%", "100%", "11.0.0", "http://cdn.company.org/client/expressInstall.swf", flashvars, params, attributes, embedCallback);
}
~~~