/
config.template.js
490 lines (484 loc) 路 18.1 KB
/
config.template.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
'use strict';
const os = require('os');
// https://api.ipify.org
function getIPv4() {
const ifaces = os.networkInterfaces();
for (const interfaceName in ifaces) {
const iface = ifaces[interfaceName];
for (const { address, family, internal } of iface) {
if (family === 'IPv4' && !internal) {
return address;
}
}
}
return '0.0.0.0'; // Default to 0.0.0.0 if no external IPv4 address found
}
const IPv4 = getIPv4();
const numWorkers = require('os').cpus().length;
module.exports = {
console: {
/*
timeZone: Time Zone corresponding to timezone identifiers from the IANA Time Zone Database es 'Europe/Rome' default UTC
*/
timeZone: 'UTC',
debug: true,
colors: true,
},
server: {
listen: {
// app listen on
ip: '0.0.0.0',
port: process.env.PORT || 3010,
},
ssl: {
// ssl/README.md
cert: '../ssl/cert.pem',
key: '../ssl/key.pem',
},
cors: {
/*
origin: Allow specified origin es ['https://example.com', 'https://subdomain.example.com', 'http://localhost:3010'] or all origins if not specified
methods: Allow only GET and POST methods
*/
origin: '*',
methods: ['GET', 'POST'],
},
recording: {
/*
The recording will be saved to the directory designated within your Server app/<dir>
Note: if you use Docker: Create the "app/rec" directory, configure it as a volume in docker-compose.yml,
ensure proper permissions, and start the Docker container.
*/
dir: 'rec',
enabled: false,
},
},
middleware: {
/*
Middleware:
- IP Whitelist: Access to the instance is restricted to only the specified IP addresses in the allowed list. This feature is disabled by default.
- ...
*/
IpWhitelist: {
enabled: false,
allowed: ['127.0.0.1', '::1'],
},
},
api: {
// Default secret key for app/api
keySecret: 'mirotalksfu_default_secret',
// Define which endpoints are allowed
allowed: {
meetings: false,
meeting: true,
join: true,
token: false,
slack: true,
//...
},
},
jwt: {
/*
JWT https://jwt.io/
Securely manages credentials for host configurations and user authentication, enhancing security and streamlining processes.
*/
key: 'mirotalksfu_jwt_secret',
exp: '1h',
},
oidc: {
/*
OIDC stands for OpenID Connect, which is an authentication protocol built on top of OAuth 2.0.
It provides a simple identity layer on the OAuth 2.0 protocol, allowing clients to verify the identity of the end-user
based on the authentication performed by an authorization server.
How to configure your own Provider:
1. Sign up for an account at https://auth0.com.
2. Navigate to https://manage.auth0.com/ to create a new application tailored to your specific requirements.
For those seeking an open-source solution, check out: https://github.com/panva/node-oidc-provider
*/
enabled: false,
config: {
issuerBaseURL: 'https://server.example.com',
baseURL: `http://localhost:${process.env.PORT ? process.env.PORT : 3010}`, // https://sfu.mirotalk.com
clientID: 'clientID',
clientSecret: 'clientSecret',
secret: 'mirotalksfu-oidc-secret',
authorizationParams: {
response_type: 'code',
scope: 'openid profile email',
},
authRequired: false, // Set to true if authentication is required for all routes
auth0Logout: true, // Set to true to enable logout with Auth0
routes: {
callback: '/auth/callback', // Indicating the endpoint where your application will handle the callback from the authentication provider after a user has been authenticated.
login: false, // Dedicated route in your application for user login.
logout: '/logout', // Indicating the endpoint where your application will handle user logout requests.
},
},
},
host: {
/*
Host Protection (default: false)
To enhance host security, enable host protection - user auth and provide valid
usernames and passwords in the users array or active users_from_db using users_api_endpoint for check.
When oidc.enabled is utilized alongside host protection, the authenticated user will be recognized as valid.
*/
protected: false,
user_auth: false,
users_from_db: false, // if true ensure that api.token is also set to true.
//users_api_endpoint: 'http://localhost:9000/api/v1/user/isAuth',
users_api_endpoint: 'https://webrtc.mirotalk.com/api/v1/user/isAuth',
users_api_secret_key: 'mirotalkweb_default_secret',
users: [
{
username: 'username',
password: 'password',
},
{
username: 'username2',
password: 'password2',
},
//...
],
},
presenters: {
list: [
/*
By default, the presenter is identified as the first participant to join the room, distinguished by their username and UUID.
Additional layers can be added to specify valid presenters and co-presenters by setting designated usernames.
*/
'Miroslav Pejic',
'miroslav.pejic.85@gmail.com',
],
join_first: true, // Set to true for traditional behavior, false to prioritize presenters
},
chatGPT: {
/*
ChatGPT
1. Goto https://platform.openai.com/
2. Create your account
3. Generate your APIKey https://platform.openai.com/account/api-keys
*/
enabled: false,
basePath: 'https://api.openai.com/v1/',
apiKey: '',
model: 'gpt-3.5-turbo',
max_tokens: 1000,
temperature: 0,
},
email: {
/*
Configure email settings for notifications or alerts
Refer to the documentation for Gmail configuration: https://support.google.com/mail/answer/185833?hl=en
*/
alert: false,
host: 'smtp.gmail.com',
port: 587,
username: 'your_username',
password: 'your_password',
sendTo: 'sfu.mirotalk@gmail.com',
},
ngrok: {
/*
Ngrok
1. Goto https://ngrok.com
2. Get started for free
3. Copy YourNgrokAuthToken: https://dashboard.ngrok.com/get-started/your-authtoken
*/
enabled: false,
authToken: '',
},
sentry: {
/*
Sentry
1. Goto https://sentry.io/
2. Create account
3. On dashboard goto Settings/Projects/YourProjectName/Client Keys (DSN)
*/
enabled: false,
DSN: '',
tracesSampleRate: 0.5,
},
slack: {
/*
Slack
1. Goto https://api.slack.com/apps/
2. Create your app
3. On Settings - Basic Information - App Credentials, chose your Signing Secret
4. Create a Slash Commands and put as Request URL: https://your.domain.name/slack
*/
enabled: false,
signingSecret: '',
},
IPLookup: {
/*
GeoJS
https://www.geojs.io/docs/v1/endpoints/geo/
*/
enabled: false,
getEndpoint(ip) {
return `https://get.geojs.io/v1/ip/geo/${ip}.json`;
},
},
survey: {
/*
QuestionPro
1. GoTo https://www.questionpro.com/
2. Create your account
3. Create your custom survey
*/
enabled: false,
url: '',
},
redirect: {
/*
Redirect URL on leave room
Upon leaving the room, users who either opt out of providing feedback or if the survey is disabled
will be redirected to a specified URL. If enabled false the default '/newroom' URL will be used.
*/
enabled: false,
url: '',
},
ui: {
/*
Customize your MiroTalk instance
*/
brand: {
app: {
name: 'MiroTalk SFU',
title: 'MiroTalk SFU<br />Free browser based Real-time video calls.<br />Simple, Secure, Fast.',
description:
'Start your next video call with a single click. No download, plug-in, or login is required. Just get straight to talking, messaging, and sharing your screen.',
},
site: {
title: 'MiroTalk SFU, Free Video Calls, Messaging and Screen Sharing',
icon: '../images/logo.svg',
appleTouchIcon: '../images/logo.svg',
},
meta: {
description:
'MiroTalk SFU powered by WebRTC and mediasoup, Real-time Simple Secure Fast video calls, messaging and screen sharing capabilities in the browser.',
keywords:
'webrtc, miro, mediasoup, mediasoup-client, self hosted, voip, sip, real-time communications, chat, messaging, meet, webrtc stun, webrtc turn, webrtc p2p, webrtc sfu, video meeting, video chat, video conference, multi video chat, multi video conference, peer to peer, p2p, sfu, rtc, alternative to, zoom, microsoft teams, google meet, jitsi, meeting',
},
og: {
type: 'app-webrtc',
siteName: 'MiroTalk SFU',
title: 'Click the link to make a call.',
description: 'MiroTalk SFU calling provides real-time video calls, messaging and screen sharing.',
image: 'https://sfu.mirotalk.com/images/mirotalksfu.png',
url: 'https://sfu.mirotalk.com',
},
html: {
features: true,
teams: true, // Please keep me always visible, thank you!
tryEasier: true,
poweredBy: true,
sponsors: true,
advertisers: true,
footer: true,
},
//...
},
/*
Toggle the visibility of specific HTML elements within the room
*/
buttons: {
main: {
shareButton: true, // presenter
hideMeButton: true,
startAudioButton: true,
startVideoButton: true,
startScreenButton: true,
swapCameraButton: true,
chatButton: true,
raiseHandButton: true,
transcriptionButton: true,
whiteboardButton: true,
emojiRoomButton: true,
settingsButton: true,
aboutButton: true, // Please keep me always visible, thank you!
exitButton: true,
},
settings: {
fileSharing: true,
lockRoomButton: true, // presenter
unlockRoomButton: true, // presenter
broadcastingButton: true, // presenter
lobbyButton: true, // presenter
sendEmailInvitation: true, // presenter
micOptionsButton: true, // presenter
tabModerator: true, // presenter
tabRecording: true,
host_only_recording: true, // presenter
pushToTalk: true,
},
producerVideo: {
videoPictureInPicture: true,
fullScreenButton: true,
snapShotButton: true,
muteAudioButton: true,
videoPrivacyButton: true,
},
consumerVideo: {
videoPictureInPicture: true,
fullScreenButton: true,
snapShotButton: true,
sendMessageButton: true,
sendFileButton: true,
sendVideoButton: true,
muteVideoButton: true,
muteAudioButton: true,
audioVolumeInput: true, // Disabled for mobile
geolocationButton: true, // Presenter
banButton: true, // presenter
ejectButton: true, // presenter
},
videoOff: {
sendMessageButton: true,
sendFileButton: true,
sendVideoButton: true,
muteAudioButton: true,
audioVolumeInput: true, // Disabled for mobile
geolocationButton: true, // Presenter
banButton: true, // presenter
ejectButton: true, // presenter
},
chat: {
chatPinButton: true,
chatMaxButton: true,
chatSaveButton: true,
chatEmojiButton: true,
chatMarkdownButton: true,
chatSpeechStartButton: true,
chatGPT: true,
},
participantsList: {
saveInfoButton: true, // presenter
sendFileAllButton: true, // presenter
ejectAllButton: true, // presenter
sendFileButton: true, // presenter & guests
geoLocationButton: true, // presenter
banButton: true, // presenter
ejectButton: true, // presenter
},
whiteboard: {
whiteboardLockButton: true, // presenter
},
//...
},
},
stats: {
/*
Umami: https://github.com/umami-software/umami
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',
id: '41d26670-f275-45bb-af82-3ce91fe57756',
},
mediasoup: {
// Worker settings
numWorkers: numWorkers,
worker: {
logLevel: 'error',
logTags: ['info', 'ice', 'dtls', 'rtp', 'srtp', 'rtcp', 'rtx', 'bwe', 'score', 'simulcast', 'svc', 'sctp'],
},
// Router settings
router: {
audioLevelObserverEnabled: true,
activeSpeakerObserverEnabled: false,
mediaCodecs: [
{
kind: 'audio',
mimeType: 'audio/opus',
clockRate: 48000,
channels: 2,
},
{
kind: 'video',
mimeType: 'video/VP8',
clockRate: 90000,
parameters: {
'x-google-start-bitrate': 1000,
},
},
{
kind: 'video',
mimeType: 'video/VP9',
clockRate: 90000,
parameters: {
'profile-id': 2,
'x-google-start-bitrate': 1000,
},
},
{
kind: 'video',
mimeType: 'video/h264',
clockRate: 90000,
parameters: {
'packetization-mode': 1,
'profile-level-id': '4d0032',
'level-asymmetry-allowed': 1,
'x-google-start-bitrate': 1000,
},
},
{
kind: 'video',
mimeType: 'video/h264',
clockRate: 90000,
parameters: {
'packetization-mode': 1,
'profile-level-id': '42e01f',
'level-asymmetry-allowed': 1,
'x-google-start-bitrate': 1000,
},
},
],
},
// WebRtcServerOptions
webRtcServerActive: false,
webRtcServerOptions: {
listenInfos: [
// { protocol: 'udp', ip: '0.0.0.0', announcedAddress: IPv4, port: 40000 },
// { protocol: 'tcp', ip: '0.0.0.0', announcedAddress: IPv4, port: 40000 },
{
protocol: 'udp',
ip: '0.0.0.0',
announcedAddress: IPv4,
portRange: { min: 40000, max: 40000 + numWorkers },
},
{
protocol: 'tcp',
ip: '0.0.0.0',
announcedAddress: IPv4,
portRange: { min: 40000, max: 40000 + numWorkers },
},
],
},
// WebRtcTransportOptions
webRtcTransport: {
listenInfos: [
// { protocol: 'udp', ip: IPv4, portRange: { min: 40000, max: 40100 } },
// { protocol: 'tcp', ip: IPv4, portRange: { min: 40000, max: 40100 } },
{
protocol: 'udp',
ip: '0.0.0.0',
announcedAddress: IPv4,
portRange: { min: 40000, max: 40100 },
},
{
protocol: 'tcp',
ip: '0.0.0.0',
announcedAddress: IPv4,
portRange: { min: 40000, max: 40100 },
},
],
initialAvailableOutgoingBitrate: 1000000,
minimumAvailableOutgoingBitrate: 600000,
maxSctpMessageSize: 262144,
maxIncomingBitrate: 1500000,
},
//announcedAddress: replace by 'public static IPV4 address' https://api.ipify.org (type string --> 'xx.xxx.xxx.xx' not xx.xxx.xxx.xx)
//announcedAddress: '' will be auto-detected on server start, for docker localPC set '127.0.0.1' otherwise the 'public static IPV4 address'
},
};