Fix mediamtx config with no password

This commit is contained in:
Tom Sightler
2024-06-26 22:06:58 -04:00
parent b7118649c3
commit 018d6bde52

View File

@@ -44,12 +44,19 @@ export default new class MediaMTX {
permissions: [{ action: 'publish' }]
},
...(utils.config().livestream_user && utils.config().livestream_pass)
? [ {
user: utils.config().livestream_user,
pass: utils.config().livestream_pass,
ips: [],
permissions: [{ action: 'read' }]
}] : []
? [
{
user: utils.config().livestream_user,
pass: utils.config().livestream_pass,
ips: [],
permissions: [{ action: 'read' }]
}]
: [
{
user: 'any',
permissions: [{ action: 'read' }]
}
]
],
rtsp: true,
protocols: [ 'tcp' ],
@@ -107,12 +114,7 @@ export default new class MediaMTX {
})
const stdoutLine = readline.createInterface({ input: this.mediamtxProcess.stdout })
const rtspConnectionOpened = /\[RTSP\] \[conn (\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}).*] opened/
stdoutLine.on('line', (line) => {
const newClientConnection = line.match(rtspConnectionOpened)
if (Array.isArray(newClientConnection) && newClientConnection[1] !== '127.0.0.1') {
debug(`New RTSP client connection from IP address: ${newClientConnection[1]}`)
}
// Replace time in mediamtx log messages with tag
debug(line.replace(/\d{4}\/\d{2}\/\d{2} \d{2}:\d{2}:\d{2} /g, chalk.green('[MediaMTX] ')))
})