[mirotalk] - add ROOM_MAX_PARTICIPANTS, update dep

This commit is contained in:
Miroslav Pejic
2025-07-22 19:19:10 +02:00
parent f6046f1529
commit 8bed5708ac
6 changed files with 86 additions and 52 deletions
+3
View File
@@ -52,6 +52,9 @@ OIDC_AUTH_REQUIRED=false # set to true if authentication is required for all rou
OIDC_AUTH_LOGOUT=true # controls automatic logout from both your app and Auth0 when set to true
SESSION_SECRET='mirotalk-p2p-oidc-secret'
# Maximum participants per room
ROOM_MAX_PARTICIPANTS=8
# Host protection
# HOST_PROTECTED:
# - When set to true, it requires a valid username and password from the HOST_USERS list to initialize or join a room.
+3 -1
View File
@@ -45,7 +45,7 @@ dependencies: {
* @license For commercial use or closed source, contact us at license.mirotalk@gmail.com or purchase directly from CodeCanyon
* @license CodeCanyon: https://codecanyon.net/item/mirotalk-p2p-webrtc-realtime-video-conferences/38376661
* @author Miroslav Pejic - miroslav.pejic.85@gmail.com
* @version 1.5.42
* @version 1.5.43
*
*/
@@ -152,6 +152,7 @@ const hostCfg = {
user_auth: userAuth,
users: hostUsers,
authenticated: !hostProtected,
maxRoomParticipants: parseInt(process.env.ROOM_MAX_PARTICIPANTS) || 8,
};
// JWT config
@@ -1383,6 +1384,7 @@ io.sockets.on('connect', async (socket) => {
active: redirectEnabled,
url: redirectURL,
},
maxRoomParticipants: hostCfg.maxRoomParticipants,
//...
});
+56 -33
View File
@@ -1,12 +1,12 @@
{
"name": "mirotalk",
"version": "1.5.42",
"version": "1.5.43",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "mirotalk",
"version": "1.5.42",
"version": "1.5.43",
"license": "AGPL-3.0",
"dependencies": {
"@mattermost/client": "10.8.0",
@@ -21,7 +21,7 @@
"dompurify": "^3.2.6",
"dotenv": "^17.2.0",
"express": "^5.1.0",
"express-openid-connect": "^2.18.1",
"express-openid-connect": "^2.19.2",
"he": "^1.2.0",
"helmet": "^8.1.0",
"httpolyglot": "0.1.2",
@@ -29,7 +29,7 @@
"jsdom": "^26.1.0",
"jsonwebtoken": "^9.0.2",
"nodemailer": "^7.0.5",
"openai": "^5.10.1",
"openai": "^5.10.2",
"qs": "^6.14.0",
"socket.io": "^4.8.1",
"swagger-ui-express": "^5.0.1",
@@ -1932,9 +1932,9 @@
}
},
"node_modules/cookie": {
"version": "0.7.1",
"resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.1.tgz",
"integrity": "sha512-6DnInpx7SJ2AK3+CTUE/ZM0vWTUboZCegxhC2xiIydHR9jNuTAASBrfEpHhiGOZw/nX51bHt6YQl8jsGo4y/0w==",
"version": "0.7.2",
"resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.2.tgz",
"integrity": "sha512-yki5XnKuf750l50uGTllt6kKILY4nQ1eNIQatoXEByZ5dWgnKqbnqmTrBE5B4N7lrMJKQ2ytWMiTO2o0v6Ew/w==",
"license": "MIT",
"engines": {
"node": ">= 0.6"
@@ -2222,15 +2222,6 @@
"node": ">=10.0.0"
}
},
"node_modules/engine.io/node_modules/cookie": {
"version": "0.7.2",
"resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.2.tgz",
"integrity": "sha512-yki5XnKuf750l50uGTllt6kKILY4nQ1eNIQatoXEByZ5dWgnKqbnqmTrBE5B4N7lrMJKQ2ytWMiTO2o0v6Ew/w==",
"license": "MIT",
"engines": {
"node": ">= 0.6"
}
},
"node_modules/engine.io/node_modules/debug": {
"version": "4.3.7",
"resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz",
@@ -2317,6 +2308,21 @@
"node": ">= 0.4"
}
},
"node_modules/es-set-tostringtag": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.1.0.tgz",
"integrity": "sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA==",
"license": "MIT",
"dependencies": {
"es-errors": "^1.3.0",
"get-intrinsic": "^1.2.6",
"has-tostringtag": "^1.0.2",
"hasown": "^2.0.2"
},
"engines": {
"node": ">= 0.4"
}
},
"node_modules/escalade": {
"version": "3.2.0",
"resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz",
@@ -2398,20 +2404,20 @@
}
},
"node_modules/express-openid-connect": {
"version": "2.18.1",
"resolved": "https://registry.npmjs.org/express-openid-connect/-/express-openid-connect-2.18.1.tgz",
"integrity": "sha512-trHqgwXxWF0n/XrDsRzsvQtnBNbU03iCNXbKR/sHwBqXlvCgup341bW7B8t6nr3L/CMoDpK+9gsTnx3qLCqdjQ==",
"version": "2.19.2",
"resolved": "https://registry.npmjs.org/express-openid-connect/-/express-openid-connect-2.19.2.tgz",
"integrity": "sha512-hRRRBS+mH9hrhVcbg7+APe+dIsYB4BDLILv7QfTmM1jSDyaU9NYpTxqWourAnlud/E4Gf4Q0qCVmSJguh4BTaA==",
"license": "MIT",
"dependencies": {
"base64url": "^3.0.1",
"clone": "^2.1.2",
"cookie": "^0.7.1",
"debug": "^4.3.4",
"futoin-hkdf": "^1.5.1",
"cookie": "^0.7.2",
"debug": "^4.4.1",
"futoin-hkdf": "^1.5.3",
"http-errors": "^1.8.1",
"joi": "^17.7.0",
"joi": "^17.13.3",
"jose": "^2.0.7",
"on-headers": "^1.0.2",
"on-headers": "^1.1.0",
"openid-client": "^4.9.1",
"url-join": "^4.0.1"
},
@@ -2423,9 +2429,9 @@
}
},
"node_modules/express-openid-connect/node_modules/debug": {
"version": "4.4.0",
"resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz",
"integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==",
"version": "4.4.1",
"resolved": "https://registry.npmjs.org/debug/-/debug-4.4.1.tgz",
"integrity": "sha512-KcKCqiftBJcZr++7ykoDIEwSa3XWowTfNPo92BYxjXiyYEVrUQh2aLyhxBCwww+heortUFxEJYcRzosstTEBYQ==",
"license": "MIT",
"dependencies": {
"ms": "^2.1.3"
@@ -2752,13 +2758,15 @@
}
},
"node_modules/form-data": {
"version": "4.0.1",
"resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.1.tgz",
"integrity": "sha512-tzN8e4TX8+kkxGPK8D5u0FNmjPUjw3lwC9lSLxxoB/+GtsJG91CO8bSWy73APlgAZzZbXEYZJuxjkHH2w+Ezhw==",
"version": "4.0.4",
"resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.4.tgz",
"integrity": "sha512-KrGhL9Q4zjj0kiUt5OO4Mr/A/jlI2jDYs5eHBpYHPcBEVSiipAvn2Ko2HnPe20rmcuuvMHNdZFp+4IlGTMF0Ow==",
"license": "MIT",
"dependencies": {
"asynckit": "^0.4.0",
"combined-stream": "^1.0.8",
"es-set-tostringtag": "^2.1.0",
"hasown": "^2.0.2",
"mime-types": "^2.1.12"
},
"engines": {
@@ -2990,6 +2998,21 @@
"url": "https://github.com/sponsors/ljharb"
}
},
"node_modules/has-tostringtag": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz",
"integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==",
"license": "MIT",
"dependencies": {
"has-symbols": "^1.0.3"
},
"engines": {
"node": ">= 0.4"
},
"funding": {
"url": "https://github.com/sponsors/ljharb"
}
},
"node_modules/hasown": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz",
@@ -4039,9 +4062,9 @@
}
},
"node_modules/openai": {
"version": "5.10.1",
"resolved": "https://registry.npmjs.org/openai/-/openai-5.10.1.tgz",
"integrity": "sha512-fq6xVfv1/gpLbsj8fArEt3b6B9jBxdhAK+VJ+bDvbUvNd+KTLlA3bnDeYZaBsGH9LUhJ1M1yXfp9sEyBLMx6eA==",
"version": "5.10.2",
"resolved": "https://registry.npmjs.org/openai/-/openai-5.10.2.tgz",
"integrity": "sha512-n+vi74LzHtvlKcDPn9aApgELGiu5CwhaLG40zxLTlFQdoSJCLACORIPC2uVQ3JEYAbqapM+XyRKFy2Thej7bIw==",
"license": "Apache-2.0",
"bin": {
"openai": "bin/cli"
+3 -3
View File
@@ -1,6 +1,6 @@
{
"name": "mirotalk",
"version": "1.5.42",
"version": "1.5.43",
"description": "A free WebRTC browser-based video call",
"main": "server.js",
"scripts": {
@@ -53,7 +53,7 @@
"dompurify": "^3.2.6",
"dotenv": "^17.2.0",
"express": "^5.1.0",
"express-openid-connect": "^2.18.1",
"express-openid-connect": "^2.19.2",
"he": "^1.2.0",
"helmet": "^8.1.0",
"httpolyglot": "0.1.2",
@@ -61,7 +61,7 @@
"jsonwebtoken": "^9.0.2",
"js-yaml": "^4.1.0",
"nodemailer": "^7.0.5",
"openai": "^5.10.1",
"openai": "^5.10.2",
"qs": "^6.14.0",
"socket.io": "^4.8.1",
"swagger-ui-express": "^5.0.1",
+1 -1
View File
@@ -73,7 +73,7 @@ let brand = {
},
about: {
imageUrl: '../images/mirotalk-logo.gif',
title: 'WebRTC P2P v1.5.42',
title: 'WebRTC P2P v1.5.43',
html: `
<button
id="support-button"
+20 -14
View File
@@ -15,7 +15,7 @@
* @license For commercial use or closed source, contact us at license.mirotalk@gmail.com or purchase directly from CodeCanyon
* @license CodeCanyon: https://codecanyon.net/item/mirotalk-p2p-webrtc-realtime-video-conferences/38376661
* @author Miroslav Pejic - miroslav.pejic.85@gmail.com
* @version 1.5.42
* @version 1.5.43
*
*/
@@ -449,11 +449,6 @@ const sinkId = 'sinkId' in HTMLMediaElement.prototype;
//....
const userLimits = {
active: false, // Limit users per room
count: 2, // Limit 2 users per room if userLimits.active true
};
const isRulesActive = true; // Presenter can do anything, guest is slightly moderate, if false no Rules for the room.
const forceCamMaxResolutionAndFps = false; // This force the webCam to max resolution as default, up to 8k and 60fps (very high bandwidth are required) if false, you can set it from settings
const useAvatarSvg = true; // if false the cam-Off avatar = images.avatar
@@ -515,6 +510,9 @@ const pickr = Pickr.create({
lS.setSettings(lsSettings);
});
// Room
let thisMaxRoomParticipants = 8;
// misc
let swBg = 'rgba(0, 0, 0, 0.7)'; // swAlert background color
let callElapsedTime; // count time
@@ -1265,7 +1263,7 @@ async function handleConnect() {
function handleServerInfo(config) {
console.log('13. Server info', config);
const { peers_count, host_protected, user_auth, is_presenter, survey, redirect, rec_prioritize_h264 } = config;
const { peers_count, host_protected, user_auth, is_presenter, survey, redirect, maxRoomParticipants } = config;
isHostProtected = host_protected;
isPeerAuthEnabled = user_auth;
@@ -1275,10 +1273,12 @@ function handleServerInfo(config) {
surveyURL = survey.url;
// Get redirect settings from server
((redirectActive = redirect.active), (redirectURL = redirect.url));
redirectActive = redirect.active;
redirectURL = redirect.url;
// Limit room to n peers
if (userLimits.active && peers_count > userLimits.count) {
if (maxRoomParticipants) thisMaxRoomParticipants = maxRoomParticipants;
if (peers_count > thisMaxRoomParticipants) {
return roomIsBusy();
}
@@ -1335,7 +1335,7 @@ function roomIsBusy() {
imageUrl: images.forbidden,
position: 'center',
title: 'Room is busy',
html: `The room is limited to ${userLimits.count} users. <br/> Please try again later`,
html: `The room is limited to ${thisMaxRoomParticipants} users. <br/> Please try again later`,
showDenyButton: false,
confirmButtonText: `OK`,
showClass: { popup: 'animate__animated animate__fadeInDown' },
@@ -2508,8 +2508,14 @@ function handleDisconnect(reason) {
}
}
}
peerVideoMediaElements[peerVideoId].parentNode.removeChild(peerVideoMediaElements[peerVideoId]);
peerAudioMediaElements[peerAudioId].parentNode.removeChild(peerAudioMediaElements[peerAudioId]);
if (peerVideoMediaElements[peerVideoId] && peerVideoMediaElements[peerVideoId].parentNode) {
peerVideoMediaElements[peerVideoId].parentNode.removeChild(peerVideoMediaElements[peerVideoId]);
}
if (peerAudioMediaElements[peerAudioId] && peerAudioMediaElements[peerAudioId].parentNode) {
peerAudioMediaElements[peerAudioId].parentNode.removeChild(peerAudioMediaElements[peerAudioId]);
}
peerConnections[peer_id].close();
msgerRemovePeer(peer_id);
removeVideoPinMediaContainer(peer_id);
@@ -7308,7 +7314,7 @@ function notifyRecording(fromId, from, fromAvatar, action) {
* Toggle Video and Audio tabs
* @param {boolean} disabled - If true, disable the tabs; otherwise, enable them
*/
function toggleVideoAudioTabs(disabled = false){
function toggleVideoAudioTabs(disabled = false) {
if (disabled) tabRoomBtn.click();
tabVideoBtn.disabled = disabled;
tabAudioBtn.disabled = disabled;
@@ -11230,7 +11236,7 @@ function showAbout() {
Swal.fire({
background: swBg,
position: 'center',
title: brand.about?.title && brand.about.title.trim() !== '' ? brand.about.title : 'WebRTC P2P v1.5.42',
title: brand.about?.title && brand.about.title.trim() !== '' ? brand.about.title : 'WebRTC P2P v1.5.43',
imageUrl: brand.about?.imageUrl && brand.about.imageUrl.trim() !== '' ? brand.about.imageUrl : images.about,
customClass: { image: 'img-about' },
html: `