[mirotalksfu] - add global participant limit per room
هذا الالتزام موجود في:
@@ -371,8 +371,14 @@ STATS_ENABLED=true # Enable usage statistics (tru
|
|||||||
STATS_SRC=https://stats.mirotalk.com/script.js # Stats script URL
|
STATS_SRC=https://stats.mirotalk.com/script.js # Stats script URL
|
||||||
STATS_ID=41d26670-f275-45bb-af82-3ce91fe57756 # Stats tracking ID
|
STATS_ID=41d26670-f275-45bb-af82-3ce91fe57756 # Stats tracking ID
|
||||||
|
|
||||||
|
# -----------------------------------------------------
|
||||||
|
# 11. Global Moderation Configuration
|
||||||
|
# -----------------------------------------------------
|
||||||
|
|
||||||
|
ROOM_MAX_PARTICIPANTS=1000 # Maximum participants per room
|
||||||
|
|
||||||
# ----------------------------------------------------
|
# ----------------------------------------------------
|
||||||
# 11. Mediasoup Configuration
|
# 12. Mediasoup Configuration
|
||||||
# ----------------------------------------------------
|
# ----------------------------------------------------
|
||||||
|
|
||||||
MEDIASOUP_ROUTER_AUDIO_LEVEL_OBSERVER_ENABLED=true # Enable audio level observer (true|false)
|
MEDIASOUP_ROUTER_AUDIO_LEVEL_OBSERVER_ENABLED=true # Enable audio level observer (true|false)
|
||||||
|
|||||||
@@ -73,6 +73,8 @@ module.exports = class Room {
|
|||||||
|
|
||||||
// Share Media
|
// Share Media
|
||||||
this.shareMediaData = {};
|
this.shareMediaData = {};
|
||||||
|
|
||||||
|
this.maxParticipants = config?.moderation?.room?.maxParticipants || 1000;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ####################################################
|
// ####################################################
|
||||||
@@ -104,6 +106,8 @@ module.exports = class Room {
|
|||||||
shareMediaData: this.shareMediaData,
|
shareMediaData: this.shareMediaData,
|
||||||
dominantSpeaker: this.activeSpeakerObserverEnabled,
|
dominantSpeaker: this.activeSpeakerObserverEnabled,
|
||||||
peers: JSON.stringify([...this.peers]),
|
peers: JSON.stringify([...this.peers]),
|
||||||
|
maxParticipants: this.maxParticipants,
|
||||||
|
maxParticipantsReached: this.peers.size > this.maxParticipants,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1483,6 +1483,13 @@ function startServer() {
|
|||||||
redirect: config.features?.redirect?.enabled ? config.features.redirect : false,
|
redirect: config.features?.redirect?.enabled ? config.features.redirect : false,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// Global Moderation & Management
|
||||||
|
moderation: {
|
||||||
|
room: {
|
||||||
|
maxParticipants: config?.moderation?.room?.maxParticipants || 1000,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
// Version Information
|
// Version Information
|
||||||
versions: {
|
versions: {
|
||||||
app: packageJson?.version,
|
app: packageJson?.version,
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ const dotenv = require('dotenv').config();
|
|||||||
const packageJson = require('../../package.json');
|
const packageJson = require('../../package.json');
|
||||||
const os = require('os');
|
const os = require('os');
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
|
const { Moderations } = require('openai/resources/moderations.js');
|
||||||
const splitChar = ',';
|
const splitChar = ',';
|
||||||
|
|
||||||
// ==============================================
|
// ==============================================
|
||||||
@@ -1290,6 +1291,23 @@ module.exports = {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Global Moderation Settings
|
||||||
|
* ========================
|
||||||
|
* Controls room participant limits and moderation features.
|
||||||
|
* This section defines how many participants can join a room
|
||||||
|
* and whether moderation features are enabled.
|
||||||
|
* Core Settings:
|
||||||
|
* - maxParticipants: Maximum number of participants allowed in a room
|
||||||
|
* - moderation: Object containing moderation settings
|
||||||
|
* - room: Object containing room-specific moderation settings
|
||||||
|
*/
|
||||||
|
moderation: {
|
||||||
|
room: {
|
||||||
|
maxParticipants: parseInt(process.env.ROOM_MAX_PARTICIPANTS) || 1000, // Maximum participants per room
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
// ==============================================
|
// ==============================================
|
||||||
// 9. Mediasoup (WebRTC) Configuration
|
// 9. Mediasoup (WebRTC) Configuration
|
||||||
// ==============================================
|
// ==============================================
|
||||||
|
|||||||
4
package-lock.json
مولّد
4
package-lock.json
مولّد
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "mirotalksfu",
|
"name": "mirotalksfu",
|
||||||
"version": "1.9.04",
|
"version": "1.9.05",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "mirotalksfu",
|
"name": "mirotalksfu",
|
||||||
"version": "1.9.04",
|
"version": "1.9.05",
|
||||||
"license": "AGPL-3.0",
|
"license": "AGPL-3.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@aws-sdk/client-s3": "^3.848.0",
|
"@aws-sdk/client-s3": "^3.848.0",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "mirotalksfu",
|
"name": "mirotalksfu",
|
||||||
"version": "1.9.04",
|
"version": "1.9.05",
|
||||||
"description": "WebRTC SFU browser-based video calls",
|
"description": "WebRTC SFU browser-based video calls",
|
||||||
"main": "Server.js",
|
"main": "Server.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
@@ -76,7 +76,7 @@ let BRAND = {
|
|||||||
},
|
},
|
||||||
about: {
|
about: {
|
||||||
imageUrl: '../images/mirotalk-logo.gif',
|
imageUrl: '../images/mirotalk-logo.gif',
|
||||||
title: '<strong>WebRTC SFU v1.9.04</strong>',
|
title: '<strong>WebRTC SFU v1.9.05</strong>',
|
||||||
html: `
|
html: `
|
||||||
<button
|
<button
|
||||||
id="support-button"
|
id="support-button"
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ if (location.href.substr(0, 5) !== 'https') location.href = 'https' + location.h
|
|||||||
* @license For commercial or closed source, contact us at license.mirotalk@gmail.com or purchase directly via CodeCanyon
|
* @license For commercial or closed source, contact us at license.mirotalk@gmail.com or purchase directly via CodeCanyon
|
||||||
* @license CodeCanyon: https://codecanyon.net/item/mirotalk-sfu-webrtc-realtime-video-conferences/40769970
|
* @license CodeCanyon: https://codecanyon.net/item/mirotalk-sfu-webrtc-realtime-video-conferences/40769970
|
||||||
* @author Miroslav Pejic - miroslav.pejic.85@gmail.com
|
* @author Miroslav Pejic - miroslav.pejic.85@gmail.com
|
||||||
* @version 1.9.04
|
* @version 1.9.05
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -5465,7 +5465,7 @@ function showAbout() {
|
|||||||
position: 'center',
|
position: 'center',
|
||||||
imageUrl: BRAND.about?.imageUrl && BRAND.about.imageUrl.trim() !== '' ? BRAND.about.imageUrl : image.about,
|
imageUrl: BRAND.about?.imageUrl && BRAND.about.imageUrl.trim() !== '' ? BRAND.about.imageUrl : image.about,
|
||||||
customClass: { image: 'img-about' },
|
customClass: { image: 'img-about' },
|
||||||
title: BRAND.about?.title && BRAND.about.title.trim() !== '' ? BRAND.about.title : 'WebRTC SFU v1.9.04',
|
title: BRAND.about?.title && BRAND.about.title.trim() !== '' ? BRAND.about.title : 'WebRTC SFU v1.9.05',
|
||||||
html: `
|
html: `
|
||||||
<br />
|
<br />
|
||||||
<div id="about">
|
<div id="about">
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
* @license For commercial or closed source, contact us at license.mirotalk@gmail.com or purchase directly via CodeCanyon
|
* @license For commercial or closed source, contact us at license.mirotalk@gmail.com or purchase directly via CodeCanyon
|
||||||
* @license CodeCanyon: https://codecanyon.net/item/mirotalk-sfu-webrtc-realtime-video-conferences/40769970
|
* @license CodeCanyon: https://codecanyon.net/item/mirotalk-sfu-webrtc-realtime-video-conferences/40769970
|
||||||
* @author Miroslav Pejic - miroslav.pejic.85@gmail.com
|
* @author Miroslav Pejic - miroslav.pejic.85@gmail.com
|
||||||
* @version 1.9.04
|
* @version 1.9.05
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -474,6 +474,20 @@ class RoomClient {
|
|||||||
.then(async (room) => {
|
.then(async (room) => {
|
||||||
console.log('##### JOIN ROOM #####', room);
|
console.log('##### JOIN ROOM #####', room);
|
||||||
|
|
||||||
|
if (room?.maxParticipantsReached) {
|
||||||
|
console.warn('00-WARNING ----> Room is full, maximum participants reached!');
|
||||||
|
endRoomSession();
|
||||||
|
return popupHtmlMessage(
|
||||||
|
null,
|
||||||
|
image.forbidden,
|
||||||
|
'Join Room',
|
||||||
|
`Room is full, maximum participants${room?.maxParticipants ? ` (${room.maxParticipants})` : ''} reached!`,
|
||||||
|
'center',
|
||||||
|
'/',
|
||||||
|
false
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
if (room === 'invalid') {
|
if (room === 'invalid') {
|
||||||
console.warn('00-WARNING ----> Invalid Room name! Path traversal pattern detected!');
|
console.warn('00-WARNING ----> Invalid Room name! Path traversal pattern detected!');
|
||||||
return this.roomInvalid();
|
return this.roomInvalid();
|
||||||
@@ -6181,7 +6195,7 @@ class RoomClient {
|
|||||||
// RECORDING
|
// RECORDING
|
||||||
// ####################################################
|
// ####################################################
|
||||||
|
|
||||||
toggleVideoAudioTabs(disabled = false){
|
toggleVideoAudioTabs(disabled = false) {
|
||||||
if (disabled) tabRoomBtn.click();
|
if (disabled) tabRoomBtn.click();
|
||||||
tabAudioDevicesBtn.disabled = disabled;
|
tabAudioDevicesBtn.disabled = disabled;
|
||||||
tabVideoDevicesBtn.disabled = disabled;
|
tabVideoDevicesBtn.disabled = disabled;
|
||||||
|
|||||||
المرجع في مشكلة جديدة
حظر مستخدم