Merge remote-tracking branch 'upstream/develop' into chat-list-migration

This commit is contained in:
GuiLeme 2023-04-26 18:03:05 -03:00
commit e3618eb016
59 changed files with 149 additions and 375 deletions

View File

@ -12,7 +12,7 @@ stages:
# define which docker image to use for builds
default:
image: gitlab.senfcall.de:5050/senfcall-public/docker-bbb-build:v2023-04-18
image: bigbluebutton/bbb-build:2023-04-25
# This stage uses git to find out since when each package has been unmodified.
# it then checks an API endpoint on the package server to find out for which of

View File

@ -13,7 +13,7 @@ We designed BigBlueButton for online learning, (though it can be used for many [
* Group collaboration (many-to-many)
* Online classes (one-to-many)
You can install on a Ubuntu 20.04 64-bit server. We provide [bbb-install.sh](https://github.com/bigbluebutton/bbb-install) to let you have a server up and running within 30 minutes (or your money back 😉).
You can install on a Ubuntu 22.04 64-bit server. We provide [bbb-install.sh](https://github.com/bigbluebutton/bbb-install) to let you have a server up and running within 30 minutes (or your money back 😉).
For full technical documentation BigBlueButton -- including architecture, features, API, and GreenLight (the default front-end) -- see [https://docs.bigbluebutton.org/](https://docs.bigbluebutton.org/).

View File

@ -40,7 +40,7 @@ object ChatDAO {
for {
user <- groupChat.users
} yield {
ChatUserDAO.insert(meetingId, groupChat.id, user)
ChatUserDAO.insert(meetingId, groupChat.id, user, visible = groupChat.createdBy.id == user.id)
}
}

View File

@ -54,7 +54,12 @@ object ChatMessageDAO {
)
)
).onComplete {
case Success(rowsAffected) => DatabaseConnection.logger.debug(s"$rowsAffected row(s) inserted on ChatMessage table!")
case Success(rowsAffected) => {
DatabaseConnection.logger.debug(s"$rowsAffected row(s) inserted on ChatMessage table!")
//Set chat visible for all participant users
ChatUserDAO.updateChatVisible(meetingId, chatId)
}
case Failure(e) => DatabaseConnection.logger.debug(s"Error inserting ChatMessage: $e")
}
}

View File

@ -12,7 +12,8 @@ case class ChatUserDbModel(
meetingId: String,
userId: String,
lastSeenAt: Long,
typingAt: Option[java.sql.Timestamp]
typingAt: Option[java.sql.Timestamp],
visible: Boolean
)
class ChatUserDbTableDef(tag: Tag) extends Table[ChatUserDbModel](tag, None, "chat_user") {
@ -21,23 +22,24 @@ class ChatUserDbTableDef(tag: Tag) extends Table[ChatUserDbModel](tag, None, "ch
val userId = column[String]("userId", O.PrimaryKey)
val lastSeenAt = column[Long]("lastSeenAt")
val typingAt = column[Option[java.sql.Timestamp]]("typingAt")
val visible = column[Boolean]("visible")
// val chat = foreignKey("chat_message_chat_fk", (chatId, meetingId), ChatTable.chats)(c => (c.chatId, c.meetingId), onDelete = ForeignKeyAction.Cascade)
// val sender = foreignKey("chat_message_sender_fk", senderId, UserTable.users)(_.userId, onDelete = ForeignKeyAction.SetNull)
override def * = (chatId, meetingId, userId, lastSeenAt, typingAt) <> (ChatUserDbModel.tupled, ChatUserDbModel.unapply)
override def * = (chatId, meetingId, userId, lastSeenAt, typingAt, visible) <> (ChatUserDbModel.tupled, ChatUserDbModel.unapply)
}
object ChatUserDAO {
def insert(meetingId: String, chatId: String, groupChatUser: GroupChatUser) = {
ChatUserDAO.insertUser(meetingId, chatId, groupChatUser.id)
def insert(meetingId: String, chatId: String, groupChatUser: GroupChatUser, visible: Boolean) = {
ChatUserDAO.insertUser(meetingId, chatId, groupChatUser.id, visible)
}
def insertUserPublicChat(meetingId: String, userId: String) = {
ChatUserDAO.insertUser(meetingId, "MAIN-PUBLIC-GROUP-CHAT", userId)
ChatUserDAO.insertUser(meetingId, "MAIN-PUBLIC-GROUP-CHAT", userId, true)
}
def insertUser(meetingId: String, chatId: String, userId: String) = {
def insertUser(meetingId: String, chatId: String, userId: String, visible: Boolean) = {
DatabaseConnection.db.run(
TableQuery[ChatUserDbTableDef].insertOrUpdate(
ChatUserDbModel(
@ -45,7 +47,8 @@ object ChatUserDAO {
chatId = chatId,
meetingId = meetingId,
lastSeenAt = 0,
typingAt = None
typingAt = None,
visible = visible
)
)
).onComplete {
@ -68,4 +71,20 @@ object ChatUserDAO {
}
}
def updateChatVisible(meetingId: String, chatId: String): Unit = {
if (chatId != "MAIN-PUBLIC-GROUP-CHAT" && chatId != "public") { //Public chat is always visible
DatabaseConnection.db.run(
TableQuery[ChatUserDbTableDef]
.filter(_.meetingId === meetingId)
.filter(_.chatId === chatId)
.filter(_.visible === false)
.map(u => (u.visible))
.update(true)
).onComplete {
case Success(rowsAffected) => DatabaseConnection.logger.debug(s"$rowsAffected row(s) updated visible on chat_user table!")
case Failure(e) => DatabaseConnection.logger.debug(s"Error updating visible on chat_user table: $e")
}
}
}
}

View File

@ -21,7 +21,7 @@
"eslint-config-google": "^0.14.0"
},
"engines": {
"node": "^16.16.0",
"npm": "^8.5.0"
"node": "^18.16.0",
"npm": "^9.5.0"
}
}

View File

@ -1,4 +1,5 @@
import {useSubscription, gql, useMutation} from '@apollo/client';
import React from "react";
export default function ChatsInfo() {
@ -21,9 +22,30 @@ export default function ChatsInfo() {
});
};
const handleCloseChat = (chatId) => {
updateVisible({
variables: {
chatId
},
});
};
const [updateVisible] = useMutation(gql`
mutation UpdateChatUser($chatId: String) {
update_chat_user(
where: { chatId: { _eq: $chatId } },
_set: { visible: false }
) {
affected_rows
}
}
`);
const { loading, error, data } = useSubscription(
gql`subscription {
chat {
chat(order_by: {public: desc}) {
chatId
meetingId
participant {
@ -35,11 +57,12 @@ export default function ChatsInfo() {
totalMessages
totalUnread
public
visible
}
}`
);
const { data: dataTyping } = useSubscription(
const { data: publicChatTypingSub } = useSubscription(
gql`subscription {
user_typing_public(where: {isCurrentlyTyping: {_eq: true}}) {
chatId
@ -54,6 +77,21 @@ export default function ChatsInfo() {
}`
);
const { data: privateChatTypingSub } = useSubscription(
gql`subscription {
user_typing_private(where: {isCurrentlyTyping: {_eq: true}}) {
chatId
isCurrentlyTyping
meetingId
typingAt
userId
user {
name
}
}
}`
);
return !loading && !error &&
(<table border="1">
<thead>
@ -67,6 +105,7 @@ export default function ChatsInfo() {
<th>Who's typing</th>
<th>Total Mgs</th>
<th>Unread</th>
<th>Visible</th>
</tr>
</thead>
<tbody>
@ -78,16 +117,24 @@ export default function ChatsInfo() {
<td>{curr.meetingId}</td>
<td>{curr.participant?.name} {curr.participant?.role} {curr.participant?.color} {curr.participant?.loggedOut === true ? ' (Offline)' : ''}</td>
{
curr.chatId === 'MAIN-PUBLIC-GROUP-CHAT' ? (
curr.chatId === 'MAIN-PUBLIC-GROUP-CHAT' ?
<td>
{(dataTyping?.user_typing_public || []).map((currUserTyping) => <span>{currUserTyping.user.name} ({currUserTyping.userId})</span>)}
{(publicChatTypingSub?.user_typing_public || []).map((currUserTyping) => <span>{currUserTyping.user.name} ({currUserTyping.userId})</span>)}
<br />
<button onClick={() => handleUpdateTypingAt(curr.chatId)}>I'm typing!</button>
</td>
) : <td></td>
:
<td>
{(privateChatTypingSub?.user_typing_private || []).map((currUserTyping) => <span>{currUserTyping.user.name} ({currUserTyping.userId})</span>)}
<br />
<button onClick={() => handleUpdateTypingAt(curr.chatId)}>I'm typing!</button>
</td>
}
<td>{curr.totalMessages}</td>
<td>{curr.totalUnread}</td>
<td>{curr.visible == true ? 'Yes' : 'No'}
<button onClick={() => handleCloseChat(curr.chatId)}>Close chat!</button>
</td>
</tr>
);
})}

View File

@ -457,10 +457,11 @@ CREATE TABLE "chat_user" (
"userId" varchar(50),
"lastSeenAt" bigint,
"typingAt" timestamp,
"visible" boolean,
CONSTRAINT "chat_user_pkey" PRIMARY KEY ("chatId","meetingId","userId"),
CONSTRAINT chat_fk FOREIGN KEY ("chatId", "meetingId") REFERENCES "chat"("chatId", "meetingId") ON DELETE CASCADE
);
CREATE INDEX "idx_chat_user_chatId" ON "chat_user"("chatId","meetingId");
CREATE INDEX "idx_chat_user_chatId" ON "chat_user"("chatId","meetingId") WHERE "visible" is true;
CREATE INDEX "idx_chat_user_typing_public" ON "chat_user"("typingAt") WHERE "chatId" = 'MAIN-PUBLIC-GROUP-CHAT';
CREATE INDEX "idx_chat_user_typing_private" ON "chat_user"("chatId", "typingAt") WHERE "chatId" != 'MAIN-PUBLIC-GROUP-CHAT';
@ -477,7 +478,8 @@ FROM chat_user
LEFT JOIN "chat_user" chat_with ON chat_with."meetingId" = chat_user."meetingId"
AND chat_with."chatId" = chat_user."chatId"
AND chat_user."chatId" != 'MAIN-PUBLIC-GROUP-CHAT'
AND chat_with."userId" != chat_user."userId";
AND chat_with."userId" != chat_user."userId"
WHERE chat_user."chatId" != 'MAIN-PUBLIC-GROUP-CHAT';
CREATE TABLE "chat_message" (
"messageId" varchar(100) PRIMARY KEY,
@ -496,8 +498,10 @@ CREATE INDEX "idx_chat_message_chatId" ON "chat_message"("chatId","meetingId");
CREATE OR REPLACE VIEW "v_chat" AS
SELECT "user"."userId",
case when "user"."userId" = "chat"."createdBy" then true else false end "amIOwner",
chat."meetingId",
chat."chatId",
cu."visible",
chat_with."userId" AS "participantId",
count(DISTINCT cm."messageId") "totalMessages",
sum(CASE WHEN cm."senderId" != "user"."userId" and cm."createdTime" > coalesce(cu."lastSeenAt",0) THEN 1 ELSE 0 end) "totalUnread",
@ -509,15 +513,19 @@ LEFT JOIN "chat_user" cu ON cu."meetingId" = "user"."meetingId" AND cu."userId"
JOIN "chat" ON "user"."meetingId" = chat."meetingId" AND cu."chatId" = chat."chatId"
LEFT JOIN "chat_user" chat_with ON chat_with."meetingId" = chat."meetingId" AND chat_with."chatId" = chat."chatId" AND chat."chatId" != 'MAIN-PUBLIC-GROUP-CHAT' AND chat_with."userId" != cu."userId"
LEFT JOIN chat_message cm ON cm."meetingId" = chat."meetingId" AND cm."chatId" = chat."chatId"
GROUP BY "user"."userId", chat."meetingId", chat."chatId", chat_with."userId";
WHERE cu."visible" is true
GROUP BY "user"."userId", chat."meetingId", chat."chatId", cu."visible", chat_with."userId";
CREATE OR REPLACE VIEW "v_chat_message_public" AS
SELECT cm.*, to_timestamp("createdTime" / 1000) AS "createdTimeAsDate"
SELECT cm.*,
to_timestamp("createdTime" / 1000) AS "createdTimeAsDate"
FROM chat_message cm
WHERE cm."chatId" = 'MAIN-PUBLIC-GROUP-CHAT';
CREATE OR REPLACE VIEW "v_chat_message_private" AS
SELECT cu."userId", cm.*, to_timestamp("createdTime" / 1000) AS "createdTimeAsDate"
SELECT cu."userId",
cm.*,
to_timestamp("createdTime" / 1000) AS "createdTimeAsDate"
FROM chat_message cm
JOIN chat_user cu ON cu."meetingId" = cm."meetingId" AND cu."chatId" = cm."chatId"
WHERE cm."chatId" != 'MAIN-PUBLIC-GROUP-CHAT';

View File

@ -32,12 +32,15 @@ update_permissions:
columns:
- lastSeenAt
- typingAt
- visible
filter:
_and:
- meetingId:
_eq: X-Hasura-MeetingId
- userId:
_eq: X-Hasura-UserId
- visible:
_eq: true
check: {}
set:
meetingId: x-hasura-MeetingId

View File

@ -22,10 +22,11 @@ select_permissions:
columns:
- chatId
- meetingId
- visible
- participantId
- public
- totalMessages
- totalUnread
- public
filter:
_and:
- meetingId:

View File

@ -14,7 +14,7 @@ object_relationships:
userId: userId
insertion_order: null
remote_table:
name: v_user
name: v_user_ref
schema: public
select_permissions:
- role: bbb_client
@ -26,5 +26,21 @@ select_permissions:
- typingAt
- isCurrentlyTyping
filter:
meetingId:
_eq: X-Hasura-MeetingId
_and:
- meetingId:
_eq: X-Hasura-MeetingId
- _or:
- meetingId:
_eq: X-Hasura-ModeratorInMeeting
- user:
isModerator:
_eq: true
- meetingId:
_neq: X-Hasura-LockedInMeeting
- _exists:
_table:
name: v_meeting_showUserlist
schema: public
_where:
meetingId:
_eq: X-Hasura-MeetingId

View File

@ -1 +1 @@
BIGBLUEBUTTON_RELEASE=2.7.0-alpha.1
BIGBLUEBUTTON_RELEASE=2.8.0-alpha.1

View File

@ -85,18 +85,6 @@ HERE
# tail -f /var/log/nginx/html5-client.log | sed -u 's/\\x22/"/g' | sed -u 's/\\x5C//g'
}
enableHTML5CameraQualityThresholds() {
echo " - Enable HTML5 cameraQualityThresholds"
yq w -i $HTML5_CONFIG public.kurento.cameraQualityThresholds.enabled true
}
enableHTML5WebcamPagination() {
echo " - Enable HTML5 webcam pagination"
yq w -i $HTML5_CONFIG public.kurento.pagination.enabled true
}
#
# Enable firewall rules to open only
#
@ -136,131 +124,6 @@ enableUFWRules() {
}
enableMultipleKurentos() {
echo " - Configuring three Kurento Media Servers (listen only, webcam, and screenshare)"
# Step 1. Setup shared certificate between FreeSWITCH and Kurento
HOSTNAME=$(cat /etc/nginx/sites-available/bigbluebutton | grep -v '#' | sed -n '/server_name/{s/.*server_name[ ]*//;s/;//;p}' | cut -d' ' -f1 | head -n 1)
openssl req -x509 -new -nodes -newkey rsa:4096 -sha256 -days 3650 -subj "/C=BR/ST=Ottawa/O=BigBlueButton Inc./OU=Live/CN=$HOSTNAME" -keyout /tmp/dtls-srtp-key.pem -out /tmp/dtls-srtp-cert.pem
cat /tmp/dtls-srtp-key.pem /tmp/dtls-srtp-cert.pem > /etc/kurento/dtls-srtp.pem
cat /tmp/dtls-srtp-key.pem /tmp/dtls-srtp-cert.pem > /opt/freeswitch/etc/freeswitch/tls/dtls-srtp.pem
sed -i 's/;pemCertificateRSA=.*/pemCertificateRSA=\/etc\/kurento\/dtls-srtp.pem/g' /etc/kurento/modules/kurento/WebRtcEndpoint.conf.ini
# Step 2. Setup systemd unit files to launch three separate instances of Kurento
for i in `seq 8888 8890`; do
cat > /usr/lib/systemd/system/kurento-media-server-${i}.service << HERE
# /usr/lib/systemd/system/kurento-media-server-#{i}.service
[Unit]
Description=Kurento Media Server daemon (${i})
After=network.target
PartOf=kurento-media-server.service
After=kurento-media-server.service
[Service]
UMask=0002
Environment=KURENTO_LOGS_PATH=/var/log/kurento-media-server
Environment=KURENTO_CONF_FILE=/etc/kurento/kurento-${i}.conf.json
User=kurento
Group=kurento
LimitNOFILE=1000000
ExecStartPre=-/bin/rm -f /var/kurento/.cache/gstreamer-1.5/registry.x86_64.bin
ExecStart=/usr/bin/kurento-media-server --gst-debug-level=3 --gst-debug="3,Kurento*:4,kms*:4,KurentoWebSocketTransport:5"
Type=simple
PIDFile=/var/run/kurento-media-server-${i}.pid
TasksMax=infinity
Restart=always
[Install]
WantedBy=kurento-media-server.service
HERE
# Make a new configuration file each instance of Kurento that binds to a different port
cp /etc/kurento/kurento.conf.json /etc/kurento/kurento-${i}.conf.json
sed -i "s/8888/${i}/g" /etc/kurento/kurento-${i}.conf.json
done
# Step 3. Override the main kurento-media-server unit to start/stop the three Kurento instances
cat > /etc/systemd/system/kurento-media-server.service << HERE
[Unit]
Description=Kurento Media Server
[Service]
Type=oneshot
ExecStart=/bin/true
RemainAfterExit=yes
[Install]
WantedBy=multi-user.target
HERE
# Step 4. Extend bbb-webrtc-sfu unit to wait for all three KMS servers to start
mkdir -p /etc/systemd/system/bbb-webrtc-sfu.service.d
cat > /etc/systemd/system/bbb-webrtc-sfu.service.d/override.conf << HERE
[Unit]
After=syslog.target network.target freeswitch.service kurento-media-server-8888.service kurento-media-server-8889.service kurento-media-server-8890.service
HERE
systemctl daemon-reload
for i in `seq 8888 8890`; do
systemctl enable kurento-media-server-${i}.service
done
# Step 5. Modify bbb-webrtc-sfu config to use the three Kurento servers
KURENTO_CONFIG=/usr/local/bigbluebutton/bbb-webrtc-sfu/config/default.yml
MEDIA_TYPE=(main audio content)
IP=$(yq r /usr/local/bigbluebutton/bbb-webrtc-sfu/config/default.yml kurento[0].ip)
for i in `seq 0 2`; do
yq w -i $KURENTO_CONFIG "kurento[$i].ip" $IP
yq w -i $KURENTO_CONFIG "kurento[$i].url" "ws://127.0.0.1:$(($i + 8888))/kurento"
yq w -i $KURENTO_CONFIG "kurento[$i].mediaType" "${MEDIA_TYPE[$i]}"
yq w -i $KURENTO_CONFIG "kurento[$i].ipClassMappings.local" ""
yq w -i $KURENTO_CONFIG "kurento[$i].ipClassMappings.private" ""
yq w -i $KURENTO_CONFIG "kurento[$i].ipClassMappings.public" ""
yq w -i $KURENTO_CONFIG "kurento[$i].options.failAfter" 5
yq w -i $KURENTO_CONFIG "kurento[$i].options.request_timeout" 30000
yq w -i $KURENTO_CONFIG "kurento[$i].options.response_timeout" 30000
done
yq w -i $KURENTO_CONFIG balancing-strategy MEDIA_TYPE
}
disableMultipleKurentos() {
echo " - Configuring a single Kurento Media Server for listen only, webcam, and screenshare"
systemctl stop kurento-media-server.service
for i in `seq 8888 8890`; do
systemctl disable kurento-media-server-${i}.service
done
# Remove the overrride (restoring the original kurento-media-server.service unit file)
rm -f /etc/systemd/system/kurento-media-server.service
rm -f /etc/systemd/system/bbb-webrtc-sfu.service.d/override.conf
systemctl daemon-reload
# Restore bbb-webrtc-sfu configuration to use a single instance of Kurento
KURENTO_CONFIG=/usr/local/bigbluebutton/bbb-webrtc-sfu/config/default.yml
yq d -i $KURENTO_CONFIG kurento[1]
yq d -i $KURENTO_CONFIG kurento[1]
yq w -i $KURENTO_CONFIG "kurento[0].url" "ws://127.0.0.1:8888/kurento"
yq w -i $KURENTO_CONFIG "kurento[0].mediaType" ""
yq w -i $KURENTO_CONFIG balancing-strategy ROUND_ROBIN
}
notCalled() {
#
# This function is not called.
@ -283,10 +146,6 @@ source /etc/bigbluebutton/bbb-conf/apply-lib.sh
#enableHTML5ClientLog
#enableUFWRules
#enableHTML5CameraQualityThresholds
#enableHTML5WebcamPagination
#enableMultipleKurentos
# Shorten the FreeSWITCH "you have been muted" and "you have been unmuted" prompts
# cp -r /etc/bigbluebutton/bbb-conf/sounds /opt/freeswitch/share/freeswitch

View File

@ -440,19 +440,6 @@ display_bigbluebutton_status () {
units="$units bbb-webrtc-recorder"
fi
if [ -f /usr/lib/systemd/system/kurento-media-server.service ]; then
units="$units kurento-media-server"
fi
for i in `seq 8888 8890`; do
# check if multi-kurento setup is configured
if [ -f /usr/lib/systemd/system/kurento-media-server-${i}.service ]; then
if systemctl is-enabled kurento-media-server-${i}.service > /dev/null; then
units="$units kurento-media-server-${i}"
fi
fi
done
if [ -f /usr/share/etherpad-lite/settings.json ]; then
units="$units etherpad"
fi
@ -718,9 +705,6 @@ if [[ $PORT_RANGE ]]; then
xmlstarlet edit --inplace --update '/configuration/settings/param[@name="rtp-start-port"]/@value' --value $START_PORT $FREESWITCH_SWITCH_CONF
xmlstarlet edit --inplace --update '/configuration/settings/param[@name="rtp-end-port"]/@value' --value $END_PORT $FREESWITCH_SWITCH_CONF
sed -i "s/minPort=.*/minPort=$START_PORT/" /etc/kurento/modules/kurento/BaseRtpEndpoint.conf.ini
sed -i "s/maxPort=.*/maxPort=$END_PORT/" /etc/kurento/modules/kurento/BaseRtpEndpoint.conf.ini
mkdir -p $(dirname $WEBRTC_SFU_ETC_CONFIG)
touch $WEBRTC_SFU_ETC_CONFIG
yq w -i $WEBRTC_SFU_ETC_CONFIG mediasoup.worker.rtcMinPort $START_PORT
@ -1417,7 +1401,6 @@ if [ $CHECK ]; then
echo "UDP port ranges"
echo
echo " FreeSWITCH: $(xmlstarlet sel -t -m './configuration/settings/param[@name="rtp-start-port"]' -v @value $FREESWITCH_SWITCH_CONF)-$(xmlstarlet sel -t -m './configuration/settings/param[@name="rtp-end-port"]' -v @value $FREESWITCH_SWITCH_CONF)"
echo " kurento: $(awk -F '=' '{if (! ($0 ~ /^;/) && $0 ~ /minPort/) print $2}' /etc/kurento/modules/kurento/BaseRtpEndpoint.conf.ini)-$(awk -F '=' '{if (! ($0 ~ /^;/) && $0 ~ /maxPort/) print $2}' /etc/kurento/modules/kurento/BaseRtpEndpoint.conf.ini)"
echo " bbb-webrtc-sfu: $(echo "$WEBRTC_SFU_CONFIG" | yq r - mediasoup.worker.rtcMinPort)-$(echo "$WEBRTC_SFU_CONFIG" | yq r - mediasoup.worker.rtcMaxPort)"
echo " bbb-webrtc-recorder: $(echo "$WEBRTC_RECORDER_CONFIG" | yq r - webrtc.rtcMinPort)-$(echo "$WEBRTC_RECORDER_CONFIG" | yq r - webrtc.rtcMaxPort)"
@ -1518,7 +1501,6 @@ if [ $ZIP ]; then
tar rf $TMP_LOG_FILE /var/log/bbb-apps-akka > /dev/null 2>&1
tar rf $TMP_LOG_FILE /var/log/bbb-fsesl-akka > /dev/null 2>&1
tar rf $TMP_LOG_FILE /var/log/bbb-webrtc-sfu > /dev/null 2>&1
tar rf $TMP_LOG_FILE /var/log/kurento-media-server > /dev/null 2>&1
tar rf $TMP_LOG_FILE /var/log/mongodb > /dev/null 2>&1
tar rf $TMP_LOG_FILE /var/log/redis > /dev/null 2>&1
tar rf $TMP_LOG_FILE /var/log/nginx/error.log* > /dev/null 2>&1
@ -1820,10 +1802,6 @@ if [ $CLEAN ]; then
rm -f /var/log/mongodb/*
fi
if [ -d /var/log/kurento-media-server ]; then
rm -f /var/log/kurento-media-server/*
fi
start_bigbluebutton
check_state
fi

View File

@ -40,9 +40,8 @@ fi
find /var/bigbluebutton/ -maxdepth 1 -type d -name "*-[0-9]*" -mtime +$history -exec rm -rf '{}' +
#
# Delete streams from Kurento and mediasoup older than N days
# Delete streams from mediasoup older than N days
#
kurento_dir=/var/kurento/
mediasoup_dir=/var/mediasoup/
remove_stale_sfu_raw_files() {
@ -55,7 +54,6 @@ remove_stale_sfu_raw_files() {
done
}
remove_stale_sfu_raw_files "$kurento_dir"
remove_stale_sfu_raw_files "$mediasoup_dir"
#
@ -70,7 +68,6 @@ find /var/freeswitch/meetings/ -name "*.opus" -mtime +$history -delete
find /opt/freeswitch/var/log/freeswitch -type f -mtime +$log_history -delete
find /var/log/bigbluebutton -type f -mtime +$log_history -delete
find /var/log/bbb-webrtc-sfu -type f -mtime +$log_history -delete
find /var/log/kurento-media-server -name "*.pid*.log" -type f -mtime +$log_history -delete
#
# Delete raw files of recordings without recording marks older than N days

View File

@ -1,35 +0,0 @@
#!/bin/bash
#
# Restart Kurento every 24+ hours
#
if [ ! -f /var/tmp/bbb-kms-last-restart.txt ]; then
date +%Y-%m-%d\ %H:%M:%S > /var/tmp/bbb-kms-last-restart.txt
exit
fi
users=$(mongo --quiet mongodb://127.0.1.1:27017/meteor --eval "db.users.count()")
if [ "$users" -eq 0 ]; then
# Make sure 24 hours have passed since last restart
# Seconds since epoch for last restart
dt1=$(cat /var/tmp/bbb-kms-last-restart.txt)
t1=`date --date="$dt1" +%s`
# Current seconds since epoch
dt2=`date +%Y-%m-%d\ %H:%M:%S`
t2=`date --date="$dt2" +%s`
# Hours since last restart
let "tDiff=$t2-$t1"
let "hDiff=$tDiff/3600"
if [ "$hDiff" -ge 24 ]; then
systemctl restart kurento-media-server bbb-webrtc-sfu
date +%Y-%m-%d\ %H:%M:%S > /var/tmp/bbb-kms-last-restart.txt
fi
fi

View File

@ -110,7 +110,7 @@ const UserListParticipants: React.FC<UserListParticipantsProps> = ({
tabIndex={0}
/>
);
}}
}}
</AutoSizer>
}
</Styled.UserListColumn>
@ -120,7 +120,7 @@ const UserListParticipants: React.FC<UserListParticipantsProps> = ({
const UserListParticipantsContainer: React.FC = () => {
const [offset, setOffset] = React.useState(0);
const [limit, setLimit] = React.useState(0);
const { loading: usersLoading, error: usersError, data: usersData } = useSubscription(USERS_SUBSCRIPTION, {
variables:{
offset,
@ -141,13 +141,9 @@ const UserListParticipantsContainer: React.FC = () => {
loading: currentUserLoading,
error: currentUserError,
data: currentUserData,
} = useSubscription(CURRENT_USER_SUBSCRIPTION, {
variables:{
userId: Auth.userID,
}
});
} = useSubscription(CURRENT_USER_SUBSCRIPTION);
const { user: currentUserArr } = (currentUserData || {});
const { user_current: currentUserArr } = (currentUserData || {});
const currentUser = currentUserArr && currentUserArr[0];
const {
@ -171,4 +167,4 @@ const UserListParticipantsContainer: React.FC = () => {
</>
};
export default UserListParticipantsContainer;
export default UserListParticipantsContainer;

View File

@ -82,11 +82,13 @@ export const MEETING_PERMISSIONS_SUBSCRIPTION = gql`subscription {
}
}`;
export const CURRENT_USER_SUBSCRIPTION = gql`subscription User($userId: String!) {
user(where: {userId: {_eq: $userId}}) {
export const CURRENT_USER_SUBSCRIPTION = gql`subscription {
user_current {
userId
isModerator
guest
presenter
locked
}
}`;

View File

@ -214,7 +214,7 @@ fi
if [ -f /etc/redhat-release ]; then
TOMCAT_SERVICE=tomcat
else
if grep -q focal /etc/lsb-release; then
if grep -q jammy /etc/lsb-release; then
TOMCAT_SERVICE=tomcat9
fi
fi

View File

@ -100,21 +100,6 @@ fi
usermod bigbluebutton -a -G freeswitch
chmod 0775 /var/freeswitch/meetings
if ! id kurento >/dev/null 2>&1; then
useradd --home-dir "/var/lib/kurento" --system kurento
fi
usermod bigbluebutton -a -G kurento
chown kurento:kurento /var/kurento
chmod 0775 /var/kurento
if [ -d /var/kurento/recordings ]; then
chmod 0775 /var/kurento/recordings
fi
if [ -d /var/kurento/screenshare ]; then
chmod 0775 /var/kurento/screenshare
fi
# Verify mediasoup raw media directories ownership and perms
if [ -d /var/mediasoup ]; then
chown bigbluebutton:bigbluebutton /var/mediasoup

View File

@ -2,5 +2,5 @@ after-install.sh
bbb-export-annotations.service
before-remove.sh
build.sh
opts-focal.sh
opts-jammy.sh
opts-global.sh

View File

@ -97,7 +97,7 @@ patch -p1 < $BUILDDIR/1914.patch
./configure --disable-core-odbc-support --disable-core-pgsql-support \
--without-python --without-erlang --without-java \
--prefix=/opt/freeswitch
--prefix=/opt/freeswitch CFLAGS="-Wno-error" CXXFLAGS="-Wno-error"
# Overrides for generating debug version
# --prefix=/opt/freeswitch CFLAGS="-Wno-error -Og -ggdb" CXXFLAGS="-Wno-error -Og -ggdb"

View File

@ -2,4 +2,4 @@ after-install.sh
bbb-pads.service
before-remove.sh
build.sh
opts-focal.sh
opts-jammy.sh

View File

@ -3,5 +3,5 @@ bbb-webhooks.service
before-install.sh
before-remove.sh
build.sh
opts-focal.sh
opts-jammy.sh
webhooks.nginx

View File

@ -2,4 +2,4 @@ after-install.sh
bbb-webrtc-recorder.service
before-remove.sh
build.sh
opts-focal.sh
opts-jammy.sh

View File

@ -1,11 +1,9 @@
after-install.sh
bbb-restart-kms
bbb-webrtc-sfu.logrotate
bbb-webrtc-sfu.service
before-install.sh
before-remove.sh
build.sh
kurento-media-server.service
opts-focal.sh
opts-jammy.sh
opts-centos7.sh
webrtc-sfu.nginx

View File

@ -10,11 +10,6 @@ case "$1" in
cp /usr/local/bigbluebutton/bbb-webrtc-sfu/config/default.example.yml $TARGET
chown bigbluebutton:bigbluebutton $TARGET
yq w -i $TARGET kurento[0].ip "$IP"
# https://github.com/bigbluebutton/bbb-webrtc-sfu/pull/37
# yq w -i $TARGET kurento[0].url "ws://$SERVER_URL:8888/kurento"
# Set mediasoup IPs
yq w -i $TARGET mediasoup.webrtc.listenIps[0].announcedIp "$IP"
yq w -i $TARGET mediasoup.plainRtp.listenIp.announcedIp "$IP"
@ -56,37 +51,11 @@ case "$1" in
mkdir -p /var/mediasoup
fi
# Create a symbolic link from /var/kurento -> /var/lib/kurento if needed
if [ ! -d /var/kurento ]; then
if [ -d /var/lib/kurento ]; then
ln -s /var/lib/kurento /var/kurento
fi
fi
chmod 644 $TARGET
chown bigbluebutton:bigbluebutton $TARGET
if [ ! -d /var/log/kurento-media-server ]; then
mkdir -p /var/log/kurento-media-server
fi
chown kurento:root /var/log/kurento-media-server
# Ensure a default port range is setup
if ! grep -v '^;' /etc/kurento/modules/kurento/BaseRtpEndpoint.conf.ini | grep -q minPort; then
cat >> /etc/kurento/modules/kurento/BaseRtpEndpoint.conf.ini << HERE
# Added by bbb-webrtc-sfu.postinst $(date)
minPort=24577
maxPort=32768
HERE
fi
# Check if using Kurento packages with focal
reloadService nginx
startService bbb-webrtc-sfu || echo "bbb-webrtc-sfu could not be registered or started"
startService kurento-media-server || echo "kurento-media-serve could not be registered or started"
;;

View File

@ -1,40 +0,0 @@
#!/bin/bash
#
# Restart Kurento every 24+ hours
#
if [ ! -f /var/tmp/bbb-kms-last-restart.txt ]; then
date +%Y-%m-%d\ %H:%M:%S > /var/tmp/bbb-kms-last-restart.txt
exit
fi
# Read in RESTART_OPTS
if [ -f /etc/default/bbb-restart-kms ]; then
source /etc/default/bbb-restart-kms
fi
users=$(mongo --quiet mongodb://127.0.1.1:27017/meteor --eval "db.users.count()")
if [ "$users" -eq 0 ]; then
# Make sure 24 hours have passed since last restart
# Seconds since epoch for last restart
dt1=$(cat /var/tmp/bbb-kms-last-restart.txt)
t1=`date --date="$dt1" +%s`
# Current seconds since epoch
dt2=`date +%Y-%m-%d\ %H:%M:%S`
t2=`date --date="$dt2" +%s`
# Hours since last restart
let "tDiff=$t2-$t1"
let "hDiff=$tDiff/3600"
if [ "$hDiff" -ge 24 ]; then
systemctl restart kurento-media-server bbb-webrtc-sfu $RESTART_OPTS
date +%Y-%m-%d\ %H:%M:%S > /var/tmp/bbb-kms-last-restart.txt
fi
fi

View File

@ -1,7 +1,7 @@
[Unit]
Description=BigBlueButton WebRTC SFU
Wants=redis-server.service
After=syslog.target network.target freeswitch.service bbb-webrtc-recorder.service kurento-media-server.service redis-server.service
After=syslog.target network.target freeswitch.service bbb-webrtc-recorder.service redis-server.service
PartOf=bigbluebutton.target
[Service]

View File

@ -1,5 +1,3 @@
#!/bin/bash -e
stopService bbb-webrtc-sfu || echo "bbb-webrtc-sfu could not be registered or started"
stopService kurento-media-server || echo "kurento-media-server could not be registered or started"

View File

@ -50,8 +50,6 @@ cp webrtc-sfu.nginx staging/usr/share/bigbluebutton/nginx
cp bbb-webrtc-sfu.service staging/usr/lib/systemd/system
cp bbb-webrtc-sfu.logrotate staging/etc/logrotate.d
cp bbb-restart-kms staging/etc/cron.hourly
cp kurento-media-server.service staging/usr/lib/systemd/system
rm -rf staging/usr/local/bigbluebutton/bbb-webrtc-sfu/.git
. ./opts-$DISTRO.sh

View File

@ -1,20 +0,0 @@
[Unit]
Description=Kurento Media Server daemon
After=network.target
PartOf=bigbluebutton.target
[Service]
UMask=0002
Environment=KURENTO_LOGS_PATH=/var/log/kurento-media-server
User=kurento
Group=kurento
LimitNOFILE=1000000
ExecStartPre=-/bin/rm -f /var/kurento/.cache/gstreamer-1.5/registry.x86_64.bin
ExecStart=/usr/bin/kurento-media-server --gst-debug-level=3 --gst-debug="3,Kurento*:4,kms*:4,KurentoWebSocketTransport:5"
Type=simple
PIDFile=/var/run/kurento-media-server.pid
Restart=always
[Install]
WantedBy=multi-user.target bigbluebutton.target

View File

@ -1,3 +0,0 @@
. ./opts-global.sh
OPTS="$OPTS -t deb -d git-core,nginx,kurento-media-server,openh264-gst-plugins-bad-1.5,bbb-apps-akka,nodejs,npm,build-essential,xmlstarlet,bbb-webrtc-recorder"

View File

@ -0,0 +1,3 @@
. ./opts-global.sh
OPTS="$OPTS -t deb -d git-core,nginx,openh264-gst-plugins-bad-1.5,bbb-apps-akka,nodejs,npm,build-essential,xmlstarlet,bbb-webrtc-recorder"

View File

@ -42,7 +42,7 @@ else
VERSION="${VERSION_NUMBER}~${VERSION_ADDON}+${COMMIT_DATE}-git.${GIT_REV}"
fi
DISTRO=focal
DISTRO=jammy
CACHE_DIR="/root/"
mkdir -p "$CACHE_DIR"

View File

@ -176,8 +176,6 @@ redis_host = props['redis_host']
redis_port = props['redis_port']
redis_password = props['redis_password']
presentation_dir = props['raw_presentation_src']
kurento_video_dir = props['kurento_video_src']
kurento_screenshare_dir = props['kurento_screenshare_src']
mediasoup_video_dir = props['mediasoup_video_src']
mediasoup_screenshare_dir = props['mediasoup_screenshare_src']
webrtc_recorder_video_dir = props['webrtc_recorder_video_src']
@ -206,9 +204,6 @@ archive_audio(meeting_id, audio_dir, raw_archive_dir)
archive_notes(meeting_id, notes_endpoint, notes_formats, raw_archive_dir)
# Presentation files
archive_directory("#{presentation_dir}/#{meeting_id}/#{meeting_id}", "#{target_dir}/presentation")
# Kurento media
archive_directory("#{kurento_screenshare_dir}/#{meeting_id}", "#{target_dir}/deskshare")
archive_directory("#{kurento_video_dir}/#{meeting_id}", "#{target_dir}/video/#{meeting_id}")
# mediasoup media
archive_directory("#{mediasoup_screenshare_dir}/#{meeting_id}", "#{target_dir}/deskshare")
archive_directory("#{mediasoup_video_dir}/#{meeting_id}", "#{target_dir}/video/#{meeting_id}")
@ -221,9 +216,6 @@ if break_timestamp.nil?
BigBlueButton.logger.info('Deleting originals of archived media files.')
# FreeSWITCH Audio files
delete_audio(meeting_id, audio_dir)
# Kurento media
FileUtils.rm_rf("#{kurento_screenshare_dir}/#{meeting_id}")
FileUtils.rm_rf("#{kurento_video_dir}/#{meeting_id}")
# mediasoup media
FileUtils.rm_rf("#{mediasoup_screenshare_dir}/#{meeting_id}")
FileUtils.rm_rf("#{mediasoup_video_dir}/#{meeting_id}")

View File

@ -1,7 +1,5 @@
bbb_version: '2.6.1'
raw_audio_src: /var/freeswitch/meetings
kurento_video_src: /var/kurento/recordings
kurento_screenshare_src: /var/kurento/screenshare
mediasoup_video_src: /var/mediasoup/recordings
mediasoup_screenshare_src: /var/mediasoup/screenshare
webrtc_recorder_video_src: /var/lib/bbb-webrtc-recorder/recordings