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

عرض الملف

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

عرض الملف

@@ -22,28 +22,41 @@ const getLocalIp = () => {
// https://api.ipify.org
module.exports = {
/*
Host Protection (default False)
In order to protect your host set
hostProtected to true and set your own Username and Password
*/
hostProtected: false,
hostUsername: 'username',
hostPassword: 'password',
// app listen on
listenIp: '0.0.0.0',
listenPort: process.env.PORT || 3010,
// ssl/README.md
sslCrt: '../ssl/cert.pem',
sslKey: '../ssl/key.pem',
/*
Ngrok
1. Goto https://ngrok.com
2. Get started for free
3. Copy YourNgrokAuthToken: https://dashboard.ngrok.com/get-started/your-authtoken
*/
ngrokAuthToken: '',
apiKeySecret: 'mirotalksfu_default_secret',
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',
},
},
host: {
/*
Host Protection (default False)
In order to protect your host set
hostProtected to true and set your own Username and Password
*/
protected: false,
username: 'username',
password: 'password',
},
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
@@ -129,7 +142,7 @@ module.exports = {
listenIps: [
{
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'
],
initialAvailableOutgoingBitrate: 1000000,