diff --git a/app/src/Server.js b/app/src/Server.js index 3bdd38d9..d8f47e27 100644 --- a/app/src/Server.js +++ b/app/src/Server.js @@ -40,7 +40,7 @@ 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.3.56 + * @version 1.3.57 * */ diff --git a/app/src/config.template.js b/app/src/config.template.js index 28be4b9f..d52c1088 100644 --- a/app/src/config.template.js +++ b/app/src/config.template.js @@ -152,7 +152,7 @@ module.exports = { stats: { /* Umami: https://github.com/umami-software/umami - We use Umami to track aggregated usage statistics in order to improve our service. + We use our Self-hosted Umami to track aggregated usage statistics in order to improve our service. */ enabled: true, src: 'https://stats.mirotalk.com/script.js', diff --git a/package.json b/package.json index d9f044dd..f4824673 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "mirotalksfu", - "version": "1.3.56", + "version": "1.3.57", "description": "WebRTC SFU browser-based video calls", "main": "Server.js", "scripts": { @@ -38,9 +38,9 @@ "author": "Miroslav Pejic", "license": "AGPL-3.0", "dependencies": { - "@sentry/integrations": "7.94.1", - "@sentry/node": "7.94.1", - "axios": "^1.6.5", + "@sentry/integrations": "7.98.0", + "@sentry/node": "7.98.0", + "axios": "^1.6.7", "body-parser": "1.20.2", "colors": "1.4.0", "compression": "1.7.4", @@ -51,7 +51,7 @@ "mediasoup": "3.13.16", "mediasoup-client": "3.7.2", "ngrok": "^4.3.3", - "openai": "^4.24.7", + "openai": "^4.26.0", "qs": "6.11.2", "socket.io": "4.7.4", "swagger-ui-express": "5.0.0", diff --git a/public/js/Room.js b/public/js/Room.js index 97b28929..5527e6a2 100644 --- a/public/js/Room.js +++ b/public/js/Room.js @@ -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.3.56 + * @version 1.3.57 * */ diff --git a/public/js/RoomClient.js b/public/js/RoomClient.js index 1afc40ce..331988a0 100644 --- a/public/js/RoomClient.js +++ b/public/js/RoomClient.js @@ -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.3.56 + * @version 1.3.57 * */ diff --git a/public/js/Umami.js b/public/js/Umami.js index ceec588b..71c7b8ba 100644 --- a/public/js/Umami.js +++ b/public/js/Umami.js @@ -1,26 +1,39 @@ 'use strict'; -// const url = 'https://localhost:3010/stats'; -const url = 'https://sfu.mirotalk.com/stats'; +console.log('STATS', window.location); -fetch(url) - .then((response) => { - if (!response.ok) { - throw new Error('Network response was not ok'); - } - return response.json(); - }) - .then((data) => { - // console.log('STATS', data); - const { enabled, src, id } = data; - if (enabled) { - const script = document.createElement('script'); - script.setAttribute('async', ''); - script.setAttribute('src', src); - script.setAttribute('data-website-id', id); - document.head.appendChild(script); - } - }) - .catch((error) => { - console.error('Stats fetch error:', error); - }); +const statsDataKey = 'statsData'; +const statsData = window.sessionStorage.getItem(statsDataKey); + +const apiUrl = window.location.origin + '/stats'; + +if (statsData) { + setStats(JSON.parse(statsData)); +} else { + fetch(apiUrl) + .then((response) => { + if (!response.ok) { + throw new Error('Network response was not ok'); + } + return response.json(); + }) + .then((data) => { + setStats(data); + window.sessionStorage.setItem(statsDataKey, JSON.stringify(data)); + }) + .catch((error) => { + console.error('Stats fetch error:', error); + }); +} + +function setStats(data) { + console.log('STATS', data); + const { enabled, src, id } = data; + if (enabled) { + const script = document.createElement('script'); + script.setAttribute('async', ''); + script.setAttribute('src', src); + script.setAttribute('data-website-id', id); + document.head.appendChild(script); + } +}