From 57c49a83257614194577b22e05abed7a926f179c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Verstraeten?= Date: Tue, 2 Jan 2024 22:16:41 +0100 Subject: [PATCH 1/3] Update snapcraft.yaml --- snap/snapcraft.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index 63971d3..5b13b55 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -1,6 +1,6 @@ name: kerberosio # you probably want to 'snapcraft register ' base: core22 # the base snap is the execution environment for this snap -version: '3.0.0' # just for humans, typically '1.2+git' or '1.3.2' +version: '3.1.0' # just for humans, typically '1.2+git' or '1.3.2' summary: A stand-alone open source video surveillance system # 79 char long summary description: | Kerberos Agent is an isolated and scalable video (surveillance) management @@ -19,5 +19,5 @@ apps: plugs: [ network, network-bind ] parts: agent: - source: . #https://github.com/kerberos-io/agent/releases/download/21c0e01/agent-amd64.tar - plugin: dump \ No newline at end of file + source: https://github.com/kerberos-io/agent/releases/download/f739d52/agent-$SNAP_ARCH.tar + plugin: dump From 4bc891b640151e96ba9d69a542af84e01512d085 Mon Sep 17 00:00:00 2001 From: Cedric Verstraeten Date: Wed, 3 Jan 2024 10:12:18 +0100 Subject: [PATCH 2/3] hotfix: move from warning to debug --- machinery/src/capture/Gortsplib.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/machinery/src/capture/Gortsplib.go b/machinery/src/capture/Gortsplib.go index d9db09f..55a1cfa 100644 --- a/machinery/src/capture/Gortsplib.go +++ b/machinery/src/capture/Gortsplib.go @@ -360,7 +360,7 @@ func (g *Golibrtsp) Start(ctx context.Context, queue *packets.Queue, configurati // decode timestamp pts, ok := g.Client.PacketPTS(g.AudioG711Media, rtppkt) if !ok { - log.Log.Warning("capture.golibrtsp.Start(): " + "unable to get PTS") + log.Log.Debug("capture.golibrtsp.Start(): " + "unable to get PTS") return } @@ -443,7 +443,7 @@ func (g *Golibrtsp) Start(ctx context.Context, queue *packets.Queue, configurati // decode timestamp pts, ok := g.Client.PacketPTS(g.VideoH264Media, rtppkt) if !ok { - log.Log.Warning("capture.golibrtsp.Start(): " + "unable to get PTS") + log.Log.Debug("capture.golibrtsp.Start(): " + "unable to get PTS") return } @@ -554,7 +554,7 @@ func (g *Golibrtsp) Start(ctx context.Context, queue *packets.Queue, configurati // decode timestamp pts, ok := g.Client.PacketPTS(g.VideoH265Media, rtppkt) if !ok { - log.Log.Warning("capture.golibrtsp.Start(): " + "unable to get PTS") + log.Log.Debug("capture.golibrtsp.Start(): " + "unable to get PTS") return } From 9d990650f370c4153f9adf39f5d5d114a435f895 Mon Sep 17 00:00:00 2001 From: Cedric Verstraeten Date: Wed, 3 Jan 2024 10:19:04 +0100 Subject: [PATCH 3/3] hotfix: onvif endpoint changed --- machinery/docs/docs.go | 68 ++++++++++++++-------------- machinery/docs/swagger.json | 68 ++++++++++++++-------------- machinery/docs/swagger.yaml | 42 ++++++++--------- machinery/src/onvif/main.go | 2 +- machinery/src/routers/http/routes.go | 8 +--- 5 files changed, 92 insertions(+), 96 deletions(-) diff --git a/machinery/docs/docs.go b/machinery/docs/docs.go index e1d6ff1..422b332 100644 --- a/machinery/docs/docs.go +++ b/machinery/docs/docs.go @@ -279,6 +279,40 @@ const docTemplate = `{ } } }, + "/api/camera/onvif/verify": { + "post": { + "security": [ + { + "Bearer": [] + } + ], + "description": "Will verify the ONVIF connectivity.", + "tags": [ + "onvif" + ], + "summary": "Will verify the ONVIF connectivity.", + "operationId": "verify-onvif", + "parameters": [ + { + "description": "OnvifCredentials", + "name": "config", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/models.OnvifCredentials" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/models.APIResponse" + } + } + } + } + }, "/api/camera/onvif/zoom": { "post": { "description": "Zooming in or out the camera.", @@ -590,40 +624,6 @@ const docTemplate = `{ } } }, - "/api/onvif/verify": { - "post": { - "security": [ - { - "Bearer": [] - } - ], - "description": "Will verify the ONVIF connectivity.", - "tags": [ - "onvif" - ], - "summary": "Will verify the ONVIF connectivity.", - "operationId": "verify-onvif", - "parameters": [ - { - "description": "OnvifCredentials", - "name": "config", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/models.OnvifCredentials" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/models.APIResponse" - } - } - } - } - }, "/api/persistence/verify": { "post": { "security": [ diff --git a/machinery/docs/swagger.json b/machinery/docs/swagger.json index a4e7d7f..deec611 100644 --- a/machinery/docs/swagger.json +++ b/machinery/docs/swagger.json @@ -271,6 +271,40 @@ } } }, + "/api/camera/onvif/verify": { + "post": { + "security": [ + { + "Bearer": [] + } + ], + "description": "Will verify the ONVIF connectivity.", + "tags": [ + "onvif" + ], + "summary": "Will verify the ONVIF connectivity.", + "operationId": "verify-onvif", + "parameters": [ + { + "description": "OnvifCredentials", + "name": "config", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/models.OnvifCredentials" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/models.APIResponse" + } + } + } + } + }, "/api/camera/onvif/zoom": { "post": { "description": "Zooming in or out the camera.", @@ -582,40 +616,6 @@ } } }, - "/api/onvif/verify": { - "post": { - "security": [ - { - "Bearer": [] - } - ], - "description": "Will verify the ONVIF connectivity.", - "tags": [ - "onvif" - ], - "summary": "Will verify the ONVIF connectivity.", - "operationId": "verify-onvif", - "parameters": [ - { - "description": "OnvifCredentials", - "name": "config", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/models.OnvifCredentials" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/models.APIResponse" - } - } - } - } - }, "/api/persistence/verify": { "post": { "security": [ diff --git a/machinery/docs/swagger.yaml b/machinery/docs/swagger.yaml index 6b5fa6b..11f1c43 100644 --- a/machinery/docs/swagger.yaml +++ b/machinery/docs/swagger.yaml @@ -494,6 +494,27 @@ paths: summary: Will return the ONVIF presets for the specific camera. tags: - onvif + /api/camera/onvif/verify: + post: + description: Will verify the ONVIF connectivity. + operationId: verify-onvif + parameters: + - description: OnvifCredentials + in: body + name: config + required: true + schema: + $ref: '#/definitions/models.OnvifCredentials' + responses: + "200": + description: OK + schema: + $ref: '#/definitions/models.APIResponse' + security: + - Bearer: [] + summary: Will verify the ONVIF connectivity. + tags: + - onvif /api/camera/onvif/zoom: post: description: Zooming in or out the camera. @@ -700,27 +721,6 @@ paths: summary: Get Authorization token. tags: - authentication - /api/onvif/verify: - post: - description: Will verify the ONVIF connectivity. - operationId: verify-onvif - parameters: - - description: OnvifCredentials - in: body - name: config - required: true - schema: - $ref: '#/definitions/models.OnvifCredentials' - responses: - "200": - description: OK - schema: - $ref: '#/definitions/models.APIResponse' - security: - - Bearer: [] - summary: Will verify the ONVIF connectivity. - tags: - - onvif /api/persistence/verify: post: description: Will verify the persistence. diff --git a/machinery/src/onvif/main.go b/machinery/src/onvif/main.go index ac7c945..19d4554 100644 --- a/machinery/src/onvif/main.go +++ b/machinery/src/onvif/main.go @@ -893,7 +893,7 @@ func GetPTZFunctionsFromDevice(configurations ptz.GetConfigurationsResponse) ([] } // VerifyOnvifConnection godoc -// @Router /api/onvif/verify [post] +// @Router /api/camera/onvif/verify [post] // @ID verify-onvif // @Security Bearer // @securityDefinitions.apikey Bearer diff --git a/machinery/src/routers/http/routes.go b/machinery/src/routers/http/routes.go index 176cdd8..e3cd587 100644 --- a/machinery/src/routers/http/routes.go +++ b/machinery/src/routers/http/routes.go @@ -54,11 +54,6 @@ func AddRoutes(r *gin.Engine, authMiddleware *jwt.GinJWTMiddleware, configDirect components.UpdateConfig(c, configDirectory, configuration, communication) }) - // Will verify the current onvif settings. - api.POST("/onvif/verify", func(c *gin.Context) { - onvif.VerifyOnvifConnection(c) - }) - // Will verify the current hub settings. api.POST("/hub/verify", func(c *gin.Context) { cloud.VerifyHub(c) @@ -94,7 +89,8 @@ func AddRoutes(r *gin.Engine, authMiddleware *jwt.GinJWTMiddleware, configDirect }) // Onvif specific methods. Doesn't require any authorization. - + // Will verify the current onvif settings. + api.POST("/camera/onvif/verify", onvif.VerifyOnvifConnection) api.POST("/camera/onvif/login", LoginToOnvif) api.POST("/camera/onvif/capabilities", GetOnvifCapabilities) api.POST("/camera/onvif/presets", GetOnvifPresets)