[mirotalk] - Fix OIDC dynamic config

This commit is contained in:
Miroslav Pejic
2025-03-06 09:14:36 +01:00
parent 565199d153
commit 938609a5fc
5 changed files with 23 additions and 15 deletions
+1
View File
@@ -43,6 +43,7 @@ IP_WHITELIST_ALLOWED='["127.0.0.1", "::1"]'
# For those seeking an open-source solution, check out: https://github.com/panva/node-oidc-provider
OIDC_ENABLED=false # true or false
OIDC_BASE_URL_DYNAMIC=false # true or false
OIDC_ISSUER_BASE_URL='https://server.example.com'
OIDC_BASE_URL='http://localhost:3000' # https://p2p.mirotalk.com
OIDC_CLIENT_ID='ClientID'
+14 -7
View File
@@ -43,7 +43,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.4.81
* @version 1.4.82
*
*/
@@ -304,6 +304,7 @@ const ipWhitelist = {
// OIDC - Open ID Connect
const OIDC = {
enabled: process.env.OIDC_ENABLED ? getEnvBoolean(process.env.OIDC_ENABLED) : false,
baseUrlDynamic: process.env.OIDC_BASE_URL_DYNAMIC ? getEnvBoolean(process.env.OIDC_BASE_URL_DYNAMIC) : false,
config: {
issuerBaseURL: process.env.OIDC_ISSUER_BASE_URL,
clientID: process.env.OIDC_CLIENT_ID,
@@ -465,11 +466,17 @@ app.use((err, req, res, next) => {
if (OIDC.enabled) {
const getDynamicConfig = (host, protocol) => {
const baseURL = `${protocol}://${host}`;
log.debug('OIDC baseURL', baseURL);
return {
...OIDC.config,
baseURL,
};
const config = OIDC.baseUrlDynamic
? {
...OIDC.config,
baseURL,
}
: OIDC.config;
log.debug('OIDC baseURL', config.baseURL);
return config;
};
// Apply the authentication middleware using dynamic baseURL configuration
@@ -1877,7 +1884,7 @@ function isValidFileName(fileName) {
function isValidHttpURL(input) {
try {
const url = new URL(input);
return url.protocol === "http:" || url.protocol === "https:";
return url.protocol === 'http:' || url.protocol === 'https:';
} catch (_) {
return false;
}
+5 -5
View File
@@ -1,6 +1,6 @@
{
"name": "mirotalk",
"version": "1.4.81",
"version": "1.4.82",
"description": "A free WebRTC browser-based video call",
"main": "server.js",
"scripts": {
@@ -42,8 +42,8 @@
"homepage": "https://github.com/miroslavpejic85/mirotalk",
"dependencies": {
"@mattermost/client": "10.2.0",
"@sentry/node": "^9.1.0",
"axios": "^1.7.9",
"@sentry/node": "^9.4.0",
"axios": "^1.8.1",
"colors": "^1.4.0",
"compression": "^1.8.0",
"cors": "^2.8.5",
@@ -59,7 +59,7 @@
"js-yaml": "^4.1.0",
"ngrok": "^5.0.0-beta.2",
"nodemailer": "^6.10.0",
"openai": "^4.85.4",
"openai": "^4.86.2",
"qs": "^6.14.0",
"socket.io": "^4.8.1",
"swagger-ui-express": "^5.0.1",
@@ -69,7 +69,7 @@
"mocha": "^11.1.0",
"node-fetch": "^3.3.2",
"nodemon": "^3.1.9",
"prettier": "3.5.2",
"prettier": "3.5.3",
"proxyquire": "^2.1.3",
"should": "^13.2.3",
"sinon": "^19.0.2"
+1 -1
View File
@@ -73,7 +73,7 @@ let brand = {
},
about: {
imageUrl: '../images/mirotalk-logo.gif',
title: 'WebRTC P2P v1.4.81',
title: 'WebRTC P2P v1.4.82',
html: `
<button
id="support-button"
+2 -2
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.4.81
* @version 1.4.82
*
*/
@@ -11035,7 +11035,7 @@ function showAbout() {
Swal.fire({
background: swBg,
position: 'center',
title: brand.about?.title && brand.about.title.trim() !== '' ? brand.about.title : 'WebRTC P2P v1.4.81',
title: brand.about?.title && brand.about.title.trim() !== '' ? brand.about.title : 'WebRTC P2P v1.4.82',
imageUrl: brand.about?.imageUrl && brand.about.imageUrl.trim() !== '' ? brand.about.imageUrl : images.about,
customClass: { image: 'img-about' },
html: `