mirror of
https://github.com/tsightler/ring-mqtt.git
synced 2025-09-26 21:01:12 +08:00
Fix mediamtx config with no password
This commit is contained in:
@@ -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] ')))
|
||||
})
|
||||
|
Reference in New Issue
Block a user