fix: go2rtc config path absolute, gitignore generated file

This commit is contained in:
Claus Lohmar 2026-08-06 13:16:02 +01:00
parent 872c8c2273
commit c4c9049e24
3 changed files with 4 additions and 8 deletions

1
.gitignore vendored
View file

@ -1 +1,2 @@
nextnvr
go2rtc.yaml

View file

@ -46,7 +46,7 @@ func (g *Go2RTCManager) Start(cameras []CameraConfig) error {
}
// Launch go2rtc as a child process.
g.cmd = exec.Command(g.config.Binary, "-config", "go2rtc.yaml")
g.cmd = exec.Command(g.config.Binary, "-config", "/opt/nextnvr/go2rtc.yaml")
g.cmd.Stdout = os.Stdout
g.cmd.Stderr = os.Stderr
@ -100,7 +100,7 @@ func (g *Go2RTCManager) monitor() {
g.mu.Lock()
if g.running {
g.cmd = exec.Command(g.config.Binary, "-config", "go2rtc.yaml")
g.cmd = exec.Command(g.config.Binary, "-config", "/opt/nextnvr/go2rtc.yaml")
g.cmd.Stdout = os.Stdout
g.cmd.Stderr = os.Stderr
if startErr := g.cmd.Start(); startErr != nil {
@ -144,5 +144,5 @@ func (g *Go2RTCManager) writeConfig(cameras []CameraConfig) error {
sb.WriteString(fmt.Sprintf(" %s_main: %s\n", cam.ID, mainURL))
}
return os.WriteFile("go2rtc.yaml", []byte(sb.String()), 0600)
return os.WriteFile("/opt/nextnvr/go2rtc.yaml", []byte(sb.String()), 0600)
}

View file

@ -1,5 +0,0 @@
# go2rtc configuration — generated by NextNVR
api:
listen: ":1984"
streams: