[mirotalksfu] - update config.template.js (read the note!)

هذا الالتزام موجود في:
Miroslav Pejic
2023-04-13 21:04:37 +02:00
الأصل 32974f0ebc
التزام efab894545
4 ملفات معدلة مع 49 إضافات و36 حذوفات

عرض الملف

@@ -76,8 +76,8 @@ const bodyParser = require('body-parser');
const app = express(); const app = express();
const options = { const options = {
key: fs.readFileSync(path.join(__dirname, config.sslKey), 'utf-8'), cert: fs.readFileSync(path.join(__dirname, config.server.ssl.cert), 'utf-8'),
cert: fs.readFileSync(path.join(__dirname, config.sslCrt), 'utf-8'), key: fs.readFileSync(path.join(__dirname, config.server.ssl.key), 'utf-8'),
}; };
const httpsServer = https.createServer(options, app); const httpsServer = https.createServer(options, app);
@@ -85,13 +85,13 @@ const io = require('socket.io')(httpsServer, {
maxHttpBufferSize: 1e7, maxHttpBufferSize: 1e7,
transports: ['websocket'], transports: ['websocket'],
}); });
const host = 'https://' + 'localhost' + ':' + config.listenPort; // config.listenIp const host = 'https://' + 'localhost' + ':' + config.server.listen.port; // config.server.listen.ip
const hostCfg = { const hostCfg = {
protected: config.hostProtected, protected: config.host.protected,
username: config.hostUsername, username: config.host.username,
password: config.hostPassword, password: config.host.password,
authenticated: !config.hostProtected, authenticated: !config.host.protected,
}; };
const apiBasePath = '/api/v1'; // api endpoint path const apiBasePath = '/api/v1'; // api endpoint path
@@ -386,8 +386,8 @@ function startServer() {
async function ngrokStart() { async function ngrokStart() {
try { try {
await ngrok.authtoken(config.ngrokAuthToken); await ngrok.authtoken(config.ngrok.authToken);
await ngrok.connect(config.listenPort); await ngrok.connect(config.server.listen.port);
const api = ngrok.getApi(); const api = ngrok.getApi();
// const data = JSON.parse(await api.get('api/tunnels')); // v3 // const data = JSON.parse(await api.get('api/tunnels')); // v3
const data = await api.listTunnels(); // v4 const data = await api.listTunnels(); // v4
@@ -415,7 +415,7 @@ function startServer() {
// START SERVER // START SERVER
// #################################################### // ####################################################
httpsServer.listen(config.listenPort, () => { httpsServer.listen(config.server.listen.port, () => {
log.log( log.log(
`%c `%c
@@ -430,7 +430,7 @@ function startServer() {
'font-family:monospace', 'font-family:monospace',
); );
if (config.ngrokAuthToken !== '') { if (config.ngrok.authToken !== '') {
return ngrokStart(); return ngrokStart();
} }
log.debug('Settings', { log.debug('Settings', {

عرض الملف

@@ -7,7 +7,7 @@ module.exports = class ServerApi {
constructor(host = null, authorization = null) { constructor(host = null, authorization = null) {
this._host = host; this._host = host;
this._authorization = authorization; this._authorization = authorization;
this._api_key_secret = config.apiKeySecret; this._api_key_secret = config.api.keySecret;
} }
isAuthorized() { isAuthorized() {

عرض الملف

@@ -22,28 +22,41 @@ const getLocalIp = () => {
// https://api.ipify.org // https://api.ipify.org
module.exports = { module.exports = {
/* server: {
Host Protection (default False) listen: {
In order to protect your host set // app listen on
hostProtected to true and set your own Username and Password ip: '0.0.0.0',
*/ port: process.env.PORT || 3010,
hostProtected: false, },
hostUsername: 'username', ssl: {
hostPassword: 'password', // ssl/README.md
// app listen on cert: '../ssl/cert.pem',
listenIp: '0.0.0.0', key: '../ssl/key.pem',
listenPort: process.env.PORT || 3010, },
// ssl/README.md },
sslCrt: '../ssl/cert.pem', host: {
sslKey: '../ssl/key.pem', /*
/* Host Protection (default False)
Ngrok In order to protect your host set
1. Goto https://ngrok.com hostProtected to true and set your own Username and Password
2. Get started for free */
3. Copy YourNgrokAuthToken: https://dashboard.ngrok.com/get-started/your-authtoken protected: false,
*/ username: 'username',
ngrokAuthToken: '', password: 'password',
apiKeySecret: 'mirotalksfu_default_secret', },
ngrok: {
/*
Ngrok
1. Goto https://ngrok.com
2. Get started for free
3. Copy YourNgrokAuthToken: https://dashboard.ngrok.com/get-started/your-authtoken
*/
authToken: '',
},
api: {
// app/api
keySecret: 'mirotalksfu_default_secret',
},
sentry: { sentry: {
/* /*
Sentry Sentry
@@ -129,7 +142,7 @@ module.exports = {
listenIps: [ listenIps: [
{ {
ip: '0.0.0.0', ip: '0.0.0.0',
announcedIp: getLocalIp(), // replace by public static IPV4 address https://api.ipify.org announcedIp: getLocalIp(), // replace by 'public static IPV4 address' https://api.ipify.org (type string --> 'xx.xxx.xxx.xx' not xx.xxx.xxx.xx)
}, //announcedIp: '' will be auto-detected on server start, for docker localPC set '127.0.0.1' }, //announcedIp: '' will be auto-detected on server start, for docker localPC set '127.0.0.1'
], ],
initialAvailableOutgoingBitrate: 1000000, initialAvailableOutgoingBitrate: 1000000,

عرض الملف

@@ -46,7 +46,7 @@ function resizeVideoMedia() {
let max = 0; let max = 0;
let optional = isHideMeActive ? 1 : 0; let optional = isHideMeActive ? 1 : 0;
let isOneVideoElement = videoMediaContainer.childElementCount - optional == 1 ? true : false; let isOneVideoElement = videoMediaContainer.childElementCount - optional == 1 ? true : false;
console.log('videoMediaContainer.childElementCount: ', videoMediaContainer.childElementCount - optional); //console.log('videoMediaContainer.childElementCount: ', videoMediaContainer.childElementCount - optional);
// full screen mode // full screen mode
let bigWidth = Width * 4; let bigWidth = Width * 4;