[mirotalksfu] - add env BRAND_HTML_INJECTION
هذا الالتزام موجود في:
@@ -220,6 +220,9 @@ AWS_REGION= # AWS region (e.g., us-east-2,
|
||||
# 8. UI Customization
|
||||
# ----------------------------------------------------
|
||||
|
||||
# Branding injection
|
||||
BRAND_HTML_INJECTION=true # Enable HTML injection for branding (true|false)
|
||||
|
||||
# App
|
||||
UI_LANGUAGE=en # Interface language (en, es, fr, etc.)
|
||||
APP_NAME=MiroTalk SFU # Application name
|
||||
|
||||
@@ -72,7 +72,10 @@ class HtmlInjector {
|
||||
|
||||
// Function to inject dynamic data (e.g., OG, TITLE, etc.) into a given file
|
||||
injectHtml(filePath, res) {
|
||||
// return res.send(this.cache[filePath]);
|
||||
// Check if HTML injection is enabled in the config
|
||||
if (this.config?.htmlInjection) {
|
||||
return res.send(this.cache[filePath]);
|
||||
}
|
||||
|
||||
if (!this.cache[filePath]) {
|
||||
log.error(`File not cached: ${filePath}`);
|
||||
|
||||
@@ -64,7 +64,7 @@ dev dependencies: {
|
||||
* @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
|
||||
* @author Miroslav Pejic - miroslav.pejic.85@gmail.com
|
||||
* @version 1.9.13
|
||||
* @version 1.9.14
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -107,6 +107,9 @@ const Mattermost = require('./Mattermost');
|
||||
const restrictAccessByIP = require('./middleware/IpWhitelist');
|
||||
const packageJson = require('../../package.json');
|
||||
|
||||
// Branding configuration
|
||||
const brandHtmlInjection = config?.ui?.brand?.htmlInjection ?? true;
|
||||
|
||||
// Incoming Stream to RTPM
|
||||
const { v4: uuidv4 } = require('uuid');
|
||||
const crypto = require('crypto-js');
|
||||
@@ -577,7 +580,7 @@ function startServer() {
|
||||
|
||||
// Brand configuration
|
||||
app.get('/brand', (req, res) => {
|
||||
res.status(200).json({ message: config?.ui?.brand || false });
|
||||
res.status(200).json({ message: brandHtmlInjection ? config?.ui?.brand : false });
|
||||
});
|
||||
|
||||
// main page
|
||||
|
||||
@@ -971,7 +971,13 @@ module.exports = {
|
||||
* Application Branding
|
||||
* --------------------
|
||||
* Core application identity and user interface text elements.
|
||||
*
|
||||
* Note:
|
||||
* Set BRAND_HTML_INJECTION to 'false' to disable HTML injection.
|
||||
* This allows for static branding in the public/views folder, without dynamic content injection.
|
||||
*/
|
||||
htmlInjection: process.env.BRAND_HTML_INJECTION !== 'false',
|
||||
|
||||
app: {
|
||||
language: process.env.UI_LANGUAGE || 'en',
|
||||
name: process.env.APP_NAME || 'MiroTalk SFU',
|
||||
|
||||
4
package-lock.json
مولّد
4
package-lock.json
مولّد
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "mirotalksfu",
|
||||
"version": "1.9.13",
|
||||
"version": "1.9.14",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "mirotalksfu",
|
||||
"version": "1.9.13",
|
||||
"version": "1.9.14",
|
||||
"license": "AGPL-3.0",
|
||||
"dependencies": {
|
||||
"@aws-sdk/client-s3": "^3.850.0",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "mirotalksfu",
|
||||
"version": "1.9.13",
|
||||
"version": "1.9.14",
|
||||
"description": "WebRTC SFU browser-based video calls",
|
||||
"main": "Server.js",
|
||||
"scripts": {
|
||||
|
||||
@@ -76,7 +76,7 @@ let BRAND = {
|
||||
},
|
||||
about: {
|
||||
imageUrl: '../images/mirotalk-logo.gif',
|
||||
title: '<strong>WebRTC SFU v1.9.13</strong>',
|
||||
title: '<strong>WebRTC SFU v1.9.14</strong>',
|
||||
html: `
|
||||
<button
|
||||
id="support-button"
|
||||
@@ -142,6 +142,8 @@ async function getBrand() {
|
||||
clientBrand: BRAND,
|
||||
});
|
||||
window.sessionStorage.setItem(brandDataKey, JSON.stringify(serverBrand));
|
||||
} else {
|
||||
console.warn('FETCH BRAND SETTINGS - DISABLED');
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('FETCH GET BRAND ERROR', error.message);
|
||||
|
||||
@@ -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 CodeCanyon: https://codecanyon.net/item/mirotalk-sfu-webrtc-realtime-video-conferences/40769970
|
||||
* @author Miroslav Pejic - miroslav.pejic.85@gmail.com
|
||||
* @version 1.9.13
|
||||
* @version 1.9.14
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -5521,7 +5521,7 @@ function showAbout() {
|
||||
position: 'center',
|
||||
imageUrl: BRAND.about?.imageUrl && BRAND.about.imageUrl.trim() !== '' ? BRAND.about.imageUrl : image.about,
|
||||
customClass: { image: 'img-about' },
|
||||
title: BRAND.about?.title && BRAND.about.title.trim() !== '' ? BRAND.about.title : 'WebRTC SFU v1.9.13',
|
||||
title: BRAND.about?.title && BRAND.about.title.trim() !== '' ? BRAND.about.title : 'WebRTC SFU v1.9.14',
|
||||
html: `
|
||||
<br />
|
||||
<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 CodeCanyon: https://codecanyon.net/item/mirotalk-sfu-webrtc-realtime-video-conferences/40769970
|
||||
* @author Miroslav Pejic - miroslav.pejic.85@gmail.com
|
||||
* @version 1.9.13
|
||||
* @version 1.9.14
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
المرجع في مشكلة جديدة
حظر مستخدم