Compare commits

...

385 Commits

Author SHA1 Message Date
Cédric Verstraeten
bbbed49887 Add capabilities + fix typo 2023-04-07 08:41:47 +02:00
Cedric Verstraeten
87f681cfe1 fix show language selector 2023-03-23 18:08:20 +01:00
Cedric Verstraeten
f935360fda add delay when failed uploading, send to different mqtt topic when no hub + fixes responsiveness 2023-03-23 16:19:01 +01:00
Cedric Verstraeten
71cd315142 disable MQTT message on motion + rework cloud upload (new option RemoveAfterUpload) + sidebar 2023-03-21 13:31:04 +01:00
Cedric Verstraeten
d9694ac1a3 Merge branch 'heads/develop' 2023-03-19 21:36:31 +01:00
Cedric Verstraeten
08f589586d allow timetable and region to be set through environment variables 2023-03-19 20:39:48 +01:00
Cedric Verstraeten
192f78ae78 renabled arm-v6 2023-03-17 15:00:16 +01:00
Cedric Verstraeten
ef20d4c0b1 fix arch 2023-03-17 14:59:58 +01:00
Cedric Verstraeten
af95c0f798 add japanese, disable armv6 build 2023-03-17 12:50:50 +01:00
Cedric Verstraeten
0e32a10ff5 Merge branch 'master' into develop 2023-03-17 12:43:03 +01:00
Cédric Verstraeten
e59c2b179d Merge pull request #83 from jeffersonGlemos/master
feat add pt full translation
2023-03-17 12:42:44 +01:00
Cedric Verstraeten
e5d03f19de Merge branch 'master' into develop 2023-03-16 23:01:03 +01:00
Cedric Verstraeten
58c3e73f6f stop uploading if no credentials 2023-03-16 22:42:37 +01:00
Jefferson Gonçalves Lemos
8ca2c44422 feat add pt full translation 2023-03-10 13:14:28 -04:00
Cedric Verstraeten
a2e584a225 default values for recording, snapshots, .. 2023-03-09 10:48:26 +01:00
Cedric Verstraeten
c4cda0afb0 fix build 2023-03-07 22:47:47 +01:00
Cédric Verstraeten
adbb923e92 align variables config.json 2023-03-07 21:30:37 +00:00
Cedric Verstraeten
f444ae4ad6 add img to readme codespance make public 2023-03-07 22:25:26 +01:00
Cédric Verstraeten
9fa9538320 Update README.md 2023-03-07 22:15:40 +01:00
Cédric Verstraeten
943e81000e Update Dockerfile 2023-03-07 20:15:00 +01:00
Cédric Verstraeten
b16d028293 Merge pull request #79 from kododake/develop
Added translation for Japanese.
2023-02-27 21:10:14 +01:00
かいりゅか
07646e483d Add files via upload 2023-02-24 19:35:06 +09:00
Cedric Verstraeten
36b93a34b4 check if QUEUE is not null ;) 2023-02-23 15:16:41 +01:00
Cedric Verstraeten
b0d2409524 stop the motion and livestreaming threads first 2023-02-23 14:58:48 +01:00
Cedric Verstraeten
be7a231950 reset configuration 2023-02-23 12:20:25 +01:00
Cedric Verstraeten
31a0b9efa4 enable the rest! 2023-02-21 22:54:33 +01:00
Cedric Verstraeten
d70a3ed343 do not reload decoder if same settings 2023-02-21 22:44:56 +01:00
Cedric Verstraeten
56cebb6451 manage decoder from higher level 2023-02-21 22:12:08 +01:00
Cedric Verstraeten
99f61bc5e8 enable decoder again ;) 2023-02-21 21:45:54 +01:00
Cedric Verstraeten
a5d02e3275 disable decoder, see what it's doing from mem consumption 2023-02-21 21:31:17 +01:00
Cedric Verstraeten
354ab7db05 add garbage collection 2023-02-21 20:49:44 +01:00
Cedric Verstraeten
dc817f8c26 keep snapshot in memory (no longer store on disk) 2023-02-21 12:54:28 +01:00
Cedric Verstraeten
a90097731c fix error 2023-02-21 12:13:29 +01:00
Cedric Verstraeten
5b3bbbb37e new approach to store snapshots! 2023-02-21 12:12:30 +01:00
Cedric Verstraeten
4a4aabd71c upgrade to joy v1.0.54 2023-02-19 22:04:39 +01:00
Cedric Verstraeten
b058c1e742 set pointers to nil 2023-02-18 22:14:33 +01:00
Cedric Verstraeten
7671b1c2c3 unsubscribe from mqtt subscriptions 2023-02-18 22:12:44 +01:00
Cedric Verstraeten
4cc8135e1a move StoreSnapshot to separate method 2023-02-17 20:03:15 +01:00
Cedric Verstraeten
3cb38099ea add process memory + boot time 2023-02-15 13:01:16 +01:00
Cedric Verstraeten
deb0308dc4 rename attributes 2023-02-15 07:02:16 +01:00
Cedric Verstraeten
24c729eea3 Update Cloud.go 2023-02-14 23:11:55 +01:00
Cedric Verstraeten
c59d511ea3 fix for macs and ips 2023-02-14 22:55:18 +01:00
Cedric Verstraeten
6f8745dc3a alignment of motion recordings, make sure there is no overlap between two sibling recordings 2023-02-14 16:59:00 +01:00
Cedric Verstraeten
65d3d649b9 disable liveview (hd/sd) through env 2023-02-14 11:26:50 +01:00
Cedric Verstraeten
b4a8028c04 better way of doing prerecording + matching timestamp with prerecord time 2023-02-14 08:57:55 +01:00
Cedric Verstraeten
9d7077813a use timescale 10000000 2023-02-11 21:32:36 +01:00
Cedric Verstraeten
2feda33808 joy4 v1.0.51 2023-02-11 20:52:36 +01:00
Cedric Verstraeten
ec42b9ea85 update timescale to 90000 2023-02-11 12:27:38 +01:00
Cedric Verstraeten
a2b4ee12ec align timescale to 90000 2023-02-11 12:02:04 +01:00
Cedric Verstraeten
a0f99a5167 add two new variables to disable snapshotting (encoding time) + disable motion 2023-02-07 13:55:38 +01:00
Cedric Verstraeten
9aff467afc allocate single frame for decoding + disable transcoding 2023-02-05 21:17:12 +01:00
Cedric Verstraeten
926f9ea32c ping Kerberos Vault if attached (was no longer working) 2023-02-03 20:25:00 +01:00
Cedric Verstraeten
43d12ee82f increase network timeout 2023-02-03 12:19:42 +01:00
Cedric Verstraeten
677c985b3d get rid of yarn.lock 2023-02-03 11:53:06 +01:00
Cedric Verstraeten
24a5ca04ca upgrade 2023-02-03 11:37:16 +01:00
Cedric Verstraeten
f81ae57395 do an update and upgrade 2023-02-03 09:28:08 +01:00
Cedric Verstraeten
7e6b69819e upgrade node build-ui image 2023-02-03 08:56:56 +01:00
Cedric Verstraeten
4aa8ce7513 align memory values 2023-02-02 22:12:47 +01:00
Cedric Verstraeten
30d59f2613 add systemd details, move to seperate deployment page 2023-02-02 13:14:36 +01:00
Cedric Verstraeten
be0277432b add documentation for static binary 2023-02-01 20:21:37 +01:00
Cedric Verstraeten
a3006f3b9f change output name 2023-02-01 19:32:31 +01:00
Cedric Verstraeten
d4e10083c4 introduce armv6 build + fix for mp4f bin + add release to heartbeat 2023-02-01 18:50:32 +01:00
Cedric Verstraeten
898a11868e another typo :F 2023-02-01 17:28:02 +01:00
Cedric Verstraeten
a098052ee8 another typo 2023-02-01 17:19:47 +01:00
Cedric Verstraeten
6f79086a27 do not move mp4fragment 2023-02-01 17:18:19 +01:00
Cedric Verstraeten
6ee07d4c12 moving www/ frontend + mp4fragmented in right directory 2023-02-01 17:17:36 +01:00
Cedric Verstraeten
a69869440f new way of stripping 2023-02-01 17:11:14 +01:00
Cedric Verstraeten
dcd4e08c6f typo (shame on me..) 2023-02-01 16:41:08 +01:00
Cedric Verstraeten
22e7a0fec9 first try for a new release.. let's see if it gets through !:) 2023-02-01 16:34:55 +01:00
Cedric Verstraeten
8daebd434d update base img 2023-02-01 15:36:15 +01:00
Cedric Verstraeten
8381cd1a5c another fix www is now in other stage 2023-02-01 12:12:11 +01:00
Cedric Verstraeten
051299f331 revert base image 2023-02-01 12:07:47 +01:00
Cedric Verstraeten
20f2c764fe error www not there 2023-02-01 12:04:31 +01:00
Cedric Verstraeten
07619c2bce mutli stage for ui 2023-02-01 12:00:04 +01:00
Cedric Verstraeten
fb86efe715 new base image 👍 2023-02-01 10:35:19 +01:00
Cedric Verstraeten
4eafe6db84 new base image 2023-02-01 06:54:57 +01:00
Cedric Verstraeten
797f986d5d upgrade to node 14 2023-01-31 21:47:43 +01:00
Cedric Verstraeten
864a8ecffa other method 2023-01-31 21:37:37 +01:00
Cedric Verstraeten
7e48be06e3 other yarn 2023-01-31 19:12:09 +01:00
Cedric Verstraeten
27861aa0a5 try with prev image 2023-01-31 18:39:48 +01:00
Cedric Verstraeten
6d45cb7e6d enable armv6 2023-01-31 15:37:36 +01:00
Cedric Verstraeten
1964b893a5 upgrade base image (changed armv6 image) 2023-01-31 15:30:48 +01:00
Cedric Verstraeten
e30c8fe39c compile bento4 + add more system info 2023-01-31 12:25:36 +01:00
Cedric Verstraeten
b183561dc6 update go.sum 2023-01-30 18:48:38 +01:00
Cedric Verstraeten
caa4952e99 Update go.mod 2023-01-30 18:45:18 +01:00
Cedric Verstraeten
5e15b9ac75 Update main.go 2023-01-30 18:20:00 +01:00
Cedric Verstraeten
4fadd770f8 set max size to 300mb 2023-01-30 17:08:16 +01:00
Cedric Verstraeten
7ac2f71de1 Update main.go 2023-01-30 16:16:07 +01:00
Cedric Verstraeten
b49eef2d1c sync to file every keyframe + added a close method to clean up all pointers 2023-01-30 16:09:31 +01:00
Cedric Verstraeten
b8735aba01 sync file continuously 2023-01-30 15:49:12 +01:00
Cedric Verstraeten
c73584a743 cleaning up pointers + wipe memory and write to disc every 100 frames. 2023-01-30 15:37:57 +01:00
Cedric Verstraeten
ef4fc0a184 add gosum 2023-01-30 14:45:34 +01:00
Cedric Verstraeten
8cada20b1e try direct write to writer (instead of bufio) 2023-01-30 14:41:46 +01:00
Cedric Verstraeten
ba4ac215b5 reenable writing packets 2023-01-30 09:32:03 +01:00
Cedric Verstraeten
947ff473a0 get rid of dependencies + add AGENT_CAPTURE_RECORDING option 2023-01-30 09:19:28 +01:00
Cedric Verstraeten
14dc1a2fa3 disable dependencies 2023-01-30 09:11:21 +01:00
Cedric Verstraeten
df69cdc6a4 add possibility to disable recording completely 2023-01-30 08:59:05 +01:00
Cedric Verstraeten
dd54e08e10 Merge branch 'master' into develop 2023-01-30 08:47:08 +01:00
Cedric Verstraeten
7e3bb2359e Update go.yml 2023-01-30 08:21:43 +01:00
Cedric Verstraeten
5d00053b6f fix for checkout 2023-01-30 08:14:37 +01:00
Cedric Verstraeten
d573c2b829 upgrade to actions/checkout@v3.1.0 2023-01-30 08:07:25 +01:00
Cedric Verstraeten
eda9eb90d8 Merge branch 'master' into develop 2023-01-29 19:57:56 +01:00
Cedric Verstraeten
34849e8250 a test for mem 2023-01-29 19:53:34 +01:00
Cedric Verstraeten
d069a606d7 remove cleanup 2023-01-29 19:52:16 +01:00
Cedric Verstraeten
f0b042a2d1 we missed a packet 💯 2023-01-29 16:58:18 +01:00
Cedric Verstraeten
8a3ec65ec1 update recording logic to make sure no packets are lost 2023-01-29 16:47:59 +01:00
Cedric Verstraeten
e53715b9b0 get rid of flush 2023-01-29 15:40:38 +01:00
Cedric Verstraeten
9ef1339f8f upgrade to joy v1.0.46 2023-01-29 11:21:56 +01:00
Cedric Verstraeten
afaa51aac3 add an intermediate flush 2023-01-29 11:14:30 +01:00
Cedric Verstraeten
fb803df15e upgrade joy4 2023-01-28 23:00:58 +01:00
Cedric Verstraeten
de0c4fa657 align fragmentation time scale + upgrade to new joy4 2023-01-28 22:55:53 +01:00
Cedric Verstraeten
18484f407c width and height were swapped causing polygon not matching motion 👎 2023-01-27 00:59:34 +01:00
Cedric Verstraeten
f4a7bc5650 increase sensitivity 2023-01-26 19:05:27 +01:00
Cedric Verstraeten
9410289b4f add gcompat 2023-01-26 18:52:26 +01:00
Cedric Verstraeten
8eecae6f9a get rid of debian c+ 2023-01-26 18:45:50 +01:00
Cedric Verstraeten
63cf88b88d add libbsd 2023-01-26 18:43:44 +01:00
Cedric Verstraeten
cb9403cbf9 Update Dockerfile 2023-01-26 18:32:51 +01:00
Cedric Verstraeten
27da1dbc74 add a few more deps 2023-01-26 18:25:06 +01:00
Cedric Verstraeten
98d9185c20 add libgcc libstdc++ 2023-01-26 18:15:46 +01:00
Cedric Verstraeten
dec367a8f5 Add libc6-compat fpr mp4fragmenter 2023-01-26 16:19:16 +01:00
Cedric Verstraeten
8a3c1e8f08 fix thresholding for motion detection (should be configurable though) 2023-01-26 14:25:44 +01:00
Cedric Verstraeten
89c385ae2f use low-res in SD streaming 2023-01-26 09:03:49 +01:00
Cedric Verstraeten
e920cb2a6b increase encoding quality 2023-01-26 00:50:24 +01:00
Cedric Verstraeten
3f6204e2eb using substream for SD live is giving issues (to be checked) 2023-01-26 00:35:29 +01:00
Cedric Verstraeten
ae9d42e821 fix for pixeltreshold might be empty + mp4fragment fix ldd 2023-01-26 00:22:30 +01:00
Cedric Verstraeten
31400bd5e7 revert to older ffmpeg (something is going wrong in decoding) 2023-01-25 22:23:03 +01:00
Cedric Verstraeten
7973559502 fix for some onvif cameras that requires PT coordinates (als if zero) 2023-01-25 14:12:22 +01:00
Cedric Verstraeten
d4bfc8677a try new release (ffmpeg) only amd64 will work for now, come back later 2023-01-25 10:46:46 +01:00
Cedric Verstraeten
155f1c7cdf alternative way to cleanup (get rid of initializers) 2023-01-24 08:48:27 +01:00
Cedric Verstraeten
9643a79603 fix mem leak 2023-01-23 10:29:19 +01:00
Cedric Verstraeten
3cc67b485e add datadog for k8s profiling 2023-01-22 15:12:45 +01:00
Cedric Verstraeten
2175d76f94 fixing 2023-01-22 00:46:20 +01:00
Cedric Verstraeten
2a069f8881 fix motion detection + color stream 2023-01-21 23:41:42 +01:00
Cedric Verstraeten
c46765ee8f Update Dockerfile 2023-01-20 20:30:15 +01:00
Cedric Verstraeten
427fad262c fix some build errors 2023-01-20 08:14:38 +01:00
Cedric Verstraeten
a895b24425 several fixes and optimasations
fix static build +jpeg encoding using libjpeg turbo + motion optimisation + process motion on substream when availalbe
2023-01-20 07:35:20 +01:00
Cedric Verstraeten
659ba3e67d armv5 not supported 2023-01-18 23:14:13 +01:00
Cedric Verstraeten
7e394e1c93 try armv5 and armv6 + get rid of bitwiseand and a absdiff 2023-01-18 23:11:01 +01:00
Cedric Verstraeten
886522039a remove bimg 2023-01-18 22:12:35 +01:00
Cedric Verstraeten
155f99597a do not resize (check performance) 2023-01-18 21:39:20 +01:00
Cedric Verstraeten
d67ac25e87 work directly on gray images 2023-01-18 21:03:07 +01:00
Cedric Verstraeten
1fdfddeb43 Update main.go 2023-01-18 18:25:56 +01:00
Cedric Verstraeten
770192ac57 add static build, get rid of dynamic libraries 2023-01-18 17:22:56 +01:00
Cedric Verstraeten
228cfd844a optimisation in motion detection 2023-01-18 09:25:13 +01:00
Cedric Verstraeten
4fbcfbc99d add resizing methods 2023-01-17 22:45:01 +01:00
Cedric Verstraeten
bfb72e8268 get rid of gocv 2023-01-17 19:50:08 +01:00
Cedric Verstraeten
e375c107ef get rid of opencv for encoding 2023-01-17 16:51:59 +01:00
Cedric Verstraeten
99ce644e5d upgrade dependencies 2023-01-17 15:29:41 +01:00
Cedric Verstraeten
05c2d4c583 make sure the stream is ready before we start sending stream over websocket (#48)
fix for https://github.com/kerberos-io/agent/issues/68
2023-01-07 08:39:00 +01:00
Cedric Verstraeten
2265eb88e7 Revert "try static build"
This reverts commit 926e392076.
2023-01-04 15:23:41 +01:00
Cedric Verstraeten
926e392076 try static build 2023-01-03 16:06:30 +01:00
Cédric Verstraeten
7c0cbd4771 Update README.md 2022-12-29 21:31:57 +01:00
Cedric Verstraeten
70d27dc502 add view demo 2022-12-29 21:31:28 +01:00
Cedric Verstraeten
fece388ae9 first release of sending live view (sd) over websockets 2022-12-29 21:16:33 +01:00
Cedric Verstraeten
5543be51da issue prod websocket 2022-12-28 12:59:13 +01:00
Cedric Verstraeten
cf28d69cce get rid of console.logs 2022-12-28 11:55:21 +01:00
Cedric Verstraeten
9ea4a96165 Merge branch 'master' of https://github.com/kerberos-io/agent 2022-12-27 22:54:24 +01:00
Cedric Verstraeten
7bd4934ee7 add websocket client 2022-12-27 22:54:22 +01:00
Cédric Verstraeten
fb5919af99 remove empty spaces 2022-12-27 20:15:10 +01:00
Cédric Verstraeten
8cf8a2e253 balena works with an USB camera 2022-12-27 20:13:18 +01:00
Cédric Verstraeten
8dfd15bc3a remove blank spaces 2022-12-27 20:11:56 +01:00
Cédric Verstraeten
05fab6c7f7 Update README.md 2022-12-27 20:11:21 +01:00
Cedric Verstraeten
9ec52d445d writing additional headers for video/mp4 2022-12-27 11:06:34 +01:00
Cédric Verstraeten
a68aaaa214 add --restart=always option 2022-12-27 10:25:16 +01:00
Cedric Verstraeten
97d2f8fb26 Fix for serving recordings (firefox bug https://github.com/kerberos-io/agent/issues/57) 2022-12-26 20:56:37 +01:00
Cedric Verstraeten
b2bc10865c push multi-arch images to separate repo + make sequential 2022-12-26 20:09:59 +01:00
Cedric Verstraeten
7b6ac61a71 upgrade kerberos-io/onvif 2022-12-26 20:01:34 +01:00
Cedric Verstraeten
27b2842481 reimplement onvif ptz (continuous) + added onvif swagger endpoints 2022-12-26 17:17:38 +01:00
Cedric Verstraeten
8507e84ea0 we'll wait a bit to stop the decoders 2022-12-20 21:49:12 +01:00
Cedric Verstraeten
66df22709f add extra check, might have an empty image 2022-12-20 21:24:14 +01:00
Cedric Verstraeten
c8c9a0fd6e add kerberos factory 2022-12-12 21:05:59 +01:00
Cedric Verstraeten
f6b95ce7f3 few more design tweaks 2022-12-12 20:47:26 +01:00
Cedric Verstraeten
6b31ddcbfc complete kubernetes docs + added openshift 2022-12-12 20:43:27 +01:00
Cedric Verstraeten
73892ee86f update kubernetes resource files 2022-12-09 20:53:41 +01:00
Cedric Verstraeten
1a0458de11 small typo 2022-12-09 18:42:04 +01:00
Cedric Verstraeten
42647172b9 fix 2022-12-09 18:35:02 +01:00
Cedric Verstraeten
e29577e1c5 simplify overview page 2022-12-09 18:34:14 +01:00
Cedric Verstraeten
9012bf2bf0 some more tweaks 2022-12-09 18:27:38 +01:00
Cedric Verstraeten
0fa1943701 add username and password env + add kubernetes deployment 2022-12-09 16:50:40 +01:00
Cedric Verstraeten
a0c1acfd85 add example env variables 2022-12-09 10:56:14 +01:00
Cedric Verstraeten
6413cc82c7 few more tweaks 2022-12-08 23:18:50 +01:00
Cedric Verstraeten
e57908c9b4 small updates 2022-12-08 23:02:57 +01:00
Cedric Verstraeten
c36007ab27 fix title heading 2022-12-08 16:21:32 +01:00
Cedric Verstraeten
928604e12b few more tweaks, agent can be deployed anywhere ;) 2022-12-08 16:19:43 +01:00
Cedric Verstraeten
e33ee6cfa6 add introduction for Docker and Docker Compose in the deployment file 2022-12-08 15:58:52 +01:00
Cedric Verstraeten
517b4b26f2 small fixes to layout! 2022-12-08 15:30:22 +01:00
Cedric Verstraeten
06b3d7e67f make an optional section in prereq 2022-12-08 13:54:56 +01:00
Cedric Verstraeten
508422d461 change introduction wordings 2022-12-08 13:53:45 +01:00
Cedric Verstraeten
528638f69c typo in reference 2022-12-08 13:51:39 +01:00
Cedric Verstraeten
70e7507a15 more tweaks for readme 2022-12-08 13:50:48 +01:00
Cedric Verstraeten
df019cf347 find better wording 2022-12-08 13:47:04 +01:00
Cedric Verstraeten
e88a786116 add small note about volume mounting 2022-12-08 13:42:45 +01:00
Cedric Verstraeten
7242212dd0 make a better reference in the introduction quick start 2022-12-08 13:11:09 +01:00
Cedric Verstraeten
e3dd5fd34b adding running and automating section 2022-12-08 13:09:28 +01:00
Cedric Verstraeten
2b90bdbc0b add documentation for docker compose 2022-12-08 13:01:03 +01:00
Cedric Verstraeten
cd4e9eed3d add references to env. list! 2022-12-08 12:29:58 +01:00
Cedric Verstraeten
0658f9afbb add example docker compose 2022-12-07 23:02:35 +01:00
Cedric Verstraeten
541630a65f fix link 2022-12-07 20:29:10 +01:00
Cedric Verstraeten
4e46f7f4bd small type H264 2022-12-07 20:28:43 +01:00
Cedric Verstraeten
4da3c7a50c Add "is camera working" section 2022-12-07 20:18:57 +01:00
Cedric Verstraeten
47fb5b81ab intiialise deployment directory 2022-12-07 17:34:38 +01:00
Cedric Verstraeten
b27b2f011b another try 2022-12-07 17:19:17 +01:00
Cedric Verstraeten
40ea660609 not wkring as expected 2022-12-07 17:17:17 +01:00
Cedric Verstraeten
d70314d4ab broken link in overview 2022-12-07 17:16:26 +01:00
Cedric Verstraeten
8867c1dde5 update overview 2022-12-07 17:14:48 +01:00
Cedric Verstraeten
a36d53a89b Merge branch 'master' of https://github.com/kerberos-io/agent 2022-12-07 16:45:45 +01:00
Cedric Verstraeten
f634b98552 add environment variables to simplify deployment docker compose and kubernetes 2022-12-07 16:45:28 +01:00
Cédric Verstraeten
3942eb5ec1 Update README.md 2022-11-29 21:51:33 +01:00
Cedric Verstraeten
f45413dab9 Merge branch 'master' of https://github.com/kerberos-io/agent 2022-11-28 16:55:08 +01:00
Cedric Verstraeten
5795a41f92 add note for USB and RPi camera 2022-11-28 16:54:57 +01:00
Cédric Verstraeten
ddc6491058 Update README.md 2022-11-24 13:49:22 +01:00
Cédric Verstraeten
9c940e18d7 Update README.md 2022-11-24 11:06:25 +01:00
Cedric Verstraeten
80b12e229a add boards 2022-11-24 09:33:43 +01:00
Cedric Verstraeten
b9a81a31c9 finetune documentation around agent / factory 2022-11-24 09:31:52 +01:00
Cedric Verstraeten
1bc063fdbb fix navigation 2022-11-24 09:23:13 +01:00
Cedric Verstraeten
98b897e4fe add overview 2022-11-24 09:19:14 +01:00
Cedric Verstraeten
312e501da4 add codespaces 2022-11-24 08:40:02 +01:00
Cédric Verstraeten
0d2e68af3f Update Dockerfile 2022-11-22 10:48:42 +01:00
Cédric Verstraeten
e16d933e56 change dev container base image ;) 2022-11-22 09:40:29 +00:00
Cédric Verstraeten
8ee5b42fde Update Dockerfile 2022-11-22 10:09:12 +01:00
Cédric Verstraeten
05447abe93 Update Dockerfile 2022-11-22 10:05:41 +01:00
Cédric Verstraeten
6c91f233e3 Update Dockerfile 2022-11-22 09:58:37 +01:00
Cédric Verstraeten
feaba1afb5 extract credentials added readme 2022-11-22 05:15:31 +00:00
Cedric Verstraeten
e70a66f7b4 organise into examples dir 2022-11-22 05:55:36 +01:00
Cédric Verstraeten
a78ccd023c add k8s + copilot extension 2022-11-21 22:51:44 +00:00
Cedric Verstraeten
87ac0932c3 add namespace + change task names 2022-11-21 10:16:09 +01:00
Cedric Verstraeten
8e1dcd7002 add k8s and openshift deployment (through ansible) examples 2022-11-21 09:06:02 +01:00
Cedric Verstraeten
1b96d01964 add template config on build, so we could restore at a later time 2022-11-20 20:06:57 +01:00
Cédric Verstraeten
c013308afe small updates to FAQ readme 2022-11-17 21:59:01 +00:00
Cédric Verstraeten
e28d133ef0 add yarn build command 2022-11-17 21:53:01 +00:00
Cédric Verstraeten
e8f03cd7d7 formatting issue + added devcontainer feature ansible! 2022-11-17 21:51:29 +00:00
Cédric Verstraeten
31f7eb5a9a add forwarded ports (ui and machinery) + add post installation commands get dependencies 2022-11-17 21:40:35 +00:00
Cédric Verstraeten
89c39aa853 make some modifications to show what needs to be uncommented for codespaces 2022-11-17 21:19:25 +00:00
Cédric Verstraeten
f349926c77 placeholder issue (recording) + formatting 2022-11-17 21:01:27 +00:00
Cedric Verstraeten
bf0ae4cb64 Revert "fixes"
This reverts commit fb666bb622.
2022-11-17 21:40:38 +01:00
Cédric Verstraeten
fb666bb622 fixes 2022-11-17 20:39:02 +00:00
Cédric Verstraeten
b69b52d292 add empty files 2022-11-17 20:37:08 +00:00
Cedric Verstraeten
d11180f26e create a seperate docker file 2022-11-17 21:20:28 +01:00
Cedric Verstraeten
69461c8c7a Merge branch 'master' of https://github.com/kerberos-io/agent 2022-11-17 21:16:54 +01:00
Cedric Verstraeten
8a373adc2c add devcontainer.json 2022-11-17 21:16:45 +01:00
Cédric Verstraeten
eb3355da9a add discord server 2022-11-08 20:56:51 +01:00
Cédric Verstraeten
2cda3ad929 Merge pull request #55 from robdsource/master
Update french translation
2022-11-04 16:05:07 +01:00
robdsource
7a344a987e Update french translation 2022-11-04 15:36:05 +01:00
Cédric Verstraeten
3ce9adc95c Merge pull request #54 from TeeTeufel/master
Adding german translation
2022-10-20 21:56:39 +02:00
Cedric Verstraeten
e5c71bb6b2 Merge branch 'develop' 2022-10-20 21:32:12 +02:00
Cedric Verstraeten
a021a9e332 broke the pre recording when setting substream 2022-10-20 21:31:56 +02:00
Christian Pätsch
d3bd8031a7 Adding german translation 2022-10-20 21:27:58 +02:00
Cedric Verstraeten
bb18fff7d9 Merge branch 'develop' 2022-10-20 17:45:51 +02:00
Cedric Verstraeten
9ed2873adb fix recording pre 2022-10-20 17:37:25 +02:00
Cedric Verstraeten
f891ac375b change cursors 2022-10-20 15:16:15 +02:00
Cedric Verstraeten
630b34ca27 get rid of console.log 2022-10-17 13:31:06 +02:00
Cedric Verstraeten
ecc7514d2b low+high res streaming, ptz and ONVIF capibilities tesing 2022-10-17 13:25:07 +02:00
Cédric Verstraeten
9e395bb8a7 Merge pull request #53 from robdsource/master
Add french translation
2022-10-11 19:35:14 +02:00
robdsource
85fe51f0f7 Add french translation 2022-10-08 21:16:54 +02:00
Cedric Verstraeten
cb247e0312 Merge branch 'develop' 2022-10-02 21:47:28 +02:00
Cedric Verstraeten
9f933ac9ed new way of computing the uptime 2022-09-29 17:16:49 +02:00
Cedric Verstraeten
b0455c6bda get rid of symbol linking 2022-09-24 21:08:09 +02:00
Cedric Verstraeten
bac247f15e get rid of armv5 for the moment + updated base image 2022-09-23 09:03:48 +02:00
Cedric Verstraeten
50823c8f8a add yarn through npm 2022-09-22 19:41:12 +02:00
Cedric Verstraeten
2b81efb2c5 fix node with nvm 2022-09-22 19:30:37 +02:00
Cedric Verstraeten
013e93be67 install nodejs throught apt-get 2022-09-22 19:17:21 +02:00
Cedric Verstraeten
934ea927b2 try to build armv6 2022-09-22 18:51:34 +02:00
Cedric Verstraeten
e54a4097a1 moved balena to other repo kerberos-io/balena-agent 2022-09-22 18:50:19 +02:00
Cedric Verstraeten
bc98b87dc2 add raspberrypi 2 + change default device 2022-09-22 17:10:48 +02:00
Cedric Verstraeten
1c7883b76a add intel nuc + orange pi + jetson 2022-09-22 14:47:48 +02:00
Cedric Verstraeten
3850a91737 add raspberrypi4 support balena 2022-09-22 14:28:56 +02:00
Cedric Verstraeten
6e8599efda Update balena.yaml 2022-09-22 12:16:09 +02:00
Cedric Verstraeten
1f66eceb3d Update docker-compose.yml 2022-09-22 10:28:08 +02:00
Cedric Verstraeten
5b551d128f Update balena.yaml 2022-09-22 10:07:06 +02:00
Cedric Verstraeten
77373dfd1d try to fix multi arch (old way -> kerberos-io/kerberos-balena) 2022-09-22 09:43:13 +02:00
Cedric Verstraeten
c4fdf7de01 adding docker-compose file 2022-09-22 08:58:40 +02:00
Cedric Verstraeten
89875358b1 trying a cross build on balena 2022-09-21 21:45:43 +02:00
Cedric Verstraeten
70bc2a3af1 add balena fleet build to workflow 2022-09-21 21:36:11 +02:00
Cedric Verstraeten
b228d808db adding balena button 2022-09-21 20:27:15 +02:00
Cedric Verstraeten
7fe3f5fb0f grant root access to bind agent to port 80 2022-09-21 19:25:21 +02:00
Cedric Verstraeten
4daf48a39c change to port 80 2022-09-21 19:12:50 +02:00
Cedric Verstraeten
20a1802bdd add a readme to balena 2022-09-21 16:52:56 +02:00
Cedric Verstraeten
b812b49e11 update logo reference balena 2022-09-21 16:48:43 +02:00
Cedric Verstraeten
30fb0b675b add balena config 2022-09-21 16:04:34 +02:00
Cedric Verstraeten
e6257f4ec6 Update config.yml 2022-09-20 22:04:20 +02:00
Cedric Verstraeten
38b28b965c Merge branch 'develop' 2022-09-20 21:45:09 +02:00
Cedric Verstraeten
16e4c68fb3 add data folder permission validation
agent will not boot up if not having any permissions
2022-09-20 21:37:35 +02:00
Cedric Verstraeten
784fe73a55 add verify connect method 2022-09-20 21:17:08 +02:00
Cedric Verstraeten
3a83ffc7b1 add verifycamera placeholder 2022-09-20 16:17:57 +02:00
Cedric Verstraeten
b6ef1249b3 fix Camera typo 2022-09-20 12:46:35 +02:00
Cedric Verstraeten
c8a863a88d Update translation.json 2022-09-20 12:44:20 +02:00
Cedric Verstraeten
da1f7ab574 add translations 2022-09-20 12:44:15 +02:00
Cédric Verstraeten
6938ecfca2 Merge pull request #46 from olokos/list_videos
Improve recorded videos dasboard counter
2022-09-11 22:35:48 +02:00
olokos
9461fe8874 Improve recorded videos dasboard counter
Implemented new `util` function, which gets count of only `.mp4` extension.
This solves the problem of folders being counted as recordings on the dashboard.
2022-09-09 23:42:30 +02:00
Cedric Verstraeten
a770825648 add more translations 2022-09-08 22:11:14 +02:00
Cedric Verstraeten
5d4a6472d9 Merge branch 'develop' 2022-09-08 16:51:37 +02:00
Cédric Verstraeten
4924bbb7d1 Merge pull request #43 from olokos/fix_pre3
Fix prerecording timing
2022-09-08 13:51:00 +02:00
olokos
56a2558ed8 Try removing GOP +1 2022-09-08 13:45:24 +02:00
olokos
0cb125720b Attempt to fix prerecording 2022-09-07 21:33:03 +02:00
olokos
0b12b7d118 Add logging for prerecording and MaxGopCount 2022-09-07 21:30:37 +02:00
Cédric Verstraeten
5f82a497ca Update main.go 2022-09-06 18:53:33 +02:00
Cedric Verstraeten
a67c84a670 add dutch translation + add placeholders + stop loading when empty media 2022-09-05 22:02:05 +02:00
Cedric Verstraeten
13a93d0432 add auto cleanup configuration 2022-09-05 14:05:46 +02:00
Cedric Verstraeten
9e18d927bf add latest tags 2022-09-05 13:31:43 +02:00
Cedric Verstraeten
44f4d2913c add some kerberos hub branding 2022-09-05 13:29:01 +02:00
Cedric Verstraeten
0caea6cf3c Update README.md 2022-09-05 13:02:36 +02:00
Cedric Verstraeten
026b343b76 Update README.md 2022-09-05 13:00:43 +02:00
Cedric Verstraeten
fea45cf349 Update README.md 2022-09-05 12:57:35 +02:00
Cedric Verstraeten
8a0481da03 fix video width + update base config 2022-09-05 12:43:23 +02:00
Cedric Verstraeten
a32ae05f69 Update config.json 2022-09-05 12:43:04 +02:00
Cedric Verstraeten
19fd33f26a add gif readme 2022-09-05 12:00:39 +02:00
Cedric Verstraeten
3d5c5b62cb language fix, add manual fallback in languageselector 2022-09-05 11:15:56 +02:00
Cedric Verstraeten
793bb28c55 add polish file 2022-09-05 08:25:34 +02:00
Cedric Verstraeten
10d6004f58 hard code 'en' for the time being 2022-09-05 08:24:27 +02:00
Cedric Verstraeten
59af5db610 load language only! 2022-09-04 21:57:40 +02:00
Cedric Verstraeten
d0457cfd7c Update LanguageSelect.jsx 2022-09-04 21:51:09 +02:00
Cedric Verstraeten
856fd8717a Update LanguageSelect.jsx 2022-09-04 21:50:58 +02:00
Cedric Verstraeten
169946dad0 set fallback 2022-09-04 21:50:12 +02:00
Cedric Verstraeten
f2e9e534ca change fallback 2022-09-04 21:46:37 +02:00
Cedric Verstraeten
6cb7906076 move translations not able to be resolved in container 2022-09-04 21:11:51 +02:00
Cedric Verstraeten
68f1de2dbf optimise and make more accurate pre recording 2022-09-04 21:05:18 +02:00
Cedric Verstraeten
a9f5e0d34e fix for language selector 2022-09-04 17:44:50 +02:00
Cedric Verstraeten
c1a958890f update translation 2022-09-04 16:19:17 +02:00
Cedric Verstraeten
8f4c7bbadc Update index.jsx 2022-09-03 22:01:49 +02:00
Cedric Verstraeten
38ee070598 change opacity + add first version of language selector 2022-09-03 22:00:15 +02:00
Cedric Verstraeten
235641cf72 change restart order (on config) + hide time settings when disabled 2022-09-03 20:07:26 +02:00
Cedric Verstraeten
ce4693cb0e add additional check 2022-09-02 15:27:59 +02:00
Thomas Quandalle
a08728d119 prerecording was not take into account 2022-09-01 21:53:42 +02:00
Thomas Quandalle
d50a888bdf Update IPCamera.go 2022-09-01 21:12:32 +02:00
Thomas Quandalle
72fefba530 add recordings page 2022-09-01 19:54:42 +02:00
Thomas Quandalle
f5cb48c2e9 Update config.js 2022-08-31 20:17:56 +02:00
Thomas Quandalle
9477fe9585 fix for hostname 2022-08-31 19:50:19 +02:00
Thomas Quandalle
e1d468cfca hide specific settings when toggled off, small tweak for infobar 2022-08-31 16:58:23 +02:00
Thomas Quandalle
e67500a4fe add link to ui library + camerasonline 2022-08-31 16:37:59 +02:00
Thomas Quandalle
daed0ee33a when in offlineMode, mqttClient can nil + try something for disconnects 2022-08-31 16:25:44 +02:00
Thomas Quandalle
721c8b6c65 cleanup config + smaller bug fixes 2022-08-31 16:09:01 +02:00
Thomas Quandalle
fb7ef7aa97 update dashboard page, add breadcrumb buttons 2022-08-31 15:12:14 +02:00
Thomas Quandalle
cf40b68338 add links + recording threshold 2022-08-31 11:15:31 +02:00
Thomas Quandalle
cdca6d77cb fix heartbeat + add kerberos hub connection kpi 2022-08-31 10:06:56 +02:00
Thomas Quandalle
f2b1f82f59 Update Dashboard.jsx 2022-08-30 20:40:52 +02:00
Thomas Quandalle
963c330c00 Update Dashboard.jsx 2022-08-30 19:29:19 +02:00
Thomas Quandalle
10864fbfe4 move dashboard info to app.jsx 2022-08-30 19:26:03 +02:00
Thomas Quandalle
7423cb36ea fix errors here and there :) 2022-08-30 10:30:21 +02:00
Thomas Quandalle
efbf03858e fix live view + add total recordings + offline mode option 2022-08-29 22:33:55 +02:00
Thomas Quandalle
b37787dd02 fix for config url, live view need some tweaks 2022-08-29 15:19:51 +02:00
Thomas Quandalle
19a680cfd8 add MJPEG and live view on dashboard page (WIP)
snapshots are now stored in color instead of gray
2022-08-29 15:12:17 +02:00
Thomas Quandalle
3de747dbb9 update config 2022-08-27 21:25:33 +02:00
Thomas Quandalle
dbaa2ddcbe add webrtc extra logging 2022-08-27 21:19:48 +02:00
Thomas Quandalle
60be32dea3 Update authentication.js 2022-08-27 15:29:09 +02:00
Thomas Quandalle
6a561c6464 change env 2022-08-27 14:40:49 +02:00
Thomas Quandalle
e62ae2f770 fix for API url (port might be different) 2022-08-27 13:38:47 +02:00
Thomas Quandalle
2fb6625e9a fix prod build 2022-08-26 22:03:45 +02:00
Cédric Verstraeten
018a0baf0a Update README.md 2022-08-26 21:49:02 +02:00
Thomas Quandalle
6182594b6e enterprise agent depending how is running + github action worlflow failed 2022-08-26 21:19:07 +02:00
Thomas Quandalle
e00b45037c add a random key when empty + add verification for hub and vault 2022-08-26 21:13:43 +02:00
Thomas Quandalle
a1c000e84f add a working settings page (Finally) 2022-08-26 18:01:18 +02:00
Thomas Quandalle
c1684bb743 add update config function - less strict linting 2022-08-22 22:48:41 +02:00
Thomas Quandalle
31b9f7022b remove console print - broke build 2022-08-22 12:26:17 +02:00
Thomas Quandalle
6b9f25ef57 a few fixes for settings page + add sub rtsp url (WIP) 2022-08-22 10:50:10 +02:00
Thomas Quandalle
24c3b97629 remove double reading from channel 2022-08-21 20:34:15 +02:00
Cédric Verstraeten
03f7201540 Merge pull request #39 from olokos/develop
Save num of changes to filename, update a lot of dependencies and fix compiling develop branch
2022-08-18 10:21:49 +02:00
olokos
9ffd9700db Revert channel size back to 1
Having the size of 2 gives no profits, but creates a side effect of 1kb recording files being saved, because of message channel being blocked awaiting for the other parameter, giving unexpected results
2022-08-17 23:33:20 +02:00
olokos
87f84e993a Eslint: Fix Unexpected unnamed function func-names
This is the proper and correct new way of using anonymous functions.

Reference: https://stackoverflow.com/questions/52735032/warning-unexpected-unnamed-function-func-names-under-eslint-rule
2022-08-17 21:12:01 +02:00
olokos
23b357e669 Fix build after 3debf62975
Because of missing imports and some undefined variables the latest code wouldn't compile.

I have fixed it.

The only thing I am not sure about is dispatchConfig: PropTypes.bool.isRequired
Not sure if it's truly bool or if this is valid, but it works finally again, but with proper log timezone!
2022-08-17 20:27:26 +02:00
olokos
4021c0dada No idea how those 2 got downgraded, but lets use the latest versions again 2022-08-17 11:50:02 +02:00
olokos
dac55e489a Merge remote-tracking branch 'upstream/develop' into develop 2022-08-17 11:44:31 +02:00
Thomas Quandalle
14e1584ca7 add timezone for logging 2022-08-16 22:59:51 +02:00
Thomas Quandalle
3dd61eea6e Merge branch 'master' into develop 2022-08-15 22:08:41 +02:00
Thomas Quandalle
3debf62975 update settings page 2022-08-15 22:08:08 +02:00
olokos
fb20aa3bf5 Split filename source line into multiple lines, improve logging message 2022-08-15 18:39:41 +02:00
olokos
e4ba5570a7 Use node 16 instead of 14 and use latest kerberos/base 2022-08-15 18:15:16 +02:00
olokos
592e03fc3b Update most of go and javascript dependencies
There were some build issues, also eslint was preventing build because of too old react-scripts, that was in conflict with another requirement for more recent eslint, so I've updated react-scripts, so newer eslint isn't a problem anymore.
2022-08-15 18:11:40 +02:00
Cédric Verstraeten
0b1fd776f4 Merge pull request #36 from olokos/master
Implement changesTreshold parameter and config.json
2022-08-15 08:17:40 +02:00
olokos
098bf0b75f Attempt to fix compilation 2022-08-15 02:52:04 +02:00
olokos
204359c6be MotionData: Implement saving changed pixels into filename
Attempt to fix saving changes detected into filename
models/MotionData.go is meant to be a model containing all of the data in regards to currently recorded video

Since I currently mostly need pixel changed saved in the filename properly, I've created 2 structs:

Partial= Timestamp + Changes working
Full= Everything - Not yet used but prepared for fully implementing the rest of data into the filename

Currently filename only saves proper timestamp and the rest is hardcoded, this is one step forwards to have it fully save a dynamic filename.
2022-08-15 02:15:39 +02:00
olokos
d0d8531537 Change changeTreshhold parameter to pixelChangeThreshold 2022-08-14 01:23:43 +02:00
olokos
1b73f5857d Implement changesTreshold parameter and config.json
In case there is no changesTreshold defined in config.json, then treshold will be 75, to stick with original hardcoded value.
2022-08-13 19:52:19 +02:00
Thomas Quandalle
5fbba44109 Merge branch 'develop' 2022-08-05 09:52:38 +02:00
Thomas Quandalle
99c68c220d add update commit before installing packages 2022-08-05 09:18:53 +02:00
Thomas Quandalle
4d7baecb32 fix hub key for motion detection alert 2022-08-05 09:06:17 +02:00
Thomas Quandalle
1853e4e33d Update main.go 2022-06-27 08:22:28 +02:00
Thomas Quandalle
eacd341cc7 refactor and rename to usbcamera-test 2022-06-27 07:59:15 +02:00
Thomas Quandalle
8b9d4f2eb6 disable window 2022-06-26 22:12:30 +02:00
Thomas Quandalle
fb8f7fc042 get rid of dependency 2022-06-26 21:36:11 +02:00
Thomas Quandalle
ae79b7c248 set x264 and fixed fps 2022-06-26 21:31:00 +02:00
Thomas Quandalle
00e62734c7 disable auto reconnect 2022-06-26 19:48:28 +02:00
Thomas Quandalle
a50f2e5435 add v4l-utils 2022-06-26 19:13:52 +02:00
Thomas Quandalle
3324ea8fa2 add user to video group 2022-06-26 18:08:09 +02:00
Thomas Quandalle
37f904c586 move it to a dedicated folder capture-test 2022-06-26 16:25:14 +02:00
Thomas Quandalle
4071bbfa98 add a webcam-test command to verify if a camera is working 2022-06-26 16:21:01 +02:00
109 changed files with 13730 additions and 4556 deletions

View File

@@ -5,11 +5,11 @@ version: 2
jobs:
machinery:
docker:
- image: kerberos/base:6e68480
- image: kerberos/base:91ab4d4
working_directory: /go/src/github.com/{{ORG_NAME}}/{{REPO_NAME}}
steps:
- checkout
- run: apt-get install -y --no-install-recommends libavcodec-dev libavformat-dev libswscale-dev
- run: apt-get update && apt-get install -y --no-install-recommends libavcodec-dev libavformat-dev libswscale-dev libjpeg62-turbo-dev
- run: cd machinery && go mod download
- run: cd machinery && go test -v ./...
- run: cd machinery && go vet

2
.devcontainer/Dockerfile Normal file
View File

@@ -0,0 +1,2 @@
FROM kerberos/devcontainer:b2bc659
LABEL AUTHOR=Kerberos.io

View File

@@ -0,0 +1,33 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
// https://github.com/microsoft/vscode-dev-containers/tree/v0.245.2/containers/docker-existing-dockerfile
{
"name": "A Dockerfile containing FFmpeg, OpenCV, Go and Yarn",
// Sets the run context to one level up instead of the .devcontainer folder.
"context": "..",
// Update the 'dockerFile' property if you aren't using the standard 'Dockerfile' filename.
"dockerFile": "./Dockerfile",
// Use 'forwardPorts' to make a list of ports inside the container available locally.
"forwardPorts": [
3000,
80
],
// Uncomment the next line to run commands after the container is created - for example installing curl.
"postCreateCommand": "cd ui && yarn install && yarn build && cd ../machinery && go mod download",
"features": {
"ghcr.io/devcontainers-contrib/features/ansible:1": {},
},
"customizations": {
"vscode": {
"extensions": [
"ms-kubernetes-tools.vscode-kubernetes-tools",
"GitHub.copilot"
]
}
},
// Uncomment when using a ptrace-based debugger like C++, Go, and Rust
// "runArgs": [ "--cap-add=SYS_PTRACE", "--security-opt", "seccomp=unconfined" ],
// Uncomment to use the Docker CLI from inside the container. See https://aka.ms/vscode-remote/samples/docker-from-docker.
// "mounts": [ "source=/var/run/docker.sock,target=/var/run/docker.sock,type=bind" ],
// Uncomment to connect as a non-root user if you've added one. See https://aka.ms/vscode-remote/containers/non-root.
// "remoteUser": "vscode"
}

View File

@@ -1,4 +1,4 @@
name: Docker Development build
name: Docker development build
on:
push:
@@ -28,10 +28,13 @@ jobs:
run: docker buildx build --platform linux/${{matrix.architecture}} -t kerberos/agent-dev:arch-$(echo ${{matrix.architecture}} | tr / -)-$(echo $GITHUB_SHA | cut -c1-7) --push .
- name: Create new and append to manifest
run: docker buildx imagetools create -t kerberos/agent-dev:$(echo $GITHUB_SHA | cut -c1-7) kerberos/agent-dev:arch-$(echo ${{matrix.architecture}} | tr / -)-$(echo $GITHUB_SHA | cut -c1-7)
- name: Create new and append to latest manifest
run: docker buildx imagetools create -t kerberos/agent-dev:latest kerberos/agent-dev:arch-$(echo ${{matrix.architecture}} | tr / -)-$(echo $GITHUB_SHA | cut -c1-7)
build-other:
runs-on: ubuntu-latest
strategy:
matrix:
#architecture: [arm64, arm/v7, arm/v6]
architecture: [arm64, arm/v7]
steps:
- name: Login to DockerHub
@@ -50,4 +53,6 @@ jobs:
- name: Run Buildx
run: docker buildx build --platform linux/${{matrix.architecture}} -t kerberos/agent-dev:arch-$(echo ${{matrix.architecture}} | tr / -)-$(echo $GITHUB_SHA | cut -c1-7) --push .
- name: Create new and append to manifest
run: docker buildx imagetools create --append -t kerberos/agent-dev:$(echo $GITHUB_SHA | cut -c1-7) kerberos/agent-dev:arch-$(echo ${{matrix.architecture}} | tr / -)-$(echo $GITHUB_SHA | cut -c1-7)
run: docker buildx imagetools create --append -t kerberos/agent-dev:$(echo $GITHUB_SHA | cut -c1-7) kerberos/agent-dev:arch-$(echo ${{matrix.architecture}} | tr / -)-$(echo $GITHUB_SHA | cut -c1-7)
- name: Create new and append to manifest latest
run: docker buildx imagetools create --append -t kerberos/agent-dev:latest kerberos/agent-dev:arch-$(echo ${{matrix.architecture}} | tr / -)-$(echo $GITHUB_SHA | cut -c1-7)

View File

@@ -1,4 +1,4 @@
name: Docker Nightly build
name: Docker nightly build
on:
# Triggers the workflow every day at 9PM (CET).
@@ -33,7 +33,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
architecture: [arm64, arm/v7]
architecture: [arm64, arm/v7, arm/v6]
steps:
- name: Login to DockerHub
uses: docker/login-action@v2

View File

@@ -1,38 +1,68 @@
name: Docker Production build
name: Docker master build
on:
push:
branches: [ master ]
env:
REPO: kerberos/agent
jobs:
build-amd64:
runs-on: ubuntu-latest
permissions:
contents: write
strategy:
matrix:
architecture: [amd64]
steps:
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Checkout
uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Available platforms
run: echo ${{ steps.buildx.outputs.platforms }}
- name: Run Buildx
run: docker buildx build --platform linux/${{matrix.architecture}} -t kerberos/agent:arch-$(echo ${{matrix.architecture}} | tr / -)-$(echo $GITHUB_SHA | cut -c1-7) --push .
- name: Create new and append to manifest
run: docker buildx imagetools create -t kerberos/agent:$(echo $GITHUB_SHA | cut -c1-7) kerberos/agent:arch-$(echo ${{matrix.architecture}} | tr / -)-$(echo $GITHUB_SHA | cut -c1-7)
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Checkout
uses: actions/checkout@v3
- uses: benjlevesque/short-sha@v2.1
id: short-sha
with:
length: 7
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Available platforms
run: echo ${{ steps.buildx.outputs.platforms }}
- name: Run Buildx
run: docker buildx build --platform linux/$(echo ${{matrix.architecture}} | tr - /) -t $REPO-arch:arch-${{matrix.architecture}}-${{steps.short-sha.outputs.sha}} --push .
- name: Create new and append to manifest
run: docker buildx imagetools create -t $REPO:${{ steps.short-sha.outputs.sha }} $REPO-arch:arch-${{matrix.architecture}}-${{steps.short-sha.outputs.sha}}
- name: Create new and append to manifest latest
run: docker buildx imagetools create -t $REPO:latest $REPO-arch:arch-${{matrix.architecture}}-${{steps.short-sha.outputs.sha}}
- name: Run Buildx with output
run: docker buildx build --platform linux/$(echo ${{matrix.architecture}} | tr - /) -t $REPO-arch:arch-$(echo ${{matrix.architecture}} | tr / -)-${{steps.short-sha.outputs.sha}} --output type=tar,dest=output-${{matrix.architecture}}.tar .
- name: Strip binary
run: mkdir -p output/ && tar -xf output-${{matrix.architecture}}.tar -C output && rm output-${{matrix.architecture}}.tar && cd output/ && tar -cf ../agent-${{matrix.architecture}}.tar -C home/agent . && rm -rf output
- uses: rickstaa/action-create-tag@v1
with:
tag: ${{ steps.short-sha.outputs.sha }}
message: "Release ${{ steps.short-sha.outputs.sha }}"
- name: Create a release
uses: ncipollo/release-action@v1
with:
latest: true
name: ${{ steps.short-sha.outputs.sha }}
tag: ${{ steps.short-sha.outputs.sha }}
artifacts: "agent-${{matrix.architecture}}.tar"
build-other:
runs-on: ubuntu-latest
permissions:
contents: write
needs: build-amd64
strategy:
matrix:
architecture: [arm64, arm/v7]
architecture: [arm64, arm-v7, arm-v6]
#architecture: [arm64, arm-v7]
steps:
- name: Login to DockerHub
uses: docker/login-action@v2
@@ -41,6 +71,10 @@ jobs:
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Checkout
uses: actions/checkout@v3
- uses: benjlevesque/short-sha@v2.1
id: short-sha
with:
length: 7
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
@@ -48,6 +82,21 @@ jobs:
- name: Available platforms
run: echo ${{ steps.buildx.outputs.platforms }}
- name: Run Buildx
run: docker buildx build --platform linux/${{matrix.architecture}} -t kerberos/agent:arch-$(echo ${{matrix.architecture}} | tr / -)-$(echo $GITHUB_SHA | cut -c1-7) --push .
run: docker buildx build --platform linux/$(echo ${{matrix.architecture}} | tr - /) -t $REPO-arch:arch-${{matrix.architecture}}-${{steps.short-sha.outputs.sha}} --push .
- name: Create new and append to manifest
run: docker buildx imagetools create --append -t kerberos/agent:$(echo $GITHUB_SHA | cut -c1-7) kerberos/agent:arch-$(echo ${{matrix.architecture}} | tr / -)-$(echo $GITHUB_SHA | cut -c1-7)
run: docker buildx imagetools create --append -t $REPO:${{ steps.short-sha.outputs.sha }} $REPO-arch:arch-${{matrix.architecture}}-${{steps.short-sha.outputs.sha}}
- name: Create new and append to manifest latest
run: docker buildx imagetools create --append -t $REPO:latest $REPO-arch:arch-${{matrix.architecture}}-${{steps.short-sha.outputs.sha}}
- name: Run Buildx with output
run: docker buildx build --platform linux/$(echo ${{matrix.architecture}} | tr - /) -t $REPO-arch:arch-$(echo ${{matrix.architecture}} | tr / -)-${{steps.short-sha.outputs.sha}} --output type=tar,dest=output-${{matrix.architecture}}.tar .
- name: Strip binary
run: mkdir -p output/ && tar -xf output-${{matrix.architecture}}.tar -C output && rm output-${{matrix.architecture}}.tar && cd output/ && tar -cf ../agent-${{matrix.architecture}}.tar -C home/agent . && rm -rf output
- name: Create a release
uses: ncipollo/release-action@v1
with:
latest: true
allowUpdates: true
name: ${{ steps.short-sha.outputs.sha }}
tag: ${{ steps.short-sha.outputs.sha }}
artifacts: "agent-${{matrix.architecture}}.tar"

View File

@@ -12,11 +12,12 @@ jobs:
name: Build
runs-on: ubuntu-latest
container:
image: kerberos/base:6e68480
image: kerberos/base:70d69dc
strategy:
matrix:
go-version: [1.17, 1.18]
go-version: [1.17, 1.18, 1.19]
steps:
- name: Set up Go ${{ matrix.go-version }}
@@ -24,9 +25,7 @@ jobs:
with:
go-version: ${{ matrix.go-version }}
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- name: Install dependencies
run: apt install -y --no-install-recommends git build-essential cmake pkg-config unzip libgtk2.0-dev curl ca-certificates libcurl4-openssl-dev libssl-dev libavcodec-dev libavformat-dev libswscale-dev libtbb2 libtbb-dev libjpeg-dev libpng-dev libtiff-dev libdc1394-22-dev
uses: actions/checkout@v3
- name: Get dependencies
run: cd machinery && go mod download
- name: Build

7
.gitignore vendored
View File

@@ -1,8 +1,13 @@
ui/node_modules
ui/build
ui/public/assets/env.js
.idea
machinery/www
yarn.lock
machinery/data/config
machinery/data/cloud
machinery/data/recordings
machinery/data/recordings
machinery/data/snapshots
machinery/test*
machinery/init-dev.sh
deployments/docker/private-docker-compose.yaml

15
.vscode/launch.json vendored Normal file
View File

@@ -0,0 +1,15 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Launch Package",
"type": "go",
"request": "launch",
"mode": "auto",
"program": "${fileDirname}"
}
]
}

View File

@@ -1,4 +1,5 @@
FROM kerberos/base:6e68480 AS builder
FROM kerberos/base:dc12d68 AS build-machinery
LABEL AUTHOR=Kerberos.io
ENV GOROOT=/usr/local/go
@@ -11,9 +12,7 @@ ENV GOSUMDB=off
RUN apt-get update && apt-get install -y --no-install-recommends \
git build-essential cmake pkg-config unzip libgtk2.0-dev \
curl ca-certificates libcurl4-openssl-dev libssl-dev \
libavcodec-dev libavformat-dev libswscale-dev libtbb2 libtbb-dev \
libjpeg-dev libpng-dev libtiff-dev libdc1394-22-dev && \
curl ca-certificates libcurl4-openssl-dev libssl-dev libjpeg62-turbo-dev && \
rm -rf /var/lib/apt/lists/*
##############################################################################
@@ -21,36 +20,28 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
RUN mkdir -p /go/src/github.com/kerberos-io/agent
COPY machinery /go/src/github.com/kerberos-io/agent/machinery
COPY ui /go/src/github.com/kerberos-io/agent/ui
########################
# Download NPM and Yarns
RUN apt-get update && apt-get install -y curl && curl -sL https://deb.nodesource.com/setup_14.x | bash - && \
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - && \
echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list && \
apt update && apt install yarn -y
##################################################################
# Build Web
# this will move the /build directory to ../machinery/www
RUN cd /go/src/github.com/kerberos-io/agent/ui && yarn && yarn build
# Get the latest commit hash, so we know which version we're running
COPY .git /go/src/github.com/kerberos-io/agent/.git
RUN cd /go/src/github.com/kerberos-io/agent/.git && git log --format="%H" -n 1 | head -c7 > /go/src/github.com/kerberos-io/agent/machinery/version
RUN cat /go/src/github.com/kerberos-io/agent/machinery/version
##################
# Build Machinery
RUN cd /go/src/github.com/kerberos-io/agent/machinery && \
go mod download && \
go build main.go && \
go build -tags timetzdata --ldflags '-s -w -extldflags "-static -latomic"' main.go && \
mkdir -p /agent && \
mv main /agent && \
mv www /agent && \
mv version /agent && \
mv data /agent && \
mkdir -p /agent/data/cloud && \
mkdir -p /agent/data/snapshots && \
mkdir -p /agent/data/log && \
mkdir -p /agent/data/recordings && \
mkdir -p /agent/data/capture-test && \
mkdir -p /agent/data/config && \
rm -rf /go/src/gitlab.com/
@@ -64,97 +55,95 @@ RUN cp -r /agent ./
####################################################################################
# This will collect dependent libraries so they're later copied to the final image.
RUN /agent/main version
RUN ldd /agent/main | tr -s '[:blank:]' '\n'
RUN ldd /agent/main | tr -s '[:blank:]' '\n' | grep '^/' | \
xargs -I % sh -c 'mkdir -p $(dirname ./%); cp % ./%;'
RUN /dist/agent/main version
##########################################################
# LDD doesnt always work in docker buildx (no idea why..)
# Therefore we are moving some libraries manually
###############################################
# Build Bento4 -> we want fragmented mp4 files
RUN mkdir -p ./usr/lib
ENV BENTO4_VERSION 1.6.0-639
RUN cd /tmp && git clone https://github.com/axiomatic-systems/Bento4 && cd Bento4 && \
git checkout tags/v${BENTO4_VERSION} && \
cd Build && \
cmake -DCMAKE_BUILD_TYPE=Release .. && \
make && \
mv /tmp/Bento4/Build/mp4fragment /dist/agent/ && \
rm -rf /tmp/Bento4
RUN [ -f /lib64/ld-linux-x86-64.so.2 ] && $(mkdir -p lib64 && \
cp /lib64/ld-linux-x86-64.so.2 lib64/) || echo "nothing to do here x86"
FROM node:18.14.0-alpine3.16 AS build-ui
RUN [ -f /lib/ld-linux-aarch64.so.1 ] && $(mkdir -p lib/aarch64-linux-gnu && \
cp /lib/ld-linux-aarch64.so.1 lib/ && \
cp /lib/aarch64-linux-gnu/lib* lib/aarch64-linux-gnu/ && \
cp /usr/lib/aarch64-linux-gnu/libopencv* usr/lib && \
cp /usr/lib/aarch64-linux-gnu/libstdc* usr/lib && \
cp /usr/lib/aarch64-linux-gnu/libx264* usr/lib ) || echo "nothing to do here arm64"
RUN apk update && apk upgrade --available && sync
RUN [ -f /usr/lib/arm-linux-gnueabihf/vfp/neon/libvpx.so.6 ] && \
$(cp /usr/lib/arm-linux-gnueabihf/vfp/neon/libvpx.so.6 ./usr/lib/) || echo "nothing to do here armv7"
########################
# Build Web (React app)
RUN cp -r /usr/local/lib/libavcodec* ./usr/lib && \
cp -r /usr/local/lib/libavformat* ./usr/lib && \
cp -r /usr/local/lib/libavfilter* ./usr/lib && \
cp -r /usr/local/lib/libavutil* ./usr/lib && \
cp -r /usr/local/lib/libavresample* ./usr/lib && \
cp -r /usr/local/lib/libavdevice* ./usr/lib && \
cp -r /usr/local/lib/libswscale* ./usr/lib && \
cp -r /usr/local/lib/libswresample* ./usr/lib && \
cp -r /usr/local/lib/libpostproc* ./usr/lib
RUN mkdir -p /go/src/github.com/kerberos-io/agent/machinery/www
COPY ui /go/src/github.com/kerberos-io/agent/ui
RUN cd /go/src/github.com/kerberos-io/agent/ui && rm -rf yarn.lock && yarn config set network-timeout 300000 && \
yarn && yarn build
# As mentioned before, above is really a hack as LDD
# doesn't work always in docker buildx. You might not need this
# when doing a local build.
################################################################
####################################
# Let's create a /dist folder containing just the files necessary for runtime.
# Later, it will be copied as the / (root) of the output image.
WORKDIR /dist
RUN mkdir -p ./agent && cp -r /go/src/github.com/kerberos-io/agent/machinery/www ./agent/
############################################
# Publish main binary to GitHub release
FROM alpine:latest
############################
# Protect by non-root user.
RUN addgroup -S kerberosio && adduser -S agent -G kerberosio
RUN addgroup -S kerberosio && adduser -S agent -G kerberosio && addgroup agent video
#################################
# Copy files from previous images
COPY --chown=0:0 --from=builder /dist /
COPY --chown=0:0 --from=builder /usr/local/go/lib/time/zoneinfo.zip /zoneinfo.zip
COPY --chown=0:0 --from=build-machinery /dist /
COPY --chown=0:0 --from=build-ui /dist /
ENV ZONEINFO=/zoneinfo.zip
RUN apk update && apk add ca-certificates --no-cache && \
apk add tzdata --no-cache && apk add curl --no-cache && rm -rf /var/cache/apk/*
#################
# Install Bento4
RUN cd && wget https://www.bok.net/Bento4/binaries/Bento4-SDK-1-6-0-639.x86_64-unknown-linux.zip && \
unzip Bento4-SDK-1-6-0-639.x86_64-unknown-linux.zip && rm Bento4-SDK-1-6-0-639.x86_64-unknown-linux.zip && \
cp ~/Bento4-SDK-1-6-0-639.x86_64-unknown-linux/bin/mp4fragment /usr/bin/
RUN apk update && apk add ca-certificates curl libstdc++ libc6-compat --no-cache && rm -rf /var/cache/apk/*
##################
# Try running agent
RUN mv /agent/* /home/agent/
RUN cp /home/agent/mp4fragment /usr/local/bin/
RUN /home/agent/main version
#######################
# Make template config
RUN cp /home/agent/data/config/config.json /home/agent/data/config.template.json
###########################
# Set permissions correctly
RUN chown -R agent:kerberosio /home/agent/data
###########################
# Grant the necessary root capabilities to the process trying to bind to the privileged port
RUN apk add libcap && setcap 'cap_net_bind_service=+ep' /home/agent/main
###################
# Run non-root user
USER agent
######################################
# By default the app runs on port 8080
# By default the app runs on port 80
EXPOSE 8080
EXPOSE 80
######################################
# Check if agent is still running
HEALTHCHECK CMD curl --fail http://localhost:8080 || exit 1
HEALTHCHECK CMD curl --fail http://localhost:80 || exit 1
###################################################
# Leeeeettttt'ssss goooooo!!!
# Run the shizzle from the right working directory.
WORKDIR /home/agent
CMD ["./main", "run", "opensource", "8080"]
CMD ["./main", "run", "opensource", "80"]

308
README.md
View File

@@ -2,8 +2,6 @@
<a target="_blank" href="https://kerberos.io"><img src="https://img.shields.io/badge/kerberos-website-gray.svg?longCache=true&colorB=brightgreen" alt="Kerberos Agent"></a>
<a target="_blank" href="https://doc.kerberos.io"><img src="https://img.shields.io/badge/kerberos-documentation-gray.svg?longCache=true&colorB=brightgreen" alt="Kerberos Agent"></a>
<a target="_blank" href="https://twitter.com/kerberosio?ref_src=twsrc%5Etfw"><img src="https://img.shields.io/twitter/url.svg?label=Follow%20%40kerberosio&style=social&url=https%3A%2F%2Ftwitter.com%2Fkerberosio" alt="Twitter Widget"></a>
<a target="_blank" href="https://join.slack.com/t/kerberosio/shared_invite/zt-1a5oj4pwm-O4qCAN9c5r2um0Ns0ge8ww"><img src="https://img.shields.io/badge/slack-@kerberosio-yellow.svg?logo=slack " alt="Kerberos.io"></a>
<a target="_blank" href="https://circleci.com/gh/kerberos-io/agent"><img src="https://circleci.com/gh/kerberos-io/agent.svg?style=svg"/></a>
<img src="https://github.com/kerberos-io/agent/workflows/Go/badge.svg"/>
@@ -17,71 +15,248 @@
<a target="_blank" href="https://www.figma.com/proto/msuYC6sv2cOCqZeDtBxNy7/%5BNEW%5D-Kerberos.io-Apps?node-id=1%3A1788&viewport=-490%2C191%2C0.34553584456443787&scaling=min-zoom&page-id=1%3A2%3Ffuid%3D449684443467913607" alt="Kerberos Agent"></a>
<a href="LICENSE"><img src="https://img.shields.io/badge/License-MIT-yellow.svg" alt="License: MIT"></a>
[![donate](
https://brianmacdonald.github.io/Ethonate/svg/eth-donate-blue.svg)](
https://brianmacdonald.github.io/Ethonate/address#0xf4a759C9436E2280Ea9cdd23d3144D95538fF4bE)
[![donate](https://brianmacdonald.github.io/Ethonate/svg/eth-donate-blue.svg)](https://brianmacdonald.github.io/Ethonate/address#0xf4a759C9436E2280Ea9cdd23d3144D95538fF4bE)
<a target="_blank" href="https://twitter.com/kerberosio?ref_src=twsrc%5Etfw"><img src="https://img.shields.io/twitter/url.svg?label=Follow%20%40kerberosio&style=social&url=https%3A%2F%2Ftwitter.com%2Fkerberosio" alt="Twitter Widget"></a>
[![Discord Shield](https://discordapp.com/api/guilds/1039619181731135499/widget.png?style=shield)](https://discord.gg/Bj77Vqfp2G)
[**Docker Hub**](https://hub.docker.com/r/kerberos/agent) | [**Documentation**](https://doc.kerberos.io) | [**Website**](https://kerberos.io)
[**Docker Hub**](https://hub.docker.com/r/kerberos/agent) | [**Documentation**](https://doc.kerberos.io) | [**Website**](https://kerberos.io) | [**View Demo**](https://demo.kerberos.io)
Kerberos Agent is a cutting edge video surveillance management system made available as Open Source under the MIT License. This means that all the source code is available for you or your company, and you can use, transform and distribute the source code; as long you keep a reference of the original license. Kerberos Agent can be used for commercial usage (which was not the case for v2). Read more [about the license here](LICENSE).
Kerberos Agent is an isolated and scalable video (surveillance) management agent made available as Open Source under the MIT License. This means that all the source code is available for you or your company, and you can use, transform and distribute the source code; as long you keep a reference of the original license. Kerberos Agent can be used for commercial usage (which was not the case for v2). Read more [about the license here](LICENSE).
![login-agent](./assets/img/agent-login.png)
## Support our project
![Kerberos Agent go through UI](./assets/img/kerberos-agent-overview.gif)
If you like our product please feel free to execute an Ethereum donation. All donations will flow back and split to our Open Source contributors, as they are the heart of this community.
<img width="272" alt="Ethereum donation linke" src="https://user-images.githubusercontent.com/1546779/173443671-3d773068-ae10-4862-a990-dc7c89f3d9c2.png">
## :thinking: Prerequisites
Ethereum Address: `0xf4a759C9436E2280Ea9cdd23d3144D95538fF4bE`
## Work In Progress
- An IP camera which supports a RTSP H264 encoded stream,
- (or) a USB camera, Raspberry Pi camera or other camera, that [you can tranform to a valid RTSP stream](https://github.com/kerberos-io/camera-to-rtsp).
- Any hardware that can run a container, for example: a Raspberry Pi, NVidia Jetson, Intel NUC, a VM, Bare metal machine or a full blown Kubernetes cluster.
Kerberos Agent (v3) is not yet released, and is actively developed. You can follow the progress [on our project board](https://github.com/kerberos-io/agent/projects/1) and review our designs at [Figma](https://www.figma.com/proto/msuYC6sv2cOCqZeDtBxNy7/%5BNEW%5D-Kerberos.io-Apps?node-id=1%3A1788&viewport=-490%2C191%2C0.34553584456443787&scaling=min-zoom&page-id=1%3A2%3Ffuid%3D449684443467913607). Feel free to give any feedback.
## :video_camera: Is my camera working?
## Previous releases
There are a myriad of cameras out there (USB, IP and other cameras), and it might be daunting to know if Kerberos Agent will work for your camera. [Therefore we are listing all the camera models that are acknowlegded by the community](https://github.com/kerberos-io/agent/issues/59). Feel free to add your camera to the list as well!
This repository contains the next generation of Kerberos.io, **Kerberos Agent (v3)**, and is the successor of the machinery and web repositories. A switch in technologies and architecture has been made. This version is still under active development and can be followed on the [develop branch](https://github.com/kerberos-io/agent/tree/develop) and [project overview](https://github.com/kerberos-io/agent/projects/1).
## :books: Overview
Read more about this [at the FAQ](#faq) below.
### Up and running in no time
![opensource-to-agent](https://user-images.githubusercontent.com/1546779/172066873-7752c979-de63-4417-8d26-34192fdbd1e6.svg)
## Introduction
1. [Quickstart - Docker](#quickstart---docker)
2. [Quickstart - Balena](#quickstart---balena)
Kerberos.io is a cutting edge video surveillance system with a strong focus on user experience, scalability, resilience, extension and integration. Kerberos.io provides different solutions, but from a high level point of view it comes into two flavours: Kerberos Agent and Kerberos Enterprise Suite. Bottom line Kerberos Enterprise Suite extends Kerberos Agent with additional components such as Kerberos Factory, Kerberos Vault and Kerberos Hub.
### Introduction
### Kerberos Agent
3. [A world of Kerberos Agents](#a-world-of-kerberos-agents)
- Installation in seconds (Kerberos Etcher, Docker, Binaries).
### Running and automation
4. [How to run and deploy a Kerberos Agent](#how-to-run-and-deploy-a-kerberos-agent)
5. [Access the Kerberos Agent](#access-the-kerberos-agent)
6. [Configure and persist with volume mounts](#configure-and-persist-with-volume-mounts)
7. [Configure with environment variables](#configure-with-environment-variables)
### Contributing
8. [Contribute with Codespaces](#contribute-with-codespaces)
9. [Develop and build](#develop-and-build)
10. [Building from source](#building-from-source)
11. [Building for Docker](#building-for-docker)
### Varia
12. [Support our project](#support-our-project)
13. [What is new?](#what-is-new)
14. [Contributors](#contributors)
## Quickstart - Docker
The easiest to get your Kerberos Agent up and running is to use our public image on [Docker hub](https://hub.docker.com/r/kerberos/agent). Once you have selected a specific tag, run below `docker` command, which will open the web interface of your Kerberos agent on port `80`, and off you go. For a more configurable and persistent deployment have a look at [Running and automating a Kerberos Agent](#running-and-automating-a-kerberos-agent).
docker run -p 80:80 --name mycamera -d --restart=always kerberos/agent:latest
If you want to connect to an USB or Raspberry Pi camera, [you'll need to run our side car container](https://github.com/kerberos-io/camera-to-rtsp) which proxy the camera to an RTSP stream. In that case you'll want to configure the Kerberos Agent container to run in the host network, so it can connect directly to the RTSP sidecar.
docker run --network=host --name mycamera -d --restart=always kerberos/agent:latest
## Quickstart - Balena
Run Kerberos Agent with Balena super powers. Monitor your agent with seamless remote access, and an encrypted https endpoint.
Checkout our fleet on [Balena Hub](https://hub.balena.io/fleets?0%5B0%5D%5Bn%5D=any&0%5B0%5D%5Bo%5D=full_text_search&0%5B0%5D%5Bv%5D=agent), and add your agent.
[![balena deploy button](https://www.balena.io/deploy.svg)](https://dashboard.balena-cloud.com/deploy?repoUrl=https://github.com/kerberos-io/agent)
**_Work In Progress_** - Currently we only support IP and USB Cameras, we have [an approach for leveraging the Raspberry Pi camera](https://github.com/kerberos-io/camera-to-rtsp), but this isn't working as expected with Balena. If you require this, you'll need to use the traditional Docker deployment with sidecar as mentioned above.
## A world of Kerberos Agents
The Kerberos Agent is an isolated and scalable video (surveillance) management agent with a strong focus on user experience, scalability, resilience, extension and integration. Next to the Kerberos Agent, Kerberos.io provides many other tools such as [Kerberos Factory](https://github.com/kerberos-io/factory), [Kerberos Vault](https://github.com/kerberos-io/vault) and [Kerberos Hub](https://github.com/kerberos-io/hub) to provide additional capabilities: bring your own cloud, bring your own storage, central overview, live streaming, machine learning etc.
As mentioned above Kerberos.io applies the concept of agents. An agent is running next to (or on) your camera, and is processing a single camera feed. It applies motion based or continuous recording and make those recordings available through a user friendly web interface. A Kerberos Agent allows you to connect to other cloud services or integrates with custom applications. Kerberos Agent is used for personal usage and scales to enterprise production level deployments.
This repository contains everything you'll need to know about our core product, Kerberos Agent. Below you'll find a brief list of features and functions.
- Low memory and CPU usage.
- Simplified and modern user interface.
- Multi architecture (ARMv7, ARMv8, amd64, etc).
- Multi camera support: IP Cameras (MJPEG/H264), USB cameras, Raspberry Pi Cameras.
- Single camera per instance (e.g. One Docker container per camera).
- Cloud integration through Webhooks, MQTT, etc.
- Cloud storage through Kerberos Hub.
- Multi camera support: IP Cameras (H264), USB cameras and Raspberry Pi Cameras [through a RTSP proxy](https://github.com/kerberos-io/camera-to-rtsp).
- Single camera per instance (e.g. one container per camera).
- Primary and secondary stream setup (record full-res, stream low-res).
- Low resolution streaming through MQTT and full resolution streaming through WebRTC.
- Ability to specifiy conditions: offline mode, motion region, time table, continuous recording, etc.
- Post- and pre-recording on motion detection.
- Ability to create fragmented recordings, and streaming though HLS fMP4.
- [Deploy where you want](#how-to-run-and-deploy-a-kerberos-agent) with the tools you use: `docker`, `docker compose`, `ansible`, `terraform`, `kubernetes`, etc.
- Cloud storage (Kerberos Hub, Kerberos Vault). WIP: Minio, Storj, Dropbox, Google Drive etc.
- WIP: Integrations (Webhooks, MQTT, Script, etc).
- REST API access and documentation through Swagger (trigger recording, update configuration, etc).
- MIT License
### Kerberos Factory (part of [Kerberos Enterprise suite](https://doc.kerberos.io/enterprise/first-things-first/))
## How to run and deploy a Kerberos Agent
- Installation on top of Kubernetes (K8S).
- Camera support for IP camera only (RTSP/H264).
- Massive horizontal scaling, thanks to Kubernetes.
- Management of multiple Kerberos Agents through a single pane of glass.
- Low memory and CPU intensive.
- Modular and extensible design for building own extensions and integrations (e.g. a video analytics platform).
- Commercial licensed and closed source.
As described before a Kerberos Agent is a container, which can be deployed through various ways and automation tools such as `docker`, `docker compose`, `kubernetes` and the list goes on. To simplify your life we have come with concrete and working examples of deployments to help you speed up your Kerberos.io journey.
## How it works: A world of Agents 🕵🏼‍♂️
We have documented the different deployment models [in the `deployments` directory](https://github.com/kerberos-io/agent/tree/master/deployments) of this repository. There you'll learn and find how to deploy using:
Kerberos.io applies the concept of agents. An agent is running next to or on your camera, and is processing a single camera feed. It applies motion based recording and make those recordings available through a user friendly web interface. Kerberos Agent allows you to connect to other cloud services or custom applications. Kerberos Agent is perfect for personal usage and/or is a great tool if you only have a couple of surveillance cameras to be processed.
- [Static binary](https://github.com/kerberos-io/agent/tree/master/deployments#0-static-binary)
- [Docker](https://github.com/kerberos-io/agent/tree/master/deployments#1-docker)
- [Docker Compose](https://github.com/kerberos-io/agent/tree/master/deployments#2-docker-compose)
- [Kubernetes](https://github.com/kerberos-io/agent/tree/master/deployments#3-kubernetes)
- [Red Hat OpenShift with Ansible](https://github.com/kerberos-io/agent/tree/master/deployments#4-red-hat-ansible-and-openshift)
- [Terraform](https://github.com/kerberos-io/agent/tree/master/deployments#5-terraform)
- [Salt](https://github.com/kerberos-io/agent/tree/master/deployments#6-salt)
If you are looking for a solution that scales better with your video surveillance and/or video analytics requirements, [Kerberos Enterprise Suite might be a better fit](https://doc.kerberos.io/enterprise/first-things-first).
By default your Kerberos Agents will store all its configuration and recordings inside the container. To help you automate and have a more consistent data governance, you can attach volumes to configure and persist data of your Kerberos Agents, and/or configure each Kerberos Agent through environment variables.
## Installation
Kerberos Agent **will ship in different formats**: Docker, binary, snap, KiOS. Version 3 is still in active development right now, and not yet released.
## Access the Kerberos Agent
## Run and develop
Once you have deployed the Kerberos Agent, using one of the deployment models described above, you will be able to access the Kerberos Agent user interface. A login page is presented asking for some credentials.
The default username and password for the Kerberos Agent is:
- Username: `root`
- Password: `root`
**_Please note that you change the username and password for a final installation, see [Configure with environment variables](#configure-with-environment-variables) below._**
## Configure and persist with volume mounts
An example of how to mount a host directory is shown below using `docker`, but is applicable for [all the deployment models and tools described above](#running-and-automating-a-kerberos-agent).
You attach a volume to your container by leveraging the `-v` option. To mount your own configuration file and recordings folder, execute as following:
docker run -p 80:80 --name mycamera \
-v $(pwd)/agent/config:/home/agent/data/config \
-v $(pwd)/agent/recordings:/home/agent/data/recordings \
-d --restart=always kerberos/agent:latest
More example [can be found in the deployment section](https://github.com/kerberos-io/agent/tree/master/deployments) for each deployment and automation tool.
## Configure with environment variables
Next to attaching the configuration file, it is also possible to override the configuration with environment variables. This makes deployments easier when leveraging `docker compose` or `kubernetes` deployments much easier and scalable. Using this approach we simplify automation through `ansible` and `terraform`.
docker run -p 80:80 --name mycamera \
-e AGENT_NAME=mycamera \
-e AGENT_TIMEZONE=Europe/Brussels \
-e AGENT_CAPTURE_IPCAMERA_RTSP=rtsp://fake.kerberos.io/stream \
-e AGENT_CAPTURE_CONTINUOUS=true \
-d --restart=always kerberos/agent:latest
| Name | Description | Default Value |
| --------------------------------------- | ----------------------------------------------------------------------------------------------- | ------------------------------- |
| `AGENT_USERNAME` | The username used to authenticate against the Kerberos Agent login page. | "root" |
| `AGENT_PASSWORD` | The password used to authenticate against the Kerberos Agent login page. | "root" |
| `AGENT_KEY` | A unique identifier for your Kerberos Agent, this is auto-generated but can be overriden. | "" |
| `AGENT_NAME` | The agent friendly-name. | "agent" |
| `AGENT_TIMEZONE` | Timezone which is used for converting time. | "Africa/Ceuta" |
| `AGENT_REMOVE_AFTER_UPLOAD` | When enabled, recordings uploaded successfully to a storage will be removed from disk. | "true" |
| `AGENT_OFFLINE` | Makes sure no external connection is made. | "false" |
| `AGENT_AUTO_CLEAN` | Cleans up the recordings directory. | "true" |
| `AGENT_AUTO_CLEAN_MAX_SIZE` | If `AUTO_CLEAN` enabled, set the max size of the recordings directory in (MB). | "100" |
| `AGENT_TIME` | Enable the timetable for Kerberos Agent | "false" |
| `AGENT_TIMETABLE` | A (weekly) time table to specify when to make recordings "start1,end1,start2,end2;start1.. | "" |
| `AGENT_REGION_POLYGON` | A single polygon set for motion detection: "x1,y1;x2,y2;x3,y3;... | "" |
| `AGENT_CAPTURE_IPCAMERA_RTSP` | Full-HD RTSP endpoint to the camera you're targetting. | "" |
| `AGENT_CAPTURE_IPCAMERA_SUB_RTSP` | Sub-stream RTSP endpoint used for livestreaming (WebRTC). | "" |
| `AGENT_CAPTURE_IPCAMERA_ONVIF` | Mark as a compliant ONVIF device. | "" |
| `AGENT_CAPTURE_IPCAMERA_ONVIF_XADDR` | ONVIF endpoint/address running on the camera. | "" |
| `AGENT_CAPTURE_IPCAMERA_ONVIF_USERNAME` | ONVIF username to authenticate against. | "" |
| `AGENT_CAPTURE_IPCAMERA_ONVIF_PASSWORD` | ONVIF password to authenticate against. | "" |
| `AGENT_CAPTURE_RECORDING` | Toggle for enabling making recordings. | "true" |
| `AGENT_CAPTURE_CONTINUOUS` | Toggle for enabling continuous or motion based recording. | "false" |
| `AGENT_CAPTURE_PRERECORDING` | If `CONTINUOUS` set to `false`, specify the recording time (seconds) before after motion event. | "10" |
| `AGENT_CAPTURE_POSTRECORDING` | If `CONTINUOUS` set to `false`, specify the recording time (seconds) after motion event. | "20" |
| `AGENT_CAPTURE_MAXLENGTH` | The maximum length of a single recording (seconds). | "30" |
| `AGENT_CAPTURE_PIXEL_CHANGE` | If `CONTINUOUS` set to `false`, the number of pixel require to change before motion triggers. | "150" |
| `AGENT_CAPTURE_FRAGMENTED` | Set the format of the recorded MP4 to fragmented (suitable for HLS). | "false" |
| `AGENT_CAPTURE_FRAGMENTED_DURATION` | If `AGENT_CAPTURE_FRAGMENTED` set to `true`, define the duration (seconds) of a fragment. | "8" |
| `AGENT_MQTT_URI` | A MQTT broker endpoint that is used for bi-directional communication (live view, onvif, etc) | "tcp://mqtt.kerberos.io:1883" |
| `AGENT_MQTT_USERNAME` | Username of the MQTT broker. | "" |
| `AGENT_MQTT_PASSWORD` | Password of the MQTT broker. | "" |
| `AGENT_STUN_URI` | When using WebRTC, you'll need to provide a STUN server. | "stun:turn.kerberos.io:8443" |
| `AGENT_TURN_URI` | When using WebRTC, you'll need to provide a TURN server. | "turn:turn.kerberos.io:8443" |
| `AGENT_TURN_USERNAME` | TURN username used for WebRTC. | "username1" |0
| `AGENT_TURN_PASSWORD` | TURN password used for WebRTC. | "password1" |
| `AGENT_CLOUD` | Store recordings in a Kerberos Hub (s3) or your Kerberos Vault (kstorage). | "s3" |
| `AGENT_HUB_URI` | The Kerberos Hub API, defaults to our Kerberos Hub SAAS. | "https://api.cloud.kerberos.io" |
| `AGENT_HUB_KEY` | The access key linked to your account in Kerberos Hub. | "" |
| `AGENT_HUB_PRIVATE_KEY` | The secret access key linked to your account in Kerberos Hub. | "" |
| `AGENT_HUB_USERNAME` | Your Kerberos Hub username, which owns the above access and secret keys. | "" |
| `AGENT_HUB_SITE` | The site ID of a site you've created in your Kerberos Hub account. | "" |
| `AGENT_KERBEROSVAULT_URI` | The Kerberos Vault API url. | "" |
| `AGENT_KERBEROSVAULT_ACCESS_KEY` | The access key of a Kerberos Vault account. | "" |
| `AGENT_KERBEROSVAULT_SECRET_KEY` | The secret key of a Kerberos Vault account. | "" |
| `AGENT_KERBEROSVAULT_PROVIDER` | A Kerberos Vault provider you have created (optional). | "" |
| `AGENT_KERBEROSVAULT_DIRECTORY` | The directory, in the provider, where the recordings will be stored in. | "" |
## Contribute with Codespaces
One of the major blockers for letting you contribute to an Open Source project is to setup your local development machine. Why? Because you might have already some tools and libraries installed that are used for other projects, and the libraries you would need for Kerberos Agent, for example FFmpeg, might require a different version. Welcome to the dependency hell..
By leveraging codespaces, which the Kerberos Agent repo supports, you will be able to setup the required development environment in a few minutes. By opening the `<> Code` tab on the top of the page, you will be able to create a codespace, [using the Kerberos Devcontainer](https://github.com/kerberos-io/devcontainer) base image. This image requires all the relevant dependencies: FFmpeg, OpenCV, Golang, Node, Yarn, etc.
![Kerberos Agent codespace](assets/img/codespace.png)
After a few minutes, you will see a beautiful `Visual Studio Code` shown in your browser, and you are ready to code!
![Kerberos Agent VSCode](assets/img/codespace-vscode.png)
On opening of the GitHub Codespace, some dependencies will be installed. Once this is done go ahead to the `ui/src/config.json` file, and (un)comment following section. Make sure to replace the `externalHost` variable with the DNS name you will retrieve from the next step.
// Uncomment this when using codespaces or other special DNS names (which you can't control)
// replace this with the DNS name of the kerberos agent server (the codespace url)
const externalHost = 'cedricve-automatic-computing-machine-v647rxvj4whx9qp-80.preview.app.github.dev';
const dev = {
ENV: 'dev',
HOSTNAME: externalHost,
//API_URL: `${protocol}//${hostname}:8080/api`,
//URL: `${protocol}//${hostname}:8080`,
//WS_URL: `${websocketprotocol}//${hostname}:8080/ws`,
// Uncomment, and comment the above lines, when using codespaces or other special DNS names (which you can't control)
API_URL: `${protocol}//${externalHost}/api`,
URL: `${protocol}//${externalHost}`,
WS_URL: `${websocketprotocol}//${externalHost}/ws`,
};
Go and open two terminals one for the `ui` project and one for the `machinery` project.
1. Terminal A:
cd machinery/
go run main.go run camera 80
2. Terminal B:
cd ui/
yarn start
Once executed, a popup will show up mentioning `portforwarding`. You should see two ports being opened, one for the ui `3000` and one for the machinery `80`. `Right-click` on the port `80` and change visibility from `private` to `public`, this is required to avoid `CORS` errors.
![Codespace make public](./assets/img/codespace-make-public.png)
As mentioned above, copy the hostname of the `machinery` DNS name, and past it in the `ui/src/config.json` file. Once done reload, the `ui` page in your browser, and you should be able to access the login page with the default credentials `root` and `root`.
## Develop and build
Kerberos Agent is divided in two parts a `machinery` and `web`. Both parts live in this repository in their relative folders. For development or running the application on your local machine, you have to run both the `machinery` and the `web` as described below. When running in production everything is shipped as only one artifact, read more about this at [Building for production](#building-for-production).
@@ -97,6 +272,10 @@ This will start a webserver and launches the web app on port `3000`.
![login-agent](./assets/img/agent-login.gif)
Once signed in you'll see the dashboard page showing up. After successfull configuration of your agent, you'll should see a live view and possible events recorded to disk.
![dashboard-agent](./assets/img/agent-dashboard.png)
### Machinery
The `machinery` is a **Golang** project which delivers two functions: it acts as the Kerberos Agent which is doing all the heavy lifting with camera processing and other kinds of logic, on the other hand it acts as a webserver (Rest API) that allows communication from the web (React) or any other custom application. The API is documented using `swagger`.
@@ -105,13 +284,13 @@ You can simply run the `machinery` using following commands.
git clone https://github.com/kerberos-io/agent
cd machinery
go run main.go run mycameraname 8080
go run main.go run mycameraname 80
This will launch the Kerberos Agent and run a webserver on port `8080`. You can change the port by your own preference. We strongly support the usage of [Goland](https://www.jetbrains.com/go/), as it comes with all the debugging and linting features builtin.
This will launch the Kerberos Agent and run a webserver on port `80`. You can change the port by your own preference. We strongly support the usage of [Goland](https://www.jetbrains.com/go/) or [Visual Studio Code](https://code.visualstudio.com/), as it comes with all the debugging and linting features builtin.
![run-in-goland](https://user-images.githubusercontent.com/1546779/111139940-0a4d1a80-8582-11eb-8985-ceaf7359f4ee.gif)
![VSCode desktop](./assets/img/vscode-desktop.png)
## Building for Production
## Building from source
Running Kerberos Agent in production only require a single binary to run. Nevertheless, we have two parts, the `machinery` and the `web`, we merge them during build time. So this is what happens.
@@ -126,48 +305,35 @@ To build the Kerberos Agent web app, you simply have to run the `build` command
Building the `machinery` is also super easy 🚀, by using `go build` you can create a single binary which ships it all; thank you Golang. After building you will endup with a binary called `main`, this is what contains everything you need to run Kerberos Agent.
Remember the build step of the `web` part, during build time we move the build directory to the `machinery` directory. Inside the `machinery` web server [we reference the](https://github.com/kerberos-io/agent/blob/master/machinery/src/routers/http/Server.go#L44) `build` directory. This makes it possible to just a have single web server that runs it all.
Remember the build step of the `web` part, during build time we move the build directory to the `machinery` directory. Inside the `machinery` web server [we reference the](https://github.com/kerberos-io/agent/blob/master/machinery/src/routers/http/Server.go#L44) `build` directory. This makes it possible to just a have single web server that runs it all.
cd machinery
go build
## Building for Docker
Inside the root of this `agent` repository, you will find a `Dockerfile`. This file contains the instructions for building and shipping **Kerberos Agent**. Important to note is that start from a prebuild base image, `kerberos/debian-opencv-ffmpeg:1.0.xxx`.
Inside the root of this `agent` repository, you will find a `Dockerfile`. This file contains the instructions for building and shipping **Kerberos Agent**. Important to note is that start from a prebuild base image, `kerberos/base:xxx`.
This base image contains already a couple of tools, such as Golang, FFmpeg and OpenCV. We do this for faster compilation times.
By running the `docker build` command, you will create the Kerberos Agent Docker image. After building you can simply run the image as a Docker container.
docker build -t kerberos/agent .
docker run -p 8080:8080 --name mycamera -d kerberos/agent:edge
## FAQ
## Support our project
#### 1. Why a mono repo?
If you like our product please feel free to execute an Ethereum donation. All donations will flow back and split to our Open Source contributors, as they are the heart of this community.
We have noticed in the past (v1 and v2) splitting the repositories (machinery and web), created a lot of confusion within our community. People didn't understand the different versions and so on. This caused a lack of collaboration, and made it impossible for some people to collaborate and contribute.
<img width="272" alt="Ethereum donation linke" src="https://user-images.githubusercontent.com/1546779/173443671-3d773068-ae10-4862-a990-dc7c89f3d9c2.png">
Having a mono repo, which is well organised, simplifies the entry point for new people who would like to use, understand and/or contribute to Kerberos Agent.
Ethereum Address: `0xf4a759C9436E2280Ea9cdd23d3144D95538fF4bE`
#### 2. Why a change in technologies?
## What is new?
In previous versions (v1 and v2) we used technologies like C++, PHP and BackboneJS. 7 years ago this was still acceptable, however time has changed and new technologies such as React and Golang became very popular.
This repository contains the next generation of Kerberos.io, **Kerberos Agent (v3)**, and is the successor of the machinery and web repositories. A switch in technologies and architecture has been made. This version is still under active development and can be followed on the [develop branch](https://github.com/kerberos-io/agent/tree/develop) and [project overview](https://github.com/kerberos-io/agent/projects/1).
Due to previous reason we have decided to rebuild the Kerberos Agent technology from scratch, taking into account all the feedback we acquired over the years. Having these technologies available, we will enable more people to contribute and use our technology.
Read more about this [at the FAQ](#faq) below.
#### 3. What is the difference with Kerberos Enterprise?
We started the developments of Kerberos Enterprise a year ago (January, 2020), our focus here was scalability, and fast development and easy deployment. We noticed that with technologies such as Golang and React, we can still provide a highly performant video surveillance system.
Kerberos Agent uses the same technology stack, and some code pieces, of Kerberos Enterprise which we have already build. We have a very clear now, of how a well developed and documented video surveillance system needs to look like.
#### 4. When are we going to be able to install the first version?
We plan to ship the first version by the end of Q1, afterwards we will add more and more features as usual.
#### 5. Change in License
Kerberos Agent (v3) is now available under the MIT license.
![opensource-to-agent](https://user-images.githubusercontent.com/1546779/172066873-7752c979-de63-4417-8d26-34192fdbd1e6.svg)
## Contributors

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 138 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 769 KiB

BIN
assets/img/codespace.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 286 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 MiB

BIN
assets/img/logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 966 KiB

60
deployments/README.md Normal file
View File

@@ -0,0 +1,60 @@
# Kerberos Agent Deployments
Great to see you here, you just arrived at the real stuff! As you may have understood Kerberos Agent is a containerized solution. A Kerberos Agent, or container equivalent, is running for each camera. This approach makes it scalable, isolated and probably the most important thing an exceptional workload governance.
Due to it's nature, of acting as a micro service, there are many different ways how to get this Kerberos Agent up and running. This part of the Kerberos Agent repository contains example configurations, for all the different deployments and automations you can leverage to deploy and scale your video landscape.
We will discuss following deployment models.
- [0. Static binary](#0-static-binary)
- [1. Docker](#1-docker)
- [2. Docker Compose](#2-docker-compose)
- [3. Kubernetes](#3-kubernetes)
- [4. Red Hat Ansible and OpenShift](#4-red-hat-ansible-and-openshift)
- [5. Kerberos Factory](#5-kerberos-factory)
- [6. Terraform](#6-terraform)
- [7. Salt](#7-salt)
## 0. Static binary
Kerberos Agents are now also shipped as static binaries. Within the Docker image build, we are extracting the Kerberos Agent binary and are [uploading them to the releases page](https://github.com/kerberos-io/agent/releases) in the repository. By opening a release you'll find a `.tar` with the relevant files.
> Learn more [about the Kerberos Agent binary here](https://github.com/kerberos-io/agent/tree/master/deployments/binary).
## 1. Docker
Leveraging `docker` is probably one of the easiest way to run and test the Kerberos Agent. Thanks to it's multi-architecture images you could run it on almost every machine. The `docker` approach is perfect for running one or two cameras in a (single machine) home deployment, a POC to verify its capabilities, or testing if your old/new IP camera is operational with our Kerberos Agent.
> Learn more [about Kerberos Agent on Docker here](https://github.com/kerberos-io/agent/tree/master/deployments/docker#1-running-a-single-container).
## 2. Docker Compose
If you consider `docker` as "your way to go", but require to run a bigger (single machine) deployment at home or inside your store then `docker compose` would be more suitable. By specifying a single `docker-compose.yaml` file, you can define all your Kerberos Agents (and thus cameras) in a single file, with a custom configuration to fit your needs.
> Learn more [about Kerberos Agent with Docker Compose here](https://github.com/kerberos-io/agent/tree/master/deployments/docker#2-running-multiple-containers-with-docker-compose).
## 3. Kubernetes
As described above, `docker` is a great tool for smaller deployments, where you are just running on a single machine and want to ramp up quickly. As you might expect, this is a not an ideal situation for production deployments. Kubernetes can help you to build a scalable, flexible and resilient deployment.
> Learn more [about Kerberos Agent in a Kubernetes cluster here](https://github.com/kerberos-io/agent/tree/master/deployments/kubernetes).
## 4. Red Hat Ansible and OpenShift
If you running an alternative distribution such as Red Hat OpenShift, things will work out exactly as mentioned before with the `Kubernetes` deployment. You'll have all the benefints of Red Hat OpenShift on top. One of the things we provide here is an Ansible playbook to deploy the Kerberos Agent in the OpenShift cluster.
> Learn more [about Kerberos Agent in OpenShift with Ansible](https://github.com/kerberos-io/agent/tree/master/deployments/ansible-openshift).
## 5. Kerberos Factory
All of the previously deployments, `docker`, `kubernetes` and `openshift` are great for a technical audience. However for business users, it might be more convenient to have a clean web ui, that one can leverage to add one or more cameras (Kerberos Agents), without the hassle of the technical resources.
> Learn more [about Kerberos Agent with Kerberos Factory](https://github.com/kerberos-io/agent/tree/master/deployments/factory).
## 6. Terraform
To be written
## 7. Salt
To be written

View File

@@ -0,0 +1,49 @@
# Deploy to a Red Hat OpenShift cluster with Ansible
Kubernetes is great, but you might love OpenShift even more. In this directory you'll find some resources to deploy your Kerberos Agent in an OpenShift cluster using Ansible playbook. We'll review the different tasks of the Ansible playbook step by step; find the complete `playbook.yaml` here.
## Variabeles
We'll have a few `variables` in our `playbook.yml` that will help us to setup secure connection with the OpenShift cluster. We need the `cluster_url` and the `username` and `password` of the OpenShift cluster. If you don't know where to find this, you can find this in the OpenShift web ui.
vars:
- oc_cluster_url: ""
- oc_username: ""
- oc_password: ""
## Tasks
Once we have supplied the `variables` we will define following tasks:
- name: Print Variables
- name: Try to login to OCP cluster
- name: Create a Namespace
- name: Create a Persistent volume claim
- name: Deploy Kerberos Agent
- name: Expose Kerberos Agent
1. Print variables: this is a validation step, where we make sure we have the correct variables supplied to the `ansible-playbook` command. This confirms we are using the right credentials to setup a secure connection with the OpenShift cluster.
2. Setup a connection with OpenShift using the defined variabeles. If successfull an `api_key` will become available in the `k8s_auth_result` variable. This variabele will be used with every subsequent operation against the OpenShift cluster.
3. A best practice is to isolate your workloads in namespaces. Therefore we'll create a new namespace in our OpenShift cluster.
4. (Optional) Create a persistent volume to persist the configuration file and recordings in a volume.
5. Deploy Kerberos Agent through a `deployment`.
6. Expose the Kerberos Agent web interface through a `LoadBalancer`; public internet accessible IP address.
## Run the playbook
Now you understand what is happening in the playbook, let's run it. Make sure you have `ansible` install on your `host` or `deploy` machine.
Specify the `environment` input variable as a `JSON` with all required variables defined in step 1. Reference the `playbook.yml` file and execute.
ansible-playbook -e '{ \
"oc_cluster_url":"https://api.j5z0adui.westeurope.aroapp.io:6443", \
"oc_username":"kubeadmin",\
"oc_password":"xxx" \
}' playbook.yml
If everything runs as expected you should see you Kerberos Agent deployed, together with an assigned public ip address. Paste the ip address in your browser, the Kerberos Agent web interface will show up. You can use [the default username and password to sign-in](https://github.com/kerberos-io/agent#access-the-kerberos-agent), or if changed to your own (which is recommended).

View File

@@ -0,0 +1,140 @@
- hosts: localhost
vars:
- oc_cluster_url: ""
- oc_username: ""
- oc_password: ""
tasks:
- name: Print Variables
debug:
msg: "OpenShift url: {{ oc_cluster_url }}, OpenShift username: {{ oc_username }}, OpenShift password: {{ oc_password }}"
- name: Try to login to OCP cluster
k8s_auth:
host: "{{ oc_cluster_url }}"
username: "{{ oc_username }}"
password: "{{ oc_password }}"
validate_certs: no
register: k8s_auth_result
- name: Create a Namespace
k8s:
state: present
host: "{{ oc_cluster_url }}"
api_key: "{{ k8s_auth_result.k8s_auth.api_key }}"
validate_certs: no
definition:
apiVersion: v1
kind: Namespace
metadata:
name: kerberos
register: k8s_namespace_result
- name: Create a Persistent volume claim
k8s:
state: present
host: "{{ oc_cluster_url }}"
api_key: "{{ k8s_auth_result.k8s_auth.api_key }}"
validate_certs: no
namespace: kerberos
definition:
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: kerberos-data
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 2Gi
storageClassName: managed-premium
register: pvc_result
- name: Deploy Kerberos Agent
k8s:
state: present
apply: yes
namespace: kerberos
host: "{{ oc_cluster_url }}"
api_key: "{{ k8s_auth_result.k8s_auth.api_key }}"
validate_certs: no
definition:
apiVersion: apps/v1
kind: Deployment
metadata:
name: agent
labels:
name: agent
spec:
selector:
matchLabels:
app: agent
replicas: 1
template:
metadata:
labels:
app: agent
spec:
volumes:
- name: kerberos-data
persistentVolumeClaim:
claimName: kerberos-data
initContainers:
- name: download-config
image: kerberos/agent:1b96d01
volumeMounts:
- name: kerberos-data
mountPath: /home/agent/data/config
subPath: config
command:
[
"cp",
"/home/agent/data/config.template.json",
"/home/agent/data/config/config.json",
]
containers:
- name: agent
image: kerberos/agent:1b96d01
volumeMounts:
- name: kerberos-data
mountPath: /home/agent/data/config
subPath: config
- name: kerberos-data
mountPath: /home/agent/data/recordings
subPath: recordings
- name: kerberos-data
mountPath: /home/agent/data/snapshots
subPath: snapshots
- name: kerberos-data
mountPath: /home/agent/data/cloud
subPath: cloud
ports:
- containerPort: 80
protocol: TCP
- name: Expose Kerberos Agent
k8s:
state: present
apply: yes
namespace: kerberos
host: "{{ oc_cluster_url }}"
api_key: "{{ k8s_auth_result.k8s_auth.api_key }}"
validate_certs: no
definition:
kind: Service
apiVersion: v1
metadata:
name: agent-svc
labels:
name: agent-svc
spec:
selector:
app: agent
type: LoadBalancer
ports:
- name: http
port: 80
targetPort: 80
protocol: TCP

View File

@@ -0,0 +1,34 @@
# Binary
Kerberos Agents are now also shipped as static binaries. Within the Docker image build, we are extracting the Kerberos Agent binary and are [uploading them to the releases page](https://github.com/kerberos-io/agent/releases) in the repository. By opening a release you'll find a `.tar` with the relevant files.
- `main`: this is the Kerberos Agent binary.
- `data`: the folder containing the recorded video, configuration, etc.
- `mp4fragment`: a binary to transform MP4s to Fragmented MP4s.
- `www`: the Kerberos Agent ui (compiled React app).
You can run the binary as following on port `8080`:
main run cameraname 8080
## Systemd
When running on a Linux OS you might consider to auto-start the Kerberos Agent using systemd. Create a file called `/etc/systemd/system/kerberos-agent.service` and copy-paste following configuration. Update the `WorkingDirectory` and `ExecStart` accordingly.
[Unit]
Wants=network.target
[Service]
ExecStart=/home/pi/agent/main run camera 80
WorkingDirectory=/home/pi/agent/
[Install]
WantedBy=multi-user.target
To load your new service, we'll execute following commands.
sudo systemctl daemon-reload
sudo systemctl enable kerberos-agent
sudo systemctl start kerberos-agent
Confirm the service is running:
sudo systemctl status kerberos-agent

View File

@@ -0,0 +1,92 @@
# Deployment with Docker
The easiest, and let's say most natural, deployment is done [by utilising `docker`](#1-running-a-single-container). Docker can run a stand-alone, single, Kerberos Agent (or container) and a bigger set of Kerberos Agents (or containers) [through `docker compose`](#2-running-multiple-containers-with-docker-compose).
## 1. Running a single container
We are creating Docker images as part of our CI/CD process. You'll find our Docker images on [Docker hub](https://hub.docker.com/r/kerberos/agent). Pick a specific tag of choice, or use latest. Once done run below command, this will open the web interface of your Kerberos agent on port 80.
docker run -p 80:80 --name mycamera -d kerberos/agent:latest
Or for a develop build:
docker run -p 80:80 --name mycamera -d kerberos/agent-dev:latest
Feel free to use another port if your host system already has a workload running on `80`. For example `8082`.
docker run -p 8082:80 --name mycamera -d kerberos/agent:latest
### Attach a volume
By default your Kerberos agent will store all its configuration and recordings inside the container. It might be interesting to store both configuration and your recordings outside the container, on your local disk. This helps persisting your storage even after you decide to wipe out your Kerberos agent.
You attach a volume to your container by leveraging the `-v` option. To mount your own configuration file, execute as following:
1. Decide where you would like to store your configuration and recordings; create a new directory for the config file and recordings folder accordingly.
mkdir agent
mkdir agent/config
mkdir agent/recordings
2. Once you have located your desired directory, copy the latest [`config.json`](https://github.com/kerberos-io/agent/blob/master/machinery/data/config/config.json) file into your config directory.
wget https://raw.githubusercontent.com/kerberos-io/agent/master/machinery/data/config/config.json -O agent/config/config.json
3. Run the docker command as following to attach your config directory and recording directory.
docker run -p 80:80 --name mycamera \
-v $(pwd)/agent/config:/home/agent/data/config \
-v $(pwd)/agent/recordings:/home/agent/data/recordings\
-d --restart=alwayskerberos/agent:latest
### Override with environment variables
Next to attaching the configuration file, it is also possible to override the configuration with environment variables. This makes deployments easier when leveraging `docker compose` or `kubernetes` deployments much easier and scalable. Using this approach we simplify automation through `ansible` and `terraform`. You'll find [the full list of environment variables on the main README.md file](https://github.com/kerberos-io/agent#override-with-environment-variables).
### 2. Running multiple containers with Docker compose
When running multiple containers, you could execute the above process multiple times, or a better way is to run a `docker compose` with predefined configuration file, a `docker-compose.yaml`.
You'll find [an example `docker-compose.yaml` file here](https://github.com/kerberos-io/agent/blob/master/deployments/docker/docker-compose.yaml). This configuration file includes a definition for running 3 Kerberos Agents (or containers). By specifying environment variables you can override the internal configuration. To add more Kerberos Agents to your deployment, just `copy-paste` a `service` block and modify the name, exposed port, and settings accordingly.
kerberos-agent2:
image: "kerberos/agent:latest"
ports:
- "8082:80"
environment:
- AGENT_NAME=agent2
- AGENT_CAPTURE_IPCAMERA_RTSP=rtsp://x.x.x.x:554/Streaming/Channels/101
- AGENT_HUB_KEY=yyy
- AGENT_HUB_PRIVATE_KEY=yyy
#### Attaching volumes
As described in [1. Running a single container](#1-running-a-single-container) you can also assign volumes to your `docker compose` services. A volume can be added to persist the recordings of your Kerberos Agents on the host machine, or to provide more accurate configurations.
When attaching a volume for persisting recordings or mounting configuration files from the host system. the `docker-compose.yaml` would look like this.
Let's start by creating some directories on your host system. We'll consider 3 Kerberos Agents in this example.
mkdir -p agent1/config agent1/recordings
mkdir -p agent2/config agent2/recordings
mkdir -p agent3/config agent3/recordings
Download the configuration file in each Kerberos Agent configuration directory.
wget https://raw.githubusercontent.com/kerberos-io/agent/master/machinery/data/config/config.json -O agent1/config/config.json
wget https://raw.githubusercontent.com/kerberos-io/agent/master/machinery/data/config/config.json -O agent2/config/config.json
wget https://raw.githubusercontent.com/kerberos-io/agent/master/machinery/data/config/config.json -O agent3/config/config.json
Next we'll add a `volumes:` section to each Kerberos Agent (service) in the `docker-compose-with-volumes.yaml` file.
volumes:
- ./agent1/config:/home/agent/data/config
- ./agent1/recordings:/home/agent/data/recordings
We'll repeat that for the other Kerberos Agents as well. You can review [the final result over here](https://github.com/kerberos-io/agent/blob/master/deployments/docker/docker-compose-with-volumes.yaml).
Run the `docker compose` command by providing a different configuration file name.
docker compose -f docker-compose-with-volumes.yaml up
Please note that you can use a combination of using a configuration file and environment variables at the same time. However environment variables will always override the setting in your configuration file.

View File

@@ -0,0 +1,27 @@
version: "3.9"
services:
kerberos-agent1:
image: "kerberos/agent:latest"
ports:
- "8081:80"
environment:
- AGENT_NAME=agent1
# You can still override the configuration with environment variables, but might not makes sense if you are attaching a host config.
# find full list of environment variables here: https://github.com/kerberos-io/agent#override-with-environment-variables
volumes:
- ./agent1/config:/home/agent/data/config
- ./agent1/recordings:/home/agent/data/recordings
kerberos-agent2:
image: "kerberos/agent:latest"
ports:
- "8082:80"
volumes:
- ./agent2/config:/home/agent/data/config
- ./agent2/recordings:/home/agent/data/recordings
kerberos-agent3:
image: "kerberos/agent:latest"
ports:
- "8083:80"
volumes:
- ./agent3/config:/home/agent/data/config
- ./agent3/recordings:/home/agent/data/recordings

View File

@@ -0,0 +1,35 @@
version: "3.9"
services:
kerberos-agent1:
image: "kerberos/agent:latest"
ports:
- "8081:80"
environment:
- AGENT_NAME=agent1
- AGENT_CAPTURE_IPCAMERA_RTSP=rtsp://x.x.x.x:554/Streaming/Channels/101
- AGENT_HUB_KEY=xxx
- AGENT_HUB_PRIVATE_KEY=xxx
- AGENT_CAPTURE_CONTINUOUS=true
- AGENT_CAPTURE_PRERECORDING=10
- AGENT_CAPTURE_POSTRECORDING=10
- AGENT_CAPTURE_MAXLENGTH=60
- AGENT_CAPTURE_PIXEL_CHANGE=150
# find full list of environment variables here: https://github.com/kerberos-io/agent#override-with-environment-variables
kerberos-agent2:
image: "kerberos/agent:latest"
ports:
- "8082:80"
environment:
- AGENT_NAME=agent2
- AGENT_CAPTURE_IPCAMERA_RTSP=rtsp://x.x.x.x:554/Streaming/Channels/101
- AGENT_HUB_KEY=yyy
- AGENT_HUB_PRIVATE_KEY=yyy
kerberos-agent3:
image: "kerberos/agent:latest"
ports:
- "8083:80"
environment:
- AGENT_NAME=agent3
- AGENT_CAPTURE_IPCAMERA_RTSP=rtsp://x.x.x.x:554/Streaming/Channels/101
- AGENT_HUB_KEY=zzz
- AGENT_HUB_PRIVATE_KEY=zzz

View File

@@ -0,0 +1,9 @@
# Deploy with Kerberos Factory
All of the previously deployments, `docker`, `kubernetes` and `openshift` are great for a technical audience. However for business users, it might be more convenient to have a clean web ui, that one can leverage to add one or more cameras (Kerberos Agents), without the hassle of the technical resources.
That's exactly why we have build [Kerberos Factory](https://github.com/kerberos-io/factory). It's a web ui on top of a Kubernetes cluster, which allows a non-technical users to administer and configure a video landscape.
![Factory login](./factory-login.gif)
The idea of [Kerberos Factory](https://github.com/kerberos-io/factory) is that one can configure and deploy a camera, by filling-in some basic input fields. Once done [Kerberos Factory](https://github.com/kerberos-io/factory), will create the relevant resources in your Kubernetes cluster.

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 MiB

View File

@@ -0,0 +1,111 @@
# Deployment with Kubernetes
As described in the [Deployment with Docker](https://github.com/kerberos-io/agent/tree/master/deployments/docker), `docker` is a great tool for smaller deployments, where you are just running on a single machine and want to ramp up quickly. As you might expect, this is a not an ideal situation for production deployments.
Kubernetes can help you to build a scalable, flexible and resilient deployment. By introducing the concept of multi-nodes and deployments, you can make sure your Kerberos Agents are evenly distributed across your different machines, and you can add more nodes when you need to scale out.
We've provided an example deployment `deployment-agent.yml` in this directory, which show case you have to create a deployment (and under the hood a pod), to run a Kerberos Agent workload.
## Create a Kerberos Agent deployment
It's always a best practices to isolate and structure your workloads in Kubernetes. To achieve this we are utilising the concept of namespaces. For this example we will create a new namespace `demo`.
kubectl create namespace demo
Now we have a namespace, have a look at `deployment-agent.yml` in this folder. This configuration file describes the Kubernetes resources we would like to create, and how the Kerberos Agent needs to behave: environment variables, container ports, etc. At the bottom of the file, we find a `service` part, this tells Kubernetes to expose the Kerberos Agent user interface on a publicly accessible IP address. **_Please note that you don't need to expose this, as you can configure the Kerberos Agent with a volume and/or environment variables._**
Let's move on, and apply the Kerberos Agent deployment and service.
kubectl apply -f deployment-agent.yml -n demo
Watch deployment and service to be ready.
watch kubectl get all -n demo
When the deployment and service is created successfully, you should see something like this.
Every 2.0s: kubectl get all -n demo Fri Dec 9 16:33:17 2022
NAME READY STATUS RESTARTS AGE
pod/agent-7c75c4dbcf-zxrb5 1/1 Running 0 19s
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
service/agent-svc LoadBalancer 10.x.x.x 108.x.x.x 80:32664/TCP 20s
NAME READY UP-TO-DATE AVAILABLE AGE
deployment.apps/agent 1/1 1 1 20s
NAME DESIRED CURRENT READY AGE
replicaset.apps/agent-7c75c4dbcf 1 1 1 20s
When copying the `EXTERNAL-IP` and pasting it in your browser, you should see the Kerberos Agent user interface. You can use [the default username and password to sign-in](https://github.com/kerberos-io/agent#access-the-kerberos-agent), or if changed to your own (which is recommended).
## Configure with volumes
Just like with `docker`, you can also attach `volumes` to the Kerberos Agent deployment, by creating a `Persistent Volume` and mount it to a specific directory.
Depending on where and how you are hosting the Kubernetes cluster, you may need to create a new `storageClass` or use a predefined `storageClass` from your cloud provider (Azure, GCP, AWS, ..). Have a look at `deployment-agent-volume.yml` to review a complete example.
template:
metadata:
labels:
app: agent
spec:
volumes:
- name: kerberos-data
persistentVolumeClaim:
claimName: kerberos-data
...
containers:
- name: agent
image: kerberos/agent:latest
volumeMounts:
- name: kerberos-data
mountPath: /home/agent/data/config
subPath: config
...
## Expose with Ingress
In the first example `deployment-agent.yml` we are using a `LoadBalancer` to expose the Kerberos Agent user interface; as shown below. If you are a bit more experienced with Kubernetes, you will know there are other `service types` as well.
---
apiVersion: v1
kind: Service
...
type: LoadBalancer
ports:
- port: 80
...
An alternative to `LoadBalancer` is `Ingress`. By leveraging an ingress such as `ingress-nginx` or `traefik` you setup a gateway (single point of contact), through which all communication to your apps (services) will flow.
A huge benefit (there are many others), is that you only allocate 1 public IP address for all your services. So instead of creating a `LoadBalancer` and thus a public IP address for every agent, you will create an `Ingress` service for each agent. Review the complete example at `deployment-agent-with-ingress.yml`.
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: agent-ingress
labels:
name: agent-ingress
annotations:
kubernetes.io/ingress.class: nginx
kubernetes.io/tls-acme: "true"
nginx.ingress.kubernetes.io/ssl-redirect: "true"
cert-manager.io/cluster-issuer: "letsencrypt-prod"
spec:
tls:
- hosts:
- "myagent.kerberos.io"
secretName: agent-secret
rules:
- host: myagent.kerberos.io
http:
paths:
- pathType: Prefix
path: "/"
backend:
service:
name: agent-svc
port:
number: 80

View File

@@ -0,0 +1,54 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: agent
labels:
name: agent
spec:
selector:
matchLabels:
app: agent
replicas: 1
template:
metadata:
labels:
app: agent
spec:
volumes:
- name: kerberos-data
persistentVolumeClaim:
claimName: kerberos-data
initContainers:
- name: download-config
image: kerberos/agent:1b96d01
volumeMounts:
- name: kerberos-data
mountPath: /home/agent/data/config
subPath: config
command:
[
"cp",
"/home/agent/data/config.template.json",
"/home/agent/data/config/config.json",
]
containers:
- name: agent
image: kerberos/agent:latest
volumeMounts:
- name: kerberos-data
mountPath: /home/agent/data/config
subPath: config
- name: kerberos-data
mountPath: /home/agent/data/recordings
subPath: recordings
- name: kerberos-data
mountPath: /home/agent/data/snapshots
subPath: snapshots
- name: kerberos-data
mountPath: /home/agent/data/cloud
subPath: cloud
ports:
- containerPort: 80
protocol: TCP

View File

@@ -0,0 +1,82 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: agent
labels:
name: agent
spec:
selector:
matchLabels:
app: agent
replicas: 1
template:
metadata:
labels:
app: agent
spec:
containers:
- name: agent
image: kerberos/agent:latest
ports:
- containerPort: 80
protocol: TCP
resources:
limits:
cpu: 1000m
memory: 512Mi
requests:
cpu: 100m
memory: 128Mi
env:
- name: AGENT_NAME
value: demo-agent
- name: AGENT_CAPTURE_IPCAMERA_RTSP
value: rtsp://fake.kerberos.io/stream
- name: AGENT_HUB_KEY
value: yyy
- name: AGENT_HUB_PRIVATE_KEY
value: yyy
# find full list of environment variables here: https://github.com/kerberos-io/agent#override-with-environment-variables
---
apiVersion: v1
kind: Service
metadata:
name: agent-svc
labels:
name: agent-svc
spec:
#type: LoadBalancer
ports:
- port: 80
targetPort: 80
selector:
app: agent
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: agent-ingress
labels:
name: agent-ingress
annotations:
kubernetes.io/ingress.class: nginx
kubernetes.io/tls-acme: "true"
nginx.ingress.kubernetes.io/ssl-redirect: "true"
cert-manager.io/cluster-issuer: "letsencrypt-prod"
spec:
tls:
- hosts:
- "demo.kerberos.io"
secretName: agent-secret
rules:
- host: demo.kerberos.io
http:
paths:
- pathType: Prefix
path: "/"
backend:
service:
name: agent-svc
port:
number: 80

View File

@@ -0,0 +1,53 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: agent
labels:
name: agent
spec:
selector:
matchLabels:
app: agent
replicas: 1
template:
metadata:
labels:
app: agent
spec:
containers:
- name: agent
image: kerberos/agent:latest
ports:
- containerPort: 80
protocol: TCP
resources:
limits:
cpu: 1000m
memory: 512Mi
requests:
cpu: 100m
memory: 128Mi
env:
- name: AGENT_NAME
value: demo-agent
- name: AGENT_CAPTURE_IPCAMERA_RTSP
value: rtsp://fake.kerberos.io/stream
- name: AGENT_HUB_KEY
value: yyy
- name: AGENT_HUB_PRIVATE_KEY
value: yyy
# find full list of environment variables here: https://github.com/kerberos-io/agent#override-with-environment-variables
---
apiVersion: v1
kind: Service
metadata:
name: agent-svc
labels:
name: agent-svc
spec:
type: LoadBalancer
ports:
- port: 80
targetPort: 80
selector:
app: agent

View File

@@ -1,37 +1,41 @@
{
"type": "template",
"key": "0x123-a-test-agent",
"name": "camera",
"mqtturi": "tcp://mqtt.kerberos.io",
"mqtt_username": "xxx",
"mqtt_password": "xxx",
"timezone": "Europe/Brussels",
"stunuri": "stun:turn.kerberos.io:8443",
"turnuri": "turn:turn.kerberos.io:8443",
"turn_password": "xxx",
"type": "",
"key": "",
"name": "agent",
"time": "false",
"offline": "false",
"auto_clean": "true",
"remove_after_upload": "true",
"max_directory_size": 100,
"timezone": "Africa/Ceuta",
"capture": {
"id": "ipcamera",
"name": "",
"ipcamera": {
"rtsp": "xxx",
"rtsp": "",
"sub_rtsp": "",
"fps": ""
},
"usbcamera": {
"device": "",
"fps": ""
"device": ""
},
"raspicamera": {
"device": "",
"fps": ""
"device": ""
},
"continuous": "false",
"postrecording": 10,
"prerecording": 5,
"maxlengthrecording":60,
"recording": "true",
"snapshots": "true",
"liveview": "true",
"motion": "true",
"postrecording": 20,
"prerecording": 10,
"maxlengthrecording": 30,
"transcodingwebrtc": "",
"transcodingresolution": 0,
"forwardwebrtc": "",
"transcodingwebrtc": "false",
"transcodingresolution": 25,
"fragmented": "false",
"fragmentedduration": 1
"fragmentedduration": 8,
"pixelChangeThreshold": 150
},
"timetable": [
{
@@ -42,8 +46,8 @@
},
{
"start1": 0,
"end1": 69840,
"start2": 70080,
"end1": 43199,
"start2": 43200,
"end2": 86400
},
{
@@ -78,6 +82,7 @@
}
],
"region": {
"name": "",
"rectangle": {
"x1": 0,
"y1": 0,
@@ -86,16 +91,24 @@
},
"polygon": []
},
"cloud": "kstorage",
"cloud": "s3",
"s3": {
"proxyuri": "http://proxy.kerberos.io",
"bucket": "kerberosaccept",
"region": "eu-west1"
},
"kstorage": {},
"mqtturi": "tcp://mqtt.kerberos.io:1883",
"mqtt_username": "",
"mqtt_password": "",
"stunuri": "stun:turn.kerberos.io:8443",
"turnuri": "turn:turn.kerberos.io:8443",
"turn_username": "username1",
"turn_password": "password1",
"heartbeaturi": "",
"hub_uri": "https://api.cloud.kerberos.io",
"hub_key": "xxx",
"hub_private_key": "xxx",
"hub_key": "",
"hub_private_key": "",
"hub_site": "",
"kstorage": {
"uri": "https://staging.api.vault.kerberos.live",
"access_key": "xxx",
"secret_access_key": "xxx",
"provider": "",
"directory": "xxx"
}
}
"condition_uri": ""
}

View File

View File

@@ -24,7 +24,656 @@ const docTemplate = `{
},
"host": "{{.Host}}",
"basePath": "{{.BasePath}}",
"paths": {},
"paths": {
"/api/camera/onvif/capabilities": {
"post": {
"description": "Will return the ONVIF capabilities for the specific camera.",
"tags": [
"camera"
],
"summary": "Will return the ONVIF capabilities for the specific camera.",
"operationId": "camera-onvif-capabilities",
"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/login": {
"post": {
"description": "Try to login into ONVIF supported camera.",
"tags": [
"camera"
],
"summary": "Try to login into ONVIF supported camera.",
"operationId": "camera-onvif-login",
"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/pantilt": {
"post": {
"description": "Panning or/and tilting the camera using a direction (x,y).",
"tags": [
"camera"
],
"summary": "Panning or/and tilting the camera.",
"operationId": "camera-onvif-pantilt",
"parameters": [
{
"description": "OnvifPanTilt",
"name": "panTilt",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/models.OnvifPanTilt"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/models.APIResponse"
}
}
}
}
},
"/api/camera/onvif/zoom": {
"post": {
"description": "Zooming in or out the camera.",
"tags": [
"camera"
],
"summary": "Zooming in or out the camera.",
"operationId": "camera-onvif-zoom",
"parameters": [
{
"description": "OnvifZoom",
"name": "zoom",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/models.OnvifZoom"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/models.APIResponse"
}
}
}
}
},
"/api/camera/verify/{streamType}": {
"post": {
"description": "This method will validate a specific profile connection from an RTSP camera, and try to get the codec.",
"tags": [
"camera"
],
"summary": "Validate a specific RTSP profile camera connection.",
"operationId": "verify-camera",
"parameters": [
{
"enum": [
"primary",
"secondary"
],
"type": "string",
"description": "Stream Type",
"name": "streamType",
"in": "path",
"required": true
},
{
"description": "Camera Streams",
"name": "cameraStreams",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/models.CameraStreams"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/models.APIResponse"
}
}
}
}
},
"/api/hub/verify": {
"post": {
"security": [
{
"Bearer": []
}
],
"description": "Will verify the hub connectivity.",
"tags": [
"config"
],
"summary": "Will verify the hub connectivity.",
"operationId": "verify-hub",
"parameters": [
{
"description": "Config",
"name": "config",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/models.Config"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/models.APIResponse"
}
}
}
}
},
"/api/login": {
"post": {
"description": "Get Authorization token.",
"tags": [
"authentication"
],
"summary": "Get Authorization token.",
"operationId": "login",
"parameters": [
{
"description": "Credentials",
"name": "credentials",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/models.Authentication"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/models.Authorization"
}
}
}
}
},
"/api/persistence/verify": {
"post": {
"security": [
{
"Bearer": []
}
],
"description": "Will verify the persistence.",
"tags": [
"config"
],
"summary": "Will verify the persistence.",
"operationId": "verify-persistence",
"parameters": [
{
"description": "Config",
"name": "config",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/models.Config"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/models.APIResponse"
}
}
}
}
}
},
"definitions": {
"models.APIResponse": {
"type": "object",
"properties": {
"data": {},
"message": {}
}
},
"models.Authentication": {
"type": "object",
"properties": {
"password": {
"type": "string"
},
"username": {
"type": "string"
}
}
},
"models.Authorization": {
"type": "object",
"properties": {
"code": {
"type": "integer"
},
"expire": {
"type": "string"
},
"role": {
"type": "string"
},
"token": {
"type": "string"
},
"username": {
"type": "string"
}
}
},
"models.CameraStreams": {
"type": "object",
"properties": {
"rtsp": {
"type": "string"
},
"sub_rtsp": {
"type": "string"
}
}
},
"models.Capture": {
"type": "object",
"properties": {
"continuous": {
"type": "string"
},
"forwardwebrtc": {
"type": "string"
},
"fragmented": {
"type": "string"
},
"fragmentedduration": {
"type": "integer"
},
"ipcamera": {
"$ref": "#/definitions/models.IPCamera"
},
"maxlengthrecording": {
"type": "integer"
},
"name": {
"type": "string"
},
"pixelChangeThreshold": {
"type": "integer"
},
"postrecording": {
"type": "integer"
},
"prerecording": {
"type": "integer"
},
"raspicamera": {
"$ref": "#/definitions/models.RaspiCamera"
},
"transcodingresolution": {
"type": "integer"
},
"transcodingwebrtc": {
"type": "string"
},
"usbcamera": {
"$ref": "#/definitions/models.USBCamera"
}
}
},
"models.Config": {
"type": "object",
"properties": {
"auto_clean": {
"type": "string"
},
"capture": {
"$ref": "#/definitions/models.Capture"
},
"cloud": {
"type": "string"
},
"condition_uri": {
"type": "string"
},
"heartbeaturi": {
"description": "obsolete",
"type": "string"
},
"hub_key": {
"type": "string"
},
"hub_private_key": {
"type": "string"
},
"hub_site": {
"type": "string"
},
"hub_uri": {
"type": "string"
},
"key": {
"type": "string"
},
"kstorage": {
"$ref": "#/definitions/models.KStorage"
},
"max_directory_size": {
"type": "integer"
},
"mqtt_password": {
"type": "string"
},
"mqtt_username": {
"type": "string"
},
"mqtturi": {
"type": "string"
},
"name": {
"type": "string"
},
"offline": {
"type": "string"
},
"region": {
"$ref": "#/definitions/models.Region"
},
"s3": {
"$ref": "#/definitions/models.S3"
},
"stunuri": {
"type": "string"
},
"time": {
"type": "string"
},
"timetable": {
"type": "array",
"items": {
"$ref": "#/definitions/models.Timetable"
}
},
"timezone": {
"type": "string"
},
"turn_password": {
"type": "string"
},
"turn_username": {
"type": "string"
},
"turnuri": {
"type": "string"
},
"type": {
"type": "string"
}
}
},
"models.Coordinate": {
"type": "object",
"properties": {
"x": {
"type": "number"
},
"y": {
"type": "number"
}
}
},
"models.IPCamera": {
"type": "object",
"properties": {
"fps": {
"type": "string"
},
"onvif": {
"type": "boolean"
},
"onvif_password": {
"type": "string"
},
"onvif_username": {
"type": "string"
},
"onvif_xaddr": {
"type": "string"
},
"rtsp": {
"type": "string"
},
"sub_rtsp": {
"type": "string"
}
}
},
"models.KStorage": {
"type": "object",
"properties": {
"access_key": {
"type": "string"
},
"cloud_key": {
"description": "old way, remove this",
"type": "string"
},
"directory": {
"type": "string"
},
"provider": {
"type": "string"
},
"secret_access_key": {
"type": "string"
},
"uri": {
"type": "string"
}
}
},
"models.OnvifCredentials": {
"type": "object",
"properties": {
"onvif_password": {
"type": "string"
},
"onvif_username": {
"type": "string"
},
"onvif_xaddr": {
"type": "string"
}
}
},
"models.OnvifPanTilt": {
"type": "object",
"properties": {
"onvif_credentials": {
"$ref": "#/definitions/models.OnvifCredentials"
},
"pan": {
"type": "number"
},
"tilt": {
"type": "number"
}
}
},
"models.OnvifZoom": {
"type": "object",
"properties": {
"onvif_credentials": {
"$ref": "#/definitions/models.OnvifCredentials"
},
"zoom": {
"type": "number"
}
}
},
"models.Polygon": {
"type": "object",
"properties": {
"coordinates": {
"type": "array",
"items": {
"$ref": "#/definitions/models.Coordinate"
}
},
"id": {
"type": "string"
}
}
},
"models.RaspiCamera": {
"type": "object",
"properties": {
"device": {
"type": "string"
}
}
},
"models.Rectangle": {
"type": "object",
"properties": {
"x1": {
"type": "integer"
},
"x2": {
"type": "integer"
},
"y1": {
"type": "integer"
},
"y2": {
"type": "integer"
}
}
},
"models.Region": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"polygon": {
"type": "array",
"items": {
"$ref": "#/definitions/models.Polygon"
}
},
"rectangle": {
"$ref": "#/definitions/models.Rectangle"
}
}
},
"models.S3": {
"type": "object",
"properties": {
"bucket": {
"type": "string"
},
"proxy": {
"type": "string"
},
"proxyuri": {
"type": "string"
},
"publickey": {
"type": "string"
},
"region": {
"type": "string"
},
"secretkey": {
"type": "string"
},
"username": {
"type": "string"
}
}
},
"models.Timetable": {
"type": "object",
"properties": {
"end1": {
"type": "integer"
},
"end2": {
"type": "integer"
},
"start1": {
"type": "integer"
},
"start2": {
"type": "integer"
}
}
},
"models.USBCamera": {
"type": "object",
"properties": {
"device": {
"type": "string"
}
}
}
},
"securityDefinitions": {
"Bearer": {
"type": "apiKey",

View File

@@ -16,7 +16,656 @@
"version": "1.0"
},
"basePath": "/",
"paths": {},
"paths": {
"/api/camera/onvif/capabilities": {
"post": {
"description": "Will return the ONVIF capabilities for the specific camera.",
"tags": [
"camera"
],
"summary": "Will return the ONVIF capabilities for the specific camera.",
"operationId": "camera-onvif-capabilities",
"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/login": {
"post": {
"description": "Try to login into ONVIF supported camera.",
"tags": [
"camera"
],
"summary": "Try to login into ONVIF supported camera.",
"operationId": "camera-onvif-login",
"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/pantilt": {
"post": {
"description": "Panning or/and tilting the camera using a direction (x,y).",
"tags": [
"camera"
],
"summary": "Panning or/and tilting the camera.",
"operationId": "camera-onvif-pantilt",
"parameters": [
{
"description": "OnvifPanTilt",
"name": "panTilt",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/models.OnvifPanTilt"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/models.APIResponse"
}
}
}
}
},
"/api/camera/onvif/zoom": {
"post": {
"description": "Zooming in or out the camera.",
"tags": [
"camera"
],
"summary": "Zooming in or out the camera.",
"operationId": "camera-onvif-zoom",
"parameters": [
{
"description": "OnvifZoom",
"name": "zoom",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/models.OnvifZoom"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/models.APIResponse"
}
}
}
}
},
"/api/camera/verify/{streamType}": {
"post": {
"description": "This method will validate a specific profile connection from an RTSP camera, and try to get the codec.",
"tags": [
"camera"
],
"summary": "Validate a specific RTSP profile camera connection.",
"operationId": "verify-camera",
"parameters": [
{
"enum": [
"primary",
"secondary"
],
"type": "string",
"description": "Stream Type",
"name": "streamType",
"in": "path",
"required": true
},
{
"description": "Camera Streams",
"name": "cameraStreams",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/models.CameraStreams"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/models.APIResponse"
}
}
}
}
},
"/api/hub/verify": {
"post": {
"security": [
{
"Bearer": []
}
],
"description": "Will verify the hub connectivity.",
"tags": [
"config"
],
"summary": "Will verify the hub connectivity.",
"operationId": "verify-hub",
"parameters": [
{
"description": "Config",
"name": "config",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/models.Config"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/models.APIResponse"
}
}
}
}
},
"/api/login": {
"post": {
"description": "Get Authorization token.",
"tags": [
"authentication"
],
"summary": "Get Authorization token.",
"operationId": "login",
"parameters": [
{
"description": "Credentials",
"name": "credentials",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/models.Authentication"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/models.Authorization"
}
}
}
}
},
"/api/persistence/verify": {
"post": {
"security": [
{
"Bearer": []
}
],
"description": "Will verify the persistence.",
"tags": [
"config"
],
"summary": "Will verify the persistence.",
"operationId": "verify-persistence",
"parameters": [
{
"description": "Config",
"name": "config",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/models.Config"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/models.APIResponse"
}
}
}
}
}
},
"definitions": {
"models.APIResponse": {
"type": "object",
"properties": {
"data": {},
"message": {}
}
},
"models.Authentication": {
"type": "object",
"properties": {
"password": {
"type": "string"
},
"username": {
"type": "string"
}
}
},
"models.Authorization": {
"type": "object",
"properties": {
"code": {
"type": "integer"
},
"expire": {
"type": "string"
},
"role": {
"type": "string"
},
"token": {
"type": "string"
},
"username": {
"type": "string"
}
}
},
"models.CameraStreams": {
"type": "object",
"properties": {
"rtsp": {
"type": "string"
},
"sub_rtsp": {
"type": "string"
}
}
},
"models.Capture": {
"type": "object",
"properties": {
"continuous": {
"type": "string"
},
"forwardwebrtc": {
"type": "string"
},
"fragmented": {
"type": "string"
},
"fragmentedduration": {
"type": "integer"
},
"ipcamera": {
"$ref": "#/definitions/models.IPCamera"
},
"maxlengthrecording": {
"type": "integer"
},
"name": {
"type": "string"
},
"pixelChangeThreshold": {
"type": "integer"
},
"postrecording": {
"type": "integer"
},
"prerecording": {
"type": "integer"
},
"raspicamera": {
"$ref": "#/definitions/models.RaspiCamera"
},
"transcodingresolution": {
"type": "integer"
},
"transcodingwebrtc": {
"type": "string"
},
"usbcamera": {
"$ref": "#/definitions/models.USBCamera"
}
}
},
"models.Config": {
"type": "object",
"properties": {
"auto_clean": {
"type": "string"
},
"capture": {
"$ref": "#/definitions/models.Capture"
},
"cloud": {
"type": "string"
},
"condition_uri": {
"type": "string"
},
"heartbeaturi": {
"description": "obsolete",
"type": "string"
},
"hub_key": {
"type": "string"
},
"hub_private_key": {
"type": "string"
},
"hub_site": {
"type": "string"
},
"hub_uri": {
"type": "string"
},
"key": {
"type": "string"
},
"kstorage": {
"$ref": "#/definitions/models.KStorage"
},
"max_directory_size": {
"type": "integer"
},
"mqtt_password": {
"type": "string"
},
"mqtt_username": {
"type": "string"
},
"mqtturi": {
"type": "string"
},
"name": {
"type": "string"
},
"offline": {
"type": "string"
},
"region": {
"$ref": "#/definitions/models.Region"
},
"s3": {
"$ref": "#/definitions/models.S3"
},
"stunuri": {
"type": "string"
},
"time": {
"type": "string"
},
"timetable": {
"type": "array",
"items": {
"$ref": "#/definitions/models.Timetable"
}
},
"timezone": {
"type": "string"
},
"turn_password": {
"type": "string"
},
"turn_username": {
"type": "string"
},
"turnuri": {
"type": "string"
},
"type": {
"type": "string"
}
}
},
"models.Coordinate": {
"type": "object",
"properties": {
"x": {
"type": "number"
},
"y": {
"type": "number"
}
}
},
"models.IPCamera": {
"type": "object",
"properties": {
"fps": {
"type": "string"
},
"onvif": {
"type": "boolean"
},
"onvif_password": {
"type": "string"
},
"onvif_username": {
"type": "string"
},
"onvif_xaddr": {
"type": "string"
},
"rtsp": {
"type": "string"
},
"sub_rtsp": {
"type": "string"
}
}
},
"models.KStorage": {
"type": "object",
"properties": {
"access_key": {
"type": "string"
},
"cloud_key": {
"description": "old way, remove this",
"type": "string"
},
"directory": {
"type": "string"
},
"provider": {
"type": "string"
},
"secret_access_key": {
"type": "string"
},
"uri": {
"type": "string"
}
}
},
"models.OnvifCredentials": {
"type": "object",
"properties": {
"onvif_password": {
"type": "string"
},
"onvif_username": {
"type": "string"
},
"onvif_xaddr": {
"type": "string"
}
}
},
"models.OnvifPanTilt": {
"type": "object",
"properties": {
"onvif_credentials": {
"$ref": "#/definitions/models.OnvifCredentials"
},
"pan": {
"type": "number"
},
"tilt": {
"type": "number"
}
}
},
"models.OnvifZoom": {
"type": "object",
"properties": {
"onvif_credentials": {
"$ref": "#/definitions/models.OnvifCredentials"
},
"zoom": {
"type": "number"
}
}
},
"models.Polygon": {
"type": "object",
"properties": {
"coordinates": {
"type": "array",
"items": {
"$ref": "#/definitions/models.Coordinate"
}
},
"id": {
"type": "string"
}
}
},
"models.RaspiCamera": {
"type": "object",
"properties": {
"device": {
"type": "string"
}
}
},
"models.Rectangle": {
"type": "object",
"properties": {
"x1": {
"type": "integer"
},
"x2": {
"type": "integer"
},
"y1": {
"type": "integer"
},
"y2": {
"type": "integer"
}
}
},
"models.Region": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"polygon": {
"type": "array",
"items": {
"$ref": "#/definitions/models.Polygon"
}
},
"rectangle": {
"$ref": "#/definitions/models.Rectangle"
}
}
},
"models.S3": {
"type": "object",
"properties": {
"bucket": {
"type": "string"
},
"proxy": {
"type": "string"
},
"proxyuri": {
"type": "string"
},
"publickey": {
"type": "string"
},
"region": {
"type": "string"
},
"secretkey": {
"type": "string"
},
"username": {
"type": "string"
}
}
},
"models.Timetable": {
"type": "object",
"properties": {
"end1": {
"type": "integer"
},
"end2": {
"type": "integer"
},
"start1": {
"type": "integer"
},
"start2": {
"type": "integer"
}
}
},
"models.USBCamera": {
"type": "object",
"properties": {
"device": {
"type": "string"
}
}
}
},
"securityDefinitions": {
"Bearer": {
"type": "apiKey",

View File

@@ -1,4 +1,262 @@
basePath: /
definitions:
models.APIResponse:
properties:
data: {}
message: {}
type: object
models.Authentication:
properties:
password:
type: string
username:
type: string
type: object
models.Authorization:
properties:
code:
type: integer
expire:
type: string
role:
type: string
token:
type: string
username:
type: string
type: object
models.CameraStreams:
properties:
rtsp:
type: string
sub_rtsp:
type: string
type: object
models.Capture:
properties:
continuous:
type: string
forwardwebrtc:
type: string
fragmented:
type: string
fragmentedduration:
type: integer
ipcamera:
$ref: '#/definitions/models.IPCamera'
maxlengthrecording:
type: integer
name:
type: string
pixelChangeThreshold:
type: integer
postrecording:
type: integer
prerecording:
type: integer
raspicamera:
$ref: '#/definitions/models.RaspiCamera'
transcodingresolution:
type: integer
transcodingwebrtc:
type: string
usbcamera:
$ref: '#/definitions/models.USBCamera'
type: object
models.Config:
properties:
auto_clean:
type: string
capture:
$ref: '#/definitions/models.Capture'
cloud:
type: string
condition_uri:
type: string
heartbeaturi:
description: obsolete
type: string
hub_key:
type: string
hub_private_key:
type: string
hub_site:
type: string
hub_uri:
type: string
key:
type: string
kstorage:
$ref: '#/definitions/models.KStorage'
max_directory_size:
type: integer
mqtt_password:
type: string
mqtt_username:
type: string
mqtturi:
type: string
name:
type: string
offline:
type: string
region:
$ref: '#/definitions/models.Region'
s3:
$ref: '#/definitions/models.S3'
stunuri:
type: string
time:
type: string
timetable:
items:
$ref: '#/definitions/models.Timetable'
type: array
timezone:
type: string
turn_password:
type: string
turn_username:
type: string
turnuri:
type: string
type:
type: string
type: object
models.Coordinate:
properties:
x:
type: number
"y":
type: number
type: object
models.IPCamera:
properties:
fps:
type: string
onvif:
type: boolean
onvif_password:
type: string
onvif_username:
type: string
onvif_xaddr:
type: string
rtsp:
type: string
sub_rtsp:
type: string
type: object
models.KStorage:
properties:
access_key:
type: string
cloud_key:
description: old way, remove this
type: string
directory:
type: string
provider:
type: string
secret_access_key:
type: string
uri:
type: string
type: object
models.OnvifCredentials:
properties:
onvif_password:
type: string
onvif_username:
type: string
onvif_xaddr:
type: string
type: object
models.OnvifPanTilt:
properties:
onvif_credentials:
$ref: '#/definitions/models.OnvifCredentials'
pan:
type: number
tilt:
type: number
type: object
models.OnvifZoom:
properties:
onvif_credentials:
$ref: '#/definitions/models.OnvifCredentials'
zoom:
type: number
type: object
models.Polygon:
properties:
coordinates:
items:
$ref: '#/definitions/models.Coordinate'
type: array
id:
type: string
type: object
models.RaspiCamera:
properties:
device:
type: string
type: object
models.Rectangle:
properties:
x1:
type: integer
x2:
type: integer
y1:
type: integer
y2:
type: integer
type: object
models.Region:
properties:
name:
type: string
polygon:
items:
$ref: '#/definitions/models.Polygon'
type: array
rectangle:
$ref: '#/definitions/models.Rectangle'
type: object
models.S3:
properties:
bucket:
type: string
proxy:
type: string
proxyuri:
type: string
publickey:
type: string
region:
type: string
secretkey:
type: string
username:
type: string
type: object
models.Timetable:
properties:
end1:
type: integer
end2:
type: integer
start1:
type: integer
start2:
type: integer
type: object
models.USBCamera:
properties:
device:
type: string
type: object
info:
contact:
email: support@kerberos.io
@@ -11,7 +269,172 @@ info:
termsOfService: https://kerberos.io
title: Swagger Kerberos Agent API
version: "1.0"
paths: {}
paths:
/api/camera/onvif/capabilities:
post:
description: Will return the ONVIF capabilities for the specific camera.
operationId: camera-onvif-capabilities
parameters:
- description: OnvifCredentials
in: body
name: config
required: true
schema:
$ref: '#/definitions/models.OnvifCredentials'
responses:
"200":
description: OK
schema:
$ref: '#/definitions/models.APIResponse'
summary: Will return the ONVIF capabilities for the specific camera.
tags:
- camera
/api/camera/onvif/login:
post:
description: Try to login into ONVIF supported camera.
operationId: camera-onvif-login
parameters:
- description: OnvifCredentials
in: body
name: config
required: true
schema:
$ref: '#/definitions/models.OnvifCredentials'
responses:
"200":
description: OK
schema:
$ref: '#/definitions/models.APIResponse'
summary: Try to login into ONVIF supported camera.
tags:
- camera
/api/camera/onvif/pantilt:
post:
description: Panning or/and tilting the camera using a direction (x,y).
operationId: camera-onvif-pantilt
parameters:
- description: OnvifPanTilt
in: body
name: panTilt
required: true
schema:
$ref: '#/definitions/models.OnvifPanTilt'
responses:
"200":
description: OK
schema:
$ref: '#/definitions/models.APIResponse'
summary: Panning or/and tilting the camera.
tags:
- camera
/api/camera/onvif/zoom:
post:
description: Zooming in or out the camera.
operationId: camera-onvif-zoom
parameters:
- description: OnvifZoom
in: body
name: zoom
required: true
schema:
$ref: '#/definitions/models.OnvifZoom'
responses:
"200":
description: OK
schema:
$ref: '#/definitions/models.APIResponse'
summary: Zooming in or out the camera.
tags:
- camera
/api/camera/verify/{streamType}:
post:
description: This method will validate a specific profile connection from an
RTSP camera, and try to get the codec.
operationId: verify-camera
parameters:
- description: Stream Type
enum:
- primary
- secondary
in: path
name: streamType
required: true
type: string
- description: Camera Streams
in: body
name: cameraStreams
required: true
schema:
$ref: '#/definitions/models.CameraStreams'
responses:
"200":
description: OK
schema:
$ref: '#/definitions/models.APIResponse'
summary: Validate a specific RTSP profile camera connection.
tags:
- camera
/api/hub/verify:
post:
description: Will verify the hub connectivity.
operationId: verify-hub
parameters:
- description: Config
in: body
name: config
required: true
schema:
$ref: '#/definitions/models.Config'
responses:
"200":
description: OK
schema:
$ref: '#/definitions/models.APIResponse'
security:
- Bearer: []
summary: Will verify the hub connectivity.
tags:
- config
/api/login:
post:
description: Get Authorization token.
operationId: login
parameters:
- description: Credentials
in: body
name: credentials
required: true
schema:
$ref: '#/definitions/models.Authentication'
responses:
"200":
description: OK
schema:
$ref: '#/definitions/models.Authorization'
summary: Get Authorization token.
tags:
- authentication
/api/persistence/verify:
post:
description: Will verify the persistence.
operationId: verify-persistence
parameters:
- description: Config
in: body
name: config
required: true
schema:
$ref: '#/definitions/models.Config'
responses:
"200":
description: OK
schema:
$ref: '#/definitions/models.APIResponse'
security:
- Bearer: []
summary: Will verify the persistence.
tags:
- config
securityDefinitions:
Bearer:
in: header

View File

@@ -1,101 +1,129 @@
module github.com/kerberos-io/agent/machinery
go 1.18
go 1.19
//replace github.com/kerberos-io/joy4 v1.0.54 => ../../../../github.com/kerberos-io/joy4
//replace github.com/kerberos-io/onvif v0.0.5 => ../../../../github.com/kerberos-io/onvif
require (
github.com/InVisionApp/conjungo v1.1.0
github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751
github.com/appleboy/gin-jwt/v2 v2.8.0
github.com/appleboy/gin-jwt/v2 v2.9.1
github.com/cedricve/go-onvif v0.0.0-20200222191200-567e8ce298f6
github.com/deepch/vdk v0.0.17
github.com/eclipse/paho.mqtt.golang v1.4.1
github.com/gin-contrib/cors v1.3.1
github.com/gin-contrib/pprof v1.3.0
github.com/gin-gonic/contrib v0.0.0-20201101042839-6a891bf89f19
github.com/gin-gonic/gin v1.8.1
github.com/golang-jwt/jwt/v4 v4.2.0
github.com/deepch/vdk v0.0.19
github.com/eclipse/paho.mqtt.golang v1.4.2
github.com/elastic/go-sysinfo v1.9.0
github.com/gin-contrib/cors v1.4.0
github.com/gin-contrib/pprof v1.4.0
github.com/gin-gonic/contrib v0.0.0-20221130124618-7e01895a63f2
github.com/gin-gonic/gin v1.8.2
github.com/golang-jwt/jwt/v4 v4.4.3
github.com/golang-module/carbon/v2 v2.2.3
github.com/gorilla/websocket v1.5.0
github.com/kellydunn/golang-geo v0.7.0
github.com/kerberos-io/joy4 v1.0.33
github.com/kerberos-io/onvif v0.0.3
github.com/kerberos-io/joy4 v1.0.55
github.com/kerberos-io/onvif v0.0.5
github.com/minio/minio-go/v6 v6.0.57
github.com/nsmith5/mjpeg v0.0.0-20200913181537-54b8ada0e53e
github.com/op/go-logging v0.0.0-20160315200505-970db520ece7
github.com/pion/webrtc/v3 v3.1.41
github.com/shirou/gopsutil v3.21.11+incompatible
github.com/sirupsen/logrus v1.8.1
github.com/swaggo/files v0.0.0-20220610200504-28940afbdbfe
github.com/swaggo/gin-swagger v1.5.0
github.com/swaggo/swag v1.8.3
github.com/pion/webrtc/v3 v3.1.50
github.com/sirupsen/logrus v1.9.0
github.com/swaggo/files v1.0.0
github.com/swaggo/gin-swagger v1.5.3
github.com/swaggo/swag v1.8.9
github.com/tevino/abool v1.2.0
gocv.io/x/gocv v0.31.0
gopkg.in/DataDog/dd-trace-go.v1 v1.46.0
gopkg.in/mgo.v2 v2.0.0-20190816093944-a6b53ec6cb22
gopkg.in/natefinch/lumberjack.v2 v2.0.0
)
require (
github.com/DataDog/datadog-agent/pkg/obfuscate v0.0.0-20211129110424-6491aa3bf583 // indirect
github.com/DataDog/datadog-agent/pkg/remoteconfig/state v0.42.0-rc.1 // indirect
github.com/DataDog/datadog-go v4.8.2+incompatible // indirect
github.com/DataDog/datadog-go/v5 v5.0.2 // indirect
github.com/DataDog/go-tuf v0.3.0--fix-localmeta-fork // indirect
github.com/DataDog/gostackparse v0.5.0 // indirect
github.com/DataDog/sketches-go v1.2.1 // indirect
github.com/KyleBanks/depth v1.2.1 // indirect
github.com/Microsoft/go-winio v0.5.1 // indirect
github.com/PuerkitoBio/purell v1.1.1 // indirect
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect
github.com/beevik/etree v1.1.0 // indirect
github.com/cespare/xxhash/v2 v2.1.2 // indirect
github.com/clbanning/mxj v1.8.4 // indirect
github.com/dgraph-io/ristretto v0.1.0 // indirect
github.com/dustin/go-humanize v1.0.0 // indirect
github.com/elastic/go-windows v1.0.0 // indirect
github.com/elgs/gostrgen v0.0.0-20161222160715-9d61ae07eeae // indirect
github.com/erikstmartin/go-testdb v0.0.0-20160219214506-8d10e4a1bae5 // indirect
github.com/gin-contrib/sse v0.1.0 // indirect
github.com/go-ole/go-ole v1.2.6 // indirect
github.com/go-openapi/jsonpointer v0.19.5 // indirect
github.com/go-openapi/jsonreference v0.19.6 // indirect
github.com/go-openapi/spec v0.20.4 // indirect
github.com/go-openapi/swag v0.19.15 // indirect
github.com/go-playground/locales v0.14.0 // indirect
github.com/go-playground/universal-translator v0.18.0 // indirect
github.com/go-playground/validator/v10 v10.10.0 // indirect
github.com/goccy/go-json v0.9.7 // indirect
github.com/gofrs/uuid v4.2.0+incompatible // indirect
github.com/go-playground/validator/v10 v10.11.1 // indirect
github.com/goccy/go-json v0.10.0 // indirect
github.com/gofrs/uuid v3.2.0+incompatible // indirect
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b // indirect
github.com/google/pprof v0.0.0-20210423192551-a2663126120b // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/gorilla/websocket v1.4.2 // indirect
github.com/joeshaw/multierror v0.0.0-20140124173710-69b34d4ec901 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/klauspost/cpuid v1.2.3 // indirect
github.com/kylelemons/go-gypsy v1.0.0 // indirect
github.com/leodido/go-urn v1.2.1 // indirect
github.com/lib/pq v1.10.6 // indirect
github.com/mailru/easyjson v0.7.6 // indirect
github.com/mattn/go-isatty v0.0.14 // indirect
github.com/lib/pq v1.10.7 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/mattn/go-isatty v0.0.16 // indirect
github.com/minio/md5-simd v1.1.0 // indirect
github.com/minio/sha256-simd v0.1.1 // indirect
github.com/mitchellh/go-homedir v1.1.0 // indirect
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/pelletier/go-toml/v2 v2.0.1 // indirect
github.com/pion/datachannel v1.5.2 // indirect
github.com/pelletier/go-toml/v2 v2.0.6 // indirect
github.com/philhofer/fwd v1.1.1 // indirect
github.com/pion/datachannel v1.5.5 // indirect
github.com/pion/dtls/v2 v2.1.5 // indirect
github.com/pion/ice/v2 v2.2.6 // indirect
github.com/pion/ice/v2 v2.2.12 // indirect
github.com/pion/interceptor v0.1.11 // indirect
github.com/pion/logging v0.2.2 // indirect
github.com/pion/mdns v0.0.5 // indirect
github.com/pion/randutil v0.1.0 // indirect
github.com/pion/rtcp v1.2.9 // indirect
github.com/pion/rtcp v1.2.10 // indirect
github.com/pion/rtp v1.7.13 // indirect
github.com/pion/sctp v1.8.2 // indirect
github.com/pion/sdp/v3 v3.0.5 // indirect
github.com/pion/srtp/v2 v2.0.9 // indirect
github.com/pion/sctp v1.8.5 // indirect
github.com/pion/sdp/v3 v3.0.6 // indirect
github.com/pion/srtp/v2 v2.0.10 // indirect
github.com/pion/stun v0.3.5 // indirect
github.com/pion/transport v0.13.0 // indirect
github.com/pion/transport v0.14.1 // indirect
github.com/pion/turn/v2 v2.0.8 // indirect
github.com/pion/udp v0.1.1 // indirect
github.com/tklauser/go-sysconf v0.3.10 // indirect
github.com/tklauser/numcpus v0.4.0 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/prometheus/procfs v0.8.0 // indirect
github.com/richardartoul/molecule v1.0.1-0.20221107223329-32cfee06a052 // indirect
github.com/secure-systems-lab/go-securesystemslib v0.4.0 // indirect
github.com/spaolacci/murmur3 v1.1.0 // indirect
github.com/tinylib/msgp v1.1.6 // indirect
github.com/ugorji/go/codec v1.2.7 // indirect
github.com/yuin/goldmark v1.4.1 // indirect
github.com/yusufpapurcu/wmi v1.2.2 // indirect
github.com/ziutek/mymysql v1.5.4 // indirect
golang.org/x/crypto v0.0.0-20220516162934-403b01795ae8 // indirect
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4 // indirect
golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4 // indirect
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c // indirect
golang.org/x/sys v0.0.0-20220128215802-99c3d69c2c27 // indirect
golang.org/x/text v0.3.7 // indirect
golang.org/x/tools v0.1.11 // indirect
google.golang.org/protobuf v1.28.0 // indirect
go4.org/intern v0.0.0-20211027215823-ae77deb06f29 // indirect
go4.org/unsafe/assume-no-moving-gc v0.0.0-20220617031537-928513b29760 // indirect
golang.org/x/crypto v0.4.0 // indirect
golang.org/x/net v0.4.0 // indirect
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4 // indirect
golang.org/x/sys v0.3.0 // indirect
golang.org/x/text v0.5.0 // indirect
golang.org/x/time v0.0.0-20211116232009-f0f3c7e86c11 // indirect
golang.org/x/tools v0.1.12 // indirect
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect
google.golang.org/grpc v1.32.0 // indirect
google.golang.org/protobuf v1.28.1 // indirect
gopkg.in/ini.v1 v1.42.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
howett.net/plist v0.0.0-20181124034731-591f970eefbb // indirect
inet.af/netaddr v0.0.0-20220617031823-097006376321 // indirect
)

View File

@@ -1,63 +1,98 @@
cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/DataDog/datadog-agent/pkg/obfuscate v0.0.0-20211129110424-6491aa3bf583 h1:3nVO1nQyh64IUY6BPZUpMYMZ738Pu+LsMt3E0eqqIYw=
github.com/DataDog/datadog-agent/pkg/obfuscate v0.0.0-20211129110424-6491aa3bf583/go.mod h1:EP9f4GqaDJyP1F5jTNMtzdIpw3JpNs3rMSJOnYywCiw=
github.com/DataDog/datadog-agent/pkg/remoteconfig/state v0.42.0-rc.1 h1:Rmz52Xlc5k3WzAHzD0SCH4USCzyti7EbK4HtrHys3ME=
github.com/DataDog/datadog-agent/pkg/remoteconfig/state v0.42.0-rc.1/go.mod h1:VVMDDibJxYEkwcLdZBT2g8EHKpbMT4JdOhRbQ9GdjbM=
github.com/DataDog/datadog-go v4.8.2+incompatible h1:qbcKSx29aBLD+5QLvlQZlGmRMF/FfGqFLFev/1TDzRo=
github.com/DataDog/datadog-go v4.8.2+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ=
github.com/DataDog/datadog-go/v5 v5.0.2 h1:UFtEe7662/Qojxkw1d6SboAeA0CPI3naKhVASwFn+04=
github.com/DataDog/datadog-go/v5 v5.0.2/go.mod h1:ZI9JFB4ewXbw1sBnF4sxsR2k1H3xjV+PUAOUsHvKpcU=
github.com/DataDog/go-tuf v0.3.0--fix-localmeta-fork h1:yBq5PrAtrM4yVeSzQ+bn050+Ysp++RKF1QmtkL4VqvU=
github.com/DataDog/go-tuf v0.3.0--fix-localmeta-fork/go.mod h1:yA5JwkZsHTLuqq3zaRgUQf35DfDkpOZqgtBqHKpwrBs=
github.com/DataDog/gostackparse v0.5.0 h1:jb72P6GFHPHz2W0onsN51cS3FkaMDcjb0QzgxxA4gDk=
github.com/DataDog/gostackparse v0.5.0/go.mod h1:lTfqcJKqS9KnXQGnyQMCugq3u1FP6UZMfWR0aitKFMM=
github.com/DataDog/sketches-go v1.2.1 h1:qTBzWLnZ3kM2kw39ymh6rMcnN+5VULwFs++lEYUUsro=
github.com/DataDog/sketches-go v1.2.1/go.mod h1:1xYmPLY1So10AwxV6MJV0J53XVH+WL9Ad1KetxVivVI=
github.com/InVisionApp/conjungo v1.1.0 h1:NMPwvjK0i7UujnGnpbvAscruuroeYYVR55OAgBmM6oc=
github.com/InVisionApp/conjungo v1.1.0/go.mod h1:86uJs2j/N0qcjh0ORLQDw1bB5kPFS/CoprqySSyp8dc=
github.com/KyleBanks/depth v1.2.1 h1:5h8fQADFrWtarTdtDudMmGsC7GPbOAu6RVB3ffsVFHc=
github.com/KyleBanks/depth v1.2.1/go.mod h1:jzSb9d0L43HxTQfT+oSA1EEp2q+ne2uh6XgeJcm8brE=
github.com/Microsoft/go-winio v0.5.0/go.mod h1:JPGBdM1cNvN/6ISo+n8V5iA4v8pBzdOpzfwIujj1a84=
github.com/Microsoft/go-winio v0.5.1 h1:aPJp2QD7OOrhO5tQXqQoGSJc+DjDtWTGLOmNyAm6FgY=
github.com/Microsoft/go-winio v0.5.1/go.mod h1:JPGBdM1cNvN/6ISo+n8V5iA4v8pBzdOpzfwIujj1a84=
github.com/PuerkitoBio/purell v1.1.1 h1:WEQqlqaGbrPkxLJWfBwQmfEAE1Z7ONdDLqrN38tNFfI=
github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0=
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 h1:d+Bc7a5rLufV/sSk/8dngufqelfh6jnri85riMAaF/M=
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE=
github.com/agiledragon/gomonkey/v2 v2.3.1/go.mod h1:ap1AmDzcVOAz1YpeJ3TCzIgstoaWLA6jbbgxfB4w2iY=
github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 h1:JYp7IbQjafoB+tBA3gMyHYHrpOtNuDiK/uB5uXxq5wM=
github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
github.com/appleboy/gin-jwt/v2 v2.8.0 h1:Glo7cb9eBR+hj8Y7WzgfkOlqCaNLjP+RV4dNO3fpdps=
github.com/appleboy/gin-jwt/v2 v2.8.0/go.mod h1:KsK7E8HTvRg3vOiumTsr/ntNTHbZ3IbHLe4Eto31p7k=
github.com/appleboy/gin-jwt/v2 v2.9.1 h1:l29et8iLW6omcHltsOP6LLk4s3v4g2FbFs0koxGWVZs=
github.com/appleboy/gin-jwt/v2 v2.9.1/go.mod h1:jwcPZJ92uoC9nOUTOKWoN/f6JZOgMSKlFSHw5/FrRUk=
github.com/appleboy/gofight/v2 v2.1.2 h1:VOy3jow4vIK8BRQJoC/I9muxyYlJ2yb9ht2hZoS3rf4=
github.com/appleboy/gofight/v2 v2.1.2/go.mod h1:frW+U1QZEdDgixycTj4CygQ48yLTUhplt43+Wczp3rw=
github.com/beevik/etree v1.1.0 h1:T0xke/WvNtMoCqgzPhkX2r4rjY3GDZFi+FjpRZY2Jbs=
github.com/beevik/etree v1.1.0/go.mod h1:r8Aw8JqVegEf0w2fDnATrX9VpkMcyFeM0FhwO62wh+A=
github.com/cedricve/go-onvif v0.0.0-20200222191200-567e8ce298f6 h1:bzFZYgZD5vf4PWaa2GjOh90HG88uKi2a+B6VnQcDlCA=
github.com/cedricve/go-onvif v0.0.0-20200222191200-567e8ce298f6/go.mod h1:nBrjN2nMHendp0Cvb/6GaJ1v92Qv/kzqxWtNBnKJEK0=
github.com/cheekybits/genny v1.0.0/go.mod h1:+tQajlRqAUrPI7DOSpB0XAqZYtQakVtB7wXkRAgjxjQ=
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
github.com/cespare/xxhash/v2 v2.1.2 h1:YRXhKfTDauu4ajMg1TPgFO5jnlC2HCbmLXMcTG5cbYE=
github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI=
github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI=
github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU=
github.com/clbanning/mxj v1.8.4 h1:HuhwZtbyvyOw+3Z1AowPkU87JkJUSv751ELWaiTpj8I=
github.com/clbanning/mxj v1.8.4/go.mod h1:BVjHeAH+rl9rs6f+QIpeRl0tfu10SXn1pUSa5PVGJng=
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc=
github.com/codahale/rfc6979 v0.0.0-20141003034818-6a90f24967eb/go.mod h1:ZjrT6AXHbDs86ZSdt/osfBi5qfexBrKUdONk989Wnk4=
github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/deepch/vdk v0.0.17 h1:FbNgJ3DVHRuMoVCUFcKAwAQ+EBfgP8nygVbg+fiqUAY=
github.com/deepch/vdk v0.0.17/go.mod h1:KqQ/KU3hOc4a62l/jPRH5Hiz5fhTq5cGCl8IqeCxWQI=
github.com/deepch/vdk v0.0.19 h1:r6xYyBTtXEIEh+csO0XHT00sI7xLF+hQFkJE9/go5II=
github.com/deepch/vdk v0.0.19/go.mod h1:7ydHfSkflMZxBXfWR79dMjrT54xzvLxnPaByOa9Jpzg=
github.com/dgraph-io/ristretto v0.1.0 h1:Jv3CGQHp9OjuMBSne1485aDpUkTKEcUqF+jm/LuerPI=
github.com/dgraph-io/ristretto v0.1.0/go.mod h1:fux0lOrBhrVCJd3lcTHsIJhq1T2rokOu6v9Vcb3Q9ug=
github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2 h1:tdlZCpZ/P9DhczCTSixgIKmwPv6+wP5DGjqLYw5SUiA=
github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw=
github.com/dustin/go-humanize v1.0.0 h1:VSnTsYCnlFHaM2/igO1h6X3HA71jcobQuxemgkq4zYo=
github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk=
github.com/eclipse/paho.mqtt.golang v1.4.1 h1:tUSpviiL5G3P9SZZJPC4ZULZJsxQKXxfENpMvdbAXAI=
github.com/eclipse/paho.mqtt.golang v1.4.1/go.mod h1:JGt0RsEwEX+Xa/agj90YJ9d9DH2b7upDZMK9HRbFvCA=
github.com/dvyukov/go-fuzz v0.0.0-20210103155950-6a8e9d1f2415/go.mod h1:11Gm+ccJnvAhCNLlf5+cS9KjtbaD5I5zaZpFMsTHWTw=
github.com/eclipse/paho.mqtt.golang v1.4.2 h1:66wOzfUHSSI1zamx7jR6yMEI5EuHnT1G6rNA5PM12m4=
github.com/eclipse/paho.mqtt.golang v1.4.2/go.mod h1:JGt0RsEwEX+Xa/agj90YJ9d9DH2b7upDZMK9HRbFvCA=
github.com/elastic/go-sysinfo v1.9.0 h1:usICqY/Nw4Mpn9f4LdtpFrKxXroJDe81GaxxUlCckIo=
github.com/elastic/go-sysinfo v1.9.0/go.mod h1:eBD1wEGVaRnRLGecc9iG1z8eOv5HnEdz9+nWd8UAxcE=
github.com/elastic/go-windows v1.0.0 h1:qLURgZFkkrYyTTkvYpsZIgf83AUsdIHfvlJaqaZ7aSY=
github.com/elastic/go-windows v1.0.0/go.mod h1:TsU0Nrp7/y3+VwE82FoZF8gC/XFg/Elz6CcloAxnPgU=
github.com/elgs/gostrgen v0.0.0-20161222160715-9d61ae07eeae h1:3KvK2DmA7TxQ6PZ2f0rWbdqjgJhRcqgbY70bBeE4clI=
github.com/elgs/gostrgen v0.0.0-20161222160715-9d61ae07eeae/go.mod h1:wruC5r2gHdr/JIUs5Rr1V45YtsAzKXZxAnn/5rPC97g=
github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98=
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
github.com/erikstmartin/go-testdb v0.0.0-20160219214506-8d10e4a1bae5 h1:Yzb9+7DPaBjB8zlTR87/ElzFsnQfuHnVUVqpZZIcV5Y=
github.com/erikstmartin/go-testdb v0.0.0-20160219214506-8d10e4a1bae5/go.mod h1:a2zkGnVExMxdzMo3M0Hi/3sEU+cWnZpSni0O6/Yb/P0=
github.com/flynn/go-docopt v0.0.0-20140912013429-f6dd2ebbb31e/go.mod h1:HyVoz1Mz5Co8TFO8EupIdlcpwShBmY98dkT2xeHkvEI=
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4=
github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ=
github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
github.com/gin-contrib/cors v1.3.1 h1:doAsuITavI4IOcd0Y19U4B+O0dNWihRyX//nn4sEmgA=
github.com/gin-contrib/cors v1.3.1/go.mod h1:jjEJ4268OPZUcU7k9Pm653S7lXUGcqMADzFA61xsmDk=
github.com/gin-contrib/gzip v0.0.5 h1:mhnVU32YnnBh2LPH2iqRqsA/eR7SAqRaD388jL2s/j0=
github.com/gin-contrib/gzip v0.0.5/go.mod h1:OPIK6HR0Um2vNmBUTlayD7qle4yVVRZT0PyhdUigrKk=
github.com/gin-contrib/pprof v1.3.0 h1:G9eK6HnbkSqDZBYbzG4wrjCsA4e+cvYAHUZw6W+W9K0=
github.com/gin-contrib/pprof v1.3.0/go.mod h1:waMjT1H9b179t3CxuG1cV3DHpga6ybizwfBaM5OXaB0=
github.com/gin-contrib/cors v1.4.0 h1:oJ6gwtUl3lqV0WEIwM/LxPF1QZ5qe2lGWdY2+bz7y0g=
github.com/gin-contrib/cors v1.4.0/go.mod h1:bs9pNM0x/UsmHPBWT2xZz9ROh8xYjYkiURUfmBoMlcs=
github.com/gin-contrib/gzip v0.0.6 h1:NjcunTcGAj5CO1gn4N8jHOSIeRFHIbn51z6K+xaN4d4=
github.com/gin-contrib/gzip v0.0.6/go.mod h1:QOJlmV2xmayAjkNS2Y8NQsMneuRShOU/kjovCXNuzzk=
github.com/gin-contrib/pprof v1.4.0 h1:XxiBSf5jWZ5i16lNOPbMTVdgHBdhfGRD5PZ1LWazzvg=
github.com/gin-contrib/pprof v1.4.0/go.mod h1:RrehPJasUVBPK6yTUwOl8/NP6i0vbUgmxtis+Z5KE90=
github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE=
github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI=
github.com/gin-gonic/contrib v0.0.0-20201101042839-6a891bf89f19 h1:J2LPEOcQmWaooBnBtUDV9KHFEnP5LYTZY03GiQ0oQBw=
github.com/gin-gonic/contrib v0.0.0-20201101042839-6a891bf89f19/go.mod h1:iqneQ2Df3omzIVTkIfn7c1acsVnMGiSLn4XF5Blh3Yg=
github.com/gin-gonic/gin v1.5.0/go.mod h1:Nd6IXA8m5kNZdNEHMBd93KT+mdY3+bewLgRvmCsR2Do=
github.com/gin-gonic/contrib v0.0.0-20221130124618-7e01895a63f2 h1:dyuNlYlG1faymw39NdJddnzJICy6587tiGSVioWhYoE=
github.com/gin-gonic/contrib v0.0.0-20221130124618-7e01895a63f2/go.mod h1:iqneQ2Df3omzIVTkIfn7c1acsVnMGiSLn4XF5Blh3Yg=
github.com/gin-gonic/gin v1.6.2/go.mod h1:75u5sXoLsGZoRN5Sgbi1eraJ4GU3++wFwWzhwvtwp4M=
github.com/gin-gonic/gin v1.7.4/go.mod h1:jD2toBW3GZUr5UMcdrwQA10I7RuaFOl/SGeDjXkfUtY=
github.com/gin-gonic/gin v1.7.7/go.mod h1:axIBovoeJpVj8S3BwE0uPMTeReE4+AfFtqpqaZ1qq1U=
github.com/gin-gonic/gin v1.8.1 h1:4+fr/el88TOO3ewCmQr8cx/CtZ/umlIRIs5M4NTNjf8=
github.com/gin-gonic/gin v1.8.1/go.mod h1:ji8BvRH1azfM+SYow9zQ6SZMvR8qOMZHmsCuWR9tTTk=
github.com/go-ole/go-ole v1.2.6 h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY=
github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0=
github.com/gin-gonic/gin v1.8.2 h1:UzKToD9/PoFj/V4rvlKqTRKnQYyz8Sc1MJlv4JHPtvY=
github.com/gin-gonic/gin v1.8.2/go.mod h1:qw5AYuDrzRTnhvusDsrov+fDIxp9Dleuu12h8nfB398=
github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg=
github.com/go-openapi/jsonpointer v0.19.5 h1:gZr+CIYByUqjcgeLXnQu2gHYQC9o73G2XUeOFYEICuY=
github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg=
@@ -70,27 +105,29 @@ github.com/go-openapi/swag v0.19.15 h1:D2NRCBzS9/pEY3gP9Nl8aDqGUcPFrwG2p+CNFrLyr
github.com/go-openapi/swag v0.19.15/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ=
github.com/go-playground/assert/v2 v2.0.1 h1:MsBgLAaY856+nPRTKrp3/OZK38U/wa0CcBYNjji3q3A=
github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4=
github.com/go-playground/locales v0.12.1/go.mod h1:IUMDtCfWo/w/mtMfIE/IG2K+Ey3ygWanZIBtBW0W2TM=
github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8=
github.com/go-playground/locales v0.14.0 h1:u50s323jtVGugKlcYeyzC0etD1HifMjqmJqb8WugfUU=
github.com/go-playground/locales v0.14.0/go.mod h1:sawfccIbzZTqEDETgFXqTho0QybSa7l++s0DH+LDiLs=
github.com/go-playground/universal-translator v0.16.0/go.mod h1:1AnU7NaIRDWWzGEKwgtJRd2xk99HeFyHw3yid4rvQIY=
github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA=
github.com/go-playground/universal-translator v0.18.0 h1:82dyy6p4OuJq4/CByFNOn/jYrnRPArHwAcmLoJZxyho=
github.com/go-playground/universal-translator v0.18.0/go.mod h1:UvRDBj+xPUEGrFYl+lu/H90nyDXpg0fqeB/AQUGNTVA=
github.com/go-playground/validator/v10 v10.2.0/go.mod h1:uOYAAleCW8F/7oMFd6aG0GOhaH6EGOAJShg8Id5JGkI=
github.com/go-playground/validator/v10 v10.4.1/go.mod h1:nlOn6nFhuKACm19sB/8EGNn9GlaMV7XkbRSipzJ0Ii4=
github.com/go-playground/validator/v10 v10.10.0 h1:I7mrTYv78z8k8VXa/qJlOlEXn/nBh+BF8dHX5nt/dr0=
github.com/go-playground/validator/v10 v10.10.0/go.mod h1:74x4gJWsvQexRdW8Pn3dXSGrTK4nAUsbPlLADvpJkos=
github.com/go-playground/validator/v10 v10.11.1 h1:prmOlTVv+YjZjmRmNSF3VmspqJIxJWXmqUsHwfTRRkQ=
github.com/go-playground/validator/v10 v10.11.1/go.mod h1:i+3WkQ1FvaUjjxh1kSvIA4dMGDBiPU55YFDl0WbKdWU=
github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE=
github.com/goccy/go-json v0.9.7 h1:IcB+Aqpx/iMHu5Yooh7jEzJk1JZ7Pjtmys2ukPr7EeM=
github.com/goccy/go-json v0.9.7/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I=
github.com/goccy/go-json v0.10.0 h1:mXKd9Qw4NuzShiRlOXKews24ufknHO7gx30lsDyokKA=
github.com/goccy/go-json v0.10.0/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I=
github.com/gofrs/uuid v3.2.0+incompatible h1:y12jRkkFxsd7GpqdSZ+/KCs/fJbqpEXSGd4+jfEaewE=
github.com/gofrs/uuid v3.2.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM=
github.com/gofrs/uuid v4.2.0+incompatible h1:yyYWMnhkhrKwwr8gAOcOCYxOOscHgDS9yZgBrnJfGa0=
github.com/gofrs/uuid v4.2.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM=
github.com/golang-jwt/jwt/v4 v4.2.0 h1:besgBTC8w8HjP6NzQdxwKH9Z5oQMZ24ThTrHp3cZ8eU=
github.com/golang-jwt/jwt/v4 v4.2.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg=
github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
github.com/golang-jwt/jwt/v4 v4.4.3 h1:Hxl6lhQFj4AnOX6MLrsCb/+7tCj7DxP7VA+2rDIq5AU=
github.com/golang-jwt/jwt/v4 v4.4.3/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0=
github.com/golang-module/carbon/v2 v2.2.3 h1:WvGIc5+qzq9drNzH+Gnjh1TZ0JgDY/IA+m2Dvk7Qm4Q=
github.com/golang-module/carbon/v2 v2.2.3/go.mod h1:LdzRApgmDT/wt0eNT8MEJbHfJdSqCtT46uZhfF30dqI=
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58=
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw=
@@ -101,25 +138,36 @@ github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:W
github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0=
github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw=
github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU=
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.8 h1:e6P7q2lk1O+qJJb4BtCQXlK8vWEO8V1ZeuEdJNOqZyg=
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/google/gofuzz v1.1.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0=
github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
github.com/google/pprof v0.0.0-20210423192551-a2663126120b h1:l2YRhr+YLzmSp7KJMswRVk/lO5SwoFIcCLzJsVj+YPc=
github.com/google/pprof v0.0.0-20210423192551-a2663126120b/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I=
github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 h1:EGx4pi6eqNxGaHF6qqu48+N2wcFQ5qg5FXgOdqsJ5d8=
github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY=
github.com/gorilla/websocket v1.4.2 h1:+/TMaTYc4QFitKJxsQ7Yye35DkWvkdLcvGKqM+x0Ufc=
github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc=
github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
github.com/hybridgroup/mjpeg v0.0.0-20140228234708-4680f319790e/go.mod h1:eagM805MRKrioHYuU7iKLUyFPVKqVV6um5DAvCkUtXs=
github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI=
github.com/joeshaw/multierror v0.0.0-20140124173710-69b34d4ec901 h1:rp+c0RAYOWj8l6qbCUTSiRLG/iKnW3K3/QfPPuSsBt4=
github.com/joeshaw/multierror v0.0.0-20140124173710-69b34d4ec901/go.mod h1:Z86h9688Y0wesXCyonoVr47MasHilkuLMqGhRZ4Hpak=
github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY=
github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y=
github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM=
github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=
@@ -127,10 +175,10 @@ github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7
github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU=
github.com/kellydunn/golang-geo v0.7.0 h1:A5j0/BvNgGwY6Yb6inXQxzYwlPHc6WVZR+MrarZYNNg=
github.com/kellydunn/golang-geo v0.7.0/go.mod h1:YYlQPJ+DPEzrHx8kT3oPHC/NjyvCCXE+IuKGKdrjrcU=
github.com/kerberos-io/joy4 v1.0.33 h1:JSIZMm7sWU9Ir7DykaSnySz4tzQMTtVgiUrp3uKWyvc=
github.com/kerberos-io/joy4 v1.0.33/go.mod h1:nZp4AjvKvTOXRrmDyAIOw+Da+JA5OcSo/JundGfOlFU=
github.com/kerberos-io/onvif v0.0.3 h1:Jcc6kKO2hyhaBddQyXyKAhqkrzeX53UH6WKoASXSBoc=
github.com/kerberos-io/onvif v0.0.3/go.mod h1:Hr2dJOH2LM5SpYKk17gYZ1CMjhGhUl+QlT5kwYogrW0=
github.com/kerberos-io/joy4 v1.0.55 h1:P5RISBp8kUowgb/bvqLPVKPJL9n9jI/wXBCLs+XFMWg=
github.com/kerberos-io/joy4 v1.0.55/go.mod h1:nZp4AjvKvTOXRrmDyAIOw+Da+JA5OcSo/JundGfOlFU=
github.com/kerberos-io/onvif v0.0.5 h1:kq9mnHZkih9Jl4DyIJ4Rzt++Y3DDKy3nI8S2ESEfZ5w=
github.com/kerberos-io/onvif v0.0.5/go.mod h1:Hr2dJOH2LM5SpYKk17gYZ1CMjhGhUl+QlT5kwYogrW0=
github.com/klauspost/cpuid v1.2.3 h1:CCtW0xUnWGVINKvE/WWOYKdsPV6mawAtvQuSl8guwQs=
github.com/klauspost/cpuid v1.2.3/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek=
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
@@ -144,22 +192,20 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/kylelemons/go-gypsy v1.0.0 h1:7/wQ7A3UL1bnqRMnZ6T8cwCOArfZCxFmb1iTxaOOo1s=
github.com/kylelemons/go-gypsy v1.0.0/go.mod h1:chkXM0zjdpXOiqkCW1XcCHDfjfk14PH2KKkQWxfJUcU=
github.com/leodido/go-urn v1.1.0/go.mod h1:+cyI34gQWZcE1eQU7NVgKkkzdXDQHr1dBMtdAPozLkw=
github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII=
github.com/leodido/go-urn v1.2.1 h1:BqpAaACuzVSgi/VLzGZIobT2z4v53pjosyNd9Yv6n/w=
github.com/leodido/go-urn v1.2.1/go.mod h1:zt4jvISO2HfUBqxjfIshjdMTYS56ZS/qv49ictyFfxY=
github.com/lib/pq v1.10.6 h1:jbk+ZieJ0D7EVGJYpL9QTz7/YW6UHbmdnZWYyK5cdBs=
github.com/lib/pq v1.10.6/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o=
github.com/lucas-clemente/quic-go v0.7.1-0.20190401152353-907071221cf9/go.mod h1:PpMmPfPKO9nKJ/psF49ESTAGQSdfXxlg1otPbEB2nOw=
github.com/lib/pq v1.10.7 h1:p7ZhMD+KsSRozJr34udlUrhboJwWAgCg34+/ZZNvZZw=
github.com/lib/pq v1.10.7/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o=
github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
github.com/mailru/easyjson v0.7.6 h1:8yTIVnZgCoiM1TgqoeTl+LfU5Jg6/xL3QhGQnimLYnA=
github.com/mailru/easyjson v0.7.6/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc=
github.com/marten-seemann/qtls v0.2.3/go.mod h1:xzjG7avBwGGbdZ8dTGxlBnLArsVKLvwmjgmPuiQEcYk=
github.com/mattn/go-isatty v0.0.9/go.mod h1:YNRxwqDuOph6SZLI9vUUz6OYw3QyUt7WiY2yME+cCiQ=
github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0=
github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc=
github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=
github.com/mattn/go-isatty v0.0.14 h1:yVuAays6BHfxijgZPzw+3Zlu5yQgKGP2/hcQbHb7S9Y=
github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94=
github.com/mattn/go-isatty v0.0.16 h1:bq3VjFmv/sOjHtdEhmkEV4x1AJtvUvOJ2PFAZ5+peKQ=
github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
github.com/minio/md5-simd v1.1.0 h1:QPfiOqlZH+Cj9teu0t9b1nTBfPbyTl16Of5MeuShdK4=
github.com/minio/md5-simd v1.1.0/go.mod h1:XpBqgZULrMYD3R+M28PcmP0CkI7PEMzB3U77ZrKZ0Gw=
github.com/minio/minio-go/v6 v6.0.57 h1:ixPkbKkyD7IhnluRgQpGSpHdpvNVaW6OD5R9IAO/9Tw=
@@ -168,141 +214,145 @@ github.com/minio/sha256-simd v0.1.1 h1:5QHSlgo3nt5yKOJrC7W8w7X+NFl8cMPZm96iu8kKU
github.com/minio/sha256-simd v0.1.1/go.mod h1:B5e1o+1/KgNmWrSQK08Y6Z1Vb5pwIktudl0J58iy0KM=
github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y=
github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421 h1:ZqeYNhU3OHLH3mGKHDcjJRFFRrJa6eAM5H+CtDdOsPc=
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg=
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M=
github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno=
github.com/nsmith5/mjpeg v0.0.0-20200913181537-54b8ada0e53e h1:bQo/jQ9qvcw7zqnovm8IbLsaOq3F+ELUQcxtxvalQvA=
github.com/nsmith5/mjpeg v0.0.0-20200913181537-54b8ada0e53e/go.mod h1:PW9xCZScEClMBP22n37i0SnN/8B9YzNXTNvOaIkLjv0=
github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A=
github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE=
github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU=
github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk=
github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY=
github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0=
github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE=
github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU=
github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
github.com/onsi/ginkgo/v2 v2.0.0/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3/PpL4c=
github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY=
github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo=
github.com/onsi/gomega v1.17.0 h1:9Luw4uT5HTjHTN8+aNcSThgH1vdXnmdJ8xIfZ4wyTRE=
github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY=
github.com/onsi/gomega v1.18.1 h1:M1GfJqGRrBrrGGsbxzV5dqM2U2ApXefZCQpkukxYRLE=
github.com/onsi/gomega v1.18.1/go.mod h1:0q+aL8jAiMXy9hbwj2mr5GziHiwhAIQpFmmtT5hitRs=
github.com/op/go-logging v0.0.0-20160315200505-970db520ece7 h1:lDH9UUVJtmYCjyT0CI4q8xvlXPxeZ0gYCVvWbmPlp88=
github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk=
github.com/opentracing/opentracing-go v1.2.0 h1:uEJPy/1a5RIPAJ0Ov+OIO8OxWu77jEv+1B0VhjKrZUs=
github.com/otiai10/copy v1.7.0/go.mod h1:rmRl6QPdJj6EiUqXQ/4Nn2lLXoNQjFCQbbNrxgc/t3U=
github.com/otiai10/curr v0.0.0-20150429015615-9b4961190c95/go.mod h1:9qAhocn7zKJG+0mI8eUu6xqkFDYS2kb2saOteoSB3cE=
github.com/otiai10/curr v1.0.0/go.mod h1:LskTG5wDwr8Rs+nNQ+1LlxRjAtTZZjtJW4rMXl6j4vs=
github.com/otiai10/mint v1.3.0/go.mod h1:F5AjcsTsWUqX+Na9fpHb52P8pcRX2CI6A3ctIT91xUo=
github.com/otiai10/mint v1.3.3/go.mod h1:/yxELlJQ0ufhjUwhshSj+wFjZ78CnZ48/1wtmBH1OTc=
github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc=
github.com/pelletier/go-toml/v2 v2.0.1 h1:8e3L2cCQzLFi2CR4g7vGFuFxX7Jl1kKX8gW+iV0GUKU=
github.com/pelletier/go-toml/v2 v2.0.1/go.mod h1:r9LEWfGN8R5k0VXJ+0BkIe7MYkRdwZOjgMj2KwnJFUo=
github.com/pion/datachannel v1.4.21/go.mod h1:oiNyP4gHx2DIwRzX/MFyH0Rz/Gz05OgBlayAI2hAWjg=
github.com/pion/datachannel v1.5.2 h1:piB93s8LGmbECrpO84DnkIVWasRMk3IimbcXkTQLE6E=
github.com/pion/datachannel v1.5.2/go.mod h1:FTGQWaHrdCwIJ1rw6xBIfZVkslikjShim5yr05XFuCQ=
github.com/pion/dtls/v2 v2.0.1/go.mod h1:uMQkz2W0cSqY00xav7WByQ4Hb+18xeQh2oH2fRezr5U=
github.com/pion/dtls/v2 v2.0.2/go.mod h1:27PEO3MDdaCfo21heT59/vsdmZc0zMt9wQPcSlLu/1I=
github.com/pion/dtls/v2 v2.1.3/go.mod h1:o6+WvyLDAlXF7YiPB/RlskRoeK+/JtuaZa5emwQcWus=
github.com/pelletier/go-toml/v2 v2.0.6 h1:nrzqCb7j9cDFj2coyLNLaZuJTLjWjlaz6nvTvIwycIU=
github.com/pelletier/go-toml/v2 v2.0.6/go.mod h1:eumQOmlWiOPt5WriQQqoM5y18pDHwha2N+QD+EUNTek=
github.com/philhofer/fwd v1.1.1 h1:GdGcTjf5RNAxwS4QLsiMzJYj5KEvPJD3Abr261yRQXQ=
github.com/philhofer/fwd v1.1.1/go.mod h1:gk3iGcWd9+svBvR0sR+KPcfE+RNWozjowpeBVG3ZVNU=
github.com/pion/datachannel v1.5.5 h1:10ef4kwdjije+M9d7Xm9im2Y3O6A6ccQb0zcqZcJew8=
github.com/pion/datachannel v1.5.5/go.mod h1:iMz+lECmfdCMqFRhXhcA/219B0SQlbpoR2V118yimL0=
github.com/pion/dtls/v2 v2.1.5 h1:jlh2vtIyUBShchoTDqpCCqiYCyRFJ/lvf/gQ8TALs+c=
github.com/pion/dtls/v2 v2.1.5/go.mod h1:BqCE7xPZbPSubGasRoDFJeTsyJtdD1FanJYL0JGheqY=
github.com/pion/ice v0.7.18/go.mod h1:+Bvnm3nYC6Nnp7VV6glUkuOfToB/AtMRZpOU8ihuf4c=
github.com/pion/ice/v2 v2.2.6 h1:R/vaLlI1J2gCx141L5PEwtuGAGcyS6e7E0hDeJFq5Ig=
github.com/pion/ice/v2 v2.2.6/go.mod h1:SWuHiOGP17lGromHTFadUe1EuPgFh/oCU6FCMZHooVE=
github.com/pion/ice/v2 v2.2.12 h1:n3M3lUMKQM5IoofhJo73D3qVla+mJN2nVvbSPq32Nig=
github.com/pion/ice/v2 v2.2.12/go.mod h1:z2KXVFyRkmjetRlaVRgjO9U3ShKwzhlUylvxKfHfd5A=
github.com/pion/interceptor v0.1.11 h1:00U6OlqxA3FFB50HSg25J/8cWi7P6FbSzw4eFn24Bvs=
github.com/pion/interceptor v0.1.11/go.mod h1:tbtKjZY14awXd7Bq0mmWvgtHB5MDaRN7HV3OZ/uy7s8=
github.com/pion/logging v0.2.2 h1:M9+AIj/+pxNsDfAT64+MAVgJO0rsyLnoJKCqf//DoeY=
github.com/pion/logging v0.2.2/go.mod h1:k0/tDVsRCX2Mb2ZEmTqNa7CWsQPc+YYCB7Q+5pahoms=
github.com/pion/mdns v0.0.4/go.mod h1:R1sL0p50l42S5lJs91oNdUL58nm0QHrhxnSegr++qC0=
github.com/pion/mdns v0.0.5 h1:Q2oj/JB3NqfzY9xGZ1fPzZzK7sDSD8rZPOvcIQ10BCw=
github.com/pion/mdns v0.0.5/go.mod h1:UgssrvdD3mxpi8tMxAXbsppL3vJ4Jipw1mTCW+al01g=
github.com/pion/quic v0.1.1/go.mod h1:zEU51v7ru8Mp4AUBJvj6psrSth5eEFNnVQK5K48oV3k=
github.com/pion/randutil v0.0.0/go.mod h1:XcJrSMMbbMRhASFVOlj/5hQial/Y8oH/HVo7TBZq+j8=
github.com/pion/randutil v0.1.0 h1:CFG1UdESneORglEsnimhUjf33Rwjubwj6xfiOXBa3mA=
github.com/pion/randutil v0.1.0/go.mod h1:XcJrSMMbbMRhASFVOlj/5hQial/Y8oH/HVo7TBZq+j8=
github.com/pion/rtcp v1.2.3/go.mod h1:zGhIv0RPRF0Z1Wiij22pUt5W/c9fevqSzT4jje/oK7I=
github.com/pion/rtcp v1.2.9 h1:1ujStwg++IOLIEoOiIQ2s+qBuJ1VN81KW+9pMPsif+U=
github.com/pion/rtcp v1.2.9/go.mod h1:qVPhiCzAm4D/rxb6XzKeyZiQK69yJpbUDJSF7TgrqNo=
github.com/pion/rtp v1.6.0/go.mod h1:QgfogHsMBVE/RFNno467U/KBqfUywEH+HK+0rtnwsdI=
github.com/pion/rtcp v1.2.10 h1:nkr3uj+8Sp97zyItdN60tE/S6vk4al5CPRR6Gejsdjc=
github.com/pion/rtcp v1.2.10/go.mod h1:ztfEwXZNLGyF1oQDttz/ZKIBaeeg/oWbRYqzBM9TL1I=
github.com/pion/rtp v1.7.13 h1:qcHwlmtiI50t1XivvoawdCGTP4Uiypzfrsap+bijcoA=
github.com/pion/rtp v1.7.13/go.mod h1:bDb5n+BFZxXx0Ea7E5qe+klMuqiBrP+w8XSjiWtCUko=
github.com/pion/sctp v1.7.10/go.mod h1:EhpTUQu1/lcK3xI+eriS6/96fWetHGCvBi9MSsnaBN0=
github.com/pion/sctp v1.8.0/go.mod h1:xFe9cLMZ5Vj6eOzpyiKjT9SwGM4KpK/8Jbw5//jc+0s=
github.com/pion/sctp v1.8.2 h1:yBBCIrUMJ4yFICL3RIvR4eh/H2BTTvlligmSTy+3kiA=
github.com/pion/sctp v1.8.2/go.mod h1:xFe9cLMZ5Vj6eOzpyiKjT9SwGM4KpK/8Jbw5//jc+0s=
github.com/pion/sdp/v2 v2.4.0/go.mod h1:L2LxrOpSTJbAns244vfPChbciR/ReU1KWfG04OpkR7E=
github.com/pion/sdp/v3 v3.0.5 h1:ouvI7IgGl+V4CrqskVtr3AaTrPvPisEOxwgpdktctkU=
github.com/pion/sdp/v3 v3.0.5/go.mod h1:iiFWFpQO8Fy3S5ldclBkpXqmWy02ns78NOKoLLL0YQw=
github.com/pion/srtp v1.5.1/go.mod h1:B+QgX5xPeQTNc1CJStJPHzOlHK66ViMDWTT0HZTCkcA=
github.com/pion/srtp/v2 v2.0.9 h1:JJq3jClmDFBPX/F5roEb0U19jSU7eUhyDqR/NZ34EKQ=
github.com/pion/srtp/v2 v2.0.9/go.mod h1:5TtM9yw6lsH0ppNCehB/EjEUli7VkUgKSPJqWVqbhQ4=
github.com/pion/sctp v1.8.5 h1:JCc25nghnXWOlSn3OVtEnA9PjQ2JsxQbG+CXZ1UkJKQ=
github.com/pion/sctp v1.8.5/go.mod h1:SUFFfDpViyKejTAdwD1d/HQsCu+V/40cCs2nZIvC3s0=
github.com/pion/sdp/v3 v3.0.6 h1:WuDLhtuFUUVpTfus9ILC4HRyHsW6TdugjEX/QY9OiUw=
github.com/pion/sdp/v3 v3.0.6/go.mod h1:iiFWFpQO8Fy3S5ldclBkpXqmWy02ns78NOKoLLL0YQw=
github.com/pion/srtp/v2 v2.0.10 h1:b8ZvEuI+mrL8hbr/f1YiJFB34UMrOac3R3N1yq2UN0w=
github.com/pion/srtp/v2 v2.0.10/go.mod h1:XEeSWaK9PfuMs7zxXyiN252AHPbH12NX5q/CFDWtUuA=
github.com/pion/stun v0.3.5 h1:uLUCBCkQby4S1cf6CGuR9QrVOKcvUwFeemaC865QHDg=
github.com/pion/stun v0.3.5/go.mod h1:gDMim+47EeEtfWogA37n6qXZS88L5V6LqFcf+DZA2UA=
github.com/pion/transport v0.6.0/go.mod h1:iWZ07doqOosSLMhZ+FXUTq+TamDoXSllxpbGcfkCmbE=
github.com/pion/transport v0.8.10/go.mod h1:tBmha/UCjpum5hqTWhfAEs3CO4/tHSg0MYRhSzR+CZ8=
github.com/pion/transport v0.10.0/go.mod h1:BnHnUipd0rZQyTVB2SBGojFHT9CBt5C5TcsJSQGkvSE=
github.com/pion/transport v0.10.1/go.mod h1:PBis1stIILMiis0PewDw91WJeLJkyIMcEk+DwKOzf4A=
github.com/pion/transport v0.12.2/go.mod h1:N3+vZQD9HlDP5GWkZ85LohxNsDcNgofQmyL6ojX5d8Q=
github.com/pion/transport v0.12.3/go.mod h1:OViWW9SP2peE/HbwBvARicmAVnesphkNkCVZIWJ6q9A=
github.com/pion/transport v0.13.0 h1:KWTA5ZrQogizzYwPEciGtHPLwpAjE91FgXnyu+Hv2uY=
github.com/pion/transport v0.13.0/go.mod h1:yxm9uXpK9bpBBWkITk13cLo1y5/ur5VQpG22ny6EP7g=
github.com/pion/turn/v2 v2.0.4/go.mod h1:1812p4DcGVbYVBTiraUmP50XoKye++AMkbfp+N27mog=
github.com/pion/transport v0.13.1/go.mod h1:EBxbqzyv+ZrmDb82XswEE0BjfQFtuw1Nu6sjnjWCsGg=
github.com/pion/transport v0.14.1 h1:XSM6olwW+o8J4SCmOBb/BpwZypkHeyM0PGFCxNQBr40=
github.com/pion/transport v0.14.1/go.mod h1:4tGmbk00NeYA3rUa9+n+dzCCoKkcy3YlYb99Jn2fNnI=
github.com/pion/turn/v2 v2.0.8 h1:KEstL92OUN3k5k8qxsXHpr7WWfrdp7iJZHx99ud8muw=
github.com/pion/turn/v2 v2.0.8/go.mod h1:+y7xl719J8bAEVpSXBXvTxStjJv3hbz9YFflvkpcGPw=
github.com/pion/udp v0.1.0/go.mod h1:BPELIjbwE9PRbd/zxI/KYBnbo7B6+oA6YuEaNE8lths=
github.com/pion/udp v0.1.1 h1:8UAPvyqmsxK8oOjloDk4wUt63TzFe9WEJkg5lChlj7o=
github.com/pion/udp v0.1.1/go.mod h1:6AFo+CMdKQm7UiA0eUPA8/eVCTx8jBIITLZHc9DWX5M=
github.com/pion/webrtc/v2 v2.2.26/go.mod h1:XMZbZRNHyPDe1gzTIHFcQu02283YO45CbiwFgKvXnmc=
github.com/pion/webrtc/v3 v3.1.41 h1:QogLjtriu+OwerRp4r6emTg4+zDWUy5R6EqthDBy7c0=
github.com/pion/webrtc/v3 v3.1.41/go.mod h1:sUcW9SFPEWerDqGOBmdYEMfRvbdd7rgwo4bNzfsXww4=
github.com/pion/webrtc/v3 v3.1.50 h1:wLMo1+re4WMZ9Kun9qcGcY+XoHkE3i0CXrrc0sjhVCk=
github.com/pion/webrtc/v3 v3.1.50/go.mod h1:y9n09weIXB+sjb9mi0GBBewNxo4TKUQm5qdtT5v3/X4=
github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA=
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
github.com/prometheus/procfs v0.8.0 h1:ODq8ZFEaYeCaZOJlZZdJA2AbQR98dSHSM1KW/You5mo=
github.com/prometheus/procfs v0.8.0/go.mod h1:z7EfXMXOkbkqb9IINtpCn86r/to3BnA0uaxHdg830/4=
github.com/richardartoul/molecule v1.0.1-0.20221107223329-32cfee06a052 h1:Qp27Idfgi6ACvFQat5+VJvlYToylpM/hcyLBI3WaKPA=
github.com/richardartoul/molecule v1.0.1-0.20221107223329-32cfee06a052/go.mod h1:uvX/8buq8uVeiZiFht+0lqSLBHF+uGV8BrTv8W/SIwk=
github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc=
github.com/rogpeppe/go-internal v1.8.0 h1:FCbCCtXNOY3UtUuHUYaghJg4y7Fd14rXifAYUAtL9R8=
github.com/rogpeppe/go-internal v1.8.0/go.mod h1:WmiCO8CzOY8rg0OYDC4/i/2WRWAB6poM+XZ2dLUbcbE=
github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/sclevine/agouti v3.0.0+incompatible/go.mod h1:b4WX9W9L1sfQKXeJf1mUTLZKJ48R1S7H23Ji7oFO5Bw=
github.com/shirou/gopsutil v3.21.11+incompatible h1:+1+c1VGhc88SSonWP6foOcLhvnKlUeu/erjjvaPEYiI=
github.com/shirou/gopsutil v3.21.11+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA=
github.com/secure-systems-lab/go-securesystemslib v0.3.1/go.mod h1:o8hhjkbNl2gOamKUA/eNW3xUrntHT9L4W89W1nfj43U=
github.com/secure-systems-lab/go-securesystemslib v0.4.0 h1:b23VGrQhTA8cN2CbBw7/FulN9fTtqYUdS5+Oxzt+DUE=
github.com/secure-systems-lab/go-securesystemslib v0.4.0/go.mod h1:FGBZgq2tXWICsxWQW1msNf49F0Pf2Op5Htayx335Qbs=
github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc=
github.com/sirupsen/logrus v1.5.0/go.mod h1:+F7Ogzej0PZc/94MaYx/nvG9jOFMD2osvC3s+Squfpo=
github.com/sirupsen/logrus v1.8.1 h1:dJKuHgqk1NNQlqoA6BTlM1Wf9DOH3NBjQyu0h9+AZZE=
github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0=
github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0=
github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0=
github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d h1:zE9ykElWQ6/NYmHa3jpm/yHnI4xSofP+UP6SpjHcSeM=
github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc=
github.com/smartystreets/goconvey v0.0.0-20190330032615-68dc04aab96a/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA=
github.com/smartystreets/goconvey v1.6.4 h1:fv0U8FUIMPNf1L9lnHLvLhgicrIVChEkdzIKYqbNC9s=
github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA=
github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0bLI=
github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c=
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.7.1 h1:5TQK59W5E3v0r2duFAb7P95B6hEeOyEnHRa8MjYSMTY=
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/swaggo/files v0.0.0-20220610200504-28940afbdbfe h1:K8pHPVoTgxFJt1lXuIzzOX7zZhZFldJQK/CgKx9BFIc=
github.com/swaggo/files v0.0.0-20220610200504-28940afbdbfe/go.mod h1:lKJPbtWzJ9JhsTN1k1gZgleJWY/cqq0psdoMmaThG3w=
github.com/swaggo/gin-swagger v1.5.0 h1:hlLbxPj6qvbtX2wpbsZuOIlcnPRCUDGccA0zMKVNpME=
github.com/swaggo/gin-swagger v1.5.0/go.mod h1:3mKpZClKx7mnUGsiwJeEkNhnr1VHMkMaTAXIoFYUXrA=
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk=
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
github.com/swaggo/files v0.0.0-20220728132757-551d4a08d97a/go.mod h1:lKJPbtWzJ9JhsTN1k1gZgleJWY/cqq0psdoMmaThG3w=
github.com/swaggo/files v1.0.0 h1:1gGXVIeUFCS/dta17rnP0iOpr6CXFwKD7EO5ID233e4=
github.com/swaggo/files v1.0.0/go.mod h1:N59U6URJLyU1PQgFqPM7wXLMhJx7QAolnvfQkqO13kc=
github.com/swaggo/gin-swagger v1.5.3 h1:8mWmHLolIbrhJJTflsaFoZzRBYVmEE7JZGIq08EiC0Q=
github.com/swaggo/gin-swagger v1.5.3/go.mod h1:3XJKSfHjDMB5dBo/0rrTXidPmgLeqsX89Yp4uA50HpI=
github.com/swaggo/swag v1.8.1/go.mod h1:ugemnJsPZm/kRwFUnzBlbHRd0JY9zE1M4F+uy2pAaPQ=
github.com/swaggo/swag v1.8.3 h1:3pZSSCQ//gAH88lfmxM3Cd1+JCsxV8Md6f36b9hrZ5s=
github.com/swaggo/swag v1.8.3/go.mod h1:jMLeXOOmYyjk8PvHTsXBdrubsNd9gUJTTCzL5iBnseg=
github.com/swaggo/swag v1.8.9 h1:kHtaBe/Ob9AZzAANfcn5c6RyCke9gG9QpH0jky0I/sA=
github.com/swaggo/swag v1.8.9/go.mod h1:ezQVUUhly8dludpVk+/PuwJWvLLanB13ygV5Pr9enSk=
github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7/go.mod h1:q4W45IWZaF22tdD+VEXcAWRA037jwmWEB5VWYORlTpc=
github.com/tevino/abool v1.2.0 h1:heAkClL8H6w+mK5md9dzsuohKeXHUpY7Vw0ZCKW+huA=
github.com/tevino/abool v1.2.0/go.mod h1:qc66Pna1RiIsPa7O4Egxxs9OqkuxDX55zznh9K07Tzg=
github.com/tidwall/gjson v1.12.1 h1:ikuZsLdhr8Ws0IdROXUS1Gi4v9Z4pGqpX/CvJkxvfpo=
github.com/tidwall/gjson v1.12.1/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk=
github.com/tidwall/gjson v1.14.3 h1:9jvXn7olKEHU1S9vwoMGliaT8jq1vJ7IH/n9zD9Dnlw=
github.com/tidwall/gjson v1.14.3/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk=
github.com/tidwall/match v1.1.1 h1:+Ho715JplO36QYgwN9PGYNhgZvoUSc9X2c80KVTi+GA=
github.com/tidwall/match v1.1.1/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JTxsfmM=
github.com/tidwall/pretty v1.2.0 h1:RWIZEg2iJ8/g6fDDYzMpobmaoGh5OLl4AXtGUGPcqCs=
github.com/tidwall/pretty v1.2.0/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU=
github.com/tklauser/go-sysconf v0.3.10 h1:IJ1AZGZRWbY8T5Vfk04D9WOA5WSejdflXxP03OUqALw=
github.com/tklauser/go-sysconf v0.3.10/go.mod h1:C8XykCvCb+Gn0oNCWPIlcb0RuglQTYaQ2hGm7jmxEFk=
github.com/tklauser/numcpus v0.4.0 h1:E53Dm1HjH1/R2/aoCtXtPgzmElmn51aOkhCFSuZq//o=
github.com/tklauser/numcpus v0.4.0/go.mod h1:1+UI3pD8NW14VMwdgJNJ1ESk2UnwhAnz5hMwiKKqXCQ=
github.com/tinylib/msgp v1.1.6 h1:i+SbKraHhnrf9M5MYmvQhFnbLhAXSDWF8WWsuyRdocw=
github.com/tinylib/msgp v1.1.6/go.mod h1:75BAfg2hauQhs3qedfdDZmWAPcFMAvJE5b9rGOMufyw=
github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw=
github.com/ugorji/go v1.2.7/go.mod h1:nF9osbDWLy6bDVv/Rtoh6QgnvNDpmCalQV5urGCCS6M=
github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY=
@@ -311,43 +361,45 @@ github.com/ugorji/go/codec v1.2.7/go.mod h1:WGN1fab3R1fzQlVQTkfxVtIBhWDRqOviHU95
github.com/urfave/cli/v2 v2.3.0/go.mod h1:LJmUH05zAU44vOAcrfzZQKsZbVcdbOG8rtL3/XcUArI=
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.4.0/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
github.com/yuin/goldmark v1.4.1 h1:/vn0k+RBvwlxEmP5E7SZMqNxPhfMVFEJiykr15/0XKM=
github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
github.com/yusufpapurcu/wmi v1.2.2 h1:KBNDSne4vP5mbSWnJbO+51IMOXJB67QiYCSBrubbPRg=
github.com/yusufpapurcu/wmi v1.2.2/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0=
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
github.com/ziutek/mymysql v1.5.4 h1:GB0qdRGsTwQSBVYuVShFBKaXSnSnYYC2d9knnE1LHFs=
github.com/ziutek/mymysql v1.5.4/go.mod h1:LMSpPZ6DbqWFxNCHW77HeMg9I646SAhApZ/wKdgO/C0=
gocv.io/x/gocv v0.31.0 h1:BHDtK8v+YPvoSPQTTiZB2fM/7BLg6511JqkruY2z6LQ=
gocv.io/x/gocv v0.31.0/go.mod h1:oc6FvfYqfBp99p+yOEzs9tbYF9gOrAQSeL/dyIPefJU=
golang.org/x/crypto v0.0.0-20190228161510-8dd112bcdc25/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
go4.org/intern v0.0.0-20211027215823-ae77deb06f29 h1:UXLjNohABv4S58tHmeuIZDO6e3mHpW2Dx33gaNt03LE=
go4.org/intern v0.0.0-20211027215823-ae77deb06f29/go.mod h1:cS2ma+47FKrLPdXFpr7CuxiTW3eyJbWew4qx0qtQWDA=
go4.org/unsafe/assume-no-moving-gc v0.0.0-20211027215541-db492cf91b37/go.mod h1:FftLjUGFEDu5k8lt0ddY+HcrH/qU/0qk+H8j9/nTl3E=
go4.org/unsafe/assume-no-moving-gc v0.0.0-20220617031537-928513b29760 h1:FyBZqvoA/jbNzuAWLQE2kG820zMAkcilx6BMjGbL/E4=
go4.org/unsafe/assume-no-moving-gc v0.0.0-20220617031537-928513b29760/go.mod h1:FftLjUGFEDu5k8lt0ddY+HcrH/qU/0qk+H8j9/nTl3E=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20190513172903-22d7a77e9e5f/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20200602180216-279210d13fed/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20200709230013-948cd5f35899/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
golang.org/x/crypto v0.0.0-20220131195533-30dcbda58838/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
golang.org/x/crypto v0.0.0-20211117183948-ae814b36b871/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
golang.org/x/crypto v0.0.0-20211215153901-e495a2d5b3d3/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
golang.org/x/crypto v0.0.0-20220427172511-eb4f295cb31f/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
golang.org/x/crypto v0.0.0-20220516162934-403b01795ae8 h1:y+mHpWoQJNAHt26Nhh6JP7hvM71IRZureyvZhoVALIs=
golang.org/x/crypto v0.0.0-20220516162934-403b01795ae8/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
golang.org/x/crypto v0.0.0-20221010152910-d6f0a8c073c2/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
golang.org/x/crypto v0.4.0 h1:UVQgzMY87xqpKNgb+kDsll2Igd33HszWHFLmpaRMq/8=
golang.org/x/crypto v0.4.0/go.mod h1:3quD/ATkf6oY+rnes5c3ExXTbLc8mueNue5/DoinL80=
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3 h1:kQgndtyPBW/JIYERgdxfwMYh3AVStj88WQTlNDi2a+o=
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4 h1:6zppjxzCulZykYSLyVDYbneBfbaBIQPYMevg0bEwv2s=
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190522155817-f3200d17e092/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks=
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20191126235420-ef20fe5d7933/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200425230154-ff2c4b7c35a0/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
golang.org/x/net v0.0.0-20200602114024-627f9648deb9/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
golang.org/x/net v0.0.0-20200813134508-3edf25e44fcc/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
golang.org/x/net v0.0.0-20201201195509-5d6afe98e0b7/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
@@ -358,31 +410,41 @@ golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qx
golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20211201190559-0a0e4e1bb54c/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
golang.org/x/net v0.0.0-20220401154927-543a649e0bdd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4 h1:HVyaeDAYux4pnY+D/SiwmLOR36ewZ4iGQIIrtnuCjFA=
golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
golang.org/x/net v0.0.0-20220531201128-c960675eff93/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco=
golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY=
golang.org/x/net v0.3.0/go.mod h1:MBQ8lrhLObU/6UmLb4fmbmk5OcyYmqtbGd/9yIeKjEE=
golang.org/x/net v0.4.0 h1:Q5QPcMlvfxFTAPV0+07Xz/MpK9NTXu2VDUuy0FeMfaU=
golang.org/x/net v0.4.0/go.mod h1:MBQ8lrhLObU/6UmLb4fmbmk5OcyYmqtbGd/9yIeKjEE=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c h1:5KslGYwFpkhGh+Q16bwMP3cOontH8FOep7tGV86Y7SQ=
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4 h1:uVc8UZUe6tr40fFVnUP5Oj+veunVezqYl9z7DYw9xzw=
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190228124157-a34e9553db1e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200724161237-0e2f3a69832c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200814200057-3d37ad5750ed/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210420072515-93ed5bcd2bfe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
@@ -390,30 +452,59 @@ golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBc
golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220128215802-99c3d69c2c27 h1:XDXtA5hveEEV8JB2l7nhMTp3t3cHp9ZpwcdjqyEWLlo=
golang.org/x/sys v0.0.0-20220128215802-99c3d69c2c27/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220608164250-635b8c9b7f68/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220622161953-175b2fd9d664/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.3.0 h1:w8ZOecv6NaNa/zC8944JTU3vz4u6Lagfk4RPQxv92NQ=
golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc=
golang.org/x/term v0.3.0/go.mod h1:q750SLmJuPmVoN1blW3UFBPREJfb1KmY3vwxfr+nFDA=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk=
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
golang.org/x/text v0.5.0 h1:OLmvp0KP+FVG99Ct/qFiL/Fhk4zp4QQnZ7b2U+5piUM=
golang.org/x/text v0.5.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
golang.org/x/time v0.0.0-20211116232009-f0f3c7e86c11 h1:GZokNIeuVkl3aZHJchRrr13WCsols02MLUcz1U9is6M=
golang.org/x/time v0.0.0-20211116232009-f0f3c7e86c11/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY=
golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20201022035929-9cf592e881e9/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0=
golang.org/x/tools v0.1.7/go.mod h1:LGqMHiF4EqQNHR1JncWGqT5BVaXmza+X+BDGol+dOxo=
golang.org/x/tools v0.1.10 h1:QjFRCZxdOhBJ/UNgnBZLbNV13DlbnK0quyivTnXJM20=
golang.org/x/tools v0.1.10/go.mod h1:Uh6Zz+xoGYZom868N8YTex3t7RhtHDBrE8Gzo9bV56E=
golang.org/x/tools v0.1.11 h1:loJ25fNOEhSXfHrpoGj91eCUThwdNX6u24rO1xnNteY=
golang.org/x/tools v0.1.11/go.mod h1:SgwaegtQh8clINPpECJMqnxLv9I09HLqnW3RMqW0CA4=
golang.org/x/tools v0.1.12 h1:VveCTK38A2rkS8ZqFY25HIDFscX5X9OoEhJd3quQmXU=
golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE=
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
google.golang.org/genproto v0.0.0-20200726014623-da3ae01ef02d h1:HJaAqDnKreMkv+AQyf1Mcw0jEmL9kKBNL07RDJu1N/k=
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY=
google.golang.org/grpc v1.32.0 h1:zWTV+LMdc3kaiJMSTOFz2UgSBgx8RNQoTGiZu3fR9S0=
google.golang.org/grpc v1.32.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak=
google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=
@@ -422,8 +513,12 @@ google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzi
google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
google.golang.org/protobuf v1.28.0 h1:w43yiav+6bVFTBQFZX0r7ipe9JQ1QsbMgHwbBziscLw=
google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
google.golang.org/protobuf v1.28.1 h1:d0NfwRgPtno5B1Wa6L2DAG+KivqkdutMf1UhdNx175w=
google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
gopkg.in/DataDog/dd-trace-go.v1 v1.46.0 h1:h/SbNfGfDMhBkB+/zzCWKPOlLcdd0Fc+QBAnZm009XM=
gopkg.in/DataDog/dd-trace-go.v1 v1.46.0/go.mod h1:kaa8caaECrtY0V/MUtPQAh1lx/euFzPJwrY1taTx3O4=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
@@ -432,8 +527,6 @@ gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntN
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=
gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=
gopkg.in/go-playground/assert.v1 v1.2.1/go.mod h1:9RXL0bg/zibRAgZUYszZSwO/z8Y/a8bDuhia5mkpMnE=
gopkg.in/go-playground/validator.v9 v9.29.1/go.mod h1:+c9/zcJMFNgbLvly1L1V+PpxWdVbfP1avr/N00E2vyQ=
gopkg.in/ini.v1 v1.42.0 h1:7N3gPTt50s8GuLortA00n8AqRTk75qOP98+mTPpgzRk=
gopkg.in/ini.v1 v1.42.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
gopkg.in/mgo.v2 v2.0.0-20190816093944-a6b53ec6cb22 h1:VpOs+IwYnYBaFnrNAeB8UUWtL3vEUnzSCL1nVjPhqrw=
@@ -452,5 +545,13 @@ gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo=
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw=
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
howett.net/plist v0.0.0-20181124034731-591f970eefbb h1:jhnBjNi9UFpfpl8YZhA9CrOqpnJdvzuiHsl/dnxl11M=
howett.net/plist v0.0.0-20181124034731-591f970eefbb/go.mod h1:vMygbs4qMhSZSc4lCUl2OEE+rDiIIJAIdR4m7MiMcm0=
inet.af/netaddr v0.0.0-20220617031823-097006376321 h1:B4dC8ySKTQXasnjDTMsoCMf1sQG4WsMej0WXaHxunmU=
inet.af/netaddr v0.0.0-20220617031823-097006376321/go.mod h1:OIezDfdzOgFhuw4HuWapWq2e9l0H9tK4F1j+ETRtF3k=

View File

@@ -1,39 +1,79 @@
package main
import (
"fmt"
"os"
"time"
"github.com/kerberos-io/agent/machinery/src/components"
"github.com/kerberos-io/agent/machinery/src/log"
"github.com/kerberos-io/agent/machinery/src/models"
"github.com/kerberos-io/agent/machinery/src/routers"
"github.com/kerberos-io/agent/machinery/src/utils"
"gopkg.in/DataDog/dd-trace-go.v1/ddtrace/tracer"
"gopkg.in/DataDog/dd-trace-go.v1/profiler"
)
var VERSION = "3.0.0"
func main() {
const VERSION = "3.0"
// You might be interested in debugging the agent.
if os.Getenv("DATADOG_AGENT_ENABLED") == "true" {
if os.Getenv("DATADOG_AGENT_K8S_ENABLED") == "true" {
tracer.Start()
defer tracer.Stop()
} else {
service := os.Getenv("DATADOG_AGENT_SERVICE")
environment := os.Getenv("DATADOG_AGENT_ENVIRONMENT")
log.Log.Info("Starting Datadog Agent with service: " + service + " and environment: " + environment)
rules := []tracer.SamplingRule{tracer.RateRule(1)}
tracer.Start(
tracer.WithSamplingRules(rules),
tracer.WithService(service),
tracer.WithEnv(environment),
)
defer tracer.Stop()
err := profiler.Start(
profiler.WithService(service),
profiler.WithEnv(environment),
profiler.WithProfileTypes(
profiler.CPUProfile,
profiler.HeapProfile,
),
)
if err != nil {
log.Log.Fatal(err.Error())
}
defer profiler.Stop()
}
}
// Start the show ;)
action := os.Args[1]
log.Log.Init()
timezone, _ := time.LoadLocation("CET")
log.Log.Init(timezone)
switch action {
case "version":
log.Log.Info("You are currrently running Kerberos Agent " + VERSION)
case "pending-upload":
name := os.Args[2]
fmt.Println(name)
case "discover":
timeout := os.Args[2]
fmt.Println(timeout)
log.Log.Info(timeout)
case "run":
{
name := os.Args[2]
port := os.Args[3]
// Print Kerberos.io ASCII art
utils.PrintASCIIArt()
// Print the environment variables which include "AGENT_" as prefix.
utils.PrintEnvironmentVariables()
// Read the config on start, and pass it to the other
// function and features. Please note that this might be changed
// when saving or updating the configuration through the REST api or MQTT handler.
@@ -44,6 +84,33 @@ func main() {
// Open this configuration either from Kerberos Agent or Kerberos Factory.
components.OpenConfig(&configuration)
// We will override the configuration with the environment variables
components.OverrideWithEnvironmentVariables(&configuration)
// Printing final configuration
utils.PrintConfiguration(&configuration)
// Check the folder permissions, it might be that we do not have permissions to write
// recordings, update the configuration or save snapshots.
utils.CheckDataDirectoryPermissions()
// Set timezone
timezone, _ := time.LoadLocation(configuration.Config.Timezone)
log.Log.Init(timezone)
// Check if we have a device Key or not, if not
// we will generate one.
if configuration.Config.Key == "" {
key := utils.RandStringBytesMaskImpr(30)
configuration.Config.Key = key
err := components.StoreConfig(configuration.Config)
if err == nil {
log.Log.Info("Main: updated unique key for agent to: " + key)
} else {
log.Log.Info("Main: something went wrong while trying to store key: " + key)
}
}
// Bootstrapping the agent
communication := models.Communication{
HandleBootstrap: make(chan string, 1),
@@ -54,6 +121,6 @@ func main() {
routers.StartWebserver(&configuration, &communication)
}
default:
fmt.Println("Sorry I don't understand :(")
log.Log.Error("Main: Sorry I don't understand :(")
}
}

View File

@@ -25,7 +25,19 @@ func OpenRTSP(url string) (av.DemuxCloser, []av.CodecData, error) {
return nil, []av.CodecData{}, err
}
func GetVideoDecoder(streams []av.CodecData) *ffmpeg.VideoDecoder {
func GetVideoStream(streams []av.CodecData) (av.CodecData, error) {
var videoStream av.CodecData
for _, stream := range streams {
if stream.Type().IsAudio() {
//astream := stream.(av.AudioCodecData)
} else if stream.Type().IsVideo() {
videoStream = stream
}
}
return videoStream, nil
}
func GetVideoDecoder(decoder *ffmpeg.VideoDecoder, streams []av.CodecData) {
// Load video codec
var vstream av.VideoCodecData
for _, stream := range streams {
@@ -35,13 +47,15 @@ func GetVideoDecoder(streams []av.CodecData) *ffmpeg.VideoDecoder {
vstream = stream.(av.VideoCodecData)
}
}
dec, _ := ffmpeg.NewVideoDecoder(vstream)
return dec
err := ffmpeg.NewVideoDecoder(decoder, vstream)
if err != nil {
log.Log.Error("GetVideoDecoder: " + err.Error())
}
}
func DecodeImage(pkt av.Packet, decoder *ffmpeg.VideoDecoder, decoderMutex *sync.Mutex) (*ffmpeg.VideoFrame, error) {
func DecodeImage(frame *ffmpeg.VideoFrame, pkt av.Packet, decoder *ffmpeg.VideoDecoder, decoderMutex *sync.Mutex) (*ffmpeg.VideoFrame, error) {
decoderMutex.Lock()
img, err := decoder.Decode(pkt.Data)
img, err := decoder.Decode(frame, pkt.Data)
decoderMutex.Unlock()
return img, err
}
@@ -52,7 +66,6 @@ func HandleStream(infile av.DemuxCloser, queue *pubsub.Queue, communication *mod
var err error
loop:
for {
// This will check if we need to stop the thread,
// because of a reconfiguration.
select {
@@ -64,9 +77,7 @@ loop:
var pkt av.Packet
if pkt, err = infile.ReadPacket(); err != nil { // sometimes this throws an end of file..
log.Log.Error("HandleStream: " + err.Error())
if err.Error() == "EOF" {
time.Sleep(30 * time.Second)
}
time.Sleep(1 * time.Second)
}
// Could be that a decode is throwing errors.
@@ -89,6 +100,7 @@ loop:
r := communication.PackageCounter.Load().(int64)
log.Log.Info("HandleStream: packet size " + strconv.Itoa(len(pkt.Data)))
communication.PackageCounter.Store((r + 1) % 1000)
communication.LastPacketTimer.Store(time.Now().Unix())
}
}
}
@@ -96,3 +108,42 @@ loop:
queue.Close()
log.Log.Debug("HandleStream: finished")
}
func HandleSubStream(infile av.DemuxCloser, queue *pubsub.Queue, communication *models.Communication) { //, wg *sync.WaitGroup) {
log.Log.Debug("HandleSubStream: started")
var err error
loop:
for {
// This will check if we need to stop the thread,
// because of a reconfiguration.
select {
case <-communication.HandleSubStream:
break loop
default:
}
var pkt av.Packet
if pkt, err = infile.ReadPacket(); err != nil { // sometimes this throws an end of file..
log.Log.Error("HandleSubStream: " + err.Error())
time.Sleep(1 * time.Second)
}
// Could be that a decode is throwing errors.
if len(pkt.Data) > 0 {
queue.WritePacket(pkt)
// This will check if we need to stop the thread,
// because of a reconfiguration.
select {
case <-communication.HandleSubStream:
break loop
default:
}
}
}
queue.Close()
log.Log.Debug("HandleSubStream: finished")
}

View File

@@ -3,11 +3,10 @@ package capture
import (
"os"
"runtime"
"runtime/debug"
"strconv"
"time"
"github.com/gin-gonic/gin"
"github.com/kerberos-io/agent/machinery/src/log"
"github.com/kerberos-io/agent/machinery/src/models"
"github.com/kerberos-io/agent/machinery/src/utils"
@@ -17,109 +16,285 @@ import (
"github.com/kerberos-io/joy4/av"
)
func HandleRecordStream(recordingCursor *pubsub.QueueCursor, configuration *models.Configuration, communication *models.Communication, streams []av.CodecData) {
log.Log.Debug("HandleRecordStream: started")
func CleanupRecordingDirectory(configuration *models.Configuration) {
autoClean := configuration.Config.AutoClean
if autoClean == "true" {
maxSize := configuration.Config.MaxDirectorySize
if maxSize == 0 {
maxSize = 300
}
// Total size of the recording directory.
recordingsDirectory := "./data/recordings"
size, err := utils.DirSize(recordingsDirectory)
if err == nil {
sizeInMB := size / 1000 / 1000
if sizeInMB >= maxSize {
// Remove the oldest recording
oldestFile, err := utils.FindOldestFile(recordingsDirectory)
if err == nil {
err := os.Remove(recordingsDirectory + "/" + oldestFile.Name())
log.Log.Info("HandleRecordStream: removed oldest file as part of cleanup - " + recordingsDirectory + "/" + oldestFile.Name())
if err != nil {
log.Log.Info("HandleRecordStream: something went wrong, " + err.Error())
}
} else {
log.Log.Info("HandleRecordStream: something went wrong, " + err.Error())
}
}
} else {
log.Log.Info("HandleRecordStream: something went wrong, " + err.Error())
}
} else {
log.Log.Info("HandleRecordStream: Autoclean disabled, nothing to do here.")
}
}
func HandleRecordStream(queue *pubsub.Queue, configuration *models.Configuration, communication *models.Communication, streams []av.CodecData) {
config := configuration.Config
recordingPeriod := config.Capture.PostRecording // number of seconds to record.
maxRecordingPeriod := config.Capture.MaxLengthRecording // maximum number of seconds to record.
// Synchronise the last synced time
now := time.Now().Unix()
startRecording := now
timestamp := now
if config.Capture.Recording == "false" {
log.Log.Info("HandleRecordStream: disabled, we will not record anything.")
} else {
log.Log.Debug("HandleRecordStream: started")
// Check if continuous recording.
if config.Capture.Continuous == "true" {
recordingPeriod := config.Capture.PostRecording // number of seconds to record.
maxRecordingPeriod := config.Capture.MaxLengthRecording // maximum number of seconds to record.
// Do not do anything!
log.Log.Info("HandleRecordStream: Start continuous recording ")
// Synchronise the last synced time
now := time.Now().Unix()
startRecording := now
timestamp := now
loc, _ := time.LoadLocation(config.Timezone)
now = time.Now().Unix()
timestamp = now
start := false
var name string
var myMuxer *mp4.Muxer
var file *os.File
var err error
// Check if continuous recording.
if config.Capture.Continuous == "true" {
// If continuous record the full length
recordingPeriod = maxRecordingPeriod
// Recording file name
fullName := ""
// Do not do anything!
log.Log.Info("HandleRecordStream: Start continuous recording ")
// Get as much packets we need.
//for pkt := range packets {
var cursorError error
var pkt av.Packet
recordingStatus := "idle"
loc, _ := time.LoadLocation(config.Timezone)
now = time.Now().Unix()
timestamp = now
start := false
var name string
var myMuxer *mp4.Muxer
var file *os.File
var err error
for cursorError == nil {
// If continuous record the full length
recordingPeriod = maxRecordingPeriod
// Recording file name
fullName := ""
pkt, cursorError = recordingCursor.ReadPacket()
// Get as much packets we need.
//for pkt := range packets {
var cursorError error
var pkt av.Packet
var nextPkt av.Packet
recordingStatus := "idle"
recordingCursor := queue.Oldest()
now := time.Now().Unix()
if start && // If already recording and current frame is a keyframe and we should stop recording
pkt.IsKeyFrame && (timestamp+recordingPeriod-now <= 0 || now-startRecording >= maxRecordingPeriod) {
// This will write the trailer a well.
if err := myMuxer.WriteTrailer(); err != nil {
log.Log.Error(err.Error())
}
log.Log.Info("HandleRecordStream: Recording finished: file save: " + name)
file.Close()
// Check if need to convert to fragmented using bento
if config.Capture.Fragmented == "true" && config.Capture.FragmentedDuration > 0 {
utils.CreateFragmentedMP4(fullName, config.Capture.FragmentedDuration)
}
// Create a symbol link.
fc, _ := os.Create("./data/cloud/" + name)
fc.Close()
// Cleanup muxer
start = false
myMuxer = nil
runtime.GC()
debug.FreeOSMemory()
recordingStatus = "idle"
if cursorError == nil {
pkt, cursorError = recordingCursor.ReadPacket()
}
// If not yet started and a keyframe, let's make a recording
if !start && pkt.IsKeyFrame {
for cursorError == nil {
// Check if within time interval
nowInTimezone := time.Now().In(loc)
weekday := nowInTimezone.Weekday()
hour := nowInTimezone.Hour()
minute := nowInTimezone.Minute()
second := nowInTimezone.Second()
timeEnabled := config.Time
timeInterval := config.Timetable[int(weekday)]
nextPkt, cursorError = recordingCursor.ReadPacket()
if timeEnabled == "true" && timeInterval != nil {
start1 := timeInterval.Start1
end1 := timeInterval.End1
start2 := timeInterval.Start2
end2 := timeInterval.End2
currentTimeInSeconds := hour*60*60 + minute*60 + second
if (currentTimeInSeconds >= start1 && currentTimeInSeconds <= end1) ||
(currentTimeInSeconds >= start2 && currentTimeInSeconds <= end2) {
now := time.Now().Unix()
} else {
log.Log.Debug("HandleRecordStream: Disabled: no continuous recording at this moment. Not within specified time interval.")
time.Sleep(5 * time.Second)
continue
if start && // If already recording and current frame is a keyframe and we should stop recording
nextPkt.IsKeyFrame && (timestamp+recordingPeriod-now <= 0 || now-startRecording >= maxRecordingPeriod) {
// Write the last packet
if err := myMuxer.WritePacket(pkt); err != nil {
log.Log.Error(err.Error())
}
// This will write the trailer a well.
if err := myMuxer.WriteTrailerWithPacket(nextPkt); err != nil {
log.Log.Error(err.Error())
}
log.Log.Info("HandleRecordStream: Recording finished: file save: " + name)
// Cleanup muxer
start = false
myMuxer.Close()
myMuxer = nil
file.Close()
file = nil
// Check if need to convert to fragmented using bento
if config.Capture.Fragmented == "true" && config.Capture.FragmentedDuration > 0 {
utils.CreateFragmentedMP4(fullName, config.Capture.FragmentedDuration)
}
// Create a symbol link.
fc, _ := os.Create("./data/cloud/" + name)
fc.Close()
recordingStatus = "idle"
// Clean up the recording directory if necessary.
CleanupRecordingDirectory(configuration)
}
// If not yet started and a keyframe, let's make a recording
if !start && pkt.IsKeyFrame {
// Check if within time interval
nowInTimezone := time.Now().In(loc)
weekday := nowInTimezone.Weekday()
hour := nowInTimezone.Hour()
minute := nowInTimezone.Minute()
second := nowInTimezone.Second()
timeEnabled := config.Time
timeInterval := config.Timetable[int(weekday)]
if timeEnabled == "true" && timeInterval != nil {
start1 := timeInterval.Start1
end1 := timeInterval.End1
start2 := timeInterval.Start2
end2 := timeInterval.End2
currentTimeInSeconds := hour*60*60 + minute*60 + second
if (currentTimeInSeconds >= start1 && currentTimeInSeconds <= end1) ||
(currentTimeInSeconds >= start2 && currentTimeInSeconds <= end2) {
} else {
log.Log.Debug("HandleRecordStream: Disabled: no continuous recording at this moment. Not within specified time interval.")
time.Sleep(5 * time.Second)
continue
}
}
start = true
timestamp = now
// timestamp_microseconds_instanceName_regionCoordinates_numberOfChanges_token
// 1564859471_6-474162_oprit_577-283-727-375_1153_27.mp4
// - Timestamp
// - Size + - + microseconds
// - device
// - Region
// - Number of changes
// - Token
startRecording = time.Now().Unix() // we mark the current time when the record started.ss
s := strconv.FormatInt(startRecording, 10) + "_" +
"6" + "-" +
"967003" + "_" +
config.Name + "_" +
"200-200-400-400" + "_0_" +
"769"
name = s + ".mp4"
fullName = "./data/recordings/" + name
// Running...
log.Log.Info("Recording started")
file, err = os.Create(fullName)
if err == nil {
myMuxer = mp4.NewMuxer(file)
}
log.Log.Info("HandleRecordStream: composing recording")
log.Log.Info("HandleRecordStream: write header")
// Creating the file, might block sometimes.
if err := myMuxer.WriteHeader(streams); err != nil {
log.Log.Error(err.Error())
}
if err := myMuxer.WritePacket(pkt); err != nil {
log.Log.Error(err.Error())
}
recordingStatus = "started"
} else if start {
if err := myMuxer.WritePacket(pkt); err != nil {
log.Log.Error(err.Error())
}
// We will sync to file every keyframe.
if pkt.IsKeyFrame {
err := file.Sync()
if err != nil {
log.Log.Error(err.Error())
} else {
log.Log.Info("HandleRecordStream: Synced file: " + name)
}
}
}
start = true
timestamp = now
pkt = nextPkt
}
// We might have interrupted the recording while restarting the agent.
// If this happens we need to check to properly close the recording.
if cursorError != nil {
if recordingStatus == "started" {
// This will write the trailer a well.
if err := myMuxer.WriteTrailer(); err != nil {
log.Log.Error(err.Error())
}
log.Log.Info("HandleRecordStream: Recording finished: file save: " + name)
// Cleanup muxer
start = false
myMuxer.Close()
myMuxer = nil
file.Close()
file = nil
// Check if need to convert to fragmented using bento
if config.Capture.Fragmented == "true" && config.Capture.FragmentedDuration > 0 {
utils.CreateFragmentedMP4(fullName, config.Capture.FragmentedDuration)
}
// Create a symbol link.
fc, _ := os.Create("./data/cloud/" + name)
fc.Close()
recordingStatus = "idle"
}
}
} else {
log.Log.Info("HandleRecordStream: Start motion based recording ")
var myMuxer *mp4.Muxer
var file *os.File
var err error
var lastDuration time.Duration
var lastRecordingTime int64
for motion := range communication.HandleMotion {
timestamp = time.Now().Unix()
startRecording = time.Now().Unix() // we mark the current time when the record started.
numberOfChanges := motion.NumberOfChanges
// If we have prerecording we will substract the number of seconds.
// Taking into account FPS = GOP size (Keyfram interval)
if config.Capture.PreRecording > 0 {
// Might be that recordings are coming short after each other.
// Therefore we do some math with the current time and the last recording time.
timeBetweenNowAndLastRecording := startRecording - lastRecordingTime
if timeBetweenNowAndLastRecording > int64(config.Capture.PreRecording) {
startRecording = startRecording - int64(config.Capture.PreRecording) + 1
} else {
startRecording = startRecording - timeBetweenNowAndLastRecording
}
}
// timestamp_microseconds_instanceName_regionCoordinates_numberOfChanges_token
// 1564859471_6-474162_oprit_577-283-727-375_1153_27.mp4
@@ -130,166 +305,175 @@ func HandleRecordStream(recordingCursor *pubsub.QueueCursor, configuration *mode
// - Number of changes
// - Token
startRecording = time.Now().Unix() // we mark the current time when the record started.ss
s := strconv.FormatInt(startRecording, 10) + "_" + "6" + "-" + "967003" + "_" + config.Name + "_" + "200-200-400-400" + "_" + "24" + "_" + "769"
name = s + ".mp4"
fullName = "./data/recordings/" + name
s := strconv.FormatInt(startRecording, 10) + "_" +
"6" + "-" +
"967003" + "_" +
config.Name + "_" +
"200-200-400-400" + "_" +
strconv.Itoa(numberOfChanges) + "_" +
"769"
name := s + ".mp4"
fullName := "./data/recordings/" + name
// Running...
log.Log.Info("Recording started")
log.Log.Info("HandleRecordStream: Recording started")
file, err = os.Create(fullName)
if err == nil {
myMuxer = mp4.NewMuxer(file)
}
start := false
log.Log.Info("HandleRecordStream: composing recording")
log.Log.Info("HandleRecordStream: write header")
// Creating the file, might block sometimes.
if err := myMuxer.WriteHeader(streams); err != nil {
log.Log.Error(err.Error())
}
if err := myMuxer.WritePacket(pkt); err != nil {
log.Log.Error(err.Error())
// Get as much packets we need.
var cursorError error
var pkt av.Packet
var nextPkt av.Packet
recordingCursor := queue.DelayedGopCount(int(config.Capture.PreRecording))
if cursorError == nil {
pkt, cursorError = recordingCursor.ReadPacket()
}
recordingStatus = "started"
for cursorError == nil {
} else if start {
if err := myMuxer.WritePacket(pkt); err != nil {
log.Log.Error(err.Error())
}
}
}
nextPkt, cursorError = recordingCursor.ReadPacket()
if cursorError != nil {
log.Log.Error("HandleRecordStream: " + cursorError.Error())
}
// We might have interrupted the recording while restarting the agent.
// If this happens we need to check to properly close the recording.
if cursorError != nil {
if recordingStatus == "started" {
// This will write the trailer a well.
if err := myMuxer.WriteTrailer(); err != nil {
log.Log.Error(err.Error())
now := time.Now().Unix()
select {
case motion := <-communication.HandleMotion:
timestamp = now
log.Log.Info("HandleRecordStream: motion detected while recording. Expanding recording.")
numberOfChanges = motion.NumberOfChanges
log.Log.Info("Received message with recording data, detected changes to save: " + strconv.Itoa(numberOfChanges))
default:
}
if (timestamp+recordingPeriod-now < 0 || now-startRecording > maxRecordingPeriod) && nextPkt.IsKeyFrame {
log.Log.Info("HandleRecordStream: closing recording (timestamp: " + strconv.FormatInt(timestamp, 10) + ", recordingPeriod: " + strconv.FormatInt(recordingPeriod, 10) + ", now: " + strconv.FormatInt(now, 10) + ", startRecording: " + strconv.FormatInt(startRecording, 10) + ", maxRecordingPeriod: " + strconv.FormatInt(maxRecordingPeriod, 10))
break
}
if pkt.IsKeyFrame && !start && pkt.Time >= lastDuration {
log.Log.Info("HandleRecordStream: write frames")
start = true
}
if start {
if err := myMuxer.WritePacket(pkt); err != nil {
log.Log.Error(err.Error())
}
// We will sync to file every keyframe.
if pkt.IsKeyFrame {
err := file.Sync()
if err != nil {
log.Log.Error(err.Error())
} else {
log.Log.Info("HandleRecordStream: Synced file: " + name)
}
}
}
pkt = nextPkt
}
log.Log.Info("HandleRecordStream: Recording finished: file save: " + name)
// This will write the trailer as well.
myMuxer.WriteTrailerWithPacket(nextPkt)
log.Log.Info("HandleRecordStream: file save: " + name)
lastDuration = pkt.Time
lastRecordingTime = time.Now().Unix()
// Cleanup muxer
myMuxer.Close()
myMuxer = nil
file.Close()
file = nil
// Check if need to convert to fragmented using bento
if config.Capture.Fragmented == "true" && config.Capture.FragmentedDuration > 0 {
utils.CreateFragmentedMP4(fullName, config.Capture.FragmentedDuration)
}
// Create a symbol link.
// Create a symbol linc.
fc, _ := os.Create("./data/cloud/" + name)
fc.Close()
// Cleanup muxer
start = false
myMuxer = nil
runtime.GC()
debug.FreeOSMemory()
recordingStatus = "idle"
// Clean up the recording directory if necessary.
CleanupRecordingDirectory(configuration)
}
}
log.Log.Debug("HandleRecordStream: finished")
}
}
// VerifyCamera godoc
// @Router /api/camera/verify/{streamType} [post]
// @ID verify-camera
// @Tags camera
// @Param streamType path string true "Stream Type" Enums(primary, secondary)
// @Param cameraStreams body models.CameraStreams true "Camera Streams"
// @Summary Validate a specific RTSP profile camera connection.
// @Description This method will validate a specific profile connection from an RTSP camera, and try to get the codec.
// @Success 200 {object} models.APIResponse
func VerifyCamera(c *gin.Context) {
var cameraStreams models.CameraStreams
err := c.BindJSON(&cameraStreams)
if err == nil {
streamType := c.Param("streamType")
if streamType == "" {
streamType = "primary"
}
rtspUrl := cameraStreams.RTSP
if streamType == "secondary" {
rtspUrl = cameraStreams.SubRTSP
}
_, codecs, err := OpenRTSP(rtspUrl)
if err == nil {
videoIdx := -1
audioIdx := -1
for i, codec := range codecs {
if codec.Type().String() == "H264" && videoIdx < 0 {
videoIdx = i
} else if codec.Type().String() == "PCM_MULAW" && audioIdx < 0 {
audioIdx = i
}
}
if videoIdx > -1 {
c.JSON(200, models.APIResponse{
Message: "All good, detected a H264 codec.",
Data: codecs,
})
} else {
c.JSON(400, models.APIResponse{
Message: "Stream doesn't have a H264 codec, we only support H264 so far.",
})
}
} else {
c.JSON(400, models.APIResponse{
Message: err.Error(),
})
}
} else {
log.Log.Info("HandleRecordStream: Start motion based recording ")
var myMuxer *mp4.Muxer
var file *os.File
var err error
for _ = range communication.HandleMotion {
now = time.Now().Unix()
timestamp = now
startRecording = now // we mark the current time when the record started.
// timestamp_microseconds_instanceName_regionCoordinates_numberOfChanges_token
// 1564859471_6-474162_oprit_577-283-727-375_1153_27.mp4
// - Timestamp
// - Size + - + microseconds
// - device
// - Region
// - Number of changes
// - Token
s := strconv.FormatInt(startRecording, 10) + "_" + "6" + "-" + "967003" + "_" + config.Name + "_" + "200-200-400-400" + "_" + "24" + "_" + "769"
name := s + ".mp4"
fullName := "./data/recordings/" + name
// Running...
log.Log.Info("HandleRecordStream: Recording started")
file, err = os.Create(fullName)
if err == nil {
myMuxer = mp4.NewMuxer(file)
}
start := false
log.Log.Info("HandleRecordStream: composing recording")
log.Log.Info("HandleRecordStream: write header")
// Creating the file, might block sometimes.
if err := myMuxer.WriteHeader(streams); err != nil {
log.Log.Error(err.Error())
}
// Get as much packets we need.
//for pkt := range packets {
var cursorError error
var pkt av.Packet
for cursorError == nil {
pkt, cursorError = recordingCursor.ReadPacket()
if cursorError != nil {
log.Log.Error("HandleRecordStream: " + cursorError.Error())
}
now := time.Now().Unix()
select {
case <-communication.HandleMotion:
timestamp = now
log.Log.Info("HandleRecordStream: motion detected while recording. Expanding recording.")
default:
}
if timestamp+recordingPeriod-now <= 0 || now-startRecording >= maxRecordingPeriod {
log.Log.Info("HandleRecordStream: closing recording (timestamp: " + strconv.FormatInt(timestamp, 10) + ", recordingPeriod: " + strconv.FormatInt(recordingPeriod, 10) + ", now: " + strconv.FormatInt(now, 10) + ", startRecording: " + strconv.FormatInt(startRecording, 10) + ", maxRecordingPeriod: " + strconv.FormatInt(maxRecordingPeriod, 10))
break
}
if pkt.IsKeyFrame {
log.Log.Info("HandleRecordStream: write frames")
start = true
}
if start {
if err := myMuxer.WritePacket(pkt); err != nil {
log.Log.Error(err.Error())
}
}
}
// This will write the trailer as well.
myMuxer.WriteTrailer()
log.Log.Info("HandleRecordStream: file save: " + name)
file.Close()
myMuxer = nil
runtime.GC()
debug.FreeOSMemory()
// Check if need to convert to fragmented using bento
if config.Capture.Fragmented == "true" && config.Capture.FragmentedDuration > 0 {
utils.CreateFragmentedMP4(fullName, config.Capture.FragmentedDuration)
}
// Create a symbol linc.
fc, _ := os.Create("./data/cloud/" + name)
fc.Close()
}
c.JSON(400, models.APIResponse{
Message: "Something went wrong while receiving the config " + err.Error(),
})
}
log.Log.Debug("HandleRecordStream: finished")
}

View File

@@ -2,31 +2,36 @@ package cloud
import (
"bytes"
"crypto/tls"
"encoding/base64"
"encoding/json"
"fmt"
"io/ioutil"
"os"
"strings"
"sync"
"github.com/elastic/go-sysinfo"
"github.com/gin-gonic/gin"
"github.com/golang-module/carbon/v2"
"github.com/kerberos-io/joy4/av/pubsub"
"github.com/minio/minio-go/v6"
mqtt "github.com/eclipse/paho.mqtt.golang"
av "github.com/kerberos-io/joy4/av"
"github.com/kerberos-io/joy4/cgo/ffmpeg"
"gocv.io/x/gocv"
"net/http"
"runtime"
"runtime/debug"
"net/url"
"strconv"
"time"
"github.com/kerberos-io/agent/machinery/src/computervision"
"github.com/kerberos-io/agent/machinery/src/log"
"github.com/kerberos-io/agent/machinery/src/models"
"github.com/kerberos-io/agent/machinery/src/onvif"
"github.com/kerberos-io/agent/machinery/src/utils"
"github.com/kerberos-io/agent/machinery/src/webrtc"
"github.com/shirou/gopsutil/disk"
"github.com/shirou/gopsutil/host"
)
func PendingUpload() {
@@ -45,157 +50,315 @@ func HandleUpload(configuration *models.Configuration, communication *models.Com
config := configuration.Config
watchDirectory := "./data/cloud/"
loop:
for {
ff, err := utils.ReadDirectory(watchDirectory)
if config.Offline == "true" {
log.Log.Debug("HandleUpload: stopping as Offline is enabled.")
} else {
// This will check if we need to stop the thread,
// because of a reconfiguration.
select {
case <-communication.HandleUpload:
break loop
default:
}
// Half a second delay between two uploads
delay := 500 * time.Millisecond
if err == nil {
for _, f := range ff {
loop:
for {
// This will check if we need to stop the thread,
// because of a reconfiguration.
select {
case <-communication.HandleUpload:
break loop
case <-time.After(2 * time.Second):
}
// This will check if we need to stop the thread,
// because of a reconfiguration.
select {
case <-communication.HandleUpload:
break loop
default:
}
ff, err := utils.ReadDirectory(watchDirectory)
if err != nil {
log.Log.Error("HandleUpload: " + err.Error())
} else {
for _, f := range ff {
fileName := f.Name()
if config.Cloud == "s3" {
UploadS3(configuration, fileName, watchDirectory)
} else if config.Cloud == "kstorage" {
UploadKerberosVault(configuration, fileName, watchDirectory)
// This will check if we need to stop the thread,
// because of a reconfiguration.
select {
case <-communication.HandleUpload:
break loop
default:
}
fileName := f.Name()
uploaded := false
configured := false
err = nil
if config.Cloud == "s3" {
uploaded, configured, err = UploadS3(configuration, fileName)
} else if config.Cloud == "kstorage" {
uploaded, configured, err = UploadKerberosVault(configuration, fileName)
}
// Check if the file is uploaded, if so, remove it.
if uploaded {
delay = 500 * time.Millisecond // reset
err := os.Remove(watchDirectory + fileName)
if err != nil {
log.Log.Error("HandleUpload: " + err.Error())
}
// Check if we need to remove the original recording
// removeAfterUpload is set to false by default
if config.RemoveAfterUpload == "true" {
err := os.Remove("./data/recordings/" + fileName)
if err != nil {
log.Log.Error("HandleUpload: " + err.Error())
}
}
} else if !configured {
err := os.Remove(watchDirectory + fileName)
if err != nil {
log.Log.Error("HandleUpload: " + err.Error())
}
} else {
delay = 5 * time.Second // slow down
log.Log.Error("HandleUpload: " + err.Error())
}
time.Sleep(delay)
}
}
}
time.Sleep(1 * time.Second)
}
log.Log.Debug("HandleUpload: finished")
}
func HandleHeartBeat(configuration *models.Configuration, communication *models.Communication) {
func GetSystemInfo() (models.System, error) {
var usedMem uint64 = 0
var totalMem uint64 = 0
var freeMem uint64 = 0
var processUsedMem uint64 = 0
architecture := ""
cpuId := ""
KernelVersion := ""
agentVersion := ""
var MACs []string
var IPs []string
hostname := ""
bootTime := time.Time{}
// Read agent version
version, err := os.Open("./version")
defer version.Close()
agentVersion = "unknown"
if err == nil {
agentVersionBytes, err := ioutil.ReadAll(version)
agentVersion = string(agentVersionBytes)
if err != nil {
log.Log.Error(err.Error())
}
}
host, err := sysinfo.Host()
if err == nil {
cpuId = host.Info().UniqueID
architecture = host.Info().Architecture
KernelVersion = host.Info().KernelVersion
MACs = host.Info().MACs
IPs = host.Info().IPs
hostname = host.Info().Hostname
bootTime = host.Info().BootTime
memory, err := host.Memory()
if err == nil {
usedMem = memory.Used
totalMem = memory.Total
freeMem = memory.Free
}
}
process, err := sysinfo.Self()
if err == nil {
memInfo, err := process.Memory()
if err == nil {
processUsedMem = memInfo.Resident
}
}
system := models.System{
Hostname: hostname,
CPUId: cpuId,
KernelVersion: KernelVersion,
Version: agentVersion,
MACs: MACs,
IPs: IPs,
BootTime: uint64(bootTime.Unix()),
Architecture: architecture,
UsedMemory: usedMem,
TotalMemory: totalMem,
FreeMemory: freeMem,
ProcessUsedMemory: processUsedMem,
}
return system, nil
}
func HandleHeartBeat(configuration *models.Configuration, communication *models.Communication, uptimeStart time.Time) {
log.Log.Debug("HandleHeartBeat: started")
config := configuration.Config
url := config.HeartbeatURI
key := ""
username := ""
vaultURI := ""
if config.Offline == "true" {
log.Log.Debug("HandleHeartBeat: stopping as Offline is enabled.")
} else {
url := config.HeartbeatURI
key := ""
username := ""
vaultURI := ""
if config.Cloud == "s3" && config.S3.Publickey != "" {
username = config.S3.Username
key = config.S3.Publickey
} else if config.Cloud == "kstorage" && config.KStorage.CloudKey != "" {
key = config.KStorage.CloudKey
username = config.KStorage.Directory
vaultURI = config.KStorage.URI
}
// This is the new way ;)
if config.HubURI != "" {
url = config.HubURI + "/devices/heartbeat"
}
if config.HubKey != "" {
key = config.HubKey
}
loop:
for {
// This will check if we need to stop the thread,
// because of a reconfiguration.
select {
case <-communication.HandleHeartBeat:
break loop
default:
if config.Cloud == "s3" && config.S3 != nil && config.S3.Publickey != "" {
username = config.S3.Username
key = config.S3.Publickey
} else if config.Cloud == "kstorage" && config.KStorage != nil && config.KStorage.CloudKey != "" {
key = config.KStorage.CloudKey
username = config.KStorage.Directory
}
uptime, _ := host.Uptime()
days := strconv.Itoa(int(uptime / (60 * 60 * 24)))
//12:11:48 up 11 days
//partitions, _ := disk.Partitions(false)
usage, _ := disk.Usage("/")
diskPercentUsed := strconv.Itoa(int(usage.UsedPercent))
onvifEnabled := "false"
if config.Capture.IPCamera.ONVIFXAddr != "" {
onvifEnabled = "true"
// This is the new way ;)
if config.HubURI != "" {
url = config.HubURI + "/devices/heartbeat"
}
if config.HubKey != "" {
key = config.HubKey
}
var object = fmt.Sprintf(`{
"key" : "%s",
"hash" : "826133658",
"version" : "3.0.0",
"cpuid" : "Serial: xxx",
"clouduser" : "%s",
"cloudpublickey" : "%s",
"cameraname" : "%s",
"cameratype" : "IPCamera",
"docker" : true,
"kios" : false,
"raspberrypi" : false,
"enterprise" : true,
"board" : "",
"disk1size" : "%s",
"disk3size" : "%s",
"diskvdasize" : "%s",
"numberoffiles" : "33",
"temperature" : "sh: 1: vcgencmd: not found",
"wifissid" : "",
"wifistrength" : "",
"uptime" : "up %s days,",
"timestamp" : 1564747908,
"siteID" : "%s",
"onvif" : "%s"
}`, config.Key, username, key, config.Name, "0", "0", diskPercentUsed, days, config.HubSite, onvifEnabled)
loop:
for {
var jsonStr = []byte(object)
buffy := bytes.NewBuffer(jsonStr)
req, _ := http.NewRequest("POST", url, buffy)
req.Header.Set("Content-Type", "application/json")
if key != "" {
// Check if we have a friendly name or not.
name := config.Name
if config.FriendlyName != "" {
name = config.FriendlyName
}
client := &http.Client{}
resp, err := client.Do(req)
if resp != nil {
resp.Body.Close()
}
if err == nil && resp.StatusCode == 200 {
log.Log.Info("HandleHeartBeat: (200) Heartbeat received by Kerberos Hub.")
} else {
log.Log.Error("HandleHeartBeat: (400) Something went wrong while sending to Kerberos Hub.")
}
// Get some system information
// like the uptime, hostname, memory usage, etc.
system, _ := GetSystemInfo()
// If we have a vault connect, we will also send some analytics
// to that service.
if vaultURI != "" {
buffy = bytes.NewBuffer(jsonStr)
req, _ = http.NewRequest("POST", vaultURI+"/devices/heartbeat", buffy)
req.Header.Set("Content-Type", "application/json")
// We will formated the uptime to a human readable format
// this will be used on Kerberos Hub: Uptime -> 1 day and 2 hours.
uptimeFormatted := uptimeStart.Format("2006-01-02 15:04:05")
uptimeString := carbon.Parse(uptimeFormatted).DiffForHumans()
uptimeString = strings.ReplaceAll(uptimeString, "ago", "")
client = &http.Client{}
resp, err = client.Do(req)
if resp != nil {
resp.Body.Close()
}
if err == nil && resp.StatusCode == 200 {
log.Log.Info("HandleHeartBeat: (200) Heartbeat received by Kerberos Vault.")
// Do the same for boottime
bootTimeFormatted := time.Unix(int64(system.BootTime), 0).Format("2006-01-02 15:04:05")
boottimeString := carbon.Parse(bootTimeFormatted).DiffForHumans()
boottimeString = strings.ReplaceAll(boottimeString, "ago", "")
// We'll check which mode is enabled for the camera.
onvifEnabled := "false"
if config.Capture.IPCamera.ONVIFXAddr != "" {
device, err := onvif.ConnectToOnvifDevice(configuration)
if err == nil {
capabilities := onvif.GetCapabilitiesFromDevice(device)
for _, v := range capabilities {
if v == "PTZ" || v == "ptz" {
onvifEnabled = "true"
}
}
}
}
// Check if the agent is running inside a cluster (Kerberos Factory) or as
// an open source agent
isEnterprise := false
if os.Getenv("DEPLOYMENT") == "factory" || os.Getenv("MACHINERY_ENVIRONMENT") == "kubernetes" {
isEnterprise = true
}
// Congert to string
macs, _ := json.Marshal(system.MACs)
ips, _ := json.Marshal(system.IPs)
var object = fmt.Sprintf(`{
"key" : "%s",
"version" : "3.0.0",
"release" : "%s",
"cpuid" : "%s",
"clouduser" : "%s",
"cloudpublickey" : "%s",
"cameraname" : "%s",
"enterprise" : %t,
"hostname" : "%s",
"architecture" : "%s",
"totalMemory" : "%d",
"usedMemory" : "%d",
"freeMemory" : "%d",
"processMemory" : "%d",
"mac_list" : %s,
"ip_list" : %s,
"board" : "",
"disk1size" : "%s",
"disk3size" : "%s",
"diskvdasize" : "%s",
"uptime" : "%s",
"boot_time" : "%s",
"siteID" : "%s",
"onvif" : "%s",
"numberoffiles" : "33",
"timestamp" : 1564747908,
"cameratype" : "IPCamera",
"docker" : true,
"kios" : false,
"raspberrypi" : false
}`, config.Key, system.Version, system.CPUId, username, key, name, isEnterprise, system.Hostname, system.Architecture, system.TotalMemory, system.UsedMemory, system.FreeMemory, system.ProcessUsedMemory, macs, ips, "0", "0", "0", uptimeString, boottimeString, config.HubSite, onvifEnabled)
var jsonStr = []byte(object)
buffy := bytes.NewBuffer(jsonStr)
req, _ := http.NewRequest("POST", url, buffy)
req.Header.Set("Content-Type", "application/json")
client := &http.Client{}
resp, err := client.Do(req)
if resp != nil {
resp.Body.Close()
}
if err == nil && resp.StatusCode == 200 {
communication.CloudTimestamp.Store(time.Now().Unix())
log.Log.Info("HandleHeartBeat: (200) Heartbeat received by Kerberos Hub.")
} else {
log.Log.Error("HandleHeartBeat: (400) Something went wrong while sending to Kerberos Hub.")
}
// If we have a Kerberos Vault connected, we will also send some analytics
// to that service.
vaultURI = config.KStorage.URI
if vaultURI != "" {
buffy = bytes.NewBuffer(jsonStr)
req, _ = http.NewRequest("POST", vaultURI+"/devices/heartbeat", buffy)
req.Header.Set("Content-Type", "application/json")
client = &http.Client{}
resp, err = client.Do(req)
if resp != nil {
resp.Body.Close()
}
if err == nil && resp.StatusCode == 200 {
log.Log.Info("HandleHeartBeat: (200) Heartbeat received by Kerberos Vault.")
} else {
log.Log.Error("HandleHeartBeat: (400) Something went wrong while sending to Kerberos Vault.")
}
}
} else {
log.Log.Error("HandleHeartBeat: (400) Something went wrong while sending to Kerberos Vault.")
log.Log.Error("HandleHeartBeat: Disabled as we do not have a public key defined.")
}
// This will check if we need to stop the thread,
// because of a reconfiguration.
select {
case <-communication.HandleHeartBeat:
break loop
case <-time.After(15 * time.Second):
}
}
time.Sleep(30 * time.Second)
}
log.Log.Debug("HandleHeartBeat: finished")
@@ -203,91 +366,385 @@ loop:
func HandleLiveStreamSD(livestreamCursor *pubsub.QueueCursor, configuration *models.Configuration, communication *models.Communication, mqttClient mqtt.Client, decoder *ffmpeg.VideoDecoder, decoderMutex *sync.Mutex) {
log.Log.Debug("HandleLiveStreamSD: finished")
log.Log.Debug("HandleLiveStreamSD: started")
config := configuration.Config
key := ""
if config.Cloud == "s3" && config.S3.Publickey != "" {
key = config.S3.Publickey
} else if config.Cloud == "kstorage" && config.KStorage.CloudKey != "" {
key = config.KStorage.CloudKey
}
// This is the new way ;)
if config.HubKey != "" {
key = config.HubKey
}
topic := "kerberos/" + key + "/device/" + config.Key + "/live"
// If offline made is enabled, we will stop the thread.
if config.Offline == "true" {
log.Log.Debug("HandleLiveStreamSD: stopping as Offline is enabled.")
} else {
lastLivestreamRequest := int64(0)
// Check if we need to enable the live stream
if config.Capture.Liveview != "false" {
var cursorError error
var pkt av.Packet
// Allocate frame
frame := ffmpeg.AllocVideoFrame()
for cursorError == nil {
pkt, cursorError = livestreamCursor.ReadPacket()
if len(pkt.Data) == 0 || !pkt.IsKeyFrame {
continue
key := ""
if config.Cloud == "s3" && config.S3 != nil && config.S3.Publickey != "" {
key = config.S3.Publickey
} else if config.Cloud == "kstorage" && config.KStorage != nil && config.KStorage.CloudKey != "" {
key = config.KStorage.CloudKey
}
// This is the new way ;)
if config.HubKey != "" {
key = config.HubKey
}
topic := "kerberos/" + key + "/device/" + config.Key + "/live"
lastLivestreamRequest := int64(0)
var cursorError error
var pkt av.Packet
for cursorError == nil {
pkt, cursorError = livestreamCursor.ReadPacket()
if len(pkt.Data) == 0 || !pkt.IsKeyFrame {
continue
}
now := time.Now().Unix()
select {
case <-communication.HandleLiveSD:
lastLivestreamRequest = now
default:
}
if now-lastLivestreamRequest > 3 {
continue
}
log.Log.Info("HandleLiveStreamSD: Sending base64 encoded images to MQTT.")
sendImage(frame, topic, mqttClient, pkt, decoder, decoderMutex)
}
// Cleanup the frame.
frame.Free()
} else {
log.Log.Debug("HandleLiveStreamSD: stopping as Liveview is disabled.")
}
now := time.Now().Unix()
select {
case <-communication.HandleLiveSD:
lastLivestreamRequest = now
default:
}
if now-lastLivestreamRequest > 3 {
continue
}
log.Log.Info("HandleLiveStreamSD: Sending base64 encoded images to MQTT.")
sendImage(topic, mqttClient, pkt, decoder, decoderMutex)
}
log.Log.Debug("HandleLiveStreamSD: finished")
}
func sendImage(topic string, mqttClient mqtt.Client, pkt av.Packet, decoder *ffmpeg.VideoDecoder, decoderMutex *sync.Mutex) {
mat := computervision.GetRGBImage(pkt, decoder, decoderMutex)
buffer, err := gocv.IMEncode(gocv.JPEGFileExt, mat)
mat.Close()
func sendImage(frame *ffmpeg.VideoFrame, topic string, mqttClient mqtt.Client, pkt av.Packet, decoder *ffmpeg.VideoDecoder, decoderMutex *sync.Mutex) {
_, err := computervision.GetRawImage(frame, pkt, decoder, decoderMutex)
if err == nil {
encoded := base64.StdEncoding.EncodeToString(buffer.GetBytes())
bytes, _ := computervision.ImageToBytes(&frame.Image)
encoded := base64.StdEncoding.EncodeToString(bytes)
mqttClient.Publish(topic, 0, false, encoded)
}
runtime.GC()
debug.FreeOSMemory()
}
func HandleLiveStreamHD(livestreamCursor *pubsub.QueueCursor, configuration *models.Configuration, communication *models.Communication, mqttClient mqtt.Client, codecs []av.CodecData, decoder *ffmpeg.VideoDecoder, decoderMutex *sync.Mutex) {
config := configuration.Config
// Should create a track here.
track := webrtc.NewVideoTrack()
go webrtc.WriteToTrack(livestreamCursor, configuration, communication, mqttClient, track, codecs, decoder, decoderMutex)
if config.Capture.ForwardWebRTC == "true" {
// We get a request with an offer, but we'll forward it.
for m := range communication.HandleLiveHDHandshake {
// Forward SDP
m.CloudKey = config.Key
request, err := json.Marshal(m)
if err == nil {
mqttClient.Publish("kerberos/webrtc/request", 2, false, request)
}
}
if config.Offline == "true" {
log.Log.Debug("HandleLiveStreamHD: stopping as Offline is enabled.")
} else {
log.Log.Info("HandleLiveStreamHD: Waiting for peer connections.")
for handshake := range communication.HandleLiveHDHandshake {
log.Log.Info("HandleLiveStreamHD: setting up a peer connection.")
key := config.Key + "/" + handshake.Cuuid
webrtc.CandidatesMutex.Lock()
_, ok := webrtc.CandidateArrays[key]
if !ok {
webrtc.CandidateArrays[key] = make(chan string, 30)
}
webrtc.CandidatesMutex.Unlock()
webrtc.InitializeWebRTCConnection(configuration, communication, mqttClient, track, handshake, webrtc.CandidateArrays[key])
// Check if we need to enable the live stream
if config.Capture.Liveview != "false" {
// Should create a track here.
track := webrtc.NewVideoTrack()
go webrtc.WriteToTrack(livestreamCursor, configuration, communication, mqttClient, track, codecs, decoder, decoderMutex)
if config.Capture.ForwardWebRTC == "true" {
// We get a request with an offer, but we'll forward it.
for m := range communication.HandleLiveHDHandshake {
// Forward SDP
m.CloudKey = config.Key
request, err := json.Marshal(m)
if err == nil {
mqttClient.Publish("kerberos/webrtc/request", 2, false, request)
}
}
} else {
log.Log.Info("HandleLiveStreamHD: Waiting for peer connections.")
for handshake := range communication.HandleLiveHDHandshake {
log.Log.Info("HandleLiveStreamHD: setting up a peer connection.")
key := config.Key + "/" + handshake.Cuuid
webrtc.CandidatesMutex.Lock()
_, ok := webrtc.CandidateArrays[key]
if !ok {
webrtc.CandidateArrays[key] = make(chan string, 30)
}
webrtc.CandidatesMutex.Unlock()
webrtc.InitializeWebRTCConnection(configuration, communication, mqttClient, track, handshake, webrtc.CandidateArrays[key])
}
}
} else {
log.Log.Debug("HandleLiveStreamHD: stopping as Liveview is disabled.")
}
}
}
// VerifyHub godoc
// @Router /api/hub/verify [post]
// @ID verify-hub
// @Security Bearer
// @securityDefinitions.apikey Bearer
// @in header
// @name Authorization
// @Tags config
// @Param config body models.Config true "Config"
// @Summary Will verify the hub connectivity.
// @Description Will verify the hub connectivity.
// @Success 200 {object} models.APIResponse
func VerifyHub(c *gin.Context) {
var config models.Config
err := c.BindJSON(&config)
if err == nil {
hubKey := config.HubKey
hubURI := config.HubURI
content := []byte(`{"message": "fake-message"}`)
body := bytes.NewReader(content)
req, err := http.NewRequest("POST", hubURI+"/queue/test", body)
if err == nil {
req.Header.Set("X-Kerberos-Cloud-Key", hubKey)
client := &http.Client{}
resp, err := client.Do(req)
if err == nil {
body, err := ioutil.ReadAll(resp.Body)
defer resp.Body.Close()
if err == nil {
if resp.StatusCode == 200 {
c.JSON(200, body)
} else {
c.JSON(400, models.APIResponse{
Data: "Something went wrong while reaching the Kerberos Hub API: " + string(body),
})
}
} else {
c.JSON(400, models.APIResponse{
Data: "Something went wrong while ready the response body: " + err.Error(),
})
}
} else {
c.JSON(400, models.APIResponse{
Data: "Something went wrong while reaching to the Kerberos Hub API: " + hubURI,
})
}
} else {
c.JSON(400, models.APIResponse{
Data: "Something went wrong while creating the HTTP request: " + err.Error(),
})
}
} else {
c.JSON(400, models.APIResponse{
Data: "Something went wrong while receiving the config " + err.Error(),
})
}
}
// VerifyPersistence godoc
// @Router /api/persistence/verify [post]
// @ID verify-persistence
// @Security Bearer
// @securityDefinitions.apikey Bearer
// @in header
// @name Authorization
// @Tags config
// @Param config body models.Config true "Config"
// @Summary Will verify the persistence.
// @Description Will verify the persistence.
// @Success 200 {object} models.APIResponse
func VerifyPersistence(c *gin.Context) {
var config models.Config
err := c.BindJSON(&config)
if err != nil || config.Cloud != "" {
if config.Cloud == "s3" {
// timestamp_microseconds_instanceName_regionCoordinates_numberOfChanges_token
// 1564859471_6-474162_oprit_577-283-727-375_1153_27.mp4
// - Timestamp
// - Size + - + microseconds
// - device
// - Region
// - Number of changes
// - Token
aws_access_key_id := config.S3.Publickey
aws_secret_access_key := config.S3.Secretkey
aws_region := config.S3.Region
// This is the new way ;)
if config.HubKey != "" {
aws_access_key_id = config.HubKey
}
if config.HubPrivateKey != "" {
aws_secret_access_key = config.HubPrivateKey
}
s3Client, err := minio.NewWithRegion("s3.amazonaws.com", aws_access_key_id, aws_secret_access_key, true, aws_region)
if err != nil {
c.JSON(400, models.APIResponse{
Data: "Creation of Kerberos Hub connection failed: " + err.Error(),
})
} else {
// Check if we need to use the proxy.
if config.S3.ProxyURI != "" {
var transport http.RoundTripper = &http.Transport{
Proxy: func(*http.Request) (*url.URL, error) {
return url.Parse(config.S3.ProxyURI)
},
TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
}
s3Client.SetCustomTransport(transport)
}
deviceKey := "fake-key"
devicename := "justatest"
coordinates := "200-200-400-400"
eventToken := "769"
timestamp := time.Now().Unix()
fileName := strconv.FormatInt(timestamp, 10) + "_6-967003_justatest_200-200-400-400_24_769.mp4"
content := []byte("test-file")
body := bytes.NewReader(content)
n, err := s3Client.PutObject(config.S3.Bucket,
config.S3.Username+"/"+fileName,
body,
body.Size(),
minio.PutObjectOptions{
ContentType: "video/mp4",
StorageClass: "ONEZONE_IA",
UserMetadata: map[string]string{
"event-timestamp": strconv.FormatInt(timestamp, 10),
"event-microseconds": deviceKey,
"event-instancename": devicename,
"event-regioncoordinates": coordinates,
"event-numberofchanges": deviceKey,
"event-token": eventToken,
"productid": deviceKey,
"publickey": aws_access_key_id,
"uploadtime": "now",
},
})
if err != nil {
c.JSON(400, models.APIResponse{
Data: "Upload of fake recording failed: " + err.Error(),
})
} else {
c.JSON(200, models.APIResponse{
Data: "Upload Finished: file has been uploaded to bucket: " + strconv.FormatInt(n, 10),
})
}
}
}
if config.Cloud == "kstorage" {
uri := config.KStorage.URI
accessKey := config.KStorage.AccessKey
secretAccessKey := config.KStorage.SecretAccessKey
directory := config.KStorage.Directory
provider := config.KStorage.Provider
if err == nil && uri != "" && accessKey != "" && secretAccessKey != "" {
var postData = []byte(`{"title":"Buy cheese and bread for breakfast."}`)
client := &http.Client{}
req, err := http.NewRequest("POST", uri+"/ping", bytes.NewReader(postData))
req.Header.Add("X-Kerberos-Storage-AccessKey", accessKey)
req.Header.Add("X-Kerberos-Storage-SecretAccessKey", secretAccessKey)
resp, err := client.Do(req)
if err == nil {
body, err := ioutil.ReadAll(resp.Body)
defer resp.Body.Close()
if err == nil && resp.StatusCode == http.StatusOK {
if provider != "" || directory != "" {
hubKey := config.KStorage.CloudKey
// This is the new way ;)
if config.HubKey != "" {
hubKey = config.HubKey
}
// Generate a random name.
timestamp := time.Now().Unix()
fileName := strconv.FormatInt(timestamp, 10) +
"_6-967003_justatest_200-200-400-400_24_769.mp4"
content := []byte("test-file")
body := bytes.NewReader(content)
//fileSize := int64(len(content))
req, err := http.NewRequest("POST", uri+"/storage", body)
if err == nil {
req.Header.Set("Content-Type", "video/mp4")
req.Header.Set("X-Kerberos-Storage-CloudKey", hubKey)
req.Header.Set("X-Kerberos-Storage-AccessKey", accessKey)
req.Header.Set("X-Kerberos-Storage-SecretAccessKey", secretAccessKey)
req.Header.Set("X-Kerberos-Storage-Provider", provider)
req.Header.Set("X-Kerberos-Storage-FileName", fileName)
req.Header.Set("X-Kerberos-Storage-Device", "test")
req.Header.Set("X-Kerberos-Storage-Capture", "IPCamera")
req.Header.Set("X-Kerberos-Storage-Directory", directory)
client := &http.Client{}
resp, err := client.Do(req)
if err == nil {
if resp != nil {
body, err := ioutil.ReadAll(resp.Body)
defer resp.Body.Close()
if err == nil {
if resp.StatusCode == 200 {
c.JSON(200, body)
} else {
c.JSON(400, models.APIResponse{
Data: "Something went wrong while verifying your persistence settings. Make sure your provider is the same as the storage provider in your Kerberos Vault, and the relevant storage provider is configured properly.",
})
}
}
}
} else {
c.JSON(400, models.APIResponse{
Data: "Upload of fake recording failed: " + err.Error(),
})
}
} else {
c.JSON(400, models.APIResponse{
Data: "Something went wrong while creating /storage POST request." + err.Error(),
})
}
} else {
c.JSON(400, models.APIResponse{
Data: "Provider and/or directory is missing from the request.",
})
}
} else {
c.JSON(400, models.APIResponse{
Data: "Something went wrong while verifying storage credentials: " + string(body),
})
}
} else {
c.JSON(400, models.APIResponse{
Data: "Something went wrong while verifying storage credentials:" + err.Error(),
})
}
}
}
} else {
c.JSON(400, models.APIResponse{
Data: "No persistence was specified, so do not know what to verify:" + err.Error(),
})
}
}

View File

@@ -1,6 +1,7 @@
package cloud
import (
"errors"
"io/ioutil"
"net/http"
"os"
@@ -9,19 +10,19 @@ import (
"github.com/kerberos-io/agent/machinery/src/models"
)
func UploadKerberosVault(configuration *models.Configuration, fileName string, directory string) bool {
func UploadKerberosVault(configuration *models.Configuration, fileName string) (bool, bool, error) {
config := configuration.Config
if config.KStorage.AccessKey == "" ||
config.KStorage.SecretAccessKey == "" ||
config.KStorage.Provider == "" ||
config.KStorage.Directory == "" ||
config.KStorage.URI == "" {
log.Log.Info("UploadKerberosVault: Kerberos Vault not properly configured.")
err := "UploadKerberosVault: Kerberos Vault not properly configured."
log.Log.Info(err)
return false, false, errors.New(err)
}
//fmt.Println("Uploading...")
// timestamp_microseconds_instanceName_regionCoordinates_numberOfChanges_token
// 1564859471_6-474162_oprit_577-283-727-375_1153_27.mp4
// - Timestamp
@@ -30,21 +31,20 @@ func UploadKerberosVault(configuration *models.Configuration, fileName string, d
// - Region
// - Number of changes
// - Token
// KerberosCloud, this means storage is disabled and proxy enabled.
log.Log.Info("UploadKerberosVault: Uploading to Kerberos Vault (" + config.KStorage.URI + ")")
log.Log.Info("UploadKerberosVault: Upload started for " + fileName)
fullname := "data/recordings/" + fileName
file, err := os.OpenFile(fullname, os.O_RDWR, 0755)
if err != nil {
log.Log.Info("UploadKerberosVault: Upload Failed, file doesn't exists anymore.")
os.Remove(directory + "/" + fileName)
return false
if file != nil {
defer file.Close()
}
if err != nil {
err := "UploadKerberosVault: Upload Failed, file doesn't exists anymore."
log.Log.Info(err)
return false, true, errors.New(err)
}
defer file.Close()
publicKey := config.KStorage.CloudKey
// This is the new way ;)
@@ -54,7 +54,9 @@ func UploadKerberosVault(configuration *models.Configuration, fileName string, d
req, err := http.NewRequest("POST", config.KStorage.URI+"/storage", file)
if err != nil {
log.Log.Error("Error reading request. " + err.Error())
errorMessage := "UploadKerberosVault: error reading request, " + config.KStorage.URI + "/storage: " + err.Error()
log.Log.Error(errorMessage)
return false, true, errors.New(errorMessage)
}
req.Header.Set("Content-Type", "video/mp4")
req.Header.Set("X-Kerberos-Storage-CloudKey", publicKey)
@@ -65,11 +67,9 @@ func UploadKerberosVault(configuration *models.Configuration, fileName string, d
req.Header.Set("X-Kerberos-Storage-Device", config.Key)
req.Header.Set("X-Kerberos-Storage-Capture", "IPCamera")
req.Header.Set("X-Kerberos-Storage-Directory", config.KStorage.Directory)
//client := &http.Client{Timeout: time.Second * 30}
client := &http.Client{}
resp, err := client.Do(req)
if resp != nil {
defer resp.Body.Close()
}
@@ -80,17 +80,16 @@ func UploadKerberosVault(configuration *models.Configuration, fileName string, d
if err == nil {
if resp.StatusCode == 200 {
log.Log.Info("UploadKerberosVault: Upload Finished, " + resp.Status + ", " + string(body))
// We will remove the file from disk as well
os.Remove(fullname)
os.Remove(directory + "/" + fileName)
return true, true, nil
} else {
log.Log.Info("UploadKerberosVault: Upload Failed, " + resp.Status + ", " + string(body))
return false, true, nil
}
resp.Body.Close()
}
}
} else {
log.Log.Info("UploadKerberosVault: Upload Failed, " + err.Error())
}
return true
errorMessage := "UploadKerberosVault: Upload Failed, " + err.Error()
log.Log.Info(errorMessage)
return false, true, errors.New(errorMessage)
}

View File

@@ -2,6 +2,7 @@ package cloud
import (
"crypto/tls"
"errors"
"net/http"
"net/url"
"os"
@@ -13,11 +14,10 @@ import (
"github.com/minio/minio-go/v6"
)
func UploadS3(configuration *models.Configuration, fileName string, directory string) bool {
func UploadS3(configuration *models.Configuration, fileName string) (bool, bool, error) {
config := configuration.Config
//fmt.Println("Uploading...")
// timestamp_microseconds_instanceName_regionCoordinates_numberOfChanges_token
// 1564859471_6-474162_oprit_577-283-727-375_1153_27.mp4
// - Timestamp
@@ -27,6 +27,13 @@ func UploadS3(configuration *models.Configuration, fileName string, directory st
// - Number of changes
// - Token
if config.S3 == nil {
errorMessage := "UploadS3: Uploading Failed, as no settings found"
log.Log.Error(errorMessage)
return false, false, errors.New(errorMessage)
}
// Legacy support, should get rid of it!
aws_access_key_id := config.S3.Publickey
aws_secret_access_key := config.S3.Secretkey
aws_region := config.S3.Region
@@ -39,9 +46,18 @@ func UploadS3(configuration *models.Configuration, fileName string, directory st
aws_secret_access_key = config.HubPrivateKey
}
// Check if we have some credentials otherwise we abort the request.
if aws_access_key_id == "" || aws_secret_access_key == "" {
errorMessage := "UploadS3: Uploading Failed, as no credentials found"
log.Log.Error(errorMessage)
return false, false, errors.New(errorMessage)
}
s3Client, err := minio.NewWithRegion("s3.amazonaws.com", aws_access_key_id, aws_secret_access_key, true, aws_region)
if err != nil {
log.Log.Error(err.Error())
errorMessage := "UploadS3: " + err.Error()
log.Log.Error(errorMessage)
return false, true, errors.New(errorMessage)
}
// Check if we need to use the proxy.
@@ -57,9 +73,9 @@ func UploadS3(configuration *models.Configuration, fileName string, directory st
fileParts := strings.Split(fileName, "_")
if len(fileParts) == 1 {
log.Log.Error("ERROR: " + fileName + " is not a valid name.")
os.Remove(directory + "/" + fileName)
return false
errorMessage := "UploadS3: " + fileName + " is not a valid name."
log.Log.Error(errorMessage)
return false, true, errors.New(errorMessage)
}
deviceKey := config.Key
@@ -73,18 +89,21 @@ func UploadS3(configuration *models.Configuration, fileName string, directory st
fullname := "data/recordings/" + fileName
file, err := os.OpenFile(fullname, os.O_RDWR, 0755)
defer file.Close()
if file != nil {
defer file.Close()
}
if err != nil {
log.Log.Error("UploadS3: " + err.Error())
os.Remove(directory + "/" + fileName)
return false
errorMessage := "UploadS3: " + err.Error()
log.Log.Error(errorMessage)
return false, true, errors.New(errorMessage)
}
fileInfo, err := file.Stat()
if err != nil {
log.Log.Error("UploadS3: " + err.Error())
os.Remove(directory + "/" + fileName)
return false
errorMessage := "UploadS3: " + err.Error()
log.Log.Error(errorMessage)
return false, true, errors.New(errorMessage)
}
n, err := s3Client.PutObject(config.S3.Bucket,
@@ -108,11 +127,11 @@ func UploadS3(configuration *models.Configuration, fileName string, directory st
})
if err != nil {
log.Log.Error("UploadS3: Uploading Failed, " + err.Error())
return false
errorMessage := "UploadS3: Uploading Failed, " + err.Error()
log.Log.Error(errorMessage)
return false, true, errors.New(errorMessage)
} else {
log.Log.Info("UploadS3: Upload Finished, file has been uploaded to bucket: " + strconv.FormatInt(n, 10))
os.Remove(directory + "/" + fileName)
return true
return true, true, nil
}
}

View File

@@ -1,14 +1,16 @@
package components
import (
"bufio"
"encoding/base64"
"encoding/json"
"fmt"
"errors"
"image"
_ "image/png"
"io/ioutil"
"os"
"reflect"
"sort"
"strconv"
"strings"
"time"
"github.com/InVisionApp/conjungo"
@@ -18,22 +20,23 @@ import (
"gopkg.in/mgo.v2/bson"
)
func GetSnapshot() string {
var snapshot string
files, err := ioutil.ReadDir("./data/snapshots")
func GetImageFromFilePath() (image.Image, error) {
snapshotDirectory := "./data/snapshots"
files, err := ioutil.ReadDir(snapshotDirectory)
if err == nil && len(files) > 1 {
sort.Slice(files, func(i, j int) bool {
return files[i].ModTime().Before(files[j].ModTime())
})
f, _ := os.Open("./data/snapshots/" + files[1].Name())
filePath := "./data/snapshots/" + files[1].Name()
f, err := os.Open(filePath)
if err != nil {
return nil, err
}
defer f.Close()
// Read entire JPG into byte slice.
reader := bufio.NewReader(f)
content, _ := ioutil.ReadAll(reader)
// Encode as base64.
snapshot = base64.StdEncoding.EncodeToString(content)
image, _, err := image.Decode(f)
return image, err
}
return snapshot
return nil, errors.New("Could not find a snapshot in " + snapshotDirectory)
}
// ReadUserConfig Reads the user configuration of the Kerberos Open Source instance.
@@ -43,15 +46,14 @@ func ReadUserConfig() (userConfig models.User) {
for {
jsonFile, err := os.Open("./data/config/user.json")
if err != nil {
fmt.Println(err)
fmt.Println("Config file is not found " + "./data/config/user.json" + ", trying again in 5s.")
log.Log.Error("Config file is not found " + "./data/config/user.json, trying again in 5s: " + err.Error())
time.Sleep(5 * time.Second)
} else {
fmt.Println("Successfully Opened user.json")
log.Log.Info("Successfully Opened user.json")
byteValue, _ := ioutil.ReadAll(jsonFile)
err = json.Unmarshal(byteValue, &userConfig)
if err != nil {
fmt.Println("JSON file not valid: " + err.Error())
log.Log.Error("JSON file not valid: " + err.Error())
} else {
jsonFile.Close()
break
@@ -122,6 +124,9 @@ func OpenConfig(configuration *models.Configuration) {
conjungo.Merge(&s3, configuration.CustomConfig.S3, opts)
configuration.Config.S3 = &s3
// Cleanup
opts = nil
} else if os.Getenv("DEPLOYMENT") == "" || os.Getenv("DEPLOYMENT") == "agent" {
// Local deployment means we do a stand-alone installation
@@ -139,11 +144,11 @@ func OpenConfig(configuration *models.Configuration) {
err = json.Unmarshal(byteValue, &configuration.Config)
jsonFile.Close()
if err != nil {
fmt.Println("JSON file not valid: " + err.Error())
log.Log.Error("JSON file not valid: " + err.Error())
} else {
err = json.Unmarshal(byteValue, &configuration.CustomConfig)
if err != nil {
fmt.Println("JSON file not valid: " + err.Error())
log.Log.Error("JSON file not valid: " + err.Error())
} else {
break
}
@@ -157,3 +162,307 @@ func OpenConfig(configuration *models.Configuration) {
return
}
// This function will override the configuration with environment variables.
func OverrideWithEnvironmentVariables(configuration *models.Configuration) {
environmentVariables := os.Environ()
for _, env := range environmentVariables {
if strings.Contains(env, "AGENT_") {
key := strings.Split(env, "=")[0]
value := os.Getenv(key)
switch key {
/* General configuration */
case "AGENT_KEY":
configuration.Config.Key = value
break
case "AGENT_NAME":
configuration.Config.Name = value
break
case "AGENT_TIMEZONE":
configuration.Config.Timezone = value
break
case "AGENT_OFFLINE":
configuration.Config.Offline = value
break
case "AGENT_AUTO_CLEAN":
configuration.Config.AutoClean = value
break
case "AGENT_AUTO_CLEAN_MAX_SIZE":
size, err := strconv.ParseInt(value, 10, 64)
if err == nil {
configuration.Config.MaxDirectorySize = size
}
break
/* Camera configuration */
case "AGENT_CAPTURE_IPCAMERA_RTSP":
configuration.Config.Capture.IPCamera.RTSP = value
break
case "AGENT_CAPTURE_IPCAMERA_SUB_RTSP":
configuration.Config.Capture.IPCamera.SubRTSP = value
break
/* ONVIF connnection settings */
case "AGENT_CAPTURE_IPCAMERA_ONVIF":
isEnabled := value == " true"
configuration.Config.Capture.IPCamera.ONVIF = isEnabled
break
case "AGENT_CAPTURE_IPCAMERA_ONVIF_XADDR":
configuration.Config.Capture.IPCamera.ONVIFXAddr = value
break
case "AGENT_CAPTURE_IPCAMERA_ONVIF_USERNAME":
configuration.Config.Capture.IPCamera.ONVIFUsername = value
break
case "AGENT_CAPTURE_IPCAMERA_ONVIF_PASSWORD":
configuration.Config.Capture.IPCamera.ONVIFPassword = value
break
/* Recording mode */
case "AGENT_CAPTURE_RECORDING":
configuration.Config.Capture.Recording = value
break
case "AGENT_CAPTURE_CONTINUOUS":
configuration.Config.Capture.Continuous = value
break
case "AGENT_CAPTURE_LIVEVIEW":
configuration.Config.Capture.Liveview = value
break
case "AGENT_CAPTURE_MOTION":
configuration.Config.Capture.Motion = value
break
case "AGENT_CAPTURE_SNAPSHOTS":
configuration.Config.Capture.Snapshots = value
break
case "AGENT_CAPTURE_PRERECORDING":
duration, err := strconv.ParseInt(value, 10, 64)
if err == nil {
configuration.Config.Capture.PreRecording = duration
}
break
case "AGENT_CAPTURE_POSTRECORDING":
duration, err := strconv.ParseInt(value, 10, 64)
if err == nil {
configuration.Config.Capture.PostRecording = duration
}
break
case "AGENT_CAPTURE_MAXLENGTH":
duration, err := strconv.ParseInt(value, 10, 64)
if err == nil {
configuration.Config.Capture.MaxLengthRecording = duration
}
break
case "AGENT_CAPTURE_PIXEL_CHANGE":
count, err := strconv.Atoi(value)
if err == nil {
configuration.Config.Capture.PixelChangeThreshold = count
}
break
case "AGENT_CAPTURE_FRAGMENTED":
configuration.Config.Capture.Fragmented = value
break
case "AGENT_CAPTURE_FRAGMENTED_DURATION":
duration, err := strconv.ParseInt(value, 10, 64)
if err == nil {
configuration.Config.Capture.FragmentedDuration = duration
}
break
/* Conditions */
case "AGENT_TIME":
configuration.Config.Time = value
break
case "AGENT_TIMETABLE":
var timetable []*models.Timetable
// Convert value to timetable array with (start1, end1, start2, end2)
// Where days are limited by ; and time by ,
// su;mo;tu;we;th;fr;sa
// 0,43199,43200,86400;0,43199,43200,86400
// Split days
daysString := strings.Split(value, ";")
for _, dayString := range daysString {
// Split time
timeString := strings.Split(dayString, ",")
if len(timeString) == 4 {
start1, err := strconv.ParseInt(timeString[0], 10, 64)
if err != nil {
continue
}
end1, err := strconv.ParseInt(timeString[1], 10, 64)
if err != nil {
continue
}
start2, err := strconv.ParseInt(timeString[2], 10, 64)
if err != nil {
continue
}
end2, err := strconv.ParseInt(timeString[3], 10, 64)
if err != nil {
continue
}
timetable = append(timetable, &models.Timetable{
Start1: int(start1),
End1: int(end1),
Start2: int(start2),
End2: int(end2),
})
}
}
configuration.Config.Timetable = timetable
break
case "AGENT_REGION_POLYGON":
var coordinates []models.Coordinate
// Convert value to coordinates array
// 0,0;1,1;2,2;3,3
coordinatesString := strings.Split(value, ";")
for _, coordinateString := range coordinatesString {
coordinate := strings.Split(coordinateString, ",")
if len(coordinate) == 2 {
x, err := strconv.ParseFloat(coordinate[0], 64)
if err != nil {
continue
}
y, err := strconv.ParseFloat(coordinate[1], 64)
if err != nil {
continue
}
coordinates = append(coordinates, models.Coordinate{
X: x,
Y: y,
})
}
}
configuration.Config.Region.Polygon = []models.Polygon{
{
Coordinates: coordinates,
ID: "0",
},
}
break
/* MQTT settings for bi-directional communication */
case "AGENT_MQTT_URI":
configuration.Config.MQTTURI = value
break
case "AGENT_MQTT_USERNAME":
configuration.Config.MQTTUsername = value
break
case "AGENT_MQTT_PASSWORD":
configuration.Config.MQTTPassword = value
break
/* WebRTC settings for live-streaming (remote) */
case "AGENT_STUN_URI":
configuration.Config.STUNURI = value
break
case "AGENT_TURN_URI":
configuration.Config.TURNURI = value
break
case "AGENT_TURN_USERNAME":
configuration.Config.TURNUsername = value
break
case "AGENT_TURN_PASSWORD":
configuration.Config.TURNPassword = value
break
/* Cloud settings for persisting recordings */
case "AGENT_CLOUD":
configuration.Config.Cloud = value
break
case "AGENT_REMOVE_AFTER_UPLOAD":
configuration.Config.RemoveAfterUpload = value
break
/* When connected and storing in Kerberos Hub (SAAS) */
case "AGENT_HUB_URI":
configuration.Config.HubURI = value
break
case "AGENT_HUB_KEY":
configuration.Config.HubKey = value
break
case "AGENT_HUB_PRIVATE_KEY":
configuration.Config.HubPrivateKey = value
break
case "AGENT_HUB_USERNAME":
configuration.Config.S3.Username = value
break
case "AGENT_HUB_SITE":
configuration.Config.HubSite = value
break
/* When storing in a Kerberos Vault */
case "AGENT_KERBEROSVAULT_URI":
configuration.Config.KStorage.URI = value
break
case "AGENT_KERBEROSVAULT_ACCESS_KEY":
configuration.Config.KStorage.AccessKey = value
break
case "AGENT_KERBEROSVAULT_SECRET_KEY":
configuration.Config.KStorage.SecretAccessKey = value
break
case "AGENT_KERBEROSVAULT_PROVIDER":
configuration.Config.KStorage.Provider = value
break
case "AGENT_KERBEROSVAULT_DIRECTORY":
configuration.Config.KStorage.Directory = value
break
}
}
}
}
func SaveConfig(config models.Config, configuration *models.Configuration, communication *models.Communication) error {
if !communication.IsConfiguring.IsSet() {
communication.IsConfiguring.Set()
err := StoreConfig(config)
if err != nil {
communication.IsConfiguring.UnSet()
return err
}
select {
case communication.HandleBootstrap <- "restart":
default:
}
communication.IsConfiguring.UnSet()
return nil
} else {
return errors.New("☄ Already reconfiguring")
}
}
func StoreConfig(config models.Config) error {
// Save into database
if os.Getenv("DEPLOYMENT") == "factory" || os.Getenv("MACHINERY_ENVIRONMENT") == "kubernetes" {
// Write to mongodb
session := database.New().Copy()
defer session.Close()
db := session.DB(database.DatabaseName)
collection := db.C("configuration")
err := collection.Update(bson.M{
"type": "config",
"name": os.Getenv("DEPLOYMENT_NAME"),
}, &config)
return err
// Save into file
} else if os.Getenv("DEPLOYMENT") == "" || os.Getenv("DEPLOYMENT") == "agent" {
res, _ := json.MarshalIndent(config, "", "\t")
err := ioutil.WriteFile("./data/config/config.json", res, 0644)
return err
}
return errors.New("Not able to update config")
}

View File

@@ -1,11 +1,14 @@
package components
import (
"runtime"
"strconv"
"sync"
"sync/atomic"
"time"
"github.com/kerberos-io/joy4/cgo/ffmpeg"
"github.com/kerberos-io/agent/machinery/src/capture"
"github.com/kerberos-io/agent/machinery/src/cloud"
"github.com/kerberos-io/agent/machinery/src/computervision"
@@ -13,6 +16,7 @@ import (
"github.com/kerberos-io/agent/machinery/src/models"
"github.com/kerberos-io/agent/machinery/src/onvif"
routers "github.com/kerberos-io/agent/machinery/src/routers/mqtt"
"github.com/kerberos-io/joy4/av"
"github.com/kerberos-io/joy4/av/pubsub"
"github.com/tevino/abool"
)
@@ -20,12 +24,30 @@ import (
func Bootstrap(configuration *models.Configuration, communication *models.Communication) {
log.Log.Debug("Bootstrap: started")
// We will keep track of the Kerberos Agent up time
// This is send to Kerberos Hub in a heartbeat.
uptimeStart := time.Now()
// Initiate the packet counter, this is being used to detect
// if a camera is going blocky, or got disconnected.
var packageCounter atomic.Value
packageCounter.Store(int64(0))
communication.PackageCounter = &packageCounter
// This is used when the last packet was received (timestamp),
// this metric is used to determine if the camera is still online/connected.
var lastPacketTimer atomic.Value
packageCounter.Store(int64(0))
communication.LastPacketTimer = &lastPacketTimer
// This is used to understand if we have a working Kerberos Hub connection
// cloudTimestamp will be updated when successfully sending heartbeats.
var cloudTimestamp atomic.Value
cloudTimestamp.Store(int64(0))
communication.CloudTimestamp = &cloudTimestamp
communication.HandleStream = make(chan string, 1)
communication.HandleSubStream = make(chan string, 1)
communication.HandleUpload = make(chan string, 1)
communication.HandleHeartBeat = make(chan string, 1)
communication.HandleLiveSD = make(chan int64, 1)
@@ -37,12 +59,17 @@ func Bootstrap(configuration *models.Configuration, communication *models.Commun
// do several checks to see if the agent is still operational.
go ControlAgent(communication)
// Create some global variables
decoder := &ffmpeg.VideoDecoder{}
subDecoder := &ffmpeg.VideoDecoder{}
cameraSettings := &models.Camera{}
// Run the agent and fire up all the other
// goroutines which do image capture, motion detection, onvif, etc.
for {
// This will blocking until receiving a signal to be restarted, reconfigured, stopped, etc.
status := RunAgent(configuration, communication)
status := RunAgent(configuration, communication, uptimeStart, cameraSettings, decoder, subDecoder)
if status == "stop" {
break
}
@@ -52,61 +79,154 @@ func Bootstrap(configuration *models.Configuration, communication *models.Commun
log.Log.Debug("Bootstrap: finished")
}
func RunAgent(configuration *models.Configuration, communication *models.Communication) string {
log.Log.Debug("RunAgent: started")
func RunAgent(configuration *models.Configuration, communication *models.Communication, uptimeStart time.Time, cameraSettings *models.Camera, decoder *ffmpeg.VideoDecoder, subDecoder *ffmpeg.VideoDecoder) string {
log.Log.Debug("RunAgent: bootstrapping agent")
config := configuration.Config
// Currently only support H264 encoded cameras, this will change.
// Establishing the camera connection
log.Log.Info("RunAgent: opening RTSP stream")
rtspUrl := config.Capture.IPCamera.RTSP
infile, streams, err := capture.OpenRTSP(rtspUrl)
//var decoder *ffmpeg.VideoDecoder
var queue *pubsub.Queue
var subQueue *pubsub.Queue
var decoderMutex sync.Mutex
var subDecoderMutex sync.Mutex
status := "not started"
if err == nil {
// At some routines we will need to decode the image.
// Make sure its properly locked as we only have a single decoder.
var decoderMutex sync.Mutex
decoder := capture.GetVideoDecoder(streams)
log.Log.Info("RunAgent: opened RTSP stream" + rtspUrl)
// We might have a secondary rtsp url, so we might need to use that.
var subInfile av.DemuxCloser
var subStreams []av.CodecData
subStreamEnabled := false
subRtspUrl := config.Capture.IPCamera.SubRTSP
if subRtspUrl != "" && subRtspUrl != rtspUrl {
subInfile, subStreams, err = capture.OpenRTSP(subRtspUrl)
if err == nil {
log.Log.Info("RunAgent: opened RTSP sub stream " + subRtspUrl)
subStreamEnabled = true
}
}
// We will initialise the camera settings object
// so we can check if the camera settings have changed, and we need
// to reload the decoders.
videoStream, _ := capture.GetVideoStream(streams)
num, denum := videoStream.(av.VideoCodecData).Framerate()
width := videoStream.(av.VideoCodecData).Width()
height := videoStream.(av.VideoCodecData).Height()
if cameraSettings.RTSP != rtspUrl || cameraSettings.SubRTSP != subRtspUrl || cameraSettings.Width != width || cameraSettings.Height != height || cameraSettings.Num != num || cameraSettings.Denum != denum || cameraSettings.Codec != videoStream.(av.VideoCodecData).Type() {
if cameraSettings.Initialized {
decoder.Close()
if subStreamEnabled {
subDecoder.Close()
}
}
// At some routines we will need to decode the image.
// Make sure its properly locked as we only have a single decoder.
log.Log.Info("RunAgent: camera settings changed, reloading decoder")
capture.GetVideoDecoder(decoder, streams)
if subStreamEnabled {
capture.GetVideoDecoder(subDecoder, subStreams)
}
cameraSettings.RTSP = rtspUrl
cameraSettings.SubRTSP = subRtspUrl
cameraSettings.Width = width
cameraSettings.Height = height
cameraSettings.Framerate = float64(num) / float64(denum)
cameraSettings.Num = num
cameraSettings.Denum = denum
cameraSettings.Codec = videoStream.(av.VideoCodecData).Type()
cameraSettings.Initialized = true
} else {
log.Log.Info("RunAgent: camera settings did not change, keeping decoder")
}
communication.Decoder = decoder
communication.SubDecoder = subDecoder
communication.DecoderMutex = &decoderMutex
communication.SubDecoderMutex = &subDecoderMutex
// Create a packet queue, which is filled by the HandleStream routing
// and consumed by all other routines: motion, livestream, etc.
if config.Capture.PreRecording <= 0 {
config.Capture.PreRecording = 1
log.Log.Warning("RunAgent: Prerecording value not found in config or invalid value! Found: " + strconv.FormatInt(config.Capture.PreRecording, 10))
}
// We are creating a queue to store the RTSP frames in, these frames will be
// processed by the different consumers: motion detection, recording, etc.
queue = pubsub.NewQueue()
queue.SetMaxGopCount(5) // GOP time frame is set to 5.
communication.Queue = queue
queue.SetMaxGopCount(int(config.Capture.PreRecording) + 1) // GOP time frame is set to prerecording (we'll add 2 gops to leave some room).
log.Log.Info("RunAgent: SetMaxGopCount was set with: " + strconv.Itoa(int(config.Capture.PreRecording)+1))
queue.WriteHeader(streams)
// We might have a substream, if so we'll create a seperate queue.
if subStreamEnabled {
log.Log.Info("RunAgent: Creating sub stream queue with SetMaxGopCount set to " + strconv.Itoa(int(1)))
subQueue = pubsub.NewQueue()
communication.SubQueue = subQueue
subQueue.SetMaxGopCount(1)
subQueue.WriteHeader(subStreams)
}
// Configure a MQTT client which helps for a bi-directional communication
communication.HandleONVIF = make(chan models.OnvifAction, 1)
mqttClient := routers.ConfigureMQTT(configuration, communication)
// Handle heartbeats
go cloud.HandleHeartBeat(configuration, communication)
go cloud.HandleHeartBeat(configuration, communication, uptimeStart)
// Handle the camera stream
go capture.HandleStream(infile, queue, communication) //, &wg)
go capture.HandleStream(infile, queue, communication)
// Handle the substream if enabled
if subStreamEnabled {
go capture.HandleSubStream(subInfile, subQueue, communication)
}
// Handle processing of motion
motionCursor := queue.Oldest()
communication.HandleMotion = make(chan int64, 1)
go computervision.ProcessMotion(motionCursor, configuration, communication, mqttClient, decoder, &decoderMutex)
communication.HandleMotion = make(chan models.MotionDataPartial, 1)
if subStreamEnabled {
motionCursor := subQueue.Latest()
go computervision.ProcessMotion(motionCursor, configuration, communication, mqttClient, subDecoder, &subDecoderMutex)
} else {
motionCursor := queue.Latest()
go computervision.ProcessMotion(motionCursor, configuration, communication, mqttClient, decoder, &decoderMutex)
}
// Handle livestream SD (low resolution over MQTT)
livestreamCursor := queue.Oldest()
go cloud.HandleLiveStreamSD(livestreamCursor, configuration, communication, mqttClient, decoder, &decoderMutex)
if subStreamEnabled {
livestreamCursor := subQueue.Latest()
go cloud.HandleLiveStreamSD(livestreamCursor, configuration, communication, mqttClient, subDecoder, &subDecoderMutex)
} else {
livestreamCursor := queue.Latest()
go cloud.HandleLiveStreamSD(livestreamCursor, configuration, communication, mqttClient, decoder, &decoderMutex)
}
// Handle livestream HD (high resolution over WEBRTC)
livestreamHDCursor := queue.Oldest()
communication.HandleLiveHDHandshake = make(chan models.SDPPayload, 1)
go cloud.HandleLiveStreamHD(livestreamHDCursor, configuration, communication, mqttClient, streams, decoder, &decoderMutex)
if subStreamEnabled {
livestreamHDCursor := subQueue.Latest()
go cloud.HandleLiveStreamHD(livestreamHDCursor, configuration, communication, mqttClient, subStreams, subDecoder, &decoderMutex)
} else {
livestreamHDCursor := queue.Latest()
go cloud.HandleLiveStreamHD(livestreamHDCursor, configuration, communication, mqttClient, streams, decoder, &decoderMutex)
}
// Handle recording, will write an mp4 to disk.
recordingCursor := queue.Oldest()
go capture.HandleRecordStream(recordingCursor, configuration, communication, streams)
go capture.HandleRecordStream(queue, configuration, communication, streams)
// Handle Upload to cloud provider (Kerberos Hub, Kerberos Vault and others)
go cloud.HandleUpload(configuration, communication)
@@ -120,20 +240,44 @@ func RunAgent(configuration *models.Configuration, communication *models.Communi
status = <-communication.HandleBootstrap
// Here we are cleaning up everything!
if configuration.Config.Offline != "true" {
communication.HandleHeartBeat <- "stop"
communication.HandleUpload <- "stop"
}
communication.HandleStream <- "stop"
communication.HandleHeartBeat <- "stop"
communication.HandleUpload <- "stop"
if subStreamEnabled {
communication.HandleSubStream <- "stop"
}
time.Sleep(time.Second * 1)
infile.Close()
infile = nil
queue.Close()
queue = nil
communication.Queue = nil
if subStreamEnabled {
subInfile.Close()
subInfile = nil
subQueue.Close()
subQueue = nil
communication.SubQueue = nil
}
close(communication.HandleONVIF)
communication.HandleONVIF = nil
close(communication.HandleLiveHDHandshake)
communication.HandleLiveHDHandshake = nil
close(communication.HandleMotion)
routers.DisconnectMQTT(mqttClient)
decoder.Close()
communication.HandleMotion = nil
// Disconnect MQTT
routers.DisconnectMQTT(mqttClient, &configuration.Config)
// Wait a few seconds to stop the decoder.
time.Sleep(time.Second * 3)
// Waiting for some seconds to make sure everything is properly closed.
log.Log.Info("RunAgent: waiting 1 second to make sure everything is properly closed.")
time.Sleep(time.Second * 1)
log.Log.Info("RunAgent: waiting 3 seconds to make sure everything is properly closed.")
time.Sleep(time.Second * 3)
} else {
log.Log.Error("Something went wrong while opening RTSP: " + err.Error())
time.Sleep(time.Second * 3)
@@ -141,6 +285,9 @@ func RunAgent(configuration *models.Configuration, communication *models.Communi
log.Log.Debug("RunAgent: finished")
// Clean up, force garbage collection
runtime.GC()
return status
}
@@ -160,6 +307,7 @@ func ControlAgent(communication *models.Communication) {
occurence = occurence + 1
}
} else {
occurence = 0
}

View File

@@ -2,12 +2,15 @@ package components
import (
"fmt"
"image"
"image/jpeg"
"log"
"time"
"github.com/deepch/vdk/av"
"github.com/deepch/vdk/codec/h264parser"
"github.com/deepch/vdk/format/rtsp"
"github.com/nsmith5/mjpeg"
)
type Stream struct {
@@ -63,7 +66,6 @@ func (s Stream) GetCodecs() []av.CodecData {
func (s Stream) ReadPackets(packetChannel chan av.Packet) {
session := s.Open()
fmt.Println("Start reading H264 packages from stream")
for {
packet, err := session.ReadPacket()
if err != nil {
@@ -81,3 +83,11 @@ func GetSPSFromCodec(codecs []av.CodecData) ([]byte, []byte) {
pps := codecs[0].(h264parser.CodecData).PPS()
return sps, pps
}
func StartMotionJPEG(imageFunction func() (image.Image, error), quality int) mjpeg.Handler {
stream := mjpeg.Handler{
Next: imageFunction,
Options: &jpeg.Options{Quality: quality},
}
return stream
}

View File

@@ -1,14 +1,11 @@
package computervision
import (
"fmt"
"bufio"
"bytes"
"encoding/base64"
"image"
"io/ioutil"
"os"
"runtime"
"runtime/debug"
"sort"
"strconv"
"image/jpeg"
"sync"
"time"
@@ -18,83 +15,27 @@ import (
"github.com/kerberos-io/agent/machinery/src/models"
"github.com/kerberos-io/joy4/av/pubsub"
//"github.com/whorfin/go-libjpeg/jpeg"
geo "github.com/kellydunn/golang-geo"
"github.com/kerberos-io/joy4/av"
"github.com/kerberos-io/joy4/cgo/ffmpeg"
"gocv.io/x/gocv"
)
func GetRGBImage(pkt av.Packet, dec *ffmpeg.VideoDecoder, decoderMutex *sync.Mutex) gocv.Mat {
var rgb gocv.Mat
img, err := capture.DecodeImage(pkt, dec, decoderMutex)
if err == nil && img != nil {
rgb, _ = ToRGB8(img.Image)
gocv.Resize(rgb, &rgb, image.Pt(rgb.Cols()/4, rgb.Rows()/4), 0, 0, gocv.InterpolationArea)
}
return rgb
}
func GetImage(pkt av.Packet, dec *ffmpeg.VideoDecoder, decoderMutex *sync.Mutex) gocv.Mat {
var gray gocv.Mat
img, err := capture.DecodeImage(pkt, dec, decoderMutex)
if err == nil && img != nil {
// Check if we need to scale down.
width := img.Width()
height := img.Height()
newWidth := width
newHeight := height
// Try minify twice.
scaleFactor := 1.0
if newWidth > 800 {
newWidth = width / 2
newHeight = height / 2
scaleFactor *= 2
}
if newWidth > 800 {
newWidth = width / 2
newHeight = height / 2
scaleFactor *= 2
}
if newWidth > 800 {
newWidth = width / 2
newHeight = height / 2
scaleFactor *= 2
}
im := img.Image
rgb, _ := ToRGB8(im)
img.Free()
if scaleFactor > 1 {
gocv.Resize(rgb, &rgb, image.Pt(newWidth, newHeight), 0, 0, gocv.InterpolationArea)
}
gray = gocv.NewMat()
gocv.CvtColor(rgb, &gray, gocv.ColorBGRToGray)
rgb.Close()
}
return gray
}
func ToRGB8(img image.YCbCr) (gocv.Mat, error) {
bounds := img.Bounds()
x := bounds.Dx()
y := bounds.Dy()
bytes := make([]byte, 0, x*y*3)
for j := bounds.Min.Y; j < bounds.Max.Y; j++ {
for i := bounds.Min.X; i < bounds.Max.X; i++ {
r, g, b, _ := img.At(i, j).RGBA()
bytes = append(bytes, byte(b>>8), byte(g>>8), byte(r>>8))
}
}
return gocv.NewMatFromBytes(y, x, gocv.MatTypeCV8UC3, bytes)
}
func ProcessMotion(motionCursor *pubsub.QueueCursor, configuration *models.Configuration, communication *models.Communication, mqttClient mqtt.Client, decoder *ffmpeg.VideoDecoder, decoderMutex *sync.Mutex) { //, wg *sync.WaitGroup) {
log.Log.Debug("ProcessMotion: started")
config := configuration.Config
var isPixelChangeThresholdReached = false
var changesToReturn = 0
pixelThreshold := config.Capture.PixelChangeThreshold
// Might not be set in the config file, so set it to 150
if pixelThreshold == 0 {
pixelThreshold = 150
}
if config.Capture.Continuous == "true" {
log.Log.Info("ProcessMotion: Continuous recording, so no motion detection.")
@@ -103,18 +44,16 @@ func ProcessMotion(motionCursor *pubsub.QueueCursor, configuration *models.Confi
log.Log.Info("ProcessMotion: Motion detection enabled.")
key := ""
if config.Cloud == "s3" && config.S3.Publickey != "" {
key = config.S3.Publickey
} else if config.Cloud == "kstorage" && config.KStorage.CloudKey != "" {
key = config.KStorage.CloudKey
}
key := config.HubKey
// Allocate a VideoFrame
frame := ffmpeg.AllocVideoFrame()
// Initialise first 2 elements
var matArray [3]*gocv.Mat
var imageArray [3]*image.Gray
j := 0
//for pkt := range packets {
var cursorError error
var pkt av.Packet
@@ -122,16 +61,18 @@ func ProcessMotion(motionCursor *pubsub.QueueCursor, configuration *models.Confi
pkt, cursorError = motionCursor.ReadPacket()
// Check If valid package.
if len(pkt.Data) > 0 && pkt.IsKeyFrame {
rgb := GetImage(pkt, decoder, decoderMutex)
matArray[j] = &rgb
j++
grayImage, err := GetGrayImage(frame, pkt, decoder, decoderMutex)
if err == nil {
imageArray[j] = grayImage
j++
}
}
if j == 2 {
if j == 3 {
break
}
}
img := matArray[0]
img := imageArray[0]
if img != nil {
// Calculate mask
@@ -150,16 +91,18 @@ func ProcessMotion(motionCursor *pubsub.QueueCursor, configuration *models.Confi
polyObjects = append(polyObjects, poly)
}
rows := img.Rows()
cols := img.Cols()
var coordinatesToCheck [][]int
bounds := img.Bounds()
rows := bounds.Dy()
cols := bounds.Dx()
// Make fixed size array of uinty8
var coordinatesToCheck []int
for y := 0; y < rows; y++ {
for x := 0; x < cols; x++ {
for _, poly := range polyObjects {
point := geo.NewPoint(float64(x), float64(y))
if poly.Contains(point) {
coordinatesToCheck = append(coordinatesToCheck, []int{x, y})
break
coordinatesToCheck = append(coordinatesToCheck, y*cols+x)
}
}
}
@@ -177,34 +120,20 @@ func ProcessMotion(motionCursor *pubsub.QueueCursor, configuration *models.Confi
continue
}
rgb := GetImage(pkt, decoder, decoderMutex)
matArray[2] = &rgb
// Store snapshots (jpg) or hull.
if i%3 == 0 {
files, err := ioutil.ReadDir("./data/snapshots")
if err == nil {
sort.Slice(files, func(i, j int) bool {
return files[i].ModTime().Before(files[j].ModTime())
})
if len(files) > 3 {
os.Remove("./data/snapshots/" + files[0].Name())
}
}
t := strconv.FormatInt(time.Now().Unix(), 10)
gocv.IMWrite("./data/snapshots/"+t+".png", rgb)
grayImage, err := GetGrayImage(frame, pkt, decoder, decoderMutex)
if err == nil {
imageArray[2] = grayImage
}
// Check if continuous recording.
if config.Capture.Continuous == "true" {
// Store snapshots (jpg) for hull.
if config.Capture.Snapshots != "false" {
StoreSnapshot(communication, frame, pkt, decoder, decoderMutex)
}
// Do not do anything! Just sleep as there is no
// motion detection needed
} else { // Do motion detection.
// Check if within time interval
detectMotion := true
// Check if within time interval
detectMotion := true
timeEnabled := config.Time
if timeEnabled != "false" {
now := time.Now().In(loc)
weekday := now.Weekday()
hour := now.Hour()
@@ -222,67 +151,108 @@ func ProcessMotion(motionCursor *pubsub.QueueCursor, configuration *models.Confi
} else {
detectMotion = false
log.Log.Debug("ProcessMotion: Time interval not valid, disabling motion detection.")
log.Log.Info("ProcessMotion: Time interval not valid, disabling motion detection.")
}
}
if detectMotion && FindMotion(matArray, coordinatesToCheck) {
mqttClient.Publish("kerberos/"+key+"/device/"+config.Key+"/motion", 2, false, "motion")
fmt.Println(key)
communication.HandleMotion <- time.Now().Unix()
}
}
matArray[0].Close()
matArray[0] = matArray[1]
matArray[1] = matArray[2]
i++
runtime.GC()
debug.FreeOSMemory()
if config.Capture.Motion != "false" {
// Remember additional information about the result of findmotion
isPixelChangeThresholdReached, changesToReturn = FindMotion(imageArray, coordinatesToCheck, pixelThreshold)
if detectMotion && isPixelChangeThresholdReached {
// If offline mode is disabled, send a message to the hub
if config.Offline == "false" {
if mqttClient != nil {
if key != "" {
mqttClient.Publish("kerberos/"+key+"/device/"+config.Key+"/motion", 2, false, "motion")
} else {
mqttClient.Publish("kerberos/device/"+config.Key+"/motion", 2, false, "motion")
}
}
}
if config.Capture.Recording != "false" {
dataToPass := models.MotionDataPartial{
Timestamp: time.Now().Unix(),
NumberOfChanges: changesToReturn,
}
communication.HandleMotion <- dataToPass //Save data to the channel
}
}
imageArray[0] = imageArray[1]
imageArray[1] = imageArray[2]
i++
}
}
if img != nil {
img = nil
}
}
if img != nil {
img.Close()
}
runtime.GC()
debug.FreeOSMemory()
frame.Free()
}
log.Log.Debug("ProcessMotion: finished")
}
func FindMotion(matArray [3]*gocv.Mat, coordinatesToCheck [][]int) bool {
func FindMotion(imageArray [3]*image.Gray, coordinatesToCheck []int, pixelChangeThreshold int) (thresholdReached bool, changesDetected int) {
image1 := imageArray[0]
image2 := imageArray[1]
image3 := imageArray[2]
threshold := 60
changes := AbsDiffBitwiseAndThreshold(image1, image2, image3, threshold, coordinatesToCheck)
return changes > pixelChangeThreshold, changes
}
h1 := gocv.NewMat()
gocv.AbsDiff(*matArray[2], *matArray[0], &h1)
h2 := gocv.NewMat()
gocv.AbsDiff(*matArray[2], *matArray[1], &h2)
func GetGrayImage(frame *ffmpeg.VideoFrame, pkt av.Packet, dec *ffmpeg.VideoDecoder, decoderMutex *sync.Mutex) (*image.Gray, error) {
_, err := capture.DecodeImage(frame, pkt, dec, decoderMutex)
and := gocv.NewMat()
gocv.BitwiseAnd(h1, h2, &and)
h1.Close()
h2.Close()
// Do a deep copy of the image
imgDeepCopy := image.NewGray(frame.ImageGray.Bounds())
imgDeepCopy.Stride = frame.ImageGray.Stride
copy(imgDeepCopy.Pix, frame.ImageGray.Pix)
thresh := gocv.NewMat()
gocv.Threshold(and, &thresh, 30.0, 255.0, gocv.ThresholdBinary)
and.Close()
return imgDeepCopy, err
}
kernel := gocv.GetStructuringElement(gocv.MorphRect, image.Pt(3, 3))
eroded := gocv.NewMat()
gocv.Erode(thresh, &eroded, kernel)
thresh.Close()
kernel.Close()
func GetRawImage(frame *ffmpeg.VideoFrame, pkt av.Packet, dec *ffmpeg.VideoDecoder, decoderMutex *sync.Mutex) (*ffmpeg.VideoFrame, error) {
_, err := capture.DecodeImage(frame, pkt, dec, decoderMutex)
return frame, err
}
func ImageToBytes(img image.Image) ([]byte, error) {
buffer := new(bytes.Buffer)
w := bufio.NewWriter(buffer)
err := jpeg.Encode(w, img, &jpeg.Options{Quality: 15})
return buffer.Bytes(), err
}
func AbsDiffBitwiseAndThreshold(img1 *image.Gray, img2 *image.Gray, img3 *image.Gray, threshold int, coordinatesToCheck []int) int {
changes := 0
for _, c := range coordinatesToCheck {
value := eroded.GetUCharAt(c[1], c[0])
if value > 0 {
for i := 0; i < len(coordinatesToCheck); i++ {
pixel := coordinatesToCheck[i]
diff := int(img3.Pix[pixel]) - int(img1.Pix[pixel])
diff2 := int(img3.Pix[pixel]) - int(img2.Pix[pixel])
if (diff > threshold || diff < -threshold) && (diff2 > threshold || diff2 < -threshold) {
changes++
}
}
eroded.Close()
log.Log.Info("FindMotion: Number of changes detected:" + strconv.Itoa(changes))
return changes > 75
return changes
}
func StoreSnapshot(communication *models.Communication, frame *ffmpeg.VideoFrame, pkt av.Packet, decoder *ffmpeg.VideoDecoder, decoderMutex *sync.Mutex) {
rgbImage, err := GetRawImage(frame, pkt, decoder, decoderMutex)
if err == nil {
buffer := new(bytes.Buffer)
w := bufio.NewWriter(buffer)
err := jpeg.Encode(w, &rgbImage.Image, &jpeg.Options{Quality: 15})
if err == nil {
snapshot := base64.StdEncoding.EncodeToString(buffer.Bytes())
communication.Image = snapshot
}
}
}

View File

@@ -7,6 +7,7 @@ import (
"sync"
"time"
"github.com/kerberos-io/agent/machinery/src/log"
"gopkg.in/mgo.v2"
)
@@ -35,7 +36,7 @@ func New() *mgo.Session {
}
session, err := mgo.DialWithInfo(mongoDBDialInfo)
if err != nil {
fmt.Printf("Error en mongo: %+v\n", err)
log.Log.Error(fmt.Sprintf("Failed to connect to database: %s", err.Error()))
os.Exit(1)
}
_instance.Session = session

View File

@@ -2,6 +2,7 @@ package log
import (
"os"
"time"
"github.com/op/go-logging"
"github.com/sirupsen/logrus"
@@ -20,7 +21,7 @@ var Log = Logging{
var gologging = logging.MustGetLogger("gologger")
func ConfigureGoLogging() {
func ConfigureGoLogging(timezone *time.Location) {
// Logging
var format = logging.MustStringFormatter(
`%{color}%{time:15:04:05.000} %{shortfunc} ▶ %{level:.4s} %{id:03x}%{color:reset} %{message}`,
@@ -44,9 +45,12 @@ func ConfigureGoLogging() {
// This a logrus
// -> github.com/sirupsen/logrus
func ConfigureLogrus() {
func ConfigureLogrus(timezone *time.Location) {
// Log as JSON instead of the default ASCII formatter.
logrus.SetFormatter(&logrus.JSONFormatter{})
logrus.SetFormatter(LocalTimeZoneFormatter{
Timezone: timezone,
Formatter: &logrus.JSONFormatter{},
}) // Use local timezone for providing datetime in logs!
// Output to stdout instead of the default stderr
// Can be any io.Writer, see below for File example
@@ -56,13 +60,14 @@ func ConfigureLogrus() {
logrus.SetLevel(logrus.InfoLevel)
}
func NewLogger(logger string, level string) *Logging {
loggy := Logging{
Logger: logger,
Level: level,
}
loggy.Init()
return &loggy
type LocalTimeZoneFormatter struct {
Timezone *time.Location
Formatter logrus.Formatter
}
func (u LocalTimeZoneFormatter) Format(e *logrus.Entry) ([]byte, error) {
e.Time = e.Time.In(u.Timezone)
return u.Formatter.Format(e)
}
type Logging struct {
@@ -70,12 +75,12 @@ type Logging struct {
Level string
}
func (self *Logging) Init() {
func (self *Logging) Init(timezone *time.Location) {
switch self.Logger {
case "go-logging":
ConfigureGoLogging()
ConfigureGoLogging(timezone)
case "logrus":
ConfigureLogrus()
ConfigureLogrus(timezone)
default:
}
}

View File

@@ -1,5 +1,28 @@
package models
type APIResponse struct {
Data interface{} `json:"data" bson:"data"`
Data interface{} `json:"data" bson:"data"`
Message interface{} `json:"message" bson:"message"`
}
type OnvifCredentials struct {
ONVIFXAddr string `json:"onvif_xaddr,omitempty" bson:"onvif_xaddr"`
ONVIFUsername string `json:"onvif_username,omitempty" bson:"onvif_username"`
ONVIFPassword string `json:"onvif_password,omitempty" bson:"onvif_password"`
}
type CameraStreams struct {
RTSP string `json:"rtsp"`
SubRTSP string `json:"sub_rtsp"`
}
type OnvifPanTilt struct {
OnvifCredentials OnvifCredentials `json:"onvif_credentials,omitempty" bson:"onvif_credentials"`
Pan float64 `json:"pan,omitempty" bson:"pan"`
Tilt float64 `json:"tilt,omitempty" bson:"tilt"`
}
type OnvifZoom struct {
OnvifCredentials OnvifCredentials `json:"onvif_credentials,omitempty" bson:"onvif_credentials"`
Zoom float64 `json:"zoom,omitempty" bson:"zoom"`
}

View File

@@ -0,0 +1,15 @@
package models
import "github.com/kerberos-io/joy4/av"
type Camera struct {
Width int
Height int
Num int
Denum int
Framerate float64
RTSP string
SubRTSP string
Codec av.CodecType
Initialized bool
}

View File

@@ -1,8 +1,11 @@
package models
import (
"sync"
"sync/atomic"
"github.com/kerberos-io/joy4/av/pubsub"
"github.com/kerberos-io/joy4/cgo/ffmpeg"
"github.com/tevino/abool"
)
@@ -10,9 +13,12 @@ import (
// all the communication between the different goroutines.
type Communication struct {
PackageCounter *atomic.Value
LastPacketTimer *atomic.Value
CloudTimestamp *atomic.Value
HandleBootstrap chan string
HandleStream chan string
HandleMotion chan int64
HandleSubStream chan string
HandleMotion chan MotionDataPartial
HandleUpload chan string
HandleHeartBeat chan string
HandleLiveSD chan int64
@@ -21,4 +27,11 @@ type Communication struct {
HandleLiveHDPeers chan string
HandleONVIF chan OnvifAction
IsConfiguring *abool.AtomicBool
Queue *pubsub.Queue
SubQueue *pubsub.Queue
DecoderMutex *sync.Mutex
SubDecoderMutex *sync.Mutex
Decoder *ffmpeg.VideoDecoder
SubDecoder *ffmpeg.VideoDecoder
Image string
}

View File

@@ -9,57 +9,68 @@ type Configuration struct {
GlobalConfig Config
}
//Config is the highlevel struct which contains all the configuration of
//your Kerberos Open Source instance.
// Config is the highlevel struct which contains all the configuration of
// your Kerberos Open Source instance.
type Config struct {
Type string `json:"type" binding:"required"`
Key string `json:"key"`
Name string `json:"name"`
Time string `json:"time,omitempty" bson:"time"`
Timezone string `json:"timezone,omitempty" bson:"timezone,omitempty"`
Capture Capture `json:"capture"`
Timetable []*Timetable `json:"timetable"`
Region *Region `json:"region"`
Cloud string `json:"cloud,omitempty" bson:"cloud,omitempty"`
S3 *S3 `json:"s3,omitempty" bson:"s3,omitempty"`
KStorage *KStorage `json:"kstorage,omitempty" bson:"kstorage,omitempty"`
MQTTURI string `json:"mqtturi,omitempty" bson:"mqtturi,omitempty"`
MQTTUsername string `json:"mqtt_username,omitempty" bson:"mqtt_username"`
MQTTPassword string `json:"mqtt_password,omitempty" bson:"mqtt_password"`
STUNURI string `json:"stunuri,omitempty" bson:"stunuri"`
TURNURI string `json:"turnuri,omitempty" bson:"turnuri"`
TURNUsername string `json:"turn_username,omitempty" bson:"turn_username"`
TURNPassword string `json:"turn_password,omitempty" bson:"turn_password"`
HeartbeatURI string `json:"heartbeaturi,omitempty" bson:"heartbeaturi"` /*obsolete*/
HubURI string `json:"hub_uri,omitempty" bson:"hub_uri"`
HubKey string `json:"hub_key,omitempty" bson:"hub_key"`
HubPrivateKey string `json:"hub_private_key,omitempty" bson:"hub_private_key"`
HubSite string `json:"hub_site,omitempty" bson:"hub_site"`
ConditionURI string `json:"condition_uri,omitempty" bson:"condition_uri"`
Type string `json:"type"`
Key string `json:"key"`
Name string `json:"name"`
FriendlyName string `json:"friendly_name"`
Time string `json:"time" bson:"time"`
Offline string `json:"offline"`
AutoClean string `json:"auto_clean"`
RemoveAfterUpload string `json:"remove_after_upload"`
MaxDirectorySize int64 `json:"max_directory_size"`
Timezone string `json:"timezone,omitempty" bson:"timezone,omitempty"`
Capture Capture `json:"capture"`
Timetable []*Timetable `json:"timetable"`
Region *Region `json:"region"`
Cloud string `json:"cloud" bson:"cloud"`
S3 *S3 `json:"s3,omitempty" bson:"s3,omitempty"`
KStorage *KStorage `json:"kstorage,omitempty" bson:"kstorage,omitempty"`
MQTTURI string `json:"mqtturi" bson:"mqtturi,omitempty"`
MQTTUsername string `json:"mqtt_username" bson:"mqtt_username"`
MQTTPassword string `json:"mqtt_password" bson:"mqtt_password"`
STUNURI string `json:"stunuri" bson:"stunuri"`
TURNURI string `json:"turnuri" bson:"turnuri"`
TURNUsername string `json:"turn_username" bson:"turn_username"`
TURNPassword string `json:"turn_password" bson:"turn_password"`
HeartbeatURI string `json:"heartbeaturi" bson:"heartbeaturi"` /*obsolete*/
HubURI string `json:"hub_uri" bson:"hub_uri"`
HubKey string `json:"hub_key" bson:"hub_key"`
HubPrivateKey string `json:"hub_private_key" bson:"hub_private_key"`
HubSite string `json:"hub_site" bson:"hub_site"`
ConditionURI string `json:"condition_uri" bson:"condition_uri"`
}
//Capture defines which camera type (Id) you are using (IP, USB or Raspberry Pi camera),
//and also contains recording specific parameters.
// Capture defines which camera type (Id) you are using (IP, USB or Raspberry Pi camera),
// and also contains recording specific parameters.
type Capture struct {
Name string `json:"name"`
IPCamera IPCamera `json:"ipcamera"`
USBCamera USBCamera `json:"usbcamera"`
RaspiCamera RaspiCamera `json:"raspicamera"`
Recording string `json:"recording,omitempty"`
Snapshots string `json:"snapshots,omitempty"`
Motion string `json:"motion,omitempty"`
Liveview string `json:"liveview,omitempty"`
Continuous string `json:"continuous,omitempty"`
PostRecording int64 `json:"postrecording"`
PreRecording int `json:"prerecording"`
PreRecording int64 `json:"prerecording"`
MaxLengthRecording int64 `json:"maxlengthrecording"`
TranscodingWebRTC string `json:"transcodingwebrtc"`
TranscodingResolution int64 `json:"transcodingresolution"`
ForwardWebRTC string `json:"forwardwebrtc"`
Fragmented string `json:"fragmented,omitempty" bson:"fragmented,omitempty"`
FragmentedDuration int64 `json:"fragmentedduration,omitempty" bson:"fragmentedduration,omitempty"`
PixelChangeThreshold int `json:"pixelChangeThreshold,omitempty"`
}
//IPCamera configuration, such as the RTSP url of the IPCamera and the FPS.
//Also includes ONVIF integration
// IPCamera configuration, such as the RTSP url of the IPCamera and the FPS.
// Also includes ONVIF integration
type IPCamera struct {
RTSP string `json:"rtsp"`
SubRTSP string `json:"sub_rtsp"`
FPS string `json:"fps"`
ONVIF bool `json:"onvif,omitempty" bson:"onvif"`
ONVIFXAddr string `json:"onvif_xaddr,omitempty" bson:"onvif_xaddr"`
@@ -67,25 +78,25 @@ type IPCamera struct {
ONVIFPassword string `json:"onvif_password,omitempty" bson:"onvif_password"`
}
//USBCamera configuration, such as the device path (/dev/video*)
// USBCamera configuration, such as the device path (/dev/video*)
type USBCamera struct {
Device string `json:"device"`
}
//RaspiCamera configuration, such as the device path (/dev/video*)
// RaspiCamera configuration, such as the device path (/dev/video*)
type RaspiCamera struct {
Device string `json:"device"`
}
//Region specifies the type (Id) of Region Of Interest (ROI), you
//would like to use.
// Region specifies the type (Id) of Region Of Interest (ROI), you
// would like to use.
type Region struct {
Name string `json:"name"`
Rectangle Rectangle `json:"rectangle"`
Polygon []Polygon `json:"polygon"`
}
//Rectangle is defined by a starting point, left top (x1,y1) and end point (x2,y2).
// Rectangle is defined by a starting point, left top (x1,y1) and end point (x2,y2).
type Rectangle struct {
X1 int `json:"x1"`
Y1 int `json:"y1"`
@@ -93,22 +104,22 @@ type Rectangle struct {
Y2 int `json:"y2"`
}
//Polygon is a sequence of coordinates (x,y). The ID specifies an unique identifier,
//as multiple polygons can be defined.
// Polygon is a sequence of coordinates (x,y). The ID specifies an unique identifier,
// as multiple polygons can be defined.
type Polygon struct {
ID string `json:"id"`
Coordinates []Coordinate `json:"coordinates"`
}
//Coordinate belongs to a Polygon.
// Coordinate belongs to a Polygon.
type Coordinate struct {
X float64 `json:"x"`
Y float64 `json:"y"`
}
//Timetable allows you to set a Time Of Intterest (TOI), which limits recording or
//detection to a predefined time interval. Two tracks can be set, which allows you
//to give some flexibility.
// Timetable allows you to set a Time Of Intterest (TOI), which limits recording or
// detection to a predefined time interval. Two tracks can be set, which allows you
// to give some flexibility.
type Timetable struct {
Start1 int `json:"start1"`
End1 int `json:"end1"`
@@ -116,7 +127,7 @@ type Timetable struct {
End2 int `json:"end2"`
}
//S3 integration
// S3 integration
type S3 struct {
Proxy string `json:"proxy,omitempty" bson:"proxy,omitempty"`
ProxyURI string `json:"proxyuri,omitempty" bson:"proxyuri,omitempty"`
@@ -127,11 +138,11 @@ type S3 struct {
Secretkey string `json:"secretkey,omitempty" bson:"secretkey,omitempty"`
}
//KStorage contains the credentials of the Kerberos Storage/Kerberos Cloud instance.
//By defining KStorage you can make your recordings available in the cloud, at a centrel place.
// KStorage contains the credentials of the Kerberos Storage/Kerberos Cloud instance.
// By defining KStorage you can make your recordings available in the cloud, at a centrel place.
type KStorage struct {
URI string `json:"uri,omitempty" bson:"uri,omitempty"`
CloudKey string `json:"cloud_key,omitempty" bson:"cloud_key,omitempty"`
CloudKey string `json:"cloud_key,omitempty" bson:"cloud_key,omitempty"` /* old way, remove this */
AccessKey string `json:"access_key,omitempty" bson:"access_key,omitempty"`
SecretAccessKey string `json:"secret_access_key,omitempty" bson:"secret_access_key,omitempty"`
Provider string `json:"provider,omitempty" bson:"provider,omitempty"`

View File

@@ -0,0 +1,18 @@
package models
type Media struct {
Key string `json:"key"`
Path string `json:"path"`
Day string `json:"day"`
ShortDay string `json:"short_day"`
Time string `json:"time"`
Timestamp string `json:"timestamp"`
CameraName string `json:"camera_name"`
CameraKey string `json:"camera_key"`
}
type EventFilter struct {
TimestampOffsetStart int64 `json:"timestamp_offset_start"`
TimestampOffsetEnd int64 `json:"timestamp_offset_end"`
NumberOfElements int `json:"number_of_elements"`
}

View File

@@ -0,0 +1,16 @@
package models
type MotionDataPartial struct {
Timestamp int64 `json:"timestamp" bson:"timestamp"`
NumberOfChanges int `json:"numberOfChanges" bson:"numberOfChanges"`
}
type MotionDataFull struct {
Timestamp int64 `json:"timestamp" bson:"timestamp"`
Size float64 `json:"size" bson:"size"`
Microseconds float64 `json:"microseconds" bson:"microseconds"`
DeviceName string `json:"deviceName" bson:"deviceName"`
Region string `json:"region" bson:"region"`
NumberOfChanges int `json:"numberOfChanges" bson:"numberOfChanges"`
Token int `json:"token" bson:"token"`
}

View File

@@ -6,9 +6,10 @@ type OnvifAction struct {
}
type OnvifActionPTZ struct {
Left int `json:"left" bson:"left"`
Right int `json:"right" bson:"right"`
Up int `json:"up" bson:"up"`
Down int `json:"down" bson:"down"`
Center int `json:"center" bson:"center"`
Left int `json:"left" bson:"left"`
Right int `json:"right" bson:"right"`
Up int `json:"up" bson:"up"`
Down int `json:"down" bson:"down"`
Center int `json:"center" bson:"center"`
Zoom float64 `json:"zoom" bson:"zoom"`
}

View File

@@ -0,0 +1,17 @@
package models
type System struct {
CPUId string `json:"cpu_idle" bson:"cpu_idle"`
Hostname string `json:"hostname" bson:"hostname"`
Version string `json:"version" bson:"version"`
Release string `json:"release" bson:"release"`
BootTime uint64 `json:"boot_time" bson:"boot_time"`
KernelVersion string `json:"kernel_version" bson:"kernel_version"`
MACs []string `json:"macs" bson:"macs"`
IPs []string `json:"ips" bson:"ips"`
Architecture string `json:"architecture" bson:"architecture"`
UsedMemory uint64 `json:"used_memory" bson:"used_memory"`
TotalMemory uint64 `json:"total_memory" bson:"total_memory"`
FreeMemory uint64 `json:"free_memory" bson:"free_memory"`
ProcessUsedMemory uint64 `json:"process_used_memory" bson:"process_used_memory"`
}

View File

@@ -7,3 +7,16 @@ type User struct {
Role string `json:"role" bson:"role"`
Language string `json:"language" bson:"language"`
}
type Authentication struct {
Username string `json:"username" bson:"username"`
Password string `json:"password" bson:"password"`
}
type Authorization struct {
Code int `json:"code" bson:"code"`
Token string `json:"token" bson:"token"`
Expire string `json:"expire" bson:"expire"`
Username string `json:"username" bson:"username"`
Role string `json:"role" bson:"role"`
}

View File

@@ -4,8 +4,11 @@ import (
"bytes"
"encoding/json"
"encoding/xml"
"errors"
"io"
"io/ioutil"
"strings"
"time"
"github.com/kerberos-io/agent/machinery/src/log"
"github.com/kerberos-io/agent/machinery/src/models"
@@ -19,97 +22,77 @@ import (
func HandleONVIFActions(configuration *models.Configuration, communication *models.Communication) {
log.Log.Debug("HandleONVIFActions: started")
config := configuration.Config
for onvifAction := range communication.HandleONVIF {
// First we'll get the desired PTZ action from the payload
// We need to know if we need to move left, right, up, down, zoom in, zoom out, center.
var ptzAction models.OnvifActionPTZ
b, _ := json.Marshal(onvifAction.Payload)
json.Unmarshal(b, &ptzAction)
if onvifAction.Action == "ptz" {
// Do the PTZ shizzle
device, err := onvif.NewDevice(onvif.DeviceParams{
Xaddr: config.Capture.IPCamera.ONVIFXAddr,
Username: config.Capture.IPCamera.ONVIFUsername,
Password: config.Capture.IPCamera.ONVIFPassword,
})
//services := device.GetServices()
//fmt.Println(services)
// Get Profiles
resp, _ := device.CallMethod(media.GetProfiles{})
defer resp.Body.Close()
b, _ := io.ReadAll(resp.Body)
stringBody := string(b)
decodedXML, et, errorFunc := getXMLNode(stringBody, "GetProfilesResponse")
if errorFunc != "" {
}
var mProfilesResp media.GetProfilesResponse
if err := decodedXML.DecodeElement(&mProfilesResp, et); err != nil {
log.Log.Error("HandleONVIFActions: " + err.Error())
}
var ptzToken xsd.ReferenceToken
for _, profile := range mProfilesResp.Profiles {
ptzToken = profile.Token
}
// Connect to Onvif device
device, err := ConnectToOnvifDevice(configuration)
if err == nil {
// Get token from the first profile
token, err := GetTokenFromProfile(device, 0)
if err == nil {
if ptzAction.Center == 1 {
absoluteVector := xsd.Vector2D{
X: 0,
Y: 0,
Space: "http://www.onvif.org/ver10/tptz/PanTiltSpaces/PositionGenericSpace",
}
// Get the configurations from the device
configurations, err := GetConfigurationsFromDevice(device)
res, _ := device.CallMethod(ptz.AbsoluteMove{
ProfileToken: ptzToken,
Position: xsd.PTZVector{
PanTilt: absoluteVector,
Zoom: xsd.Vector1D{
X: 0,
Space: "http://www.onvif.org/ver10/tptz/ZoomSpaces/PositionGenericSpace",
},
},
})
if err == nil {
bs, _ := ioutil.ReadAll(res.Body)
log.Log.Info("HandleONVIFActions: " + string(bs))
if onvifAction.Action == "ptz" {
} else {
distance := 0.1
panTiltVector := xsd.Vector2D{
X: 0,
Y: 0,
Space: "http://www.onvif.org/ver10/tptz/PanTiltSpaces/TranslationGenericSpace",
}
if ptzAction.Left == 1 {
panTiltVector.X = -1 * distance
}
if ptzAction.Right == 1 {
panTiltVector.X = distance
}
if ptzAction.Up == 1 {
panTiltVector.Y = distance
}
if ptzAction.Down == 1 {
panTiltVector.Y = -1 * distance
}
if err == nil {
res, _ := device.CallMethod(ptz.RelativeMove{
ProfileToken: ptzToken,
Translation: xsd.PTZVector{
PanTilt: panTiltVector,
Zoom: xsd.Vector1D{
X: 0,
Space: "http://www.onvif.org/ver10/tptz/ZoomSpaces/TranslationGenericSpace",
},
},
})
if ptzAction.Center == 1 {
bs, _ := ioutil.ReadAll(res.Body)
log.Log.Info("HandleONVIFActions: " + string(bs))
// We will move the camera to zero position.
err := AbsolutePanTiltMove(device, configurations, token, 0, 0)
if err != nil {
log.Log.Error("HandleONVIFActions (AbsolutePanTitleMove): " + err.Error())
}
} else {
// Distance should be a parameter as well
distance := 0.7
// We will calculate if we need to move pan or tilt (and the direction).
x := float64(0)
y := float64(0)
if ptzAction.Left == 1 {
x = -1 * distance
}
if ptzAction.Right == 1 {
x = 1 * distance
}
if ptzAction.Up == 1 {
y = 1 * distance
}
if ptzAction.Down == 1 {
y = -1 * distance
}
err := ContinuousPanTilt(device, configurations, token, x, y)
if err != nil {
log.Log.Error("HandleONVIFActions (ContinuousPanTilt): " + err.Error())
}
}
}
} else if onvifAction.Action == "zoom" {
if err == nil {
zoom := ptzAction.Zoom
err := ContinuousZoom(device, configurations, token, zoom)
if err != nil {
log.Log.Error("HandleONVIFActions (ContinuousZoom): " + err.Error())
}
}
}
}
}
}
@@ -117,11 +100,209 @@ func HandleONVIFActions(configuration *models.Configuration, communication *mode
log.Log.Debug("HandleONVIFActions: finished")
}
func getXMLNode(xmlBody string, nodeName string) (*xml.Decoder, *xml.StartElement, string) {
func ConnectToOnvifDevice(configuration *models.Configuration) (*onvif.Device, error) {
log.Log.Debug("ConnectToOnvifDevice: started")
config := configuration.Config
// Get the capabilities of the ONVIF device
device, err := onvif.NewDevice(onvif.DeviceParams{
Xaddr: config.Capture.IPCamera.ONVIFXAddr,
Username: config.Capture.IPCamera.ONVIFUsername,
Password: config.Capture.IPCamera.ONVIFPassword,
})
if err != nil {
log.Log.Error("ConnectToOnvifDevice: " + err.Error())
}
log.Log.Debug("ConnectToOnvifDevice: finished")
return device, err
}
func GetTokenFromProfile(device *onvif.Device, profileId int) (xsd.ReferenceToken, error) {
// We aim to receive a profile token from the server
var profileToken xsd.ReferenceToken
// Get Profiles
resp, err := device.CallMethod(media.GetProfiles{})
if err == nil {
defer resp.Body.Close()
b, err := io.ReadAll(resp.Body)
if err == nil {
stringBody := string(b)
decodedXML, et, err := getXMLNode(stringBody, "GetProfilesResponse")
if err != nil {
log.Log.Error("GetTokenFromProfile: " + err.Error())
return profileToken, err
} else {
// Decode the profiles from the server
var mProfilesResp media.GetProfilesResponse
if err := decodedXML.DecodeElement(&mProfilesResp, et); err != nil {
log.Log.Error("GetTokenFromProfile: " + err.Error())
}
// We'll try to get the token from a preferred profile
for i, profile := range mProfilesResp.Profiles {
if profileId == i {
profileToken = profile.Token
}
}
}
}
}
return profileToken, err
}
func GetConfigurationsFromDevice(device *onvif.Device) (ptz.GetConfigurationsResponse, error) {
// We'll try to receive the PTZ configurations from the server
var configurations ptz.GetConfigurationsResponse
// Get the configurations from the device
resp, err := device.CallMethod(ptz.GetConfigurations{})
if err == nil {
defer resp.Body.Close()
b, err := io.ReadAll(resp.Body)
if err == nil {
stringBody := string(b)
decodedXML, et, err := getXMLNode(stringBody, "GetConfigurationsResponse")
if err != nil {
log.Log.Error("GetConfigurationsFromDevice: " + err.Error())
return configurations, err
} else {
if err := decodedXML.DecodeElement(&configurations, et); err != nil {
log.Log.Error("GetConfigurationsFromDevice: " + err.Error())
return configurations, err
}
}
}
}
return configurations, err
}
func AbsolutePanTiltMove(device *onvif.Device, configuration ptz.GetConfigurationsResponse, token xsd.ReferenceToken, pan float32, tilt float32) error {
absoluteVector := xsd.Vector2D{
X: float64(pan),
Y: float64(tilt),
Space: configuration.PTZConfiguration.DefaultAbsolutePantTiltPositionSpace,
}
res, err := device.CallMethod(ptz.AbsoluteMove{
ProfileToken: token,
Position: xsd.PTZVector{
PanTilt: absoluteVector,
},
})
if err != nil {
log.Log.Error("AbsoluteMove: " + err.Error())
}
bs, _ := ioutil.ReadAll(res.Body)
log.Log.Debug("AbsoluteMove: " + string(bs))
return err
}
func ContinuousPanTilt(device *onvif.Device, configuration ptz.GetConfigurationsResponse, token xsd.ReferenceToken, pan float64, tilt float64) error {
panTiltVector := xsd.Vector2D{
X: pan,
Y: tilt,
Space: configuration.PTZConfiguration.DefaultContinuousPanTiltVelocitySpace,
}
res, err := device.CallMethod(ptz.ContinuousMove{
ProfileToken: token,
Velocity: xsd.PTZSpeedPanTilt{
PanTilt: panTiltVector,
},
})
if err != nil {
log.Log.Error("ContinuousPanTiltMove: " + err.Error())
}
bs, _ := ioutil.ReadAll(res.Body)
log.Log.Debug("ContinuousPanTiltMove: " + string(bs))
time.Sleep(500 * time.Millisecond)
res, errStop := device.CallMethod(ptz.Stop{
ProfileToken: token,
PanTilt: true,
})
if errStop != nil {
log.Log.Error("ContinuousPanTiltMove: " + errStop.Error())
}
if errStop == nil {
return err
} else {
return errStop
}
}
func ContinuousZoom(device *onvif.Device, configuration ptz.GetConfigurationsResponse, token xsd.ReferenceToken, zoom float64) error {
zoomVector := xsd.Vector1D{
X: zoom,
Space: configuration.PTZConfiguration.DefaultContinuousZoomVelocitySpace,
}
res, err := device.CallMethod(ptz.ContinuousMove{
ProfileToken: token,
Velocity: xsd.PTZSpeedZoom{
Zoom: zoomVector,
},
})
if err != nil {
log.Log.Error("ContinuousPanTiltZoom: " + err.Error())
}
bs, _ := ioutil.ReadAll(res.Body)
log.Log.Debug("ContinuousPanTiltZoom: " + string(bs))
time.Sleep(500 * time.Millisecond)
res, errStop := device.CallMethod(ptz.Stop{
ProfileToken: token,
Zoom: true,
})
if errStop != nil {
log.Log.Error("ContinuousPanTiltZoom: " + errStop.Error())
}
if errStop == nil {
return err
} else {
return errStop
}
}
func GetCapabilitiesFromDevice(device *onvif.Device) []string {
var capabilities []string
services := device.GetServices()
for key, _ := range services {
log.Log.Debug("GetCapabilitiesFromDevice: has key: " + key)
if key != "" {
keyParts := strings.Split(key, "/")
if len(keyParts) > 0 {
capability := keyParts[len(keyParts)-1]
capabilities = append(capabilities, capability)
}
}
}
return capabilities
}
func getXMLNode(xmlBody string, nodeName string) (*xml.Decoder, *xml.StartElement, error) {
xmlBytes := bytes.NewBufferString(xmlBody)
decodedXML := xml.NewDecoder(xmlBytes)
for {
token, err := decodedXML.Token()
if err != nil {
@@ -130,9 +311,9 @@ func getXMLNode(xmlBody string, nodeName string) (*xml.Decoder, *xml.StartElemen
switch et := token.(type) {
case xml.StartElement:
if et.Name.Local == nodeName {
return decodedXML, &et, ""
return decodedXML, &et, nil
}
}
}
return nil, nil, "error in NodeName"
return nil, nil, errors.New("error in NodeName - username and password might be wrong")
}

View File

@@ -2,6 +2,7 @@ package http
import (
"net/http"
"os"
"time"
jwt "github.com/appleboy/gin-jwt/v2"
@@ -45,9 +46,18 @@ func JWTMiddleWare() jwt.GinJWTMiddleware {
username := loginVals.Username
password := loginVals.Password
usernameENV := "root"
passwordENV := "root"
if username == usernameENV && password == passwordENV {
// Get username from ENV
usernameFromConfig := os.Getenv("AGENT_USERNAME")
if usernameFromConfig == "" {
usernameFromConfig = "root"
}
// Get password from ENV
passwordFromConfig := os.Getenv("AGENT_PASSWORD")
if passwordFromConfig == "" {
passwordFromConfig = "root"
}
if username == usernameFromConfig && password == passwordFromConfig {
return &models.User{
Username: username,
Role: "admin",

View File

@@ -0,0 +1,248 @@
package http
import (
"github.com/gin-gonic/gin"
"github.com/kerberos-io/agent/machinery/src/models"
"github.com/kerberos-io/agent/machinery/src/onvif"
)
// Login godoc
// @Router /api/login [post]
// @ID login
// @Tags authentication
// @Summary Get Authorization token.
// @Description Get Authorization token.
// @Param credentials body models.Authentication true "Credentials"
// @Success 200 {object} models.Authorization
func Login() {}
// LoginToOnvif godoc
// @Router /api/camera/onvif/login [post]
// @ID camera-onvif-login
// @Tags camera
// @Param config body models.OnvifCredentials true "OnvifCredentials"
// @Summary Try to login into ONVIF supported camera.
// @Description Try to login into ONVIF supported camera.
// @Success 200 {object} models.APIResponse
func LoginToOnvif(c *gin.Context) {
var onvifCredentials models.OnvifCredentials
err := c.BindJSON(&onvifCredentials)
if err == nil && onvifCredentials.ONVIFXAddr != "" {
configuration := &models.Configuration{
Config: models.Config{
Capture: models.Capture{
IPCamera: models.IPCamera{
ONVIFXAddr: onvifCredentials.ONVIFXAddr,
ONVIFUsername: onvifCredentials.ONVIFUsername,
ONVIFPassword: onvifCredentials.ONVIFPassword,
},
},
},
}
device, err := onvif.ConnectToOnvifDevice(configuration)
if err == nil {
c.JSON(200, gin.H{
"device": device,
})
} else {
c.JSON(400, gin.H{
"data": "Something went wrong: " + err.Error(),
})
}
} else {
c.JSON(400, gin.H{
"data": "Something went wrong: " + err.Error(),
})
}
}
// GetOnvifCapabilities godoc
// @Router /api/camera/onvif/capabilities [post]
// @ID camera-onvif-capabilities
// @Tags camera
// @Param config body models.OnvifCredentials true "OnvifCredentials"
// @Summary Will return the ONVIF capabilities for the specific camera.
// @Description Will return the ONVIF capabilities for the specific camera.
// @Success 200 {object} models.APIResponse
func GetOnvifCapabilities(c *gin.Context) {
var onvifCredentials models.OnvifCredentials
err := c.BindJSON(&onvifCredentials)
if err == nil && onvifCredentials.ONVIFXAddr != "" {
configuration := &models.Configuration{
Config: models.Config{
Capture: models.Capture{
IPCamera: models.IPCamera{
ONVIFXAddr: onvifCredentials.ONVIFXAddr,
ONVIFUsername: onvifCredentials.ONVIFUsername,
ONVIFPassword: onvifCredentials.ONVIFPassword,
},
},
},
}
device, err := onvif.ConnectToOnvifDevice(configuration)
if err == nil {
c.JSON(200, gin.H{
"capabilities": onvif.GetCapabilitiesFromDevice(device),
})
} else {
c.JSON(400, gin.H{
"data": "Something went wrong: " + err.Error(),
})
}
} else {
c.JSON(400, gin.H{
"data": "Something went wrong: " + err.Error(),
})
}
}
// DoOnvifPanTilt godoc
// @Router /api/camera/onvif/pantilt [post]
// @ID camera-onvif-pantilt
// @Tags camera
// @Param panTilt body models.OnvifPanTilt true "OnvifPanTilt"
// @Summary Panning or/and tilting the camera.
// @Description Panning or/and tilting the camera using a direction (x,y).
// @Success 200 {object} models.APIResponse
func DoOnvifPanTilt(c *gin.Context) {
var onvifPanTilt models.OnvifPanTilt
err := c.BindJSON(&onvifPanTilt)
if err == nil && onvifPanTilt.OnvifCredentials.ONVIFXAddr != "" {
configuration := &models.Configuration{
Config: models.Config{
Capture: models.Capture{
IPCamera: models.IPCamera{
ONVIFXAddr: onvifPanTilt.OnvifCredentials.ONVIFXAddr,
ONVIFUsername: onvifPanTilt.OnvifCredentials.ONVIFUsername,
ONVIFPassword: onvifPanTilt.OnvifCredentials.ONVIFPassword,
},
},
},
}
device, err := onvif.ConnectToOnvifDevice(configuration)
if err == nil {
// Get token from the first profile
token, err := onvif.GetTokenFromProfile(device, 0)
if err == nil {
// Get the configurations from the device
configurations, err := onvif.GetConfigurationsFromDevice(device)
if err == nil {
pan := onvifPanTilt.Pan
tilt := onvifPanTilt.Tilt
err := onvif.ContinuousPanTilt(device, configurations, token, pan, tilt)
if err == nil {
c.JSON(200, models.APIResponse{
Message: "Successfully pan/tilted the camera",
})
} else {
c.JSON(400, models.APIResponse{
Message: "Something went wrong: " + err.Error(),
})
}
} else {
c.JSON(400, models.APIResponse{
Message: "Something went wrong: " + err.Error(),
})
}
} else {
c.JSON(400, models.APIResponse{
Message: "Something went wrong: " + err.Error(),
})
}
} else {
c.JSON(400, models.APIResponse{
Message: "Something went wrong: " + err.Error(),
})
}
} else {
c.JSON(400, models.APIResponse{
Message: "Something went wrong: " + err.Error(),
})
}
}
// DoOnvifZoom godoc
// @Router /api/camera/onvif/zoom [post]
// @ID camera-onvif-zoom
// @Tags camera
// @Param zoom body models.OnvifZoom true "OnvifZoom"
// @Summary Zooming in or out the camera.
// @Description Zooming in or out the camera.
// @Success 200 {object} models.APIResponse
func DoOnvifZoom(c *gin.Context) {
var onvifZoom models.OnvifZoom
err := c.BindJSON(&onvifZoom)
if err == nil && onvifZoom.OnvifCredentials.ONVIFXAddr != "" {
configuration := &models.Configuration{
Config: models.Config{
Capture: models.Capture{
IPCamera: models.IPCamera{
ONVIFXAddr: onvifZoom.OnvifCredentials.ONVIFXAddr,
ONVIFUsername: onvifZoom.OnvifCredentials.ONVIFUsername,
ONVIFPassword: onvifZoom.OnvifCredentials.ONVIFPassword,
},
},
},
}
device, err := onvif.ConnectToOnvifDevice(configuration)
if err == nil {
// Get token from the first profile
token, err := onvif.GetTokenFromProfile(device, 0)
if err == nil {
// Get the configurations from the device
configurations, err := onvif.GetConfigurationsFromDevice(device)
if err == nil {
zoom := onvifZoom.Zoom
err := onvif.ContinuousZoom(device, configurations, token, zoom)
if err == nil {
c.JSON(200, models.APIResponse{
Message: "Successfully zoomed the camera",
})
} else {
c.JSON(400, models.APIResponse{
Message: "Something went wrong: " + err.Error(),
})
}
} else {
c.JSON(400, models.APIResponse{
Message: "Something went wrong: " + err.Error(),
})
}
} else {
c.JSON(400, models.APIResponse{
Message: "Something went wrong: " + err.Error(),
})
}
} else {
c.JSON(400, models.APIResponse{
Message: "Something went wrong: " + err.Error(),
})
}
} else {
c.JSON(400, models.APIResponse{
Message: "Something went wrong: " + err.Error(),
})
}
}

View File

@@ -1,67 +1,57 @@
package http
import (
"encoding/json"
"io/ioutil"
"os"
"image"
"time"
jwt "github.com/appleboy/gin-jwt/v2"
"github.com/gin-gonic/gin"
"gopkg.in/mgo.v2/bson"
"github.com/kerberos-io/agent/machinery/src/capture"
"github.com/kerberos-io/agent/machinery/src/routers/websocket"
"github.com/kerberos-io/agent/machinery/src/cloud"
"github.com/kerberos-io/agent/machinery/src/components"
"github.com/kerberos-io/agent/machinery/src/database"
"github.com/kerberos-io/agent/machinery/src/log"
"github.com/kerberos-io/agent/machinery/src/models"
"github.com/kerberos-io/agent/machinery/src/utils"
)
func AddRoutes(r *gin.Engine, authMiddleware *jwt.GinJWTMiddleware, configuration *models.Configuration, communication *models.Communication) *gin.RouterGroup {
r.GET("/ws", func(c *gin.Context) {
websocket.WebsocketHandler(c, communication)
})
// This is legacy should be removed in future! Now everything
// lives under the /api prefix.
r.GET("/config", func(c *gin.Context) {
c.JSON(200, gin.H{
"config": configuration.Config,
"custom": configuration.CustomConfig,
"global": configuration.GlobalConfig,
"snapshot": components.GetSnapshot(),
"snapshot": communication.Image,
})
})
// This is legacy should be removed in future! Now everything
// lives under the /api prefix.
r.POST("/config", func(c *gin.Context) {
if !communication.IsConfiguring.IsSet() {
communication.IsConfiguring.Set()
// Save into file
var conf models.Config
c.BindJSON(&conf)
if os.Getenv("DEPLOYMENT") == "factory" || os.Getenv("MACHINERY_ENVIRONMENT") == "kubernetes" {
// Write to mongodb
session := database.New().Copy()
defer session.Close()
db := session.DB(database.DatabaseName)
collection := db.C("configuration")
collection.Update(bson.M{
"type": "config",
"name": os.Getenv("DEPLOYMENT_NAME"),
}, &conf)
} else if os.Getenv("DEPLOYMENT") == "" || os.Getenv("DEPLOYMENT") == "agent" {
res, _ := json.MarshalIndent(conf, "", "\t")
ioutil.WriteFile("./data/config/config.json", res, 0644)
var config models.Config
err := c.BindJSON(&config)
if err == nil {
err := components.SaveConfig(config, configuration, communication)
if err == nil {
c.JSON(200, gin.H{
"data": "☄ Reconfiguring",
})
} else {
c.JSON(400, gin.H{
"data": "Something went wrong: " + err.Error(),
})
}
select {
case communication.HandleBootstrap <- "restart":
default:
}
communication.IsConfiguring.UnSet()
c.JSON(200, gin.H{
"data": "☄ Reconfiguring",
})
} else {
c.JSON(200, gin.H{
"data": "☄ Already reconfiguring",
c.JSON(400, gin.H{
"data": "Something went wrong: " + err.Error(),
})
}
})
@@ -70,15 +60,128 @@ func AddRoutes(r *gin.Engine, authMiddleware *jwt.GinJWTMiddleware, configuratio
{
api.POST("/login", authMiddleware.LoginHandler)
api.GET("/dashboard", func(c *gin.Context) {
// This will return the timestamp when the last packet was correctyl received
// this is to calculate if the camera connection is still working.
lastPacketReceived := int64(0)
if communication.LastPacketTimer != nil && communication.LastPacketTimer.Load() != nil {
lastPacketReceived = communication.LastPacketTimer.Load().(int64)
}
// If an agent is properly setup with Kerberos Hub, we will send
// a ping to Kerberos Hub every 15seconds. On receiving a positive response
// it will update the CloudTimestamp value.
cloudTimestamp := int64(0)
if communication.CloudTimestamp != nil && communication.CloudTimestamp.Load() != nil {
cloudTimestamp = communication.CloudTimestamp.Load().(int64)
}
// The total number of recordings stored in the directory.
recordingDirectory := "./data/recordings"
numberOfRecordings := utils.NumberOfMP4sInDirectory(recordingDirectory)
// All days stored in this agent.
days := []string{}
latestEvents := []models.Media{}
files, err := utils.ReadDirectory(recordingDirectory)
if err == nil {
events := utils.GetSortedDirectory(files)
// Get All days
days = utils.GetDays(events, recordingDirectory, configuration)
// Get all latest events
var eventFilter models.EventFilter
eventFilter.NumberOfElements = 5
latestEvents = utils.GetMediaFormatted(events, recordingDirectory, configuration, eventFilter) // will get 5 latest recordings.
}
c.JSON(200, gin.H{
"offlineMode": configuration.Config.Offline,
"cameraOnline": lastPacketReceived,
"cloudOnline": cloudTimestamp,
"numberOfRecordings": numberOfRecordings,
"days": days,
"latestEvents": latestEvents,
})
})
api.POST("/latest-events", func(c *gin.Context) {
var eventFilter models.EventFilter
err := c.BindJSON(&eventFilter)
if err == nil {
// Default to 10 if no limit is set.
if eventFilter.NumberOfElements == 0 {
eventFilter.NumberOfElements = 10
}
recordingDirectory := "./data/recordings"
files, err := utils.ReadDirectory(recordingDirectory)
if err == nil {
events := utils.GetSortedDirectory(files)
// We will get all recordings from the directory (as defined by the filter).
fileObjects := utils.GetMediaFormatted(events, recordingDirectory, configuration, eventFilter)
c.JSON(200, gin.H{
"events": fileObjects,
})
} else {
c.JSON(400, gin.H{
"data": "Something went wrong: " + err.Error(),
})
}
} else {
c.JSON(400, gin.H{
"data": "Something went wrong: " + err.Error(),
})
}
})
api.GET("/days", func(c *gin.Context) {
recordingDirectory := "./data/recordings"
files, err := utils.ReadDirectory(recordingDirectory)
if err == nil {
events := utils.GetSortedDirectory(files)
days := utils.GetDays(events, recordingDirectory, configuration)
c.JSON(200, gin.H{
"events": days,
})
} else {
c.JSON(400, gin.H{
"data": "Something went wrong: " + err.Error(),
})
}
})
api.GET("/config", func(c *gin.Context) {
c.JSON(200, gin.H{
"config": configuration.Config,
"custom": configuration.CustomConfig,
"global": configuration.GlobalConfig,
"snapshot": components.GetSnapshot(),
"snapshot": communication.Image,
})
})
api.POST("/config", func(c *gin.Context) {
var config models.Config
err := c.BindJSON(&config)
if err == nil {
err := components.SaveConfig(config, configuration, communication)
if err == nil {
c.JSON(200, gin.H{
"data": "☄ Reconfiguring",
})
} else {
c.JSON(200, gin.H{
"data": "☄ Reconfiguring",
})
}
} else {
c.JSON(400, gin.H{
"data": "Something went wrong: " + err.Error(),
})
}
})
api.GET("/restart", func(c *gin.Context) {
communication.HandleBootstrap <- "restart"
c.JSON(200, gin.H{
@@ -93,10 +196,40 @@ func AddRoutes(r *gin.Engine, authMiddleware *jwt.GinJWTMiddleware, configuratio
})
})
api.POST("/hub/verify", func(c *gin.Context) {
cloud.VerifyHub(c)
})
api.POST("/persistence/verify", func(c *gin.Context) {
cloud.VerifyPersistence(c)
})
// Streaming handler
api.GET("/stream", func(c *gin.Context) {
// TODO add a token validation!
imageFunction := func() (image.Image, error) {
// We will only send an image once per second.
time.Sleep(time.Second * 1)
log.Log.Info("AddRoutes (/stream): reading from MJPEG stream")
img, err := components.GetImageFromFilePath()
return img, err
}
h := components.StartMotionJPEG(imageFunction, 80)
h.ServeHTTP(c.Writer, c.Request)
})
// Camera specific methods. Doesn't require any authorization.
// These are available for anyone, but require the agent, to reach
// the camera.
api.POST("/camera/onvif/login", LoginToOnvif)
api.POST("/camera/onvif/capabilities", GetOnvifCapabilities)
api.POST("/camera/onvif/pantilt", DoOnvifPanTilt)
api.POST("/camera/onvif/zoom", DoOnvifZoom)
api.POST("/camera/verify/:streamType", capture.VerifyCamera)
// Secured endpoints..
api.Use(authMiddleware.MiddlewareFunc())
{
// Secured endpoints..
}
}
return api

View File

@@ -63,6 +63,7 @@ func StartServer(configuration *models.Configuration, communication *models.Comm
r.Use(static.Serve("/media", static.LocalFile("./www", true)))
r.Use(static.Serve("/settings", static.LocalFile("./www", true)))
r.Use(static.Serve("/login", static.LocalFile("./www", true)))
r.Handle("GET", "/file/*filepath", Files)
// Run the api on port
err = r.Run(":" + configuration.Port)
@@ -70,3 +71,9 @@ func StartServer(configuration *models.Configuration, communication *models.Comm
log.Fatal(err)
}
}
func Files(c *gin.Context) {
c.Header("Access-Control-Allow-Origin", "*")
c.Header("Content-Type", "video/mp4")
c.File("./data/recordings" + c.Param("filepath"))
}

View File

@@ -17,93 +17,100 @@ func ConfigureMQTT(configuration *models.Configuration, communication *models.Co
config := configuration.Config
opts := mqtt.NewClientOptions()
if config.Offline == "true" {
log.Log.Info("ConfigureMQTT: not starting as running in Offline mode.")
} else {
// We will set the MQTT endpoint to which we want to connect
// and share and receive messages to/from.
mqttURL := config.MQTTURI
opts.AddBroker(mqttURL)
log.Log.Info("ConfigureMQTT: Set broker uri " + mqttURL)
opts := mqtt.NewClientOptions()
// Our MQTT broker can have username/password credentials
// to protect it from the outside.
mqtt_username := config.MQTTUsername
mqtt_password := config.MQTTPassword
if mqtt_username != "" || mqtt_password != "" {
opts.SetUsername(mqtt_username)
opts.SetPassword(mqtt_password)
log.Log.Info("ConfigureMQTT: Set username " + mqtt_username)
log.Log.Info("ConfigureMQTT: Set password " + mqtt_password)
}
// We will set the MQTT endpoint to which we want to connect
// and share and receive messages to/from.
mqttURL := config.MQTTURI
opts.AddBroker(mqttURL)
log.Log.Info("ConfigureMQTT: Set broker uri " + mqttURL)
// Some extra options to make sure the connection behaves
// properly. More information here: github.com/eclipse/paho.mqtt.golang.
opts.SetCleanSession(true)
opts.SetConnectRetry(true)
opts.SetAutoReconnect(true)
opts.SetConnectTimeout(30 * time.Second)
hubKey := ""
// This is the old way ;)
if config.Cloud == "s3" && config.S3.Publickey != "" {
hubKey = config.S3.Publickey
} else if config.Cloud == "kstorage" && config.KStorage.CloudKey != "" {
hubKey = config.KStorage.CloudKey
}
// This is the new way ;)
if config.HubKey != "" {
hubKey = config.HubKey
}
if hubKey != "" {
rand.Seed(time.Now().UnixNano())
random := rand.Intn(100)
mqttClientID := config.Key + strconv.Itoa(random) // this random int is to avoid conflicts.
// This is a worked-around.
// current S3 (Kerberos Hub SAAS) is using a secured MQTT, where the client id,
// should match the kerberos hub key.
if config.Cloud == "s3" {
mqttClientID = config.Key
// Our MQTT broker can have username/password credentials
// to protect it from the outside.
mqtt_username := config.MQTTUsername
mqtt_password := config.MQTTPassword
if mqtt_username != "" || mqtt_password != "" {
opts.SetUsername(mqtt_username)
opts.SetPassword(mqtt_password)
log.Log.Info("ConfigureMQTT: Set username " + mqtt_username)
log.Log.Info("ConfigureMQTT: Set password " + mqtt_password)
}
opts.SetClientID(mqttClientID)
log.Log.Info("ConfigureMQTT: Set ClientID " + mqttClientID)
rand.Seed(time.Now().UnixNano())
webrtc.CandidateArrays = make(map[string](chan string))
// Some extra options to make sure the connection behaves
// properly. More information here: github.com/eclipse/paho.mqtt.golang.
opts.SetCleanSession(true)
opts.SetConnectRetry(true)
//opts.SetAutoReconnect(true)
opts.SetConnectTimeout(30 * time.Second)
opts.OnConnect = func(c mqtt.Client) {
// We managed to connect to the MQTT broker, hurray!
log.Log.Info("ConfigureMQTT: " + mqttClientID + " connected to " + mqttURL)
// Create a subscription to know if send out a livestream or not.
MQTTListenerHandleLiveSD(c, hubKey, configuration, communication)
// Create a subscription for the WEBRTC livestream.
MQTTListenerHandleLiveHDHandshake(c, hubKey, configuration, communication)
// Create a subscription for keeping alive the WEBRTC livestream.
MQTTListenerHandleLiveHDKeepalive(c, hubKey, configuration, communication)
// Create a subscription to listen to the number of WEBRTC peers.
MQTTListenerHandleLiveHDPeers(c, hubKey, configuration, communication)
// Create a subscription to listen for WEBRTC candidates.
MQTTListenerHandleLiveHDCandidates(c, hubKey, configuration, communication)
// Create a susbcription to listen for ONVIF actions: e.g. PTZ, Zoom, etc.
MQTTListenerHandleONVIF(c, hubKey, configuration, communication)
hubKey := ""
// This is the old way ;)
if config.Cloud == "s3" && config.S3 != nil && config.S3.Publickey != "" {
hubKey = config.S3.Publickey
} else if config.Cloud == "kstorage" && config.KStorage != nil && config.KStorage.CloudKey != "" {
hubKey = config.KStorage.CloudKey
}
}
mqc := mqtt.NewClient(opts)
if token := mqc.Connect(); token.WaitTimeout(3 * time.Second) {
if token.Error() != nil {
log.Log.Error("ConfigureMQTT: unable to establish mqtt broker connection, error was: " + token.Error().Error())
// This is the new way ;)
if config.HubKey != "" {
hubKey = config.HubKey
}
if hubKey != "" {
rand.Seed(time.Now().UnixNano())
random := rand.Intn(100)
mqttClientID := config.Key + strconv.Itoa(random) // this random int is to avoid conflicts.
// This is a worked-around.
// current S3 (Kerberos Hub SAAS) is using a secured MQTT, where the client id,
// should match the kerberos hub key.
if config.Cloud == "s3" {
mqttClientID = config.Key
}
opts.SetClientID(mqttClientID)
log.Log.Info("ConfigureMQTT: Set ClientID " + mqttClientID)
rand.Seed(time.Now().UnixNano())
webrtc.CandidateArrays = make(map[string](chan string))
opts.OnConnect = func(c mqtt.Client) {
// We managed to connect to the MQTT broker, hurray!
log.Log.Info("ConfigureMQTT: " + mqttClientID + " connected to " + mqttURL)
// Create a subscription to know if send out a livestream or not.
MQTTListenerHandleLiveSD(c, hubKey, configuration, communication)
// Create a subscription for the WEBRTC livestream.
MQTTListenerHandleLiveHDHandshake(c, hubKey, configuration, communication)
// Create a subscription for keeping alive the WEBRTC livestream.
MQTTListenerHandleLiveHDKeepalive(c, hubKey, configuration, communication)
// Create a subscription to listen to the number of WEBRTC peers.
MQTTListenerHandleLiveHDPeers(c, hubKey, configuration, communication)
// Create a subscription to listen for WEBRTC candidates.
MQTTListenerHandleLiveHDCandidates(c, hubKey, configuration, communication)
// Create a susbcription to listen for ONVIF actions: e.g. PTZ, Zoom, etc.
MQTTListenerHandleONVIF(c, hubKey, configuration, communication)
}
}
mqc := mqtt.NewClient(opts)
if token := mqc.Connect(); token.WaitTimeout(3 * time.Second) {
if token.Error() != nil {
log.Log.Error("ConfigureMQTT: unable to establish mqtt broker connection, error was: " + token.Error().Error())
}
}
return mqc
}
return mqc
return nil
}
func MQTTListenerHandleLiveSD(mqttClient mqtt.Client, hubKey string, configuration *models.Configuration, communication *models.Communication) {
@@ -186,6 +193,16 @@ func MQTTListenerHandleONVIF(mqttClient mqtt.Client, hubKey string, configuratio
})
}
func DisconnectMQTT(mqttClient mqtt.Client) {
mqttClient.Disconnect(1000)
func DisconnectMQTT(mqttClient mqtt.Client, config *models.Config) {
if mqttClient != nil {
// Cleanup all subscriptions.
mqttClient.Unsubscribe("kerberos/" + config.HubKey + "/device/" + config.Key + "/request-live")
mqttClient.Unsubscribe(config.Key + "/register")
mqttClient.Unsubscribe("kerberos/webrtc/keepalivehub/" + config.Key)
mqttClient.Unsubscribe("kerberos/webrtc/peers/" + config.Key)
mqttClient.Unsubscribe("candidate/cloud")
mqttClient.Unsubscribe("kerberos/onvif/" + config.Key)
mqttClient.Disconnect(1000)
mqttClient = nil
}
}

View File

@@ -0,0 +1,177 @@
package websocket
import (
"context"
"encoding/base64"
"net/http"
"sync"
"github.com/gin-gonic/gin"
"github.com/gorilla/websocket"
"github.com/kerberos-io/agent/machinery/src/computervision"
"github.com/kerberos-io/agent/machinery/src/log"
"github.com/kerberos-io/agent/machinery/src/models"
"github.com/kerberos-io/joy4/cgo/ffmpeg"
)
type Message struct {
ClientID string `json:"client_id" bson:"client_id"`
MessageType string `json:"message_type" bson:"message_type"`
Message map[string]string `json:"message" bson:"message"`
}
type Connection struct {
Socket *websocket.Conn
mu sync.Mutex
Cancels map[string]context.CancelFunc
}
// Concurrency handling - sending messages
func (c *Connection) WriteJson(message Message) error {
c.mu.Lock()
defer c.mu.Unlock()
return c.Socket.WriteJSON(message)
}
func (c *Connection) WriteMessage(bytes []byte) error {
c.mu.Lock()
defer c.mu.Unlock()
return c.Socket.WriteMessage(websocket.TextMessage, bytes)
}
var sockets = make(map[string]*Connection)
var upgrader = websocket.Upgrader{
CheckOrigin: func(r *http.Request) bool {
return true
},
}
func WebsocketHandler(c *gin.Context, communication *models.Communication) {
w := c.Writer
r := c.Request
conn, err := upgrader.Upgrade(w, r, nil)
// error handling here
if err == nil {
defer conn.Close()
var message Message
err = conn.ReadJSON(&message)
clientID := message.ClientID
if sockets[clientID] == nil {
connection := new(Connection)
connection.Socket = conn
sockets[clientID] = connection
sockets[clientID].Cancels = make(map[string]context.CancelFunc)
}
// Continuously read messages
for {
switch message.MessageType {
case "hello":
m := message.Message
bePolite := Message{
ClientID: clientID,
MessageType: "hello-back",
Message: map[string]string{
"message": "Hello " + m["client_id"] + "!",
},
}
sockets[clientID].WriteJson(bePolite)
case "stop-sd":
_, exists := sockets[clientID].Cancels["stream-sd"]
if exists {
sockets[clientID].Cancels["stream-sd"]()
delete(sockets[clientID].Cancels, "stream-sd")
} else {
log.Log.Error("Streaming sd does not exists for " + clientID)
}
case "stream-sd":
startStrean := Message{
ClientID: clientID,
MessageType: "stream-sd",
Message: map[string]string{
"message": "Start streaming low resolution",
},
}
sockets[clientID].WriteJson(startStrean)
_, exists := sockets[clientID].Cancels["stream-sd"]
if exists {
log.Log.Info("Already streaming sd for " + clientID)
} else {
ctx, cancel := context.WithCancel(context.Background())
sockets[clientID].Cancels["stream-sd"] = cancel
go ForwardSDStream(ctx, clientID, sockets[clientID], communication)
}
}
err = conn.ReadJSON(&message)
if err != nil {
break
}
}
// If clientID is in sockets
_, exists := sockets[clientID]
if exists {
delete(sockets, clientID)
log.Log.Info("WebsocketHandler: " + clientID + ": terminated and disconnected websocket connection.")
}
}
}
func ForwardSDStream(ctx context.Context, clientID string, connection *Connection, communication *models.Communication) {
queue := communication.Queue
cursor := queue.Latest()
decoder := communication.Decoder
decoderMutex := communication.DecoderMutex
// Allocate ffmpeg.VideoFrame
frame := ffmpeg.AllocVideoFrame()
logreader:
for {
var encodedImage string
if queue != nil && cursor != nil && decoder != nil {
pkt, err := cursor.ReadPacket()
if err == nil {
if !pkt.IsKeyFrame {
continue
}
img, err := computervision.GetRawImage(frame, pkt, decoder, decoderMutex)
if err == nil {
bytes, _ := computervision.ImageToBytes(&img.Image)
encodedImage = base64.StdEncoding.EncodeToString(bytes)
}
} else {
log.Log.Error("ForwardSDStream:" + err.Error())
break logreader
}
}
startStrean := Message{
ClientID: clientID,
MessageType: "image",
Message: map[string]string{
"base64": encodedImage,
},
}
err := connection.WriteJson(startStrean)
if err != nil {
log.Log.Error("ForwardSDStream:" + err.Error())
break logreader
}
select {
case <-ctx.Done():
break logreader
default:
}
}
frame.Free()
log.Log.Info("ForwardSDStream: stop sending streaming over websocket")
}

View File

@@ -2,18 +2,106 @@ package utils
import (
"bytes"
"errors"
"fmt"
"io/ioutil"
"math/rand"
"os"
"os/exec"
"path/filepath"
"reflect"
"sort"
"strconv"
"strings"
"time"
"github.com/kerberos-io/agent/machinery/src/log"
"github.com/kerberos-io/agent/machinery/src/models"
)
const letterBytes = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"
// MaxUint8 - maximum value which can be held in an uint8
const MaxUint8 = ^uint8(0)
// MinUint8 - minimum value which can be held in an uint8
const MinUint8 = 0
// MaxUint16 - maximum value which can be held in an uint16
const MaxUint16 = ^uint16(0)
// MinUint16 - minimum value which can be held in an uint8
const MinUint16 = 0
const (
letterIdxBits = 6 // 6 bits to represent a letter index
letterIdxMask = 1<<letterIdxBits - 1 // All 1-bits, as many as letterIdxBits
letterIdxMax = 63 / letterIdxBits // # of letter indices fitting in 63 bits
)
func PrintASCIIArt() {
asciiArt := ` _ __ _ _
| |/ /___ _ __| |__ ___ _ __ ___ ___ (_) ___
| ' // _ \ '__| '_ \ / _ \ '__/ _ \/ __| | |/ _ \
| . \ __/ | | |_) | __/ | | (_) \__ \_| | (_) |
|_|\_\___|_| |_.__/ \___|_| \___/|___(_)_|\___/
`
fmt.Println(asciiArt)
}
func DirSize(path string) (int64, error) {
var size int64
err := filepath.Walk(path, func(_ string, info os.FileInfo, err error) error {
if err != nil {
return err
}
if !info.IsDir() {
size += info.Size()
}
return err
})
return size, err
}
func FindOldestFile(dir string) (oldestFile os.FileInfo, err error) {
files, err := ioutil.ReadDir(dir)
if err != nil {
return
}
oldestTime := time.Now()
for _, file := range files {
if file.Mode().IsRegular() && file.ModTime().Before(oldestTime) {
oldestFile = file
oldestTime = file.ModTime()
}
}
if oldestFile == nil {
err = os.ErrNotExist
}
return
}
func RandStringBytesMaskImpr(n int) string {
b := make([]byte, n)
// A rand.Int63() generates 63 random bits, enough for letterIdxMax letters!
for i, cache, remain := n-1, rand.Int63(), letterIdxMax; i >= 0; {
if remain == 0 {
cache, remain = rand.Int63(), letterIdxMax
}
if idx := int(cache & letterIdxMask); idx < len(letterBytes) {
b[i] = letterBytes[idx]
i--
}
cache >>= letterIdxBits
remain--
}
return string(b)
}
func CountDigits(i int64) (count int) {
for i != 0 {
i /= 10
@@ -22,15 +110,164 @@ func CountDigits(i int64) (count int) {
return count
}
func CheckDataDirectoryPermissions() error {
recordingsDirectory := "./data/recordings"
configDirectory := "./data/config"
snapshotsDirectory := "./data/snapshots"
cloudDirectory := "./data/cloud"
err := CheckDirectoryPermissions(recordingsDirectory)
if err == nil {
err = CheckDirectoryPermissions(configDirectory)
if err == nil {
err = CheckDirectoryPermissions(snapshotsDirectory)
if err == nil {
err = CheckDirectoryPermissions(cloudDirectory)
}
}
}
if err != nil {
log.Log.Error("Checking data directory permissions: " + err.Error())
return err
}
log.Log.Info("Checking data directory permissions: OK")
return nil
}
func CheckDirectoryPermissions(directory string) error {
// Check if the directory exists
if _, err := os.Stat(directory); os.IsNotExist(err) {
return errors.New("Directory does not exist, " + directory)
}
// Try to create a file
file := directory + "/.test"
f, err := os.Create(file)
if f != nil {
defer f.Close()
}
// We will remove the file if it was created
if err == nil {
err := os.Remove(file)
if err == nil {
return nil
} else {
return errors.New("Problem deleting a file: " + err.Error())
}
}
return errors.New("Problem creating a file: " + err.Error())
}
func ReadDirectory(directory string) ([]os.FileInfo, error) {
ff, err := ioutil.ReadDir(directory)
if err != nil {
log.Log.Error(err.Error())
return []os.FileInfo{}, nil
}
return ff, err
}
func GetSortedDirectory(files []os.FileInfo) []os.FileInfo {
sort.Slice(files, func(i, j int) bool {
return files[i].ModTime().After(files[j].ModTime())
})
return files
}
func GetMediaFormatted(files []os.FileInfo, recordingDirectory string, configuration *models.Configuration, eventFilter models.EventFilter) []models.Media {
filePaths := []models.Media{}
count := 0
for _, file := range files {
fileName := file.Name()
fileParts := strings.Split(fileName, "_")
if len(fileParts) == 6 {
timestamp := fileParts[0]
timestampInt, err := strconv.ParseInt(timestamp, 10, 64)
if err == nil {
// If we have an offset we will check if we should skip or not
if eventFilter.TimestampOffsetEnd > 0 {
// Medias are sorted from new to older. TimestampOffsetEnd holds the oldest
// timestamp of the previous batch of events. By doing this check, we make sure
// to skip the previous batch.
if timestampInt >= eventFilter.TimestampOffsetEnd {
continue
}
}
loc, _ := time.LoadLocation(configuration.Config.Timezone)
time := time.Unix(timestampInt, 0).In(loc)
day := time.Format("02-01-2006")
timeString := time.Format("15:04:05")
shortDay := time.Format("Jan _2")
media := models.Media{
Key: fileName,
Path: recordingDirectory + "/" + fileName,
CameraName: configuration.Config.Name,
CameraKey: configuration.Config.Key,
Day: day,
ShortDay: shortDay,
Time: timeString,
Timestamp: timestamp,
}
filePaths = append(filePaths, media)
count = count + 1
if eventFilter.NumberOfElements > 0 && count >= eventFilter.NumberOfElements {
break
}
}
}
}
return filePaths
}
func GetDays(files []os.FileInfo, recordingDirectory string, configuration *models.Configuration) []string {
days := []string{}
for _, file := range files {
fileName := file.Name()
fileParts := strings.Split(fileName, "_")
if len(fileParts) == 6 {
timestamp := fileParts[0]
timestampInt, err := strconv.ParseInt(timestamp, 10, 64)
if err == nil {
loc, _ := time.LoadLocation(configuration.Config.Timezone)
time := time.Unix(timestampInt, 0).In(loc)
day := time.Format("02-01-2006")
days = append(days, day)
}
}
}
uniqueDays := Unique(days)
return uniqueDays
}
func Unique(intSlice []string) []string {
keys := make(map[string]bool)
list := []string{}
for _, entry := range intSlice {
if _, value := keys[entry]; !value {
keys[entry] = true
list = append(list, entry)
}
}
return list
}
func NumberOfFilesInDirectory(path string) int {
files, _ := ioutil.ReadDir(path)
return len(files)
}
// NumberOfMP4sInDirectory returns the count of all files with mp4 extension in current directory
func NumberOfMP4sInDirectory(path string) int {
pattern := filepath.Join(path, "*.mp4")
files, _ := filepath.Glob(pattern)
return len(files)
}
func RandStringBytesRmndr(n int) string {
b := make([]byte, n)
for i := range b {
@@ -42,7 +279,8 @@ func RandStringBytesRmndr(n int) string {
func CreateFragmentedMP4(fullName string, fragmentedDuration int64) {
path, _ := os.Getwd()
duration := fragmentedDuration * 1000
cmd := exec.Command("mp4fragment", "--fragment-duration", strconv.FormatInt(duration, 10), fullName, fullName+"f.mp4")
// This timescale is crucial, as it should be the same as the one defined in JOY4.
cmd := exec.Command("mp4fragment", "--timescale", "10000000", "--fragment-duration", strconv.FormatInt(duration, 10), fullName, fullName+"f.mp4")
cmd.Dir = path
log.Log.Info(cmd.String())
var out bytes.Buffer
@@ -60,3 +298,35 @@ func CreateFragmentedMP4(fullName string, fragmentedDuration int64) {
os.Remove(fullName)
os.Rename(fullName+"f.mp4", fullName)
}
func PrintEnvironmentVariables() {
// Print environment variables that include "AGENT_" as a prefix.
environmentVariables := ""
for _, e := range os.Environ() {
if strings.Contains(e, "AGENT_") {
pair := strings.Split(e, "=")
environmentVariables = environmentVariables + pair[0] + "=" + pair[1] + " "
}
}
log.Log.Info("Printing out environmentVariables (AGENT_...): " + environmentVariables)
}
func PrintConfiguration(configuration *models.Configuration) {
// We will print out the struct.
if configuration == nil {
log.Log.Info("Configuration is nil")
return
}
config := configuration.Config
// Iterate over the struct and printout the values.
v := reflect.ValueOf(config)
typeOfS := v.Type()
configurationVariables := ""
for i := 0; i < v.NumField(); i++ {
key := typeOfS.Field(i).Name
value := v.Field(i).Interface()
// Convert to string.
configurationVariables = configurationVariables + key + ": " + fmt.Sprintf("%v", value) + " "
}
log.Log.Info("Printing our configuration (config.json): " + configurationVariables)
}

View File

@@ -5,8 +5,6 @@ import (
"encoding/json"
"fmt"
"io"
"runtime"
"runtime/debug"
"strconv"
"sync"
"sync/atomic"
@@ -106,7 +104,7 @@ func InitializeWebRTCConnection(configuration *models.Configuration, communicati
mediaEngine := &pionWebRTC.MediaEngine{}
if err := mediaEngine.RegisterDefaultCodecs(); err != nil {
panic("InitializeWebRTCConnection: something went wrong registering codecs.")
log.Log.Error("InitializeWebRTCConnection: something went wrong registering codecs.")
}
api := pionWebRTC.NewAPI(pionWebRTC.WithMediaEngine(mediaEngine))
@@ -127,89 +125,92 @@ func InitializeWebRTCConnection(configuration *models.Configuration, communicati
},
)
if _, err = peerConnection.AddTrack(track); err != nil {
panic(err)
}
if err == nil && peerConnection != nil {
_, err = peerConnection.AddTransceiverFromTrack(track,
pionWebRTC.RtpTransceiverInit{
Direction: pionWebRTC.RTPTransceiverDirectionSendonly,
},
)
if _, err = peerConnection.AddTrack(track); err != nil {
panic(err)
}
if err != nil {
panic(err)
}
_, err = peerConnection.AddTransceiverFromTrack(track,
pionWebRTC.RtpTransceiverInit{
Direction: pionWebRTC.RTPTransceiverDirectionSendonly,
},
)
peerConnection.OnICEConnectionStateChange(func(connectionState pionWebRTC.ICEConnectionState) {
if connectionState == pionWebRTC.ICEConnectionStateDisconnected {
atomic.AddInt64(&peerConnectionCount, -1)
peerConnections[handshake.Cuuid] = nil
close(candidates)
close(w.PacketsCount)
if err := peerConnection.Close(); err != nil {
panic(err)
}
runtime.GC()
debug.FreeOSMemory()
} else if connectionState == pionWebRTC.ICEConnectionStateConnected {
atomic.AddInt64(&peerConnectionCount, 1)
} else if connectionState == pionWebRTC.ICEConnectionStateChecking {
for candidate := range candidates {
log.Log.Info("InitializeWebRTCConnection: Received candidate.")
if candidateErr := peerConnection.AddICECandidate(pionWebRTC.ICECandidateInit{Candidate: string(candidate)}); candidateErr != nil {
if err != nil {
panic(err)
}
peerConnection.OnICEConnectionStateChange(func(connectionState pionWebRTC.ICEConnectionState) {
if connectionState == pionWebRTC.ICEConnectionStateDisconnected {
atomic.AddInt64(&peerConnectionCount, -1)
peerConnections[handshake.Cuuid] = nil
close(candidates)
close(w.PacketsCount)
if err := peerConnection.Close(); err != nil {
panic(err)
}
} else if connectionState == pionWebRTC.ICEConnectionStateConnected {
atomic.AddInt64(&peerConnectionCount, 1)
} else if connectionState == pionWebRTC.ICEConnectionStateChecking {
for candidate := range candidates {
log.Log.Info("InitializeWebRTCConnection: Received candidate.")
if candidateErr := peerConnection.AddICECandidate(pionWebRTC.ICECandidateInit{Candidate: string(candidate)}); candidateErr != nil {
}
}
}
}
log.Log.Info("InitializeWebRTCConnection: connection state changed to: " + connectionState.String())
log.Log.Info("InitializeWebRTCConnection: Number of peers connected (" + strconv.FormatInt(peerConnectionCount, 10) + ")")
})
log.Log.Info("InitializeWebRTCConnection: connection state changed to: " + connectionState.String())
log.Log.Info("InitializeWebRTCConnection: Number of peers connected (" + strconv.FormatInt(peerConnectionCount, 10) + ")")
})
offer := w.CreateOffer(sd)
if err = peerConnection.SetRemoteDescription(offer); err != nil {
panic(err)
}
//gatherCompletePromise := pionWebRTC.GatheringCompletePromise(peerConnection)
answer, err := peerConnection.CreateAnswer(nil)
if err != nil {
panic(err)
} else if err = peerConnection.SetLocalDescription(answer); err != nil {
panic(err)
}
// When an ICE candidate is available send to the other Pion instance
// the other Pion instance will add this candidate by calling AddICECandidate
var candidatesMux sync.Mutex
peerConnection.OnICECandidate(func(candidate *pionWebRTC.ICECandidate) {
if candidate == nil {
return
offer := w.CreateOffer(sd)
if err = peerConnection.SetRemoteDescription(offer); err != nil {
panic(err)
}
candidatesMux.Lock()
defer candidatesMux.Unlock()
//gatherCompletePromise := pionWebRTC.GatheringCompletePromise(peerConnection)
answer, err := peerConnection.CreateAnswer(nil)
if err != nil {
panic(err)
} else if err = peerConnection.SetLocalDescription(answer); err != nil {
panic(err)
}
// When an ICE candidate is available send to the other Pion instance
// the other Pion instance will add this candidate by calling AddICECandidate
var candidatesMux sync.Mutex
peerConnection.OnICECandidate(func(candidate *pionWebRTC.ICECandidate) {
if candidate == nil {
return
}
candidatesMux.Lock()
defer candidatesMux.Unlock()
topic := fmt.Sprintf("%s/%s/candidate/edge", name, handshake.Cuuid)
log.Log.Info("InitializeWebRTCConnection: Send candidate to " + topic)
candiInit := candidate.ToJSON()
sdpmid := "0"
candiInit.SDPMid = &sdpmid
candi, err := json.Marshal(candiInit)
if err == nil {
log.Log.Info("InitializeWebRTCConnection:" + string(candi))
token := mqttClient.Publish(topic, 2, false, candi)
token.Wait()
}
})
peerConnections[handshake.Cuuid] = peerConnection
topic := fmt.Sprintf("%s/%s/candidate/edge", name, handshake.Cuuid)
log.Log.Info("InitializeWebRTCConnection: Send candidate to " + topic)
candiInit := candidate.ToJSON()
sdpmid := "0"
candiInit.SDPMid = &sdpmid
candi, err := json.Marshal(candiInit)
if err == nil {
log.Log.Info("InitializeWebRTCConnection:" + string(candi))
token := mqttClient.Publish(topic, 2, false, candi)
token.Wait()
topic := fmt.Sprintf("%s/%s/answer", name, handshake.Cuuid)
log.Log.Info("InitializeWebRTCConnection: Send SDP answer to " + topic)
mqttClient.Publish(topic, 2, false, []byte(base64.StdEncoding.EncodeToString([]byte(answer.SDP))))
}
})
peerConnections[handshake.Cuuid] = peerConnection
if err == nil {
topic := fmt.Sprintf("%s/%s/answer", name, handshake.Cuuid)
log.Log.Info("InitializeWebRTCConnection: Send SDP answer to " + topic)
mqttClient.Publish(topic, 2, false, []byte(base64.StdEncoding.EncodeToString([]byte(answer.SDP))))
}
} else {
log.Log.Error("InitializeWebRTCConnection: NewPeerConnection failed: " + err.Error())
}
}
@@ -229,10 +230,7 @@ func WriteToTrack(livestreamCursor *pubsub.QueueCursor, configuration *models.Co
// Later when we read a packet we need to figure out which track to send it to.
videoIdx := -1
audioIdx := -1
log.Log.Info("WriteToTrack: listing codecs.")
for i, codec := range codecs {
log.Log.Info("WriteToTrack: codec - " + codec.Type().String() + " found.")
log.Log.Info(codec.Type().String())
if codec.Type().String() == "H264" && videoIdx < 0 {
videoIdx = i
} else if codec.Type().String() == "PCM_MULAW" && audioIdx < 0 {
@@ -311,7 +309,8 @@ func WriteToTrack(livestreamCursor *pubsub.QueueCursor, configuration *models.Co
}
if config.Capture.TranscodingWebRTC == "true" {
decoderMutex.Lock()
/*decoderMutex.Lock()
decoder.SetFramerate(30, 1)
frame, err := decoder.Decode(pkt.Data)
decoderMutex.Unlock()
@@ -327,10 +326,8 @@ func WriteToTrack(livestreamCursor *pubsub.QueueCursor, configuration *models.Co
pkt = _outpkts[0]
codecData, _ = encoder.CodecData()
}
}
if frame != nil {
frame.Free()
}
}*/
}
switch int(pkt.Idx) {
@@ -367,7 +364,7 @@ func WriteToTrack(livestreamCursor *pubsub.QueueCursor, configuration *models.Co
}
} else {
if err := track.WriteSample(sample); err != nil && err != io.ErrClosedPipe {
fmt.Println("WriteToTrack: something went wrong while writing sample: " + err.Error())
log.Log.Error("WriteToTrack: something went wrong while writing sample: " + err.Error())
}
}
}

View File

@@ -18,6 +18,14 @@
"plugins": ["react"],
"rules": {
"class-methods-use-this": "off",
"react/forbid-prop-types": "off",
"no-case-declarations": "off",
"camelcase": "off",
"jsx-a11y/media-has-caption": "off",
"jsx-a11y/anchor-is-valid": "off",
"jsx-a11y/click-events-have-key-events": "off",
"jsx-a11y/no-noninteractive-element-interactions": "off",
"jsx-a11y/no-static-element-interactions": "off",
"jsx-a11y/label-has-associated-control": [
"error",
{

View File

@@ -1,3 +1,3 @@
{
"singleQuote": true
}
}

View File

@@ -4,39 +4,50 @@
"private": false,
"dependencies": {
"@giantmachines/redux-websocket": "^1.5.1",
"@kerberos-io/ui": "1.64.0",
"@material-ui/core": "^4.11.2",
"@testing-library/jest-dom": "^5.11.4",
"@testing-library/react": "^11.1.0",
"@testing-library/user-event": "^12.1.10",
"axios": "^0.21.1",
"classnames": "^2.2.6",
"connected-react-router": "^6.8.0",
"crypto-browserify": "^3.12.0",
"eslint-config-prettier": "^8.1.0",
"eslint-plugin-prettier": "^3.3.1",
"@kerberos-io/ui": "^1.72.0",
"@material-ui/core": "^4.12.4",
"@material-ui/icons": "^4.11.3",
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/react": "^11.2.7",
"@testing-library/user-event": "^12.8.3",
"axios": "^0.21.4",
"classnames": "^2.3.1",
"connected-react-router": "^6.9.3",
"eslint-config-prettier": "8.5.*",
"eslint-plugin-prettier": "4.2.*",
"eslint-watch": "^7.0.0",
"history": "4.10.1",
"prettier": "^2.2.1",
"prop-types": "^15.7.2",
"i18next": "^21.9.1",
"i18next-browser-languagedetector": "^6.1.5",
"i18next-http-backend": "^1.4.1",
"i18next-xhr-backend": "^3.2.2",
"md5": "^2.3.0",
"prettier": "^2.7.1",
"prop-types": "^15.8.1",
"react": "^17.0.1",
"react-dom": "^17.0.1",
"react-redux": "^7.2.2",
"react-dom": "^17.0.2",
"react-i18next": "^11.18.5",
"react-redux": "^7.2.8",
"react-router": "^5.2.0",
"react-router-dom": "^5.2.0",
"react-router-dom": "^5.3.3",
"react-router-redux": "^4.0.8",
"react-scripts": "^5.0.1",
"react-scripts": "5.*",
"react-tooltip": "^4.2.21",
"redux": "^4.0.5",
"redux-devtools-extension": "^2.13.8",
"redux-thunk": "^2.3.0",
"redux": "^4.2.0",
"redux-devtools-extension": "^2.13.9",
"redux-thunk": "^2.4.1",
"rxjs": "^7.5.6",
"typeface-roboto": "^1.1.13",
"vott-ct": "^2.2.27",
"uuidv4": "2.0.0",
"vott-ct": "^2.3.3",
"web-vitals": "^0.2.4"
},
"browser": {
"crypto": false
},
"scripts": {
"start": "react-scripts start",
"build": "GENERATE_SOURCEMAP=false react-scripts build && rm -rf ../machinery/www && mv build ../machinery/www",
"build": "GENERATE_SOURCEMAP=false REACT_APP_ENVIRONMENT=production react-scripts build && rm -rf ../machinery/www && mv build ../machinery/www",
"test": "react-scripts test",
"eject": "react-scripts eject",
"lint": "eslint --debug 'src/**/*.{js,jsx,ts,tsx}'",
@@ -55,13 +66,13 @@
]
},
"devDependencies": {
"eslint": "^7.22.0",
"eslint": "^7.32.0",
"eslint-config-airbnb": "^18.2.1",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-jsx-a11y": "^6.4.1",
"eslint-plugin-react": "^7.22.0",
"eslint-plugin-react-hooks": "^4.2.0",
"sass": "^1.52.2",
"sass-loader": "^10.2.0"
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-jsx-a11y": "^6.6.1",
"eslint-plugin-react": "^7.30.1",
"eslint-plugin-react-hooks": "^4.6.0",
"sass": "^1.54.4",
"sass-loader": "^10.3.1"
}
}

View File

@@ -1,5 +1,5 @@
(function(window) {
window["env"] = window["env"] || {};
(function (window) {
window['env'] = window['env'] || {};
// Environment variables
window["env"]["apiUrl"] = "http://api.factory.kerberos.io";
window['env']['apiUrl'] = 'http://api.factory.kerberos.io';
})(this);

View File

@@ -1,5 +1,5 @@
(function(window) {
window["env"] = window["env"] || {};
(function (window) {
window['env'] = window['env'] || {};
// Environment variables
window["env"]["apiUrl"] = "${FACTORY_API_URL}";
window['env']['apiUrl'] = '${FACTORY_API_URL}';
})(this);

View File

@@ -0,0 +1,207 @@
{
"breadcrumb": {
"watch_recordings": "Aufnahmen ansehen",
"configure": "Konfigurieren"
},
"buttons": {
"save": "Speichern"
},
"navigation": {
"profile": "Profil",
"admin": "admin",
"management": "Management",
"dashboard": "Übersicht",
"recordings": "Aufnahmen",
"settings": "Einstellungen",
"help_support": "Hilfe und Unterstützung",
"swagger": "Swagger API",
"documentation": "Dokumentation",
"ui_library": "UI Bibliothek",
"layout": "Sprache & Layout",
"choose_language": "Sprache wählen"
},
"dashboard": {
"title": "Übersicht",
"heading": "Übersicht der Videoüberwachung",
"number_of_days": "Anzahl der Tage",
"total_recordings": "Aufnahmen insgesamt",
"connected": "Verbunden",
"not_connected": "Nicht verbunden",
"offline_mode": "Offline Modus",
"latest_events": "Letzte Ereignisse",
"configure_connection": "Verbindungseinstellungen",
"no_events": "Keine Ereignisse",
"no_events_description": "Es konnten keine Ereignisse gefunden werden. Stelle sicher das der Kerberos Agent richtig konfiguriert ist.",
"motion_detected": "Bewegung erkannt",
"live_view": "Live Übertragung",
"loading_live_view": "Live Übertragung laden",
"loading_live_view_description": "Die Live Übertragung wird geladen. Sollte noch keine Kamera konfiguriert sein, kannst du dies in den Einstellungen machen.",
"time": "Zeit",
"description": "Beschreibung",
"name": "Name"
},
"recordings": {
"title": "Aufnahmen",
"heading": "Alle Aufnahmen an einem zentralen Ort",
"search_media": "Aufnahmen durchsuchen"
},
"settings": {
"title": "Einstellungen",
"heading": "Übersicht der Kamera und Agent Einstellungen",
"submenu": {
"all": "Alle Einstellungen",
"overview": "Übersicht",
"camera": "Kamera",
"recording": "Aufnahme",
"streaming": "Stream",
"conditions": "Kriterien",
"persistence": "Persistenz"
},
"info": {
"kerberos_hub_demo": "Um Kerberos Hub in Aktion zu sehen, schaue dir gerne unsere Demo an!",
"configuration_updated_success": "Die Einstellungen wurden erfolgreich gespeichert.",
"configuration_updated_error": "Beim speichern der Einstellungen ist ein Fehler aufgetreten!",
"verify_hub": "Überprüfen der Kerberos Hub Einstellungen.",
"verify_hub_success": "Die Kerberos Hub Einstellung wurden erfolgreich überprüft",
"verify_hub_error": "Beim überprüfen der Kerberos Hub Einstellungen ist ein Fehler aufgetreten",
"verify_persistence": "Überprüfen der Speichereinstellungen.",
"verify_persistence_success": "Die Speichereinstellungen wurden erfolgreich überprüft.",
"verify_persistence_error": "Beim überprüfen der Speichereinstellungen ist ein Fehler aufgetreten",
"verify_camera": "Überprüfen der Kameraeinstellungen.",
"verify_camera_success": "Die Kameraeinstellungen wurden erfolgreich überprüft.",
"verify_camera_error": "Beim überprüfen der Kameraeinstellungen ist ein Fehler aufgetreten"
},
"overview": {
"general": "Allgemein",
"description_general": "Allgemeine Einstellungen für den Kerberos Agent",
"key": "Schlüssel",
"camera_name": "Kamera Name",
"timezone": "Zeitzone",
"select_timezone": "Zeitzone auswählen",
"advanced_configuration": "Erweiterte Konfiguration",
"description_advanced_configuration": "Erweiterte Einstellungen um Funktionen des Kerberos Agent zu aktivieren oder deaktivieren",
"offline_mode": "Offline Modus",
"description_offline_mode": "Ausgehende Verbindungen deaktivieren"
},
"camera": {
"camera": "Kamera",
"description_camera": "Diese Einstellungen sind notwendig um eine Verbindung mit der Kamera herzustellen",
"only_h264": "Aktuell werden nur H264 RTSP kompatible Kameras unterstützt",
"rtsp_url": "RTSP URL",
"rtsp_h264": "H264 RTSP URL der Kamera",
"sub_rtsp_url": "RTSP url für die Live Übertragung.",
"sub_rtsp_h264": "Ergänzende URL der Kamera mit geringerer Auflösung für die Live Übertragung.",
"onvif": "ONVIF",
"description_onvif": "Zugangsdaten der ONVIF Funktionen der Kamera. Diese werden zur Steuerung der Kamera, falls vorhanden, verwendet.",
"onvif_xaddr": "ONVIF xaddr",
"onvif_username": "ONVIF Benutzername",
"onvif_password": "ONVIF Passwort",
"verify_connection": "Verbindung prüfen",
"verify_sub_connection": "Live Verbindung prüfen"
},
"recording": {
"recording": "Aufnahme",
"description_recording": "Einstellungen zum Aufnahmeverhalten. Aufnahmen können fortlaufend oder anhand der Bewegungserkennung geamcht werden.",
"continuous_recording": "Fortlaufende Aufnahme",
"description_continuous_recording": "24/7 oder Bewegungserkennung",
"max_duration": "Maximale Dauer der Aufnahme (Sekunden)",
"description_max_duration": "Maximale dauer der Aufnahme in Sekunden",
"pre_recording": "Vorlauf der Aufnahme (Sekunden)",
"description_pre_recording": "Sekunden vor der Erkennung einer Bewegung",
"post_recording": "Nachlauf der Aufnahme (Sekunden)",
"description_post_recording": "Sekunden nach der Erkennung einer Bewegung",
"threshold": "Schwellwert der Aufnahme (Pixel)",
"description_threshold": "Anzahl der geänderten Pixel die notwendig sind um die Aufnahem zu starten",
"autoclean": "Automatisches aufräumen",
"description_autoclean": "Der Kerberos Agent kann, wenn gewünscht, den Speicher automatisch aufräumen wenn ein vorgegebener Schwellwert erreicht ist. Es werden immer zuerst die ältesten Aufnahemn entfernt.",
"autoclean_enable": "Automatisches Aufräumen aktivieren",
"autoclean_description_enable": "Entferne die älteste Aufnahme wenn der Schwellwert erreicht wurde.",
"autoclean_max_directory_size": "Maximale Größe des Verzeichnisses (MB)",
"autoclean_description_max_directory_size": "Maximale größe der gespeichterten Aufnahmen im Verzeichnis in MB.",
"fragmentedrecordings": "Fragmentierte Aufnahmen",
"description_fragmentedrecordings": "Wenn die Aufnahmen fragmentiert werden können diese auch für HLS Übertragungen genutzt werden. Der Inhalt des MP4 Kontainers sieht dann anders aus.",
"fragmentedrecordings_enable": "Fragmentierung aktivieren",
"fragmentedrecordings_description_enable": "Die Fragmentierung muss aktiviert sein, wenn HLS verwendet werden soll.",
"fragmentedrecordings_duration": "Dauer eines Fragments",
"fragmentedrecordings_description_duration": "Dauer eines Fragments in Sekunden"
},
"streaming": {
"stun_turn": "STUN/TURN für WebRTC",
"description_stun_turn": "For full-resolution livestreaming we use the concept of WebRTC. One of the key capabilities is the ICE-candidate feature, which allows NAT traversal using the concepts of STUN/TURN.",
"stun_server": "STUN Server",
"turn_server": "TURN Server",
"turn_username": "Benutzername",
"turn_password": "Passwort",
"stun_turn_forward": "Weiterleiten und transkodieren",
"stun_turn_description_forward": "Optiemierungen und Verbesserungen der TURN/STUN Kommunikation.",
"stun_turn_webrtc": "Weiterleiten an WebRTC Schnittstelle",
"stun_turn_description_webrtc": "Weiterleiten der H264 Übertragung über MQTT",
"stun_turn_transcode": "Übertragung transkodieren",
"stun_turn_description_transcode": "Übertragung in geringerer Auflösung",
"stun_turn_downscale": "Reduzierung der Auflösung in % zur original Auflösung",
"mqtt": "MQTT",
"description_mqtt": "MQTT wird verwendet um Video und ONVIF von",
"description2_mqtt": "zum Kerberos Agent zu realisieren.",
"mqtt_brokeruri": "MQTT Uri",
"mqtt_username": "Benutzername",
"mqtt_password": "Passwort"
},
"conditions": {
"timeofinterest": "Zeitraum",
"description_timeofinterest": "Aufnahmen nur in einem vorgegebenen Zeitraum erfassen. Hierzu sollte die Zeitzone in den Einstellungen korrekt hinterlegt sein.",
"timeofinterest_enabled": "Aktivieren",
"timeofinterest_description_enabled": "Wenn aktiviert, kann der Zeitraum der Aufnahmen definiert werden",
"sunday": "Sonntag",
"monday": "Montag",
"tuesday": "Dienstag",
"wednesday": "Mittwoch",
"thursday": "Donnerstag",
"friday": "Freitag",
"saturday": "Samstag",
"externalcondition": "Externe Aufnahmekriterien",
"description_externalcondition": "Anhand einer externer Kriterien kann die Aufnahme aktiviert oder deaktiviert werden.",
"regionofinterest": "Aufnahmebereich",
"description_regionofinterest": "Durch das definieren von Aufnahmebereichen kann gesteuert werden, in welchem Bereich Bewegungen erfasst werden sollen."
},
"persistence": {
"kerberoshub": "Kerberos Hub",
"description_kerberoshub": "Kerberos Agents können Zustandsinformationen an eine Zentrale",
"description2_kerberoshub": "installation senden. Zustands- und relevante Systeminformationen werden zentral abgelegt um einen Überblick über die Videoüberwachung zu erhalten.",
"persistence": "Persistenz",
"saasoffering": "Kerberos Hub (SAAS Angebot)",
"description_persistence": "Die möglichkeit zur Speicherung der Daten an einem Zentralen Ort ist der Beginn einer effektiven Videoüberwachung. Es kann zwischen",
"description2_persistence": ", oder einem Drittanbieter gewählt werden.",
"select_persistence": "Speicherort auswählen",
"kerberoshub_proxyurl": "Kerberos Hub Proxy URL",
"kerberoshub_description_proxyurl": "Der Proxy Endpunkt zum hochladen der Aufnahmen.",
"kerberoshub_apiurl": "Kerberos Hub API URL",
"kerberoshub_description_apiurl": "Der API Endpunkt zum hochladen der Aufnahmen.",
"kerberoshub_publickey": "Öffentlicher Schlüssel",
"kerberoshub_description_publickey": "Der öffentliche Schlüssel des Kerberos Hub Accounts.",
"kerberoshub_privatekey": "Privater Schlüssel",
"kerberoshub_description_privatekey": "Der private Schlüssel des Kerberos Hub Accounts.",
"kerberoshub_site": "Standort",
"kerberoshub_description_site": "Die Standort ID zu der die Daten im Kerberos Hub gehören.",
"kerberoshub_region": "Region",
"kerberoshub_description_region": "Die Region in der die Aufnahmen gespeichert werden sollen.",
"kerberoshub_bucket": "Bucket",
"kerberoshub_description_bucket": "Der Bucket in dem die Aufnahmen gespeichert werden.",
"kerberoshub_username": "Benutzername/Verzeichnis",
"kerberoshub_description_username": "Der Benutzername des Kerberos Hub Accounts.",
"kerberosvault_apiurl": "Kerberos Vault API URL",
"kerberosvault_description_apiurl": "Die Kerberos Vault API URL.",
"kerberosvault_provider": "Anbieter",
"kerberosvault_description_provider": "Der Anbieter zu dem die Aufnahmen gesendet werden.",
"kerberosvault_directory": "Verzeichnis",
"kerberosvault_description_directory": "Das Uneterverzeichnis in dem die Aufnahmen gespeichert werden sollen.",
"kerberosvault_accesskey": "Zugriffsschlüssel",
"kerberosvault_description_accesskey": "Der Zugriffsschlüssel des Kerberos Vault Accounts..",
"kerberosvault_secretkey": "Geheimer Schlüssel",
"kerberosvault_description_secretkey": "Der geheime Schlüssel des Kerberos Vault Accounts.",
"verify_connection": "Verbindung prüfen",
"remove_after_upload": "Once recordings are uploaded to some persistence, you might want to remove them from the local Kerberos Agent.",
"remove_after_upload_description": "Remove recordings after they are uploaded successfully.",
"remove_after_upload_enabled": "Enabled delete on upload"
}
}
}

View File

@@ -0,0 +1,207 @@
{
"breadcrumb": {
"watch_recordings": "Watch recordings",
"configure": "Configure"
},
"buttons": {
"save": "Save"
},
"navigation": {
"profile": "Profile",
"admin": "admin",
"management": "Management",
"dashboard": "Dashboard",
"recordings": "Recordings",
"settings": "Settings",
"help_support": "Help & Support",
"swagger": "Swagger API",
"documentation": "Documentation",
"ui_library": "UI Library",
"layout": "Language & Layout",
"choose_language": "Choose language"
},
"dashboard": {
"title": "Dashboard",
"heading": "Overview of your video surveilance",
"number_of_days": "Number of days",
"total_recordings": "Total recordings",
"connected": "Connected",
"not_connected": "Not connected",
"offline_mode": "Offline mode",
"latest_events": "Latest events",
"configure_connection": "Configure connection",
"no_events": "No events",
"no_events_description": "No recordings where found, make sure your Kerberos Agent is properly configured.",
"motion_detected": "Motion was detected",
"live_view": "Live view",
"loading_live_view": "Loading live view",
"loading_live_view_description": "Hold on we are loading your live view here. If you didn't configure your camera connection, update it on the settings pages.",
"time": "Time",
"description": "Description",
"name": "Name"
},
"recordings": {
"title": "Recordings",
"heading": "All your recordings in a single place",
"search_media": "Search media"
},
"settings": {
"title": "Settings",
"heading": "Onboard your camera",
"submenu": {
"all": "All",
"overview": "Overview",
"camera": "Camera",
"recording": "Recording",
"streaming": "Streaming",
"conditions": "Conditions",
"persistence": "Persistence"
},
"info": {
"kerberos_hub_demo": "Have a look at our Kerberos Hub demo environment, to see Kerberos Hub in action!",
"configuration_updated_success": "Your configuration have been updated successfully.",
"configuration_updated_error": "Something went wrong while saving.",
"verify_hub": "Verifying your Kerberos Hub settings.",
"verify_hub_success": "Kerberos Hub settings are successfully verified.",
"verify_hub_error": "Something went wrong while verifying Kerberos Hub",
"verify_persistence": "Verifying your persistence settings.",
"verify_persistence_success": "Persistence settings are successfully verified.",
"verify_persistence_error": "Something went wrong while verifying the persistence",
"verify_camera": "Verifying your camera settings.",
"verify_camera_success": "Camera settings are successfully verified.",
"verify_camera_error": "Something went wrong while verifying the camera settings"
},
"overview": {
"general": "General",
"description_general": "General settings for your Kerberos Agent",
"key": "Key",
"camera_name": "Camera name",
"timezone": "Timezone",
"select_timezone": "Select a timezone",
"advanced_configuration": "Advanced configuration",
"description_advanced_configuration": "Detailed configuration options to enable or disable specific parts of the Kerberos Agent",
"offline_mode": "Offline mode",
"description_offline_mode": "Disable all outgoing traffic"
},
"camera": {
"camera": "Camera",
"description_camera": "Camera settings are required to make a connection to your camera of choice.",
"only_h264": "Currently only H264 RTSP streams are supported.",
"rtsp_url": "RTSP url",
"rtsp_h264": "A H264 RTSP connection to your camera.",
"sub_rtsp_url": "Sub RTSP url (used for livestreaming)",
"sub_rtsp_h264": "A secondary RTSP connection to the low resolution of your camera.",
"onvif": "ONVIF",
"description_onvif": "Credentials to communicate with ONVIF capabilities. These are used for PTZ or other capabilities provided by the camera.",
"onvif_xaddr": "ONVIF xaddr",
"onvif_username": "ONVIF username",
"onvif_password": "ONVIF password",
"verify_connection": "Verify Connection",
"verify_sub_connection": "Verify Sub Connection"
},
"recording": {
"recording": "Recording",
"description_recording": "Specify how you would like to make recordings. Having a continuous 24/7 setup or a motion based recording.",
"continuous_recording": "Continuous recording",
"description_continuous_recording": "Make 24/7 or motion based recordings.",
"max_duration": "max video duration (seconds)",
"description_max_duration": "The maximum duration of a recording.",
"pre_recording": "pre recording (key frames buffered)",
"description_pre_recording": "Seconds before an event occurred.",
"post_recording": "post recording (seconds)",
"description_post_recording": "Seconds after an event occurred.",
"threshold": "Recording threshold (pixels)",
"description_threshold": "The number of pixels changed to record",
"autoclean": "Auto clean",
"description_autoclean": "Specify if the Kerberos Agent can cleanup recordings when a specific storage capacity (MB) is reached. This will remove the oldest recordings when the capacity is reached.",
"autoclean_enable": "Enable auto clean",
"autoclean_description_enable": "Remove oldest recording when capacity reached.",
"autoclean_max_directory_size": "Maximum directory size (MB)",
"autoclean_description_max_directory_size": "The maximum MB's of recordings stored.",
"fragmentedrecordings": "Fragmented recordings",
"description_fragmentedrecordings": "When recordings are fragmented they are suitable for an HLS stream. When turned on the MP4 container will look a bit different.",
"fragmentedrecordings_enable": "Enable fragmentation",
"fragmentedrecordings_description_enable": "Fragmented recordings are required for HLS.",
"fragmentedrecordings_duration": "fragment duration",
"fragmentedrecordings_description_duration": "Duration of a single fragment."
},
"streaming": {
"stun_turn": "STUN/TURN for WebRTC",
"description_stun_turn": "For full-resolution livestreaming we use the concept of WebRTC. One of the key capabilities is the ICE-candidate feature, which allows NAT traversal using the concepts of STUN/TURN.",
"stun_server": "STUN server",
"turn_server": "TURN server",
"turn_username": "Username",
"turn_password": "Password",
"stun_turn_forward": "Forwarding and transcoding",
"stun_turn_description_forward": "Optimisations and enhancements for TURN/STUN communication.",
"stun_turn_webrtc": "Forwarding to WebRTC broker",
"stun_turn_description_webrtc": "Forward h264 stream through MQTT",
"stun_turn_transcode": "Transcode stream",
"stun_turn_description_transcode": "Convert stream to a lower resolution",
"stun_turn_downscale": "Downscale resolution (in % or original resolution)",
"mqtt": "MQTT",
"description_mqtt": "A MQTT broker is used to communicate from",
"description2_mqtt": "to the Kerberos Agent, to achieve for example livestreaming or ONVIF (PTZ) capabilities.",
"mqtt_brokeruri": "Broker Uri",
"mqtt_username": "Username",
"mqtt_password": "Password"
},
"conditions": {
"timeofinterest": "Time Of Interest",
"description_timeofinterest": "Only make recordings between specific time intervals (based on timezone).",
"timeofinterest_enabled": "Enabled",
"timeofinterest_description_enabled": "If enabled you can specify time windows",
"sunday": "Sunday",
"monday": "Monday",
"tuesday": "Tuesday",
"wednesday": "Wednesday",
"thursday": "Thursday",
"friday": "Friday",
"saturday": "Saturday",
"externalcondition": "External Condition",
"description_externalcondition": "Depending on an external webservice recording can be enabled or disabled.",
"regionofinterest": "Region Of Interest",
"description_regionofinterest": "By defining one or more regions, motion will be tracked only in the regions you have defined."
},
"persistence": {
"kerberoshub": "Kerberos Hub",
"description_kerberoshub": "Kerberos Agents can send heartbeats to a central",
"description2_kerberoshub": "installation. Heartbeats and other relevant information are synced to Kerberos Hub to show realtime information about your video landscape.",
"persistence": "Persistence",
"saasoffering": "Kerberos Hub (SAAS offering)",
"description_persistence": "Having the ability to store your recordings is the beginning of everything. You can choose between our",
"description2_persistence": ", or a 3rd party provider",
"select_persistence": "Select a persistence",
"kerberoshub_proxyurl": "Kerberos Hub Proxy URL",
"kerberoshub_description_proxyurl": "The Proxy endpoint for uploading your recordings.",
"kerberoshub_apiurl": "Kerberos Hub API URL",
"kerberoshub_description_apiurl": "The API endpoint for uploading your recordings.",
"kerberoshub_publickey": "Public key",
"kerberoshub_description_publickey": "The public key granted to your Kerberos Hub account.",
"kerberoshub_privatekey": "Private key",
"kerberoshub_description_privatekey": "The private key granted to your Kerberos Hub account.",
"kerberoshub_site": "Site",
"kerberoshub_description_site": "The site ID the Kerberos Agents are belonging to in Kerberos Hub.",
"kerberoshub_region": "Region",
"kerberoshub_description_region": "The region we are storing our recordings in.",
"kerberoshub_bucket": "Bucket",
"kerberoshub_description_bucket": "The bucket we are storing our recordings in.",
"kerberoshub_username": "Username/Directory",
"kerberoshub_description_username": "The username of your Kerberos Hub account.",
"kerberosvault_apiurl": "Kerberos Vault API URL",
"kerberosvault_description_apiurl": "The Kerberos Vault API",
"kerberosvault_provider": "Provider",
"kerberosvault_description_provider": "The provider to which your recordings will be send.",
"kerberosvault_directory": "Directory",
"kerberosvault_description_directory": "Sub directory the recordings will be stored in your provider.",
"kerberosvault_accesskey": "Access key",
"kerberosvault_description_accesskey": "The access key of your Kerberos Vault account.",
"kerberosvault_secretkey": "Secret key",
"kerberosvault_description_secretkey": "The secret key of your Kerberos Vault account.",
"verify_connection": "Verify Connection",
"remove_after_upload": "Once recordings are uploaded to some persistence, you might want to remove them from the local Kerberos Agent.",
"remove_after_upload_description": "Remove recordings after they are uploaded successfully.",
"remove_after_upload_enabled": "Enabled delete on upload"
}
}
}

View File

@@ -0,0 +1,207 @@
{
"breadcrumb": {
"watch_recordings": "Watch recordings",
"configure": "Configure"
},
"buttons": {
"save": "Save"
},
"navigation": {
"profile": "Perfil",
"admin": "admin",
"management": "Administración",
"dashboard": "Tablero",
"recordings": "Grabaciones",
"settings": "Ajustes",
"help_support": "Servicio de asistencia",
"swagger": "Swagger API",
"documentation": "Documentación",
"ui_library": "UI Biblioteca",
"layout": "Idioma y diseño",
"choose_language": "Elige lengua"
},
"dashboard": {
"title": "Dashboard",
"heading": "Overview of your video surveilance",
"number_of_days": "Number of days",
"total_recordings": "Total recordings",
"connected": "Connected",
"not_connected": "Not connected",
"offline_mode": "Offline mode",
"latest_events": "Latest events",
"configure_connection": "Configure connection",
"no_events": "No events",
"no_events_description": "No recordings where found, make sure your Kerberos Agent is properly configured.",
"motion_detected": "Motion was detected",
"live_view": "Live view",
"loading_live_view": "Loading live view",
"loading_live_view_description": "Hold on we are loading your live view here. If you didn't configure your camera connection, update it on the settings pages.",
"time": "Time",
"description": "Description",
"name": "Name"
},
"recordings": {
"title": "Recordings",
"heading": "All your recordings in a single place",
"search_media": "Search media"
},
"settings": {
"title": "Settings",
"heading": "Onboard your camera",
"submenu": {
"all": "All",
"overview": "Overview",
"camera": "Camera",
"recording": "Recording",
"streaming": "Streaming",
"conditions": "Conditions",
"persistence": "Persistence"
},
"info": {
"kerberos_hub_demo": "Have a look at our Kerberos Hub demo environment, to see Kerberos Hub in action!",
"configuration_updated_success": "Your configuration have been updated successfully.",
"configuration_updated_error": "Something went wrong while saving.",
"verify_hub": "Verifying your Kerberos Hub settings.",
"verify_hub_success": "Kerberos Hub settings are successfully verified.",
"verify_hub_error": "Something went wrong while verifying Kerberos Hub",
"verify_persistence": "Verifying your persistence settings.",
"verify_persistence_success": "Persistence settings are successfully verified.",
"verify_persistence_error": "Something went wrong while verifying the persistence",
"verify_camera": "Verifying your camera settings.",
"verify_camera_success": "Camera settings are successfully verified.",
"verify_camera_error": "Something went wrong while verifying the camera settings"
},
"overview": {
"general": "General",
"description_general": "General settings for your Kerberos Agent",
"key": "Key",
"camera_name": "Camera name",
"timezone": "Timezone",
"select_timezone": "Select a timezone",
"advanced_configuration": "Advanced configuration",
"description_advanced_configuration": "Detailed configuration options to enable or disable specific parts of the Kerberos Agent",
"offline_mode": "Offline mode",
"description_offline_mode": "Disable all outgoing traffic"
},
"camera": {
"camera": "Camera",
"description_camera": "Camera settings are required to make a connection to your camera of choice.",
"only_h264": "Currently only H264 RTSP streams are supported.",
"rtsp_url": "RTSP url",
"rtsp_h264": "A H264 RTSP connection to your camera.",
"sub_rtsp_url": "Sub RTSP url (used for livestreaming)",
"sub_rtsp_h264": "A secondary RTSP connection to the low resolution of your camera.",
"onvif": "ONVIF",
"description_onvif": "Credentials to communicate with ONVIF capabilities. These are used for PTZ or other capabilities provided by the camera.",
"onvif_xaddr": "ONVIF xaddr",
"onvif_username": "ONVIF username",
"onvif_password": "ONVIF password",
"verify_connection": "Verify Connection",
"verify_sub_connection": "Verify Sub Connection"
},
"recording": {
"recording": "Recording",
"description_recording": "Specify how you would like to make recordings. Having a continuous 24/7 setup or a motion based recording.",
"continuous_recording": "Continuous recording",
"description_continuous_recording": "Make 24/7 or motion based recordings.",
"max_duration": "max video duration (seconds)",
"description_max_duration": "The maximum duration of a recording.",
"pre_recording": "pre recording (key frames buffered)",
"description_pre_recording": "Seconds before an event occurred.",
"post_recording": "post recording (seconds)",
"description_post_recording": "Seconds after an event occurred.",
"threshold": "Recording threshold (pixels)",
"description_threshold": "The number of pixels changed to record",
"autoclean": "Auto clean",
"description_autoclean": "Specify if the Kerberos Agent can cleanup recordings when a specific storage capacity (MB) is reached. This will remove the oldest recordings when the capacity is reached.",
"autoclean_enable": "Enable auto clean",
"autoclean_description_enable": "Remove oldest recording when capacity reached.",
"autoclean_max_directory_size": "Maximum directory size (MB)",
"autoclean_description_max_directory_size": "The maximum MB's of recordings stored.",
"fragmentedrecordings": "Fragmented recordings",
"description_fragmentedrecordings": "When recordings are fragmented they are suitable for an HLS stream. When turned on the MP4 container will look a bit different.",
"fragmentedrecordings_enable": "Enable fragmentation",
"fragmentedrecordings_description_enable": "Fragmented recordings are required for HLS.",
"fragmentedrecordings_duration": "fragment duration",
"fragmentedrecordings_description_duration": "Duration of a single fragment."
},
"streaming": {
"stun_turn": "STUN/TURN for WebRTC",
"description_stun_turn": "For full-resolution livestreaming we use the concept of WebRTC. One of the key capabilities is the ICE-candidate feature, which allows NAT traversal using the concepts of STUN/TURN.",
"stun_server": "STUN server",
"turn_server": "TURN server",
"turn_username": "Username",
"turn_password": "Password",
"stun_turn_forward": "Forwarding and transcoding",
"stun_turn_description_forward": "Optimisations and enhancements for TURN/STUN communication.",
"stun_turn_webrtc": "Forwarding to WebRTC broker",
"stun_turn_description_webrtc": "Forward h264 stream through MQTT",
"stun_turn_transcode": "Transcode stream",
"stun_turn_description_transcode": "Convert stream to a lower resolution",
"stun_turn_downscale": "Downscale resolution (in % or original resolution)",
"mqtt": "MQTT",
"description_mqtt": "A MQTT broker is used to communicate from",
"description2_mqtt": "to the Kerberos Agent, to achieve for example livestreaming or ONVIF (PTZ) capabilities.",
"mqtt_brokeruri": "Broker Uri",
"mqtt_username": "Username",
"mqtt_password": "Password"
},
"conditions": {
"timeofinterest": "Time Of Interest",
"description_timeofinterest": "Only make recordings between specific time intervals (based on timezone).",
"timeofinterest_enabled": "Enabled",
"timeofinterest_description_enabled": "If enabled you can specify time windows",
"sunday": "Sunday",
"monday": "Monday",
"tuesday": "Tuesday",
"wednesday": "Wednesday",
"thursday": "Thursday",
"friday": "Friday",
"saturday": "Saturday",
"externalcondition": "External Condition",
"description_externalcondition": "Depending on an external webservice recording can be enabled or disabled.",
"regionofinterest": "Region Of Interest",
"description_regionofinterest": "By defining one or more regions, motion will be tracked only in the regions you have defined."
},
"persistence": {
"kerberoshub": "Kerberos Hub",
"description_kerberoshub": "Kerberos Agents can send heartbeats to a central",
"description2_kerberoshub": "installation. Heartbeats and other relevant information are synced to Kerberos Hub to show realtime information about your video landscape.",
"persistence": "Persistence",
"saasoffering": "Kerberos Hub (SAAS offering)",
"description_persistence": "Having the ability to store your recordings is the beginning of everything. You can choose between our",
"description2_persistence": ", or a 3rd party provider",
"select_persistence": "Select a persistence",
"kerberoshub_proxyurl": "Kerberos Hub Proxy URL",
"kerberoshub_description_proxyurl": "The Proxy endpoint for uploading your recordings.",
"kerberoshub_apiurl": "Kerberos Hub API URL",
"kerberoshub_description_apiurl": "The API endpoint for uploading your recordings.",
"kerberoshub_publickey": "Public key",
"kerberoshub_description_publickey": "The public key granted to your Kerberos Hub account.",
"kerberoshub_privatekey": "Private key",
"kerberoshub_description_privatekey": "The private key granted to your Kerberos Hub account.",
"kerberoshub_site": "Site",
"kerberoshub_description_site": "The site ID the Kerberos Agents are belonging to in Kerberos Hub.",
"kerberoshub_region": "Region",
"kerberoshub_description_region": "The region we are storing our recordings in.",
"kerberoshub_bucket": "Bucket",
"kerberoshub_description_bucket": "The bucket we are storing our recordings in.",
"kerberoshub_username": "Username/Directory",
"kerberoshub_description_username": "The username of your Kerberos Hub account.",
"kerberosvault_apiurl": "Kerberos Vault API URL",
"kerberosvault_description_apiurl": "The Kerberos Vault API",
"kerberosvault_provider": "Provider",
"kerberosvault_description_provider": "The provider to which your recordings will be send.",
"kerberosvault_directory": "Directory",
"kerberosvault_description_directory": "Sub directory the recordings will be stored in your provider.",
"kerberosvault_accesskey": "Access key",
"kerberosvault_description_accesskey": "The access key of your Kerberos Vault account.",
"kerberosvault_secretkey": "Secret key",
"kerberosvault_description_secretkey": "The secret key of your Kerberos Vault account.",
"verify_connection": "Verify Connection",
"remove_after_upload": "Once recordings are uploaded to some persistence, you might want to remove them from the local Kerberos Agent.",
"remove_after_upload_description": "Remove recordings after they are uploaded successfully.",
"remove_after_upload_enabled": "Enabled delete on upload"
}
}
}

View File

@@ -0,0 +1,207 @@
{
"breadcrumb": {
"watch_recordings": "Visionner les enregistrements",
"configure": "Configurer"
},
"buttons": {
"save": "Enregistrer"
},
"navigation": {
"profile": "Profil",
"admin": "admin",
"management": "Gestion",
"dashboard": "Tableau de bord",
"recordings": "Enregistrements",
"settings": "Paramètres",
"help_support": "Aide et Support",
"swagger": "API Swagger",
"documentation": "Documentation",
"ui_library": "Bibliothèque UI",
"layout": "Langue et Mise en page",
"choose_language": "Choisissez la langue"
},
"dashboard": {
"title": "Tableau de bord",
"heading": "Vue d'ensemble de votre vidéosurveillance",
"number_of_days": "Nombre de jours",
"total_recordings": "Total d'enregistrements",
"connected": "Connexion établie",
"not_connected": "Pas de connexion",
"offline_mode": "Mode hors-ligne",
"latest_events": "Derniers événements",
"configure_connection": "Configurer la connexion",
"no_events": "Aucun événement",
"no_events_description": "Aucun enregistrement n'a été trouvé, assurez-vous de la bonne configuration de votre Agent Kerberos.",
"motion_detected": "Un mouvement a été détecté",
"live_view": "Visualiser le direct",
"loading_live_view": "Chargement de l'affichage en direct",
"loading_live_view_description": "Veuillez patienter, nous chargeons ici votre affichage en direct. Si vous n'avez pas configuré la connexion de votre caméra, mettez-la à jour dans les paramètres.",
"time": "Temps",
"description": "Description",
"name": "Nom"
},
"recordings": {
"title": "Enregistrements",
"heading": "Tout vos enregistrements au même endroit",
"search_media": "Rechercher un média"
},
"settings": {
"title": "Paramètres",
"heading": "A bord de votre caméra",
"submenu": {
"all": "Ensemble",
"overview": "Aperçu",
"camera": "Caméra",
"recording": "Enregistrement",
"streaming": "Diffusion continue",
"conditions": "Conditions",
"persistence": "Persistance"
},
"info": {
"kerberos_hub_demo": "Jeter un œil à notre environnement de démo Kerberos Hub, pour voir Kerberos Hub en action !",
"configuration_updated_success": "Votre configuration a été mise à jour avec succès.",
"configuration_updated_error": "Quelque chose s'est mal déroulé lors de la sauvegarde.",
"verify_hub": "Vérifier vos paramètres Kerberos Hub.",
"verify_hub_success": "Les paramètres Kerberos Hub sont vérifiés avec succès.",
"verify_hub_error": "Quelque chose s'est mal déroulé lors de la vérification Kerberos Hub",
"verify_persistence": "Vérifier vos paramètres de persistance.",
"verify_persistence_success": "Les paramètres de persistance sont vérifiés avec succès.",
"verify_persistence_error": "Quelque chose s'est mal déroulé lors de la vérification de la persistance",
"verify_camera": "Vérifier les paramètres de votre caméra.",
"verify_camera_success": "Les paramètres de la caméra sont vérifiés avec succès.",
"verify_camera_error": "Quelque chose s'est mal déroulé lors de la vérification des paramètres de la caméra"
},
"overview": {
"general": "Général",
"description_general": "Paramètres généraux pour votre Agent Kerberos",
"key": "Clé",
"camera_name": "Nom de la caméra",
"timezone": "Fuseau horaire",
"select_timezone": "Sélectionner un fuseau horaire",
"advanced_configuration": "Configuration avancée",
"description_advanced_configuration": "Les options de configuration détaillées pour activer ou désactiver des composants spécifiques de l'Agent Kerberos",
"offline_mode": "Mode hors-ligne",
"description_offline_mode": "Désactiver tout le trafic sortant"
},
"camera": {
"camera": "Caméra",
"description_camera": "Les paramètres de la caméra sont requis pour établir une connexion à la caméra de votre choix.",
"only_h264": "Actuellement, seuls les flux RTSP H264 sont pris en charge.",
"rtsp_url": "URL RTSP",
"rtsp_h264": "Une connexion RTSP H264 à votre caméra.",
"sub_rtsp_url": "URL RTSP secondaire (utilisé pour le direct)",
"sub_rtsp_h264": "Une connexion RTSP secondaire vers le flux basse résolution de votre caméra.",
"onvif": "ONVIF",
"description_onvif": "Les identifiants pour communiquer avec les fonctionnalités ONVIF. Ils sont utilisés pour les fonctionnalités PTZ ou autres fournies par la caméra.",
"onvif_xaddr": "Xaddr ONVIF",
"onvif_username": "Nom d'utilisateur ONVIF",
"onvif_password": "Mot de passe ONVIF",
"verify_connection": "Vérifier la connexion",
"verify_sub_connection": "Vérifier la connexion secondaire"
},
"recording": {
"recording": "Enregistrement",
"description_recording": "Préciser comment vous souhaitez réaliser les enregistrements, soit en ayant une installation enregistrant en continue 24 h/24 ou bien basée sur la détection de mouvement.",
"continuous_recording": "Enregistrement continu",
"description_continuous_recording": "Enregistrements 24 h/24 ou basés sur la détection de mouvement.",
"max_duration": "Durée maximale de la vidéo (en secondes)",
"description_max_duration": "La durée maximale d'un enregistrement.",
"pre_recording": "Pré-enregistrement (images mises en cache)",
"description_pre_recording": "Nombre de secondes avant qu'un événement ne se produise.",
"post_recording": "Post-enregistrement (en secondes)",
"description_post_recording": "Nombre de secondes après qu'un événement ne se produise.",
"threshold": "Seuil de déclenchement (en pixels)",
"description_threshold": "Le nombre de pixels ayant changé pour pour enregistrer",
"autoclean": "Nettoyage automatique",
"description_autoclean": "Préciser si l'Agent Kerberos peut supprimer des enregistrements lorsqu'une limite définie de stockage est atteinte (en Mo). Cela supprimera les enregistrements plus anciens lorsque la capacité sera atteinte.",
"autoclean_enable": "Activer le nettoyage automatique",
"autoclean_description_enable": "Supprimer les enregistrements plus anciens lorsque cette capacité est atteinte.",
"autoclean_max_directory_size": "Taille maximale du répertoire (en Mo)",
"autoclean_description_max_directory_size": "Le nombre maximum de Mo d'enregistrements stockés.",
"fragmentedrecordings": "Enregistrements fragmentés",
"description_fragmentedrecordings": "Lorsque les enregistrements sont fragmentés, ils conviennent à un flux HLS. A l'activation, le conteneur MP4 aura un aspect un peu différent.",
"fragmentedrecordings_enable": "Activer la fragmentation",
"fragmentedrecordings_description_enable": "Les enregistrements fragmentés sont requis pour le HLS.",
"fragmentedrecordings_duration": "Durée du fragment",
"fragmentedrecordings_description_duration": "Durée d'un seul fragment."
},
"streaming": {
"stun_turn": "STUN/TURN pour WebRTC",
"description_stun_turn": "Pour la diffusion continue en résolution intégrale nous utilisons le concept de WebRTC. Une des principales fonctionnalités est l'ICE-candidate, qui permet de traverser le NAT en utilisant les concepts de STUN/TURN.",
"stun_server": "Serveur STUN",
"turn_server": "Serveur TURN",
"turn_username": "Nom d'utilisateur",
"turn_password": "Mot de passe",
"stun_turn_forward": "Redirection et transcodage",
"stun_turn_description_forward": "Optimisations et améliorations pour la communication TURN/STUN.",
"stun_turn_webrtc": "Redirection pour l'agent WebRTC",
"stun_turn_description_webrtc": "Rediriger le flux H264 via MQTT",
"stun_turn_transcode": "Transcoder le flux",
"stun_turn_description_transcode": "Convertir le flux à une résolution inférieure",
"stun_turn_downscale": "Réduction de la résolution (en % ou résolution originale)",
"mqtt": "MQTT",
"description_mqtt": "Un agent de messages MQTT est utilisé pour communiquer depuis",
"description2_mqtt": "jusqu'à l'Agent Kerberos afin de permettre, par exemple, la diffusion continue ou des fonctionnalités ONVIF (PTZ).",
"mqtt_brokeruri": "Uri de l'agent de messages",
"mqtt_username": "Nom d'utilisateur",
"mqtt_password": "Mot de passe"
},
"conditions": {
"timeofinterest": "Période d'intérêt",
"description_timeofinterest": "Effectuer des enregistrements uniquement pendant un intervalle de temps défini (basé sur le fuseau horaire).",
"timeofinterest_enabled": "Activer",
"timeofinterest_description_enabled": "Si activé, vous pouvez préciser une plage horaire",
"sunday": "Dimanche",
"monday": "Lundi",
"tuesday": "Mardi",
"wednesday": "Mercredi",
"thursday": "Jeudi",
"friday": "Vendredi",
"saturday": "Samedi",
"externalcondition": "Condition externe",
"description_externalcondition": "En fonction d'un service Web externe, l'enregistrement peut-être activé ou désactivé.",
"regionofinterest": "Zone d'intérêt",
"description_regionofinterest": "En définissant une ou plusieurs zones, la détection de mouvement ne se fera qu'uniquement dans les zones que vous avez définies."
},
"persistence": {
"kerberoshub": "Kerberos Hub",
"description_kerberoshub": "Les Agents Kerberos peuvent envoyés des signaux de présence vers une installation centrale",
"description2_kerberoshub": ". Les signaux de présence et d'autres informations pertinentes sont synchronisés vers Kerberos Hub pour fournir des informations en temps réel de votre environnement vidéo.",
"persistence": "Persistance",
"saasoffering": "Kerberos Hub (offre SAAS)",
"description_persistence": "Avoir la possibilité de stocker vos enregistrements est le commencement de tout. Vous pouvez choisir entre notre",
"description2_persistence": " ou auprès d'un fournisseur tiers",
"select_persistence": "Sélectionner une persistance",
"kerberoshub_proxyurl": "URL du proxy Kerberos Hub",
"kerberoshub_description_proxyurl": "Le point de terminaison du proxy pour téléverser vos enregistrements.",
"kerberoshub_apiurl": "URL de l'API Kerberos Hub",
"kerberoshub_description_apiurl": "Le point de terminaison de l'API pour téléverser vos enregistrements.",
"kerberoshub_publickey": "Clé publique",
"kerberoshub_description_publickey": "La clé publique attribuée à votre compte Kerberos Hub.",
"kerberoshub_privatekey": "Clé privée",
"kerberoshub_description_privatekey": "La clé privée attribuée à votre compte Kerberos Hub.",
"kerberoshub_site": "Site",
"kerberoshub_description_site": "L'identifiant (ID) du site auquel appartiennent les Agents Kerberos dans Kerberos Hub.",
"kerberoshub_region": "Région",
"kerberoshub_description_region": "La région dans laquelle nous stockons vos enregistrements.",
"kerberoshub_bucket": "Compartiment",
"kerberoshub_description_bucket": "Le compartiment dans lequel nous stockons vos enregistrements.",
"kerberoshub_username": "Utilisateur/Répertoire",
"kerberoshub_description_username": "Le nom d'utilisateur de votre compte Kerberos Hub.",
"kerberosvault_apiurl": "URL de l'API Kerberos Vault",
"kerberosvault_description_apiurl": "L'API Kerberos Vault",
"kerberosvault_provider": "Fournisseur",
"kerberosvault_description_provider": "Le fournisseur auquel vos enregistrements seront envoyés.",
"kerberosvault_directory": "Répertoire",
"kerberosvault_description_directory": "Le sous-répertoire dans lequel les enregistrements seront stockés chez votre fournisseur.",
"kerberosvault_accesskey": "Clé d'accès",
"kerberosvault_description_accesskey": "La clé d'accès de votre compte Kerberos Vault.",
"kerberosvault_secretkey": "Clé secrète",
"kerberosvault_description_secretkey": "La clé secrète de votre compte Kerberos Vault.",
"verify_connection": "Vérifier la connexion",
"remove_after_upload": "Once recordings are uploaded to some persistence, you might want to remove them from the local Kerberos Agent.",
"remove_after_upload_description": "Remove recordings after they are uploaded successfully.",
"remove_after_upload_enabled": "Enabled delete on upload"
}
}
}

View File

@@ -0,0 +1,207 @@
{
"breadcrumb": {
"watch_recordings": "録画を見る",
"configure": "設定"
},
"buttons": {
"save": "保存"
},
"navigation": {
"profile": "プロフィール",
"admin": "管理者",
"management": "管理",
"dashboard": "ダッシュボード",
"recordings": "録画",
"settings": "設定",
"help_support": "ヘルプ",
"swagger": "Swagger API",
"documentation": "ドキュメンテーション",
"ui_library": "UI ライブラリ",
"layout": "言語",
"choose_language": "言語を選択"
},
"dashboard": {
"title": "ダッシュボード",
"heading": "ビデオ監視の概要",
"number_of_days": "日数",
"total_recordings": "録画一覧",
"connected": "接続済み",
"not_connected": "接続されていません",
"offline_mode": "オフラインモード",
"latest_events": "最新のイベント",
"configure_connection": "接続の構成",
"no_events": "イベントなし",
"no_events_description": "記録が見つかりません。Kerberos エージェントが正しく構成されていることを確認してください。",
"motion_detected": "モーションが検出されました",
"live_view": "ライブビュー",
"loading_live_view": "ライブビューを読み込んでいます",
"loading_live_view_description": "ライブ ビューをロードしています。お待ちください。",
"time": "時間",
"description": "説明",
"name": "名前"
},
"recordings": {
"title": "録画",
"heading": "すべての録音を 1 か所に",
"search_media": "メディアを検索"
},
"settings": {
"title": "設定",
"heading": "搭載カメラ",
"submenu": {
"all": "全て",
"overview": "概要",
"camera": "カメラ",
"recording": "録音",
"streaming": "ストリーミング",
"conditions": "条件",
"persistence": "持続性"
},
"info": {
"kerberos_hub_demo": "Kerberos Hub のデモ環境を見て、Kerberos Hub の動作を確認してください。",
"configuration_updated_success": "構成が正常に更新されました。",
"configuration_updated_error": "保存中にエラーが発生しました。",
"verify_hub": "Kerberos Hub の設定を確認しています。",
"verify_hub_success": "Kerberos Hub 設定が正常に検証されました。",
"verify_hub_error": "Kerberos Hub の検証中に問題が発生しました",
"verify_persistence": "持続性設定を確認しています。",
"verify_persistence_success": "持続性設定が正常に検証されました。",
"verify_persistence_error": "持続性の検証中に問題が発生しました",
"verify_camera": "カメラの設定を確認しています。",
"verify_camera_success": "カメラの設定が正常に検証されました。",
"verify_camera_error": "カメラ設定の確認中に問題が発生しました"
},
"overview": {
"general": "全般的",
"description_general": "Kerberos エージェントの一般設定",
"key": "鍵",
"camera_name": "カメラ名",
"timezone": "タイムゾーン",
"select_timezone": "タイムゾーンを選択",
"advanced_configuration": "詳細設定",
"description_advanced_configuration": "Kerberos エージェントの特定の部分を有効または無効にするための詳細な構成オプション",
"offline_mode": "オフラインモード",
"description_offline_mode": "すべての送信トラフィックを無効にする"
},
"camera": {
"camera": "カメラ",
"description_camera": "選択したカメラに接続するには、カメラの設定が必要です。",
"only_h264": "現在、H264 RTSP ストリームのみがサポートされています。",
"rtsp_url": "RTSP URL",
"rtsp_h264": "カメラへの H264 RTSP 接続。",
"sub_rtsp_url": "Sub RTSP url (ライブストリーミングに使用)",
"sub_rtsp_h264": "カメラの低解像度へのセカンダリ RTSP 接続。",
"onvif": "ONVIF",
"description_onvif": "ONVIF 機能と通信するための資格情報",
"onvif_xaddr": "ONVIF xaddr",
"onvif_username": "ONVIF ユーザー名",
"onvif_password": "ONVIF パスワード",
"verify_connection": "接続の確認",
"verify_sub_connection": "サブ接続の確認"
},
"recording": {
"recording": "録画",
"description_recording": "録画方法を指定します。",
"continuous_recording": "連続記録",
"description_continuous_recording": "24 時間またはモーション ベースの録画を行います。",
"max_duration": "動画の最大再生時間 (秒)",
"description_max_duration": "録音の最大継続時間。",
"pre_recording": "事前録画 (キー フレームのバッファリング)",
"description_pre_recording": "イベントが発生する数秒前。",
"post_recording": "ポストレコーディング (秒)",
"description_post_recording": "イベントが発生してからの秒数。",
"threshold": "記録閾値(ピクセル)",
"description_threshold": "記録するために変更されたピクセル数",
"autoclean": "オートクリーン",
"description_autoclean": "特定のストレージ容量 (MB) に達したときに、Kerberos エージェントが記録をクリーンアップできるかどうかを指定します。",
"autoclean_enable": "自動クリーニングを有効にする",
"autoclean_description_enable": "容量に達したら、最も古い記録を削除します。",
"autoclean_max_directory_size": "最大ディレクトリ サイズ (MB)",
"autoclean_description_max_directory_size": "保存された録音の最大 MB。",
"fragmentedrecordings": "断片化された録音",
"description_fragmentedrecordings": "録音が断片化されている場合、HLS ストリームに適しています。",
"fragmentedrecordings_enable": "断片化を有効にする",
"fragmentedrecordings_description_enable": "HLS には断片化された録音が必要です。",
"fragmentedrecordings_duration": "フラグメント期間",
"fragmentedrecordings_description_duration": "1 つのフラグメントの持続時間。"
},
"streaming": {
"stun_turn": "WebRTCのSTUN/TURN",
"description_stun_turn": "フル解像度のライブ ストリーミングには、WebRTC の概念を使用します。",
"stun_server": "STUNサーバー",
"turn_server": "TURNサーバー",
"turn_username": "ユーザー名",
"turn_password": "パスワード",
"stun_turn_forward": "転送とトランスコーディング",
"stun_turn_description_forward": "TURN/STUN 通信の最適化と機能強化。",
"stun_turn_webrtc": "WebRTC ブローカーへの転送",
"stun_turn_description_webrtc": "MQTT を介して h264 ストリームを転送する",
"stun_turn_transcode": "トランスコード ストリーム",
"stun_turn_description_transcode": "ストリームを低解像度に変換する",
"stun_turn_downscale": "解像度のダウンスケール (% または元の解像度)",
"mqtt": "MQTT",
"description_mqtt": "それらの通信にはMQTT ブローカーが使用されます。",
"description2_mqtt": "たとえば、ライブストリーミングや ONVIF (PTZ) 機能を実現するために、Kerberos エージェントに送信します。",
"mqtt_brokeruri": "ブローカー URI",
"mqtt_username": "ユーザー名",
"mqtt_password": "パスワード"
},
"conditions": {
"timeofinterest": "特定の時間",
"description_timeofinterest": "特定の時間間隔 (タイムゾーンに基づく) の間のみ録画を行います。",
"timeofinterest_enabled": "有効",
"timeofinterest_description_enabled": "有効にすると、時間枠を指定できます",
"sunday": "日曜日",
"monday": "月曜日",
"tuesday": "火曜日",
"wednesday": "水曜日",
"thursday": "木曜日",
"friday": "金曜日",
"saturday": "土曜日",
"externalcondition": "外部条件",
"description_externalcondition": "外部 Web サービスに応じて、記録を有効または無効にすることができます。",
"regionofinterest": "検出領域",
"description_regionofinterest": "1 つまたは複数の領域を定義すると、定義した領域でのみモーションが追跡されます。"
},
"persistence": {
"kerberoshub": "ケルベロス ハブ",
"description_kerberoshub": "Kerberos エージェントはハートビートを中央に送信できます。",
"description2_kerberoshub": "インストール。",
"persistence": "持続性",
"saasoffering": "Kerberos ハブ (SAAS オファリング)",
"description_persistence": "録音を保存する機能を持つことは、すべての始まりです。",
"description2_persistence": "、またはサードパーティのプロバイダ",
"select_persistence": "永続性を選択",
"kerberoshub_proxyurl": "Kerberos ハブ プロキシ URL",
"kerberoshub_description_proxyurl": "記録をアップロードするためのプロキシ エンドポイント。",
"kerberoshub_apiurl": "ケルベロス ハブ API URL",
"kerberoshub_description_apiurl": "録音をアップロードするための API エンドポイント。",
"kerberoshub_publickey": "公開鍵",
"kerberoshub_description_publickey": "Kerberos Hub アカウントに付与された公開鍵。",
"kerberoshub_privatekey": "秘密鍵",
"kerberoshub_description_privatekey": "Kerberos Hub アカウントに付与された秘密鍵。",
"kerberoshub_site": "サイト",
"kerberoshub_description_site": "Kerberos Hub で Kerberos エージェントが属しているサイト ID。",
"kerberoshub_region": "領域",
"kerberoshub_description_region": "録音を保存しているリージョン。",
"kerberoshub_bucket": "bucket",
"kerberoshub_description_bucket": "録音を保存しているbucket",
"kerberoshub_username": "ユーザー名/ディレクトリ",
"kerberoshub_description_username": "Kerberos Hub アカウントのユーザー名。",
"kerberosvault_apiurl": "Kerberos ボールト API URL",
"kerberosvault_description_apiurl": "Kerberos ボールト API",
"kerberosvault_provider": "プロバイダ",
"kerberosvault_description_provider": "録音の送信先のプロバイダー。",
"kerberosvault_directory": "ディレクトリ",
"kerberosvault_description_directory": "録音がプロバイダーに保存されるサブディレクトリ。",
"kerberosvault_accesskey": "アクセスキー",
"kerberosvault_description_accesskey": "Kerberos Vault アカウントのアクセス キー。",
"kerberosvault_secretkey": "秘密鍵",
"kerberosvault_description_secretkey": "Kerberos Vault アカウントの秘密鍵。",
"verify_connection": "接続の確認",
"remove_after_upload": "Once recordings are uploaded to some persistence, you might want to remove them from the local Kerberos Agent.",
"remove_after_upload_description": "Remove recordings after they are uploaded successfully.",
"remove_after_upload_enabled": "Enabled delete on upload"
}
}
}

View File

@@ -0,0 +1,208 @@
{
"breadcrumb": {
"watch_recordings": "Bekijk opnames",
"configure": "Instellingen"
},
"buttons": {
"save": "Opslaan"
},
"navigation": {
"profile": "Profiel",
"admin": "beheerder",
"management": "Beheer",
"dashboard": "Overzicht",
"recordings": "Opnames",
"settings": "Instellingen",
"help_support": "Hulp & informatie",
"swagger": "Swagger API",
"documentation": "Documentatie",
"ui_library": "UI bibliotheek",
"layout": "Taal & Weergave",
"choose_language": "Kies taal"
},
"dashboard": {
"title": "Overzicht",
"heading": "Overzicht van je video beveiliging",
"number_of_days": "Aantal dagen",
"total_recordings": "Aantal opnames",
"connected": "Verbonden",
"not_connected": "Niet verbonden",
"offline_mode": "Offline modus",
"latest_events": "Laatste opnames",
"configure_connection": "Configureer verbinding",
"no_events": "Geen opnames",
"no_events_description": "Geen opnames gevonden, zorg ervoor dat je Kerberos Agent geconfigureerd is.",
"motion_detected": "Beweging gedetecteerd",
"live_view": "Live weergave",
"loading_live_view": "Live view laden",
"loading_live_view_description": "Eventjes geduld we laden jouw live weergave. Indien je de camera connectie nog niet geconfigureerd hebt, ga naar de instellingen pagina.",
"time": "Tijd",
"description": "Omschrijving",
"name": "Naam"
},
"recordings": {
"title": "Opnames",
"heading": "Al je opnames in een eenvoudig overzicht",
"search_media": "Zoek video"
},
"settings": {
"title": "Instellingen",
"heading": "Configureer je camera",
"submenu": {
"all": "Alle",
"overview": "Overzicht",
"camera": "Camera",
"recording": "Opnemen",
"streaming": "Streaming",
"conditions": "Condities",
"persistence": "Opslag"
},
"info": {
"kerberos_hub_demo": "Bekijk onze Kerberos Hub demo omgeving om een beter inzicht te verkrijgen!",
"configuration_updated_success": "De configuratie is succesvol opgeslagen.",
"configuration_updated_error": "Er ging iets fout tijdens het opslaan.",
"verify_hub": "We controleren jouw Kerberos Hub instellingen.",
"verify_hub_success": "De Kerberos Hub instellingen zijn goed bevonden.",
"verify_hub_error": "Er ging iets fout tijdens het controleren van Kerberos Hub",
"verify_persistence": "Controleren van de opslag instellingen.",
"verify_persistence_success": "De opslag instellingen zijn goed bevonden",
"verify_persistence_error": "Er ging iets fout tijdens het controleren van de opslag instellingen",
"verify_camera": "We controleren de camera instellingen.",
"verify_camera_success": "De camera instellingen zijn gevalideerd.",
"verify_camera_error": "Er ging iets mis met de camera instellingen."
},
"overview": {
"general": "Algemeen",
"description_general": "Algemene instellingen voor jouw Kerberos Agent",
"key": "Key",
"camera_name": "Camera naam",
"timezone": "Tijdzone",
"select_timezone": "Selecteer uw tijdzone",
"advanced_configuration": "Geavanceerde instellingen",
"description_advanced_configuration": "Detail instellingen om bepaalde functionaliteiten van je Kerberos Agent aan en uit te zetten",
"offline_mode": "Offline modus",
"description_offline_mode": "Uitzetten van uitgaande connectiviteit"
},
"camera": {
"camera": "Camera",
"description_camera": "Camera settings are required to make a connection to your camera of choice.",
"only_h264": "Momenteel worden enkel H264 RTSP streams gesupporteerd",
"rtsp_url": "RTSP url",
"rtsp_h264": "Een H264 RTSP connectie met jouw camera.",
"sub_rtsp_url": "Sub RTSP url (used for livestreaming)",
"sub_rtsp_h264": "A secondary RTSP connection to the low resolution of your camera.",
"onvif": "ONVIF",
"description_onvif": "Gegevens om te communiceren met ONVIF vaardigheden. Deze worden gebruikt voor PTZ of andere vaardigheden van de camera.",
"onvif_xaddr": "ONVIF xaddr",
"onvif_username": "ONVIF gebruikersnaam",
"onvif_password": "ONVIF wachtwoord",
"verify_connection": "Verifieer verbinding",
"verify_sub_connection": "Verify Sub Connection"
},
"recording": {
"recording": "Opname",
"description_recording": "Detailleer hoe je opnames wilt maken. Bv. doorlopende 24/7 opnames of bewegings detectie opnames.",
"continuous_recording": "Doorlopende opnames",
"description_continuous_recording": "Maak 24/7 of bewegings opnames.",
"max_duration": "Maximaal video duratie (seconden)",
"description_max_duration": "De maximale duur van een opname.",
"pre_recording": "voor opname (key frames buffered)",
"description_pre_recording": "Aantal seconden voor een beweging gedetecteerd is",
"post_recording": "na opname (seconden)",
"description_post_recording": "Aantal seconden na een beweging gedetecteerd is",
"threshold": "Opname drempel (pixels)",
"description_threshold": "Het aantal pixel veranderingen voor een opname",
"autoclean": "Automatische opruiming",
"description_autoclean": "De Kerberos Agent kan opnames verwijderen wanneer een opslag limiet bereikt is. Indien het geval worden de oudste opnames eerst verwijderd",
"autoclean_enable": "Zet automatische verwijdering aan",
"autoclean_description_enable": "Verwijder oudste opnames wanneer limiet bereikt is",
"autoclean_max_directory_size": "Maximale map opslag (MB)",
"autoclean_description_max_directory_size": "De maximale video opslag (MB's.)",
"fragmentedrecordings": "Gefragmenteerde opnames",
"description_fragmentedrecordings": "Wanneer opnames gefragmenteerd zijn, zijn deze toegankelijk voor een HLS stream. Wanneer geactiveerd zal de MP4 container er iets anders uitzien.",
"fragmentedrecordings_enable": "Zet fragmentatie aan",
"fragmentedrecordings_description_enable": "Fragmenteerde opnames zijn noodzakelijk voor HLS.",
"fragmentedrecordings_duration": "fragment duratie",
"fragmentedrecordings_description_duration": "Duratie van een fragment.",
"verify_connection": "Verifieer Connectie"
},
"streaming": {
"stun_turn": "STUN/TURN voor WebRTC",
"description_stun_turn": "Voor een hoge definitie live weergave, wordt WebRTC toegepast. Een van de vaardigheden is de toepassing van ICE-candidate, welke NAT traversal toelaat doormiddel van STUN/TURN.",
"stun_server": "STUN server",
"turn_server": "TURN server",
"turn_username": "Gebruikersnaam",
"turn_password": "Wachtwoord",
"stun_turn_forward": "Doorsturen en transcoden",
"stun_turn_description_forward": "Optimalisatie en verbetering voor TURN/STUN communicatie.",
"stun_turn_webrtc": "Doorsturen naar een WebRTC broker",
"stun_turn_description_webrtc": "Doorsturen van H264 stream naar MQTT",
"stun_turn_transcode": "Transcode stream",
"stun_turn_description_transcode": "Omzetten van stream naar een lagere resolutie",
"stun_turn_downscale": "Neerschalen resolutie (in % van originale resolutie)",
"mqtt": "MQTT",
"description_mqtt": "Een MQTT broker wordt gebruikt om te communiceren van",
"description2_mqtt": "naar de Kerberos Agent, om te genieten van livestreaming of ONVIF (PTZ) vaardigheden.",
"mqtt_brokeruri": "Broker Uri",
"mqtt_username": "Gebruikersnaam",
"mqtt_password": "Wachtworod"
},
"conditions": {
"timeofinterest": "Tijds interval",
"description_timeofinterest": "Maken van opnames tussen twee tijdstippen (gebasseerd op tijdszone).",
"timeofinterest_enabled": "Geactiveerd",
"timeofinterest_description_enabled": "Wanneer geactiveerd kan je een tijdsinterval instellen",
"sunday": "Zondag",
"monday": "Maandag",
"tuesday": "Dinsdag",
"wednesday": "Woensdag",
"thursday": "Donderdag",
"friday": "Vrijdag",
"saturday": "Zaterdag",
"externalcondition": "Externe Condities",
"description_externalcondition": "Afhankelijk van een externe webservice opnames zijn geactiveerd of niet geactiveerd.",
"regionofinterest": "Bereik interval",
"description_regionofinterest": "Door het instellen van een of meerdere regios wordt beweging enkel gedetecteerd in de vooropgestelde regios."
},
"persistence": {
"kerberoshub": "Kerberos Hub",
"description_kerberoshub": "Kerberos Agents sturen een bericht naar een centrale",
"description2_kerberoshub": "installatie. Berichten en andere relevante informatie worden gesynced naar Kerberos Hub on zo een real-tive overzicht te geven van jouw video landschap.",
"persistence": "Opslag",
"saasoffering": "Kerberos Hub (SAAS)",
"description_persistence": "De mogelijkheid om jouw opnames op te slaan is het begin van alles. Je kan kiezen tussen ons",
"description2_persistence": ", of een 3rd party provider",
"select_persistence": "Selecteer een opslagmethode",
"kerberoshub_proxyurl": "Kerberos Hub Proxy URL",
"kerberoshub_description_proxyurl": "De Proxy url voor het opladen van jouw opnames.",
"kerberoshub_apiurl": "Kerberos Hub API URL",
"kerberoshub_description_apiurl": "De API endpoint om jouw opnames op te laden.",
"kerberoshub_publickey": "Publieke sleutel",
"kerberoshub_description_publickey": "De publieke sleutel voor jouw Kerberos Hub account.",
"kerberoshub_privatekey": "Private key",
"kerberoshub_description_privatekey": "De private sleutel voor jouw Kerberos Hub account.",
"kerberoshub_site": "Site",
"kerberoshub_description_site": "De site ID waar je Kerberos Agents toebehoort in Kerberos Hub.",
"kerberoshub_region": "Regio",
"kerberoshub_description_region": "De regio waar jouw opnames worden opgeslagen.",
"kerberoshub_bucket": "Bucket",
"kerberoshub_description_bucket": "De bucket opslag locatie",
"kerberoshub_username": "Gebruikersnaam/Map",
"kerberoshub_description_username": "De gebruikersnaam van jouw Kerberos Hub account.",
"kerberosvault_apiurl": "Kerberos Vault API URL",
"kerberosvault_description_apiurl": "De Kerberos Vault API",
"kerberosvault_provider": "Provider",
"kerberosvault_description_provider": "De provider verantwoordelijk voor de opnames op te slaan.",
"kerberosvault_directory": "Map",
"kerberosvault_description_directory": "Sub map waarin de opnames worden opgeslagen.",
"kerberosvault_accesskey": "Access key",
"kerberosvault_description_accesskey": "De access key van jouw Kerberos Vault account.",
"kerberosvault_secretkey": "Secret key",
"kerberosvault_description_secretkey": "De secret key van jouw Kerberos Vault account.",
"verify_connection": "Verifieer verbinding",
"remove_after_upload": "Wanneer opnames opgeslagen zijn, kan je ze verwijderen in de lokale Kerberos Agent.",
"remove_after_upload_description": "Verwijder opnames wanneer ze zijn geupload naar een opslag locatie.",
"remove_after_upload_enabled": "Activeer verwijderen na uploaden"
}
}
}

View File

@@ -0,0 +1,207 @@
{
"breadcrumb": {
"watch_recordings": "Watch recordings",
"configure": "Configure"
},
"buttons": {
"save": "Save"
},
"navigation": {
"profile": "Profil",
"admin": "admin",
"management": "Kierownictwo",
"dashboard": "Panel",
"recordings": "Nagrania",
"settings": "Ustawienia",
"help_support": "Pomoc wsparcie",
"swagger": "Swagger API",
"documentation": "Dokumentacja",
"ui_library": "UI Biblioteka",
"layout": "Język i układ",
"choose_language": "Wybierz język"
},
"dashboard": {
"title": "Dashboard",
"heading": "Overview of your video surveilance",
"number_of_days": "Number of days",
"total_recordings": "Total recordings",
"connected": "Connected",
"not_connected": "Not connected",
"offline_mode": "Offline mode",
"latest_events": "Latest events",
"configure_connection": "Configure connection",
"no_events": "No events",
"no_events_description": "No recordings where found, make sure your Kerberos Agent is properly configured.",
"motion_detected": "Motion was detected",
"live_view": "Live view",
"loading_live_view": "Loading live view",
"loading_live_view_description": "Hold on we are loading your live view here. If you didn't configure your camera connection, update it on the settings pages.",
"time": "Time",
"description": "Description",
"name": "Name"
},
"recordings": {
"title": "Recordings",
"heading": "All your recordings in a single place",
"search_media": "Search media"
},
"settings": {
"title": "Settings",
"heading": "Onboard your camera",
"submenu": {
"all": "All",
"overview": "Overview",
"camera": "Camera",
"recording": "Recording",
"streaming": "Streaming",
"conditions": "Conditions",
"persistence": "Persistence"
},
"info": {
"kerberos_hub_demo": "Have a look at our Kerberos Hub demo environment, to see Kerberos Hub in action!",
"configuration_updated_success": "Your configuration have been updated successfully.",
"configuration_updated_error": "Something went wrong while saving.",
"verify_hub": "Verifying your Kerberos Hub settings.",
"verify_hub_success": "Kerberos Hub settings are successfully verified.",
"verify_hub_error": "Something went wrong while verifying Kerberos Hub",
"verify_persistence": "Verifying your persistence settings.",
"verify_persistence_success": "Persistence settings are successfully verified.",
"verify_persistence_error": "Something went wrong while verifying the persistence",
"verify_camera": "Verifying your camera settings.",
"verify_camera_success": "Camera settings are successfully verified.",
"verify_camera_error": "Something went wrong while verifying the camera settings"
},
"overview": {
"general": "General",
"description_general": "General settings for your Kerberos Agent",
"key": "Key",
"camera_name": "Camera name",
"timezone": "Timezone",
"select_timezone": "Select a timezone",
"advanced_configuration": "Advanced configuration",
"description_advanced_configuration": "Detailed configuration options to enable or disable specific parts of the Kerberos Agent",
"offline_mode": "Offline mode",
"description_offline_mode": "Disable all outgoing traffic"
},
"camera": {
"camera": "Camera",
"description_camera": "Camera settings are required to make a connection to your camera of choice.",
"only_h264": "Currently only H264 RTSP streams are supported.",
"rtsp_url": "RTSP url",
"rtsp_h264": "A H264 RTSP connection to your camera.",
"sub_rtsp_url": "Sub RTSP url (used for livestreaming)",
"sub_rtsp_h264": "A secondary RTSP connection to the low resolution of your camera.",
"onvif": "ONVIF",
"description_onvif": "Credentials to communicate with ONVIF capabilities. These are used for PTZ or other capabilities provided by the camera.",
"onvif_xaddr": "ONVIF xaddr",
"onvif_username": "ONVIF username",
"onvif_password": "ONVIF password",
"verify_connection": "Verify Connection",
"verify_sub_connection": "Verify Sub Connection"
},
"recording": {
"recording": "Recording",
"description_recording": "Specify how you would like to make recordings. Having a continuous 24/7 setup or a motion based recording.",
"continuous_recording": "Continuous recording",
"description_continuous_recording": "Make 24/7 or motion based recordings.",
"max_duration": "max video duration (seconds)",
"description_max_duration": "The maximum duration of a recording.",
"pre_recording": "pre recording (key frames buffered)",
"description_pre_recording": "Seconds before an event occurred.",
"post_recording": "post recording (seconds)",
"description_post_recording": "Seconds after an event occurred.",
"threshold": "Recording threshold (pixels)",
"description_threshold": "The number of pixels changed to record",
"autoclean": "Auto clean",
"description_autoclean": "Specify if the Kerberos Agent can cleanup recordings when a specific storage capacity (MB) is reached. This will remove the oldest recordings when the capacity is reached.",
"autoclean_enable": "Enable auto clean",
"autoclean_description_enable": "Remove oldest recording when capacity reached.",
"autoclean_max_directory_size": "Maximum directory size (MB)",
"autoclean_description_max_directory_size": "The maximum MB's of recordings stored.",
"fragmentedrecordings": "Fragmented recordings",
"description_fragmentedrecordings": "When recordings are fragmented they are suitable for an HLS stream. When turned on the MP4 container will look a bit different.",
"fragmentedrecordings_enable": "Enable fragmentation",
"fragmentedrecordings_description_enable": "Fragmented recordings are required for HLS.",
"fragmentedrecordings_duration": "fragment duration",
"fragmentedrecordings_description_duration": "Duration of a single fragment."
},
"streaming": {
"stun_turn": "STUN/TURN for WebRTC",
"description_stun_turn": "For full-resolution livestreaming we use the concept of WebRTC. One of the key capabilities is the ICE-candidate feature, which allows NAT traversal using the concepts of STUN/TURN.",
"stun_server": "STUN server",
"turn_server": "TURN server",
"turn_username": "Username",
"turn_password": "Password",
"stun_turn_forward": "Forwarding and transcoding",
"stun_turn_description_forward": "Optimisations and enhancements for TURN/STUN communication.",
"stun_turn_webrtc": "Forwarding to WebRTC broker",
"stun_turn_description_webrtc": "Forward h264 stream through MQTT",
"stun_turn_transcode": "Transcode stream",
"stun_turn_description_transcode": "Convert stream to a lower resolution",
"stun_turn_downscale": "Downscale resolution (in % or original resolution)",
"mqtt": "MQTT",
"description_mqtt": "A MQTT broker is used to communicate from",
"description2_mqtt": "to the Kerberos Agent, to achieve for example livestreaming or ONVIF (PTZ) capabilities.",
"mqtt_brokeruri": "Broker Uri",
"mqtt_username": "Username",
"mqtt_password": "Password"
},
"conditions": {
"timeofinterest": "Time Of Interest",
"description_timeofinterest": "Only make recordings between specific time intervals (based on timezone).",
"timeofinterest_enabled": "Enabled",
"timeofinterest_description_enabled": "If enabled you can specify time windows",
"sunday": "Sunday",
"monday": "Monday",
"tuesday": "Tuesday",
"wednesday": "Wednesday",
"thursday": "Thursday",
"friday": "Friday",
"saturday": "Saturday",
"externalcondition": "External Condition",
"description_externalcondition": "Depending on an external webservice recording can be enabled or disabled.",
"regionofinterest": "Region Of Interest",
"description_regionofinterest": "By defining one or more regions, motion will be tracked only in the regions you have defined."
},
"persistence": {
"kerberoshub": "Kerberos Hub",
"description_kerberoshub": "Kerberos Agents can send heartbeats to a central",
"description2_kerberoshub": "installation. Heartbeats and other relevant information are synced to Kerberos Hub to show realtime information about your video landscape.",
"persistence": "Persistence",
"saasoffering": "Kerberos Hub (SAAS offering)",
"description_persistence": "Having the ability to store your recordings is the beginning of everything. You can choose between our",
"description2_persistence": ", or a 3rd party provider",
"select_persistence": "Select a persistence",
"kerberoshub_proxyurl": "Kerberos Hub Proxy URL",
"kerberoshub_description_proxyurl": "The Proxy endpoint for uploading your recordings.",
"kerberoshub_apiurl": "Kerberos Hub API URL",
"kerberoshub_description_apiurl": "The API endpoint for uploading your recordings.",
"kerberoshub_publickey": "Public key",
"kerberoshub_description_publickey": "The public key granted to your Kerberos Hub account.",
"kerberoshub_privatekey": "Private key",
"kerberoshub_description_privatekey": "The private key granted to your Kerberos Hub account.",
"kerberoshub_site": "Site",
"kerberoshub_description_site": "The site ID the Kerberos Agents are belonging to in Kerberos Hub.",
"kerberoshub_region": "Region",
"kerberoshub_description_region": "The region we are storing our recordings in.",
"kerberoshub_bucket": "Bucket",
"kerberoshub_description_bucket": "The bucket we are storing our recordings in.",
"kerberoshub_username": "Username/Directory",
"kerberoshub_description_username": "The username of your Kerberos Hub account.",
"kerberosvault_apiurl": "Kerberos Vault API URL",
"kerberosvault_description_apiurl": "The Kerberos Vault API",
"kerberosvault_provider": "Provider",
"kerberosvault_description_provider": "The provider to which your recordings will be send.",
"kerberosvault_directory": "Directory",
"kerberosvault_description_directory": "Sub directory the recordings will be stored in your provider.",
"kerberosvault_accesskey": "Access key",
"kerberosvault_description_accesskey": "The access key of your Kerberos Vault account.",
"kerberosvault_secretkey": "Secret key",
"kerberosvault_description_secretkey": "The secret key of your Kerberos Vault account.",
"verify_connection": "Verify Connection",
"remove_after_upload": "Once recordings are uploaded to some persistence, you might want to remove them from the local Kerberos Agent.",
"remove_after_upload_description": "Remove recordings after they are uploaded successfully.",
"remove_after_upload_enabled": "Enabled delete on upload"
}
}
}

View File

@@ -0,0 +1,207 @@
{
"breadcrumb": {
"watch_recordings": "Assistir gravações",
"configure": "Configurar"
},
"buttons": {
"save": "Salvar"
},
"navigation": {
"profile": "Perfil",
"admin": "admin",
"management": "Gestão",
"dashboard": "Painel",
"recordings": "Gravações",
"settings": "Configurações",
"help_support": "Ajuda e suporte",
"swagger": "Swagger API",
"documentation": "Documentação",
"ui_library": "UI Biblioteca",
"layout": "Idioma e layout",
"choose_language": "Escolha o seu idioma"
},
"dashboard": {
"title": "Painel",
"heading": "Visão geral de sua videovigilância",
"number_of_days": "Número de dias",
"total_recordings": "Total de gravações",
"connected": "Conectado",
"not_connected": "Desconectado",
"offline_mode": "Modo Offline",
"latest_events": "Ultimos eventos",
"configure_connection": "Configurar conexão",
"no_events": "Nenhum evento",
"no_events_description": "Nenhuma gravação foi encontrada, certifique-se de que seu Kerberos Agent esteja configurado corretamente.",
"motion_detected": "Movimento detectado",
"live_view": "Visualização ao vivo",
"loading_live_view": "Carregando visualização ao vivo",
"loading_live_view_description": "Aguarde, estamos carregando sua visualização ao vivo. Se você não configurou a conexão de sua câmera, atualize-a nas páginas de configurações.",
"time": "Time",
"description": "Descrição",
"name": "Nome"
},
"recordings": {
"title": "Gravações",
"heading": "Todas as suas gravações em um único lugar",
"search_media": "Pesquisar mídia"
},
"settings": {
"title": "Configurações",
"heading": "Integre sua câmera",
"submenu": {
"all": "Todas",
"overview": "Visão geral",
"camera": "Câmera",
"recording": "Gravação",
"streaming": "Transmissão",
"conditions": "Condições",
"persistence": "Armazenamento"
},
"info": {
"kerberos_hub_demo": "Dê uma olhada em nosso ambiente de demonstração do Kerberos Hub para ver o Kerberos Hub em ação!",
"configuration_updated_success": "Sua configuração foi atualizada com sucesso.",
"configuration_updated_error": "Ocorreu um erro durante o salvamento.",
"verify_hub": "Verificando as configurações do Kerberos Hub.",
"verify_hub_success": "As configurações do Kerberos Hub foram verificadas com sucesso.",
"verify_hub_error": "Algo deu errado ao verificar o Kerberos Hub",
"verify_persistence": "Verificando suas configurações de armazenamento.",
"verify_persistence_success": "As configurações de armazenamento foram verificadas com sucesso.",
"verify_persistence_error": "Algo deu errado ao verificar o armazenamento",
"verify_camera": "Verificando as configurações de sua câmera.",
"verify_camera_success": "As configurações da câmera foram verificadas com sucesso.",
"verify_camera_error": "Algo deu errado ao verificar as configurações da câmera."
},
"overview": {
"general": "Geral",
"description_general": "Configurações gerais para seu agente Kerberos",
"key": "Chave",
"camera_name": "Nome da câmera",
"timezone": "Fuso horário",
"select_timezone": "Selecione a timezone",
"advanced_configuration": "Configurações avançadas",
"description_advanced_configuration": "Opções de configuração detalhadas para habilitar ou desabilitar partes específicas do Kerberos Agent",
"offline_mode": "Modo Offline",
"description_offline_mode": "Desative todo o tráfego de saída"
},
"camera": {
"camera": "Câmera",
"description_camera": "As configurações da câmera são necessárias para fazer uma conexão com a câmera de sua escolha.",
"only_h264": "Atualmente, apenas streams H264 RTSP são suportados.",
"rtsp_url": "Url RTSP",
"rtsp_h264": "Uma conexão H264 RTSP para sua câmera.",
"sub_rtsp_url": "Sub RTSP URL(usado para transmissão ao vivo)",
"sub_rtsp_h264": "Uma conexão RTSP secundária para a baixa resolução de sua câmera.",
"onvif": "ONVIF",
"description_onvif": "Credenciais para se comunicar com recursos ONVIF. Eles são usados para PTZ ou outros recursos fornecidos pela câmera.",
"onvif_xaddr": "ONVIF xaddr",
"onvif_username": "ONVIF usuario (username)",
"onvif_password": "ONVIF senha (password)",
"verify_connection": "Verificar conexão",
"verify_sub_connection": "Verificar subconexão"
},
"recording": {
"recording": "Gravação",
"description_recording": "Especifique como você gostaria de fazer gravações. Gravar o tempo todo (24/7) ou baseada na detecção de movimento.",
"continuous_recording": "Gravação contínua",
"description_continuous_recording": "Faça gravações 24/7 ou baseadas na detecção de movimento.",
"max_duration": "duração máxima do vídeo (segundos)",
"description_max_duration": "A duração máxima de uma gravação.",
"pre_recording": "pré-gravação (key frames em buffer)",
"description_pre_recording": "Segundos antes de um evento ocorrer.",
"post_recording": "pós gravação (segundos)",
"description_post_recording": "Segundos após a ocorrência de um evento.",
"threshold": "Limite de gravação (pixels)",
"description_threshold": "O número de pixels alterados para gravar",
"autoclean": "Limpeza automática",
"description_autoclean": "Especifique se o Agente Kerberos pode limpar gravações quando uma capacidade de armazenamento específica (MB) é atingida. Isso removerá as gravações mais antigas quando a capacidade for atingida.",
"autoclean_enable": "Ativar limpeza automática",
"autoclean_description_enable": "Remova a gravação mais antiga quando a capacidade for atingida.",
"autoclean_max_directory_size": "Tamanho máximo do diretório (MB)",
"autoclean_description_max_directory_size": "O máximo de MB de gravações armazenadas.",
"fragmentedrecordings": "Gravações Fragmentadas",
"description_fragmentedrecordings": "Quando as gravações são fragmentadas, elas são adequadas para um fluxo HLS. Quando ativado, o contêiner MP4 parecerá um pouco diferente.",
"fragmentedrecordings_enable": "Ativar fragmentação",
"fragmentedrecordings_description_enable": "Gravações fragmentadas são necessárias para HLS.",
"fragmentedrecordings_duration": "Duração do fragmento",
"fragmentedrecordings_description_duration": "Duração de um único fragmento."
},
"streaming": {
"stun_turn": "STUN/TURN para WebRTC",
"description_stun_turn": "Para transmissão ao vivo de resolução total, usamos o conceito de WebRTC. Um dos principais recursos é o recurso ICE-candidate, que permite a travessia de NAT usando os conceitos de STUN/TURN.",
"stun_server": "Servidor STUN",
"turn_server": "Servidor TURN",
"turn_username": "Usuario",
"turn_password": "Senha",
"stun_turn_forward": "Encaminhamento e transcodificação",
"stun_turn_description_forward": "Otimizações e melhorias para a comunicação TURN/STUN.",
"stun_turn_webrtc": "Encaminhamento para broker WebRTC",
"stun_turn_description_webrtc": "Encaminhar stream h264 através do MQTT",
"stun_turn_transcode": "Transcodificar stream",
"stun_turn_description_transcode": "Converter stream para uma resolução mais baixa",
"stun_turn_downscale": "Resolução reduzida (em % ou resolução original)",
"mqtt": "MQTT",
"description_mqtt": "Um broker MQTT é usado para se comunicar de",
"description2_mqtt": "para o Kerberos Agent, para obter, por exemplo, recursos de transmissão ao vivo ou ONVIF (PTZ).",
"mqtt_brokeruri": "Url Broker",
"mqtt_username": "Usuario",
"mqtt_password": "Senha"
},
"conditions": {
"timeofinterest": "Tempo de interesse",
"description_timeofinterest": "Apenas faça gravações entre intervalos de tempo específicos (com base no fuso horário).",
"timeofinterest_enabled": "Habilitado",
"timeofinterest_description_enabled": "Se ativado, você pode especificar os intervalos de tempo",
"sunday": "Domingo",
"monday": "Segunda",
"tuesday": "Terça",
"wednesday": "Quarta",
"thursday": "Quinta",
"friday": "Sexta",
"saturday": "Sabado",
"externalcondition": "Condição Externa",
"description_externalcondition": "Dependendo de um serviço de web(API) externo, a gravação pode ser habilitada ou desabilitada.",
"regionofinterest": "Região de interesse",
"description_regionofinterest": "Ao definir uma ou mais regiões, o movimento será rastreado apenas nas regiões definidas por você."
},
"persistence": {
"kerberoshub": "Kerberos Hub",
"description_kerberoshub": "Agentes Kerberos podem enviar sinais constantes para a central",
"description2_kerberoshub": "instalação. Os sinais e outras informações relevantes são sincronizadas com o Kerberos Hub para mostrar informações em tempo real sobre seu cenário de vídeo.",
"persistence": "Armazenamento",
"saasoffering": "Kerberos Hub (oferta SAAS)",
"description_persistence": "Ter a capacidade de armazenar suas gravações é o começo de tudo. Você pode escolher entre nossos",
"description2_persistence": ", ou um provedor terceirizado",
"select_persistence": "Selecione um provedor de armazenamento",
"kerberoshub_proxyurl": "Url proxy para Kerberos Hub",
"kerberoshub_description_proxyurl": "O endpoint Proxy para enviar suas gravações.",
"kerberoshub_apiurl": "Url de API do Kerberos Hub",
"kerberoshub_description_apiurl": "O endpoint da API para enviar suas gravações.",
"kerberoshub_publickey": "Chave pública (Public key)",
"kerberoshub_description_publickey": "A chave pública concedida à sua conta do Kerberos Hub.",
"kerberoshub_privatekey": "Chave privada (Private key)",
"kerberoshub_description_privatekey": "A chave privada concedida à sua conta do Kerberos Hub.",
"kerberoshub_site": "Local",
"kerberoshub_description_site": "O ID do local ao qual os Agentes Kerberos pertencem no Hub Kerberos.",
"kerberoshub_region": "Região",
"kerberoshub_description_region": "A região em que estamos armazenando nossas gravações.",
"kerberoshub_bucket": "Bucket",
"kerberoshub_description_bucket": "O bucket no qual estamos armazenando nossas gravações.",
"kerberoshub_username": "Nome de usuário/diretório (Username/Directory)",
"kerberoshub_description_username": "O nome de usuário da sua conta do Kerberos Hub.",
"kerberosvault_apiurl": "Url da API do Kerberos Vault",
"kerberosvault_description_apiurl": "a API Kerberos Vault",
"kerberosvault_provider": "Provedor",
"kerberosvault_description_provider": "O provedor para o qual suas gravações serão enviadas.",
"kerberosvault_directory": "Diretório",
"kerberosvault_description_directory": "Subdiretório as gravações serão armazenadas em seu provedor.",
"kerberosvault_accesskey": "Chave de acesso(Access key)",
"kerberosvault_description_accesskey": "A chave de acesso da sua conta do Kerberos Vault.",
"kerberosvault_secretkey": "Chave secreta(Secret key)",
"kerberosvault_description_secretkey": "A chave secreta da sua conta do Kerberos Vault.",
"verify_connection": "Verificar conexão",
"remove_after_upload": "Once recordings are uploaded to some persistence, you might want to remove them from the local Kerberos Agent.",
"remove_after_upload_description": "Remove recordings after they are uploaded successfully.",
"remove_after_upload_enabled": "Enabled delete on upload"
}
}
}

View File

@@ -1,6 +1,14 @@
import React from 'react';
import PropTypes from 'prop-types';
import { withTranslation } from 'react-i18next';
import uuid from 'uuidv4';
import {
connect as connectWS,
disconnect as disconnectWS,
send,
} from '@giantmachines/redux-websocket';
import {
Badge,
Main,
MainBody,
Gradient,
@@ -10,61 +18,123 @@ import {
NavigationItem,
NavigationGroup,
Profilebar,
Icon,
} from '@kerberos-io/ui';
import { interval } from 'rxjs';
import { connect } from 'react-redux';
import './App.module.scss';
import logo from './header-minimal-logo-36x36.svg';
import '@kerberos-io/ui/lib/index.css';
import { Link } from 'react-router-dom';
import { logout } from './actions';
import config from './config';
import { getDashboardInformation } from './actions/agent';
import LanguageSelect from './components/LanguageSelect/LanguageSelect';
import logo from './header-minimal-logo-36x36.svg';
import '@kerberos-io/ui/lib/index.css';
import './App.scss';
// eslint-disable-next-line react/prefer-stateless-function
class App extends React.Component {
componentDidMount() {
const { dispatchGetDashboardInformation, dispatchConnect } = this.props;
dispatchGetDashboardInformation();
dispatchConnect();
const interval$ = interval(5000);
this.subscription = interval$.subscribe(() => {
dispatchGetDashboardInformation();
});
}
componentDidUpdate(prevProps) {
// We are connected again, lets fire the initial events.
const { connected, dispatchSend, dispatchConnect } = this.props;
const { connected: connectedPrev } = prevProps;
if (connectedPrev === false && connected === true) {
const message = {
client_id: uuid(),
message_type: 'hello',
};
dispatchSend(message);
}
// We disconnected, let's try to connect again
if (connectedPrev === true && connected === false) {
dispatchConnect();
}
}
componentWillUnmount() {
this.subscription.unsubscribe();
const message = {
client_id: uuid(),
message_type: 'goodbye',
};
const { dispatchSend, dispatchDisconnect } = this.props;
dispatchSend(message);
dispatchDisconnect();
}
getCurrentTimestamp() {
return Math.round(Date.now() / 1000);
}
render() {
const { children, username, dispatchLogout } = this.props;
const { t, connected } = this.props;
const { children, username, dashboard, dispatchLogout } = this.props;
const cloudOnline = this.getCurrentTimestamp() - dashboard.cloudOnline < 30;
return (
<div id="page-root">
<Sidebar
logo={logo}
title="Kerberos Agent"
version={config.VERSION}
mobile
>
<Sidebar logo={logo} title="Kerberos Agent" version="v1-beta" mobile>
<Profilebar
username={username}
email="support@kerberos.io"
userrole="admin"
userrole={t('navigation.admin')}
logout={dispatchLogout}
/>
<Navigation>
<NavigationSection title="management" />
<NavigationSection title={t('navigation.management')} />
<NavigationGroup>
<NavigationItem
title="Dashboard"
title={t('navigation.dashboard')}
icon="dashboard"
link="dashboard"
/>
<NavigationItem title="Recordings" icon="media" link="media" />
<NavigationItem
title="Settings"
title={t('navigation.recordings')}
icon="media"
link="media"
/>
<NavigationItem
title={t('navigation.settings')}
icon="preferences"
link="settings"
/>
</NavigationGroup>
<NavigationSection title="help & support" />
<NavigationSection title={t('navigation.help_support')} />
<NavigationGroup>
<NavigationItem
title="Swagger API docs"
title={t('navigation.swagger')}
icon="api"
external
link={`${config.API_URL}swagger/index.html`}
link={`${config.URL}/swagger/index.html`}
/>
<NavigationItem
title="Documentation"
title={t('navigation.documentation')}
icon="book"
external
link="https://doc.kerberos.io/agent/announcement"
/>
<NavigationItem
title="Kerberos Hub"
icon="cloud"
external
link="https://app.kerberos.io"
/>
<NavigationItem
title={t('navigation.ui_library')}
icon="paint"
external
link="https://ui.kerberos.io/"
/>
<NavigationItem
title="Github"
icon="github-nav"
@@ -72,10 +142,48 @@ class App extends React.Component {
link="https://github.com/kerberos-io/agent"
/>
</NavigationGroup>
<NavigationSection title={t('navigation.layout')} />
<NavigationGroup>
<LanguageSelect />
</NavigationGroup>
<NavigationSection title="Websocket" />
<NavigationGroup>
<div className="websocket-badge">
<Badge
title={connected ? 'connected' : 'disconnected'}
status={connected ? 'success' : 'warning'}
/>
</div>
</NavigationGroup>
</Navigation>
</Sidebar>
<Main>
<Gradient />
{!cloudOnline && (
<a href="https://app.kerberos.io" target="_blank" rel="noreferrer">
<div className="cloud-not-installed">
<div>
<Icon label="cloud" />
Activate Kerberos Hub, and make your cameras and recordings
available through a secured cloud!
</div>
</div>
</a>
)}
{dashboard.offlineMode === 'true' && (
<Link to="/settings">
<div className="offline-mode">
<div>
<Icon label="info" />
Attention! Kerberos is currently running in Offline mode.
</div>
</div>
</Link>
)}
<MainBody>{children}</MainBody>
</Main>
</div>
@@ -84,18 +192,36 @@ class App extends React.Component {
}
const mapStateToProps = (state) => ({
username: state.auth.username,
username: state.authentication.username,
dashboard: state.agent.dashboard,
connected: state.wss.connected,
});
const mapDispatchToProps = (dispatch) => ({
dispatchLogout: () => dispatch(logout()),
dispatchConnect: () => {
dispatch(connectWS(config.WS_URL));
},
dispatchDisconnect: () => dispatch(disconnectWS()),
dispatchSend: (message) => dispatch(send(message)),
dispatchGetDashboardInformation: (dashboard, success, error) =>
dispatch(getDashboardInformation(dashboard, success, error)),
});
App.propTypes = {
t: PropTypes.func.isRequired,
dispatchLogout: PropTypes.func.isRequired,
dispatchConnect: PropTypes.func.isRequired,
dispatchDisconnect: PropTypes.func.isRequired,
dispatchSend: PropTypes.func.isRequired,
// eslint-disable-next-line react/forbid-prop-types
children: PropTypes.array.isRequired,
username: PropTypes.string.isRequired,
connected: PropTypes.bool.isRequired,
dashboard: PropTypes.object.isRequired,
dispatchGetDashboardInformation: PropTypes.func.isRequired,
};
export default connect(mapStateToProps, mapDispatchToProps)(App);
export default withTranslation()(
connect(mapStateToProps, mapDispatchToProps)(App)
);

View File

@@ -1 +0,0 @@
@import "./app.variables";

40
ui/src/App.scss Normal file
View File

@@ -0,0 +1,40 @@
@import "./app.variables";
.grid-container {
row-gap: size(2);
}
.main {
padding-top: size(7);
@media (min-width: 800px) {
padding-top: 0;
}
}
.MuiPopover-root {
z-index: 99999999 !important;
}
.offline-mode, .cloud-not-installed {
background: var(--upper-gradient);
width: 100%;
color: white;
margin: -6px 0 0 0;
display: flex;
align-items: center;
> div {
padding: size(1.5) size(4);
display: flex;
align-items: center;
}
svg {
padding-right: size(1);
}
}
.cloud-not-installed {
background: linear-gradient(90deg, hsl(170deg 48% 34%) 0%, hsl(127deg 62% 31%) 58.33%, hsl(278deg 16% 42%) 100%);
}

225
ui/src/actions/agent.js Normal file
View File

@@ -0,0 +1,225 @@
import {
doGetConfig,
doSaveConfig,
doVerifyHub,
doVerifyPersistence,
doGetKerberosAgentTags,
doGetDashboardInformation,
doGetEvents,
doVerifyCamera,
} from '../api/agent';
export const addRegion = (id, polygon) => {
return (dispatch) => {
dispatch({
type: 'ADD_REGION',
id,
polygon,
});
};
};
export const removeRegion = (id, polygon) => {
return (dispatch) => {
dispatch({
type: 'REMOVE_REGION',
id,
polygon,
});
};
};
export const updateRegion = (id, polygon) => {
return (dispatch) => {
dispatch({
type: 'UPDATE_REGION',
id,
polygon,
});
};
};
export const verifyCamera = (streamType, config, onSuccess, onError) => {
return (dispatch) => {
doVerifyCamera(
streamType,
config,
() => {
dispatch({
type: 'VERIFY_CAMERA',
});
if (onSuccess) {
onSuccess();
}
},
(error) => {
const { message } = error.response.data;
if (onError) {
onError(message);
}
}
);
};
};
export const verifyPersistence = (config, onSuccess, onError) => {
return (dispatch) => {
doVerifyPersistence(
config,
() => {
dispatch({
type: 'VERIFY_PERSISTENCE',
});
if (onSuccess) {
onSuccess();
}
},
(error) => {
const { data } = error.response.data;
if (onError) {
onError(data);
}
}
);
};
};
export const verifyHub = (config, onSuccess, onError) => {
return (dispatch) => {
doVerifyHub(
config,
() => {
dispatch({
type: 'VERIFY_HUB',
});
if (onSuccess) {
onSuccess();
}
},
(error) => {
const { data } = error.response.data;
if (onError) {
onError(data);
}
}
);
};
};
export const getKerberosAgentTags = (onSuccess, onError) => {
return (dispatch) => {
doGetKerberosAgentTags(
(data) => {
dispatch({
type: 'GET_MACHINERY_TAGS',
tags: data.data,
});
if (onSuccess) {
onSuccess();
}
},
() => {
if (onError) {
onError();
}
}
);
};
};
export const getDashboardInformation = (onSuccess, onError) => {
return (dispatch) => {
doGetDashboardInformation(
(data) => {
dispatch({
type: 'GET_DASHBOARD',
dashboard: data,
});
if (onSuccess) {
onSuccess();
}
},
() => {
if (onError) {
onError();
}
}
);
};
};
export const getEvents = (eventfilter, onSuccess, onError) => {
return (dispatch) => {
doGetEvents(
eventfilter,
(data) => {
dispatch({
type: 'GET_EVENTS',
events: data.events,
filter: eventfilter,
});
if (onSuccess) {
onSuccess();
}
},
() => {
if (onError) {
onError();
}
}
);
};
};
export const getConfig = (onSuccess, onError) => {
return (dispatch) => {
doGetConfig(
(config) => {
dispatch({
type: 'GET_CONFIG',
config,
});
if (onSuccess) {
onSuccess(config);
}
},
() => {
if (onError) {
onError();
}
}
);
};
};
export const updateConfig = (field, value) => {
return (dispatch) => {
dispatch({
type: 'UPDATE_CONFIG',
field,
value,
});
};
};
export const saveConfig = (service, config, onSuccess, onError) => {
return (dispatch) => {
doSaveConfig(
service,
config,
() => {
dispatch({
type: 'SAVE_CONTAINER',
});
if (onSuccess) {
onSuccess();
}
},
() => {
if (onError) {
onError();
}
}
);
};
};

View File

@@ -1 +1,2 @@
export * from './authentication';
export * from './agent';

153
ui/src/api/agent.js Normal file
View File

@@ -0,0 +1,153 @@
import API from './api';
export function doGetConfig(onSuccess, onError) {
const endpoint = API.get(`config`);
endpoint
.then((res) => {
if (res.status !== 200) {
throw new Error(res.data);
}
return res.data;
})
.then((data) => {
onSuccess(data);
})
.catch((error) => {
onError(error);
});
}
export function doSaveConfig(config, onSuccess, onError) {
const endpoint = API.post(`config`, {
...config,
});
endpoint
.then((res) => {
if (res.status !== 200) {
throw new Error(res.data);
}
return res.data;
})
.then((data) => {
onSuccess(data);
})
.catch((error) => {
onError(error);
});
}
export function doGetKerberosAgentTags(onSuccess, onError) {
const endpoint = API.get(`kerberos-agent/tags`);
endpoint
.then((res) => {
if (res.status !== 200) {
throw new Error(res.data);
}
return res.data;
})
.then((data) => {
onSuccess(data);
})
.catch((error) => {
onError(error);
});
}
export function doVerifyPersistence(config, onSuccess, onError) {
const endpoint = API.post(`persistence/verify`, {
...config,
});
endpoint
.then((res) => {
if (res.status !== 200) {
throw new Error(res.data);
}
return res.data;
})
.then((data) => {
onSuccess(data);
})
.catch((error) => {
onError(error);
});
}
export function doVerifyHub(config, onSuccess, onError) {
const endpoint = API.post(`hub/verify`, {
...config,
});
endpoint
.then((res) => {
if (res.status !== 200) {
throw new Error(res.data);
}
return res.data;
})
.then((data) => {
onSuccess(data);
})
.catch((error) => {
onError(error);
});
}
export function doVerifyCamera(streamType, config, onSuccess, onError) {
const cameraStreams = {
rtsp: '',
sub_rtsp: '',
};
if (config) {
cameraStreams.rtsp = config.capture.ipcamera.rtsp;
cameraStreams.sub_rtsp = config.capture.ipcamera.sub_rtsp;
}
const endpoint = API.post(`camera/verify/${streamType}`, cameraStreams);
endpoint
.then((res) => {
if (res.status !== 200) {
throw new Error(res.message);
}
return res.message;
})
.then((data) => {
onSuccess(data);
})
.catch((error) => {
onError(error);
});
}
export function doGetDashboardInformation(onSuccess, onError) {
const endpoint = API.get(`dashboard`);
endpoint
.then((res) => {
if (res.status !== 200) {
throw new Error(res.data);
}
return res.data;
})
.then((data) => {
onSuccess(data);
})
.catch((error) => {
onError(error);
});
}
export function doGetEvents(eventfilter, onSuccess, onError) {
const endpoint = API.post(`latest-events`, eventfilter);
endpoint
.then((res) => {
if (res.status !== 200) {
throw new Error(res.data);
}
return res.data;
})
.then((data) => {
onSuccess(data);
})
.catch((error) => {
onError(error);
});
}

View File

@@ -1,7 +1,7 @@
import API from './api';
export function doLogin(username, password, onSuccess, onError) {
API.post('api/login', {
API.post('login', {
username,
password,
})
@@ -26,7 +26,7 @@ export function doLogin(username, password, onSuccess, onError) {
}
export function doCheckIfInstalled(onSuccess, onError) {
API.get('api/installed')
API.get('installed')
.then((res) => {
if (res.status !== 200) {
throw new Error(res.data);
@@ -46,11 +46,3 @@ export function doCheckIfInstalled(onSuccess, onError) {
}
});
}
/* export function doAuth(onSuccess, onError) {
}
export function doRefreshToken(onSuccess, onError) {
} */

View File

@@ -0,0 +1,97 @@
import React from 'react';
import i18next from 'i18next';
import Popover from '@material-ui/core/Popover';
import List from '@material-ui/core/List';
import ListItem from '@material-ui/core/ListItem';
import ListSubheader from '@material-ui/core/ListSubheader';
import { Icon } from '@kerberos-io/ui';
import { useTranslation } from 'react-i18next';
import './LanguageSelect.scss';
const LanguageSelect = () => {
let selected = localStorage.getItem('i18nextLng') || i18next.language || 'en';
const languageMap = {
en: {
label: 'English',
dir: 'ltr',
active: true,
},
nl: { label: 'Nederlands', dir: 'ltr', active: false },
fr: { label: 'Francais', dir: 'ltr', active: false },
pl: { label: 'Polski', dir: 'ltr', active: false },
de: { label: 'Deutsch', dir: 'ltr', active: false },
pt: { label: 'Português', dir: 'ltr', active: false },
es: { label: 'Español', dir: 'ltr', active: false },
ja: { label: '日本', dir: 'rlt', active: false },
};
if (!languageMap[selected]) {
selected = 'en';
}
const [menuAnchor, setMenuAnchor] = React.useState(null);
React.useEffect(() => {
document.body.dir = languageMap[selected].dir;
}, [menuAnchor, selected]);
const { t } = useTranslation();
return (
<>
<li
id="language-picker"
onClick={({ currentTarget }) => setMenuAnchor(currentTarget)}
>
<a>
<Icon label="world" />
<span>{languageMap[selected].label}</span>
</a>
</li>
<Popover
open={!!menuAnchor}
anchorEl={menuAnchor}
onClose={() => setMenuAnchor(null)}
anchorOrigin={{
vertical: 'bottom',
horizontal: 'left',
}}
transformOrigin={{
vertical: 'top',
horizontal: 'left',
}}
>
<div>
<List>
<ListSubheader>{t('navigation.choose_language')}</ListSubheader>
{Object.keys(languageMap)?.map((item) => (
<ListItem
button
key={item}
onClick={() => {
i18next.changeLanguage(item);
localStorage.setItem('i18nextLng', item);
setMenuAnchor(null);
}}
>
{languageMap[item] ? languageMap[item].label : ''}
</ListItem>
))}
<hr />
<a
href="https://github.com/kerberos-io/agent/issues/47"
rel="noreferrer"
target="_blank"
>
<ListItem button key="contribute-language">
Contribute language
</ListItem>
</a>
</List>
</div>
</Popover>
</>
);
};
export default LanguageSelect;

View File

@@ -0,0 +1,33 @@
.MuiPopover-paper {
box-shadow: none !important;
}
.MuiListItem-button {
font-size: 14px;
line-height: 14px;
}
.MuiList-padding {
padding-top: 8px;
padding-bottom: 8px;
border-left: 2px solid #eeecec;
}
.MuiListSubheader-sticky {
line-height: 40px !important;
text-transform: uppercase;
font-size: 12px !important;
}
#language-picker {
cursor: pointer;
}
a, a:active, a:focus, a:hover {
color: inherit;
}
hr {
margin: 8px 0 0 0 !important;
padding: 4px 0 0 0 !important;
}

View File

@@ -1,19 +1,33 @@
const { hostname } = window.location;
const { protocol } = window.location;
const { hostname, host, protocol } = window.location;
const websocketprotocol = protocol === 'http:' ? 'ws:' : 'wss:';
// Uncomment this when using codespaces or other special DNS names (which you can't control)
// replace this with the DNS name of the kerberos agent server (the codespace url)
// const externalHost = 'xxx-8080.preview.app.github.dev';
const dev = {
ENV: 'dev',
// Comment the below lines, when using codespaces or other special DNS names (which you can't control)
HOSTNAME: hostname,
API_URL: `${protocol}//${hostname}:8080/`,
API_URL: `${protocol}//${hostname}:8080/api`,
URL: `${protocol}//${hostname}:8080`,
WS_URL: `${websocketprotocol}//${hostname}:8080/ws`,
// Uncomment, and comment the above lines, when using codespaces or other special DNS names (which you can't control)
// HOSTNAME: externalHost,
// API_URL: `${protocol}//${externalHost}/api`,
// URL: `${protocol}//${externalHost}`,
// WS_URL: `${websocketprotocol}//${externalHost}/ws`,
};
const prod = {
ENV: 'prod',
ENV: process.env.REACT_APP_ENVIRONMENT,
HOSTNAME: hostname,
API_URL: `${protocol}//${hostname}/api/`,
API_URL: `${protocol}//${host}/api`,
URL: `${protocol}//${host}`,
WS_URL: `${websocketprotocol}//${host}/ws`,
};
const config = process.env.REACT_APP_STAGE === 'production' ? prod : dev;
const config = process.env.REACT_APP_ENVIRONMENT === 'production' ? prod : dev;
export default {
// Add common config values here

View File

@@ -25,8 +25,8 @@ export default function RequireAuth(ComposedComponent) {
}
const mapStateToProps = (state) => ({
isAuthenticated: state.auth.loggedIn,
isInstalled: state.auth.installed,
isAuthenticated: state.authentication.loggedIn,
isInstalled: state.authentication.installed,
});
const mapDispatchToProps = (dispatch) =>

View File

@@ -27,8 +27,8 @@ export default function RequireGuest(ComposedComponent) {
}
const mapStateToProps = (state) => ({
isAuthenticated: state.auth.loggedIn,
isInstalled: state.auth.installed,
isAuthenticated: state.authentication.loggedIn,
isInstalled: state.authentication.installed,
});
const mapDispatchToProps = (dispatch) =>

View File

@@ -25,8 +25,8 @@ export default function RequireInstall(ComposedComponent) {
}
const mapStateToProps = (state) => ({
isAuthenticated: state.auth.loggedIn,
isInstalled: state.auth.installed,
isAuthenticated: state.authentication.loggedIn,
isInstalled: state.authentication.installed,
});
const mapDispatchToProps = (dispatch) =>

20
ui/src/i18n.js Normal file
View File

@@ -0,0 +1,20 @@
import i18n from 'i18next';
import { initReactI18next } from 'react-i18next';
import Backend from 'i18next-xhr-backend';
import LanguageDetector from 'i18next-browser-languagedetector';
i18n
.use(Backend)
.use(LanguageDetector)
.use(initReactI18next)
.init({
fallbackLng: 'en',
debug: false,
interpolation: {
escapeValue: false,
},
load: 'languageOnly',
whitelist: ['de', 'en', 'nl', 'fr', 'pl', 'es', 'pt', 'ja'],
});
export default i18n;

View File

@@ -1,10 +1,11 @@
import React from 'react';
import React, { Suspense } from 'react';
import ReactDOM from 'react-dom';
import { Route, Switch } from 'react-router-dom';
import { createStore, applyMiddleware } from 'redux';
import { createBrowserHistory } from 'history';
import { routerMiddleware, ConnectedRouter } from 'connected-react-router';
import { Provider } from 'react-redux';
import reduxWebsocket from '@giantmachines/redux-websocket';
import { composeWithDevTools } from 'redux-devtools-extension';
import thunk from 'redux-thunk';
import { Redirect } from 'react-router';
@@ -17,6 +18,7 @@ import Media from './pages/Media/Media';
import Settings from './pages/Settings/Settings';
import RequireAuth from './containers/RequireAuth';
import RequireGuest from './containers/RequireGuest';
import './i18n';
const history = createBrowserHistory();
@@ -31,7 +33,7 @@ function getAuthState() {
// const installed = localStorage.getItem('installed') || null;
const difference = new Date(expire) - new Date();
const state = {
auth: {
authentication: {
token,
expire,
username,
@@ -48,24 +50,32 @@ function getAuthState() {
}
}
const reduxWebsocketMiddleware = reduxWebsocket();
const store = createStore(
rootReducer(history),
{ ...getAuthState() },
composeWithDevTools(applyMiddleware(thunk, routerMiddleware(history)))
composeWithDevTools(
applyMiddleware(thunk, reduxWebsocketMiddleware, routerMiddleware(history))
)
);
const Loader = () => <div>loading...</div>;
ReactDOM.render(
<Provider store={store}>
<ConnectedRouter history={history}>
<Switch>
<Route path="/login" component={RequireGuest(Login)} />
<App>
<Route exact path="/" component={RequireAuth(Dashboard)} />
<Route exact path="/dashboard" component={RequireAuth(Dashboard)} />
<Route exact path="/" render={() => <Redirect to="/dashboard" />} />
<Route exact path="/media" component={RequireAuth(Media)} />
<Route exact path="/settings" component={RequireAuth(Settings)} />
</App>
<Suspense fallback={<Loader />}>
<App>
<Route exact path="/" component={RequireAuth(Dashboard)} />
<Route exact path="/dashboard" component={RequireAuth(Dashboard)} />
<Route exact path="/" render={() => <Redirect to="/dashboard" />} />
<Route exact path="/media" component={RequireAuth(Media)} />
<Route exact path="/settings" component={RequireAuth(Settings)} />
</App>
</Suspense>
</Switch>
</ConnectedRouter>
</Provider>,

View File

@@ -1,159 +1,320 @@
import React from 'react';
import PropTypes from 'prop-types';
import { Link, withRouter } from 'react-router-dom';
import { withTranslation } from 'react-i18next';
import { send } from '@giantmachines/redux-websocket';
import { connect } from 'react-redux';
import {
Breadcrumb,
KPI,
VideoCard,
ImageCard,
Table,
TableHeader,
TableBody,
TableRow,
Icon,
Ellipse,
Button,
Card,
SetupBox,
Modal,
ModalHeader,
ModalBody,
ModalFooter,
} from '@kerberos-io/ui';
// import { Link } from 'react-router-dom';
import './Dashboard.scss';
import ReactTooltip from 'react-tooltip';
import config from '../../config';
// eslint-disable-next-line react/prefer-stateless-function
class Dashboard extends React.Component {
constructor() {
super();
this.state = {
liveviewLoaded: false,
open: false,
currentRecording: '',
};
}
componentDidMount() {
const liveview = document.getElementsByClassName('videocard-video');
if (liveview && liveview.length > 0) {
liveview[0].addEventListener('load', () => {
this.setState({
liveviewLoaded: true,
});
});
}
const { connected } = this.props;
if (connected === true) {
const { dispatchSend } = this.props;
const message = {
message_type: 'stream-sd',
};
dispatchSend(message);
}
}
componentDidUpdate(prevProps) {
const { connected: connectedPrev } = prevProps;
const { connected } = this.props;
if (connectedPrev === false && connected === true) {
const { dispatchSend } = this.props;
const message = {
message_type: 'stream-sd',
};
dispatchSend(message);
}
}
componentWillUnmount() {
const liveview = document.getElementsByClassName('videocard-video');
if (liveview && liveview.length > 0) {
liveview[0].remove();
}
const { dispatchSend } = this.props;
const message = {
message_type: 'stop-sd',
};
dispatchSend(message);
}
handleClose() {
this.setState({
open: false,
currentRecording: '',
});
}
getCurrentTimestamp() {
return Math.round(Date.now() / 1000);
}
openModal(file) {
this.setState({
open: true,
currentRecording: file,
});
}
render() {
const { dashboard, t, images } = this.props;
const { liveviewLoaded, open, currentRecording } = this.state;
// We check if the camera was getting a valid frame
// during the last 5 seconds, otherwise we assume the camera is offline.
const isCameraOnline =
this.getCurrentTimestamp() - dashboard.cameraOnline < 15;
// We check if a connection is made to Kerberos Hub, or if Offline mode
// has been turned on.
const cloudOnline = this.getCurrentTimestamp() - dashboard.cloudOnline < 30;
let cloudConnection = t('dashboard.not_connected');
if (dashboard.offlineMode === 'true') {
cloudConnection = t('dashboard.offline_mode');
} else {
cloudConnection = cloudOnline
? t('dashboard.connected')
: t('dashboard.not_connected');
}
return (
<div>
<div id="dashboard">
<Breadcrumb
title="Dashboard"
level1="Overview of your video surveilance"
title={t('dashboard.title')}
level1={t('dashboard.heading')}
level1Link=""
>
{/* <Link to="/deployments">
<Link to="/media">
<Button
label="Add Kerberos Agent"
icon="plus-circle"
label={t('breadcrumb.watch_recordings')}
icon="media"
type="default"
/>
</Link> */}
</Link>
<Link to="/settings">
<Button
label={t('breadcrumb.configure')}
icon="preferences"
type={isCameraOnline ? 'neutral' : 'default'}
/>
</Link>
</Breadcrumb>
<div className="stats grid-container --four-columns">
<KPI number="69" divider="0" footer="Number of days" />
<KPI number="1540" divider="0" footer="Total recordings" />
<Card
title="Camera"
subtitle="succesfully connected"
footer="IP Camera"
icon="circle-check-big"
<KPI
number={dashboard.days ? dashboard.days.length : 0}
divider="0"
footer={t('dashboard.number_of_days')}
/>
<Card
title="Cloud"
subtitle="Not connected"
footer="Kerberos Hub"
icon="circle-cross-big"
<KPI
number={
dashboard.numberOfRecordings ? dashboard.numberOfRecordings : 0
}
divider="0"
footer={t('dashboard.total_recordings')}
/>
<Link to="/settings">
<Card
title="IP Camera"
subtitle={
isCameraOnline
? t('dashboard.connected')
: t('dashboard.not_connected')
}
footer="Camera"
icon={isCameraOnline ? 'circle-check-big' : 'circle-cross-big'}
/>
</Link>
<Link to="/settings">
<Card
title="Kerberos Hub"
subtitle={cloudConnection}
footer="Cloud"
icon={
cloudOnline && dashboard.offlineMode !== 'true'
? 'circle-check-big'
: 'circle-cross-big'
}
/>
</Link>
</div>
<hr />
<div className="stats grid-container --two-columns">
<div>
<h2>Latest events</h2>
<Table>
<TableHeader>
<TableRow
id="header"
headercells={['time', 'description', 'name']}
/>
</TableHeader>
<TableBody>
<TableRow
id="cells1"
bodycells={[
<>
<Ellipse status="success" />{' '}
<p data-tip="10m and 5s ago">19:45:10</p>
</>,
<>
<p>Motion was detected</p>
</>,
<>
<span className="version">Frontdoor</span>&nbsp;
<Icon label="cameras" />
</>,
]}
/>
<TableRow
id="cells1"
bodycells={[
<>
<Ellipse status="success" />{' '}
<p data-tip="10m and 5s ago">18:23:44</p>
</>,
<>
<p>Motion was detected</p>
</>,
<>
<span>Frontdoor</span>&nbsp;
<Icon label="cameras" />
</>,
]}
/>
<TableRow
id="cells1"
bodycells={[
<>
<Ellipse status="success" />{' '}
<p data-tip="10m and 5s ago">18:20:29</p>
</>,
<>
<p>Motion was detected</p>
</>,
<>
<span className="version">Frontdoor</span>&nbsp;
<Icon label="cameras" />
</>,
]}
/>
<TableRow
id="cells1"
bodycells={[
<>
<Ellipse status="success" />{' '}
<p data-tip="10m and 5s ago">15:16:58</p>
</>,
<>
<p>Motion was detected</p>
</>,
<>
<span className="version">Frontdoor</span>&nbsp;
<Icon label="cameras" />
</>,
]}
/>
<TableRow
id="cells1"
bodycells={[
<>
<Ellipse status="success" />{' '}
<p data-tip="10m and 5s ago">10:05:44</p>
</>,
<>
<p>Motion was detected</p>
</>,
<>
<span className="version">Frontdoor</span>&nbsp;
<Icon label="cameras" />
</>,
]}
/>
</TableBody>
</Table>
<h2>{t('dashboard.latest_events')}</h2>
{(!dashboard.latestEvents ||
dashboard.latestEvents.length === 0) && (
<SetupBox
dashed
url="/settings"
btnicon="preferences"
btnlabel={t('dashboard.configure_connection')}
header={t('dashboard.no_events')}
text={t('dashboard.no_events_description')}
/>
)}
{dashboard.latestEvents && dashboard.latestEvents.length > 0 && (
<Table>
<TableHeader>
<TableRow
id="header"
headercells={[
t('dashboard.time'),
t('dashboard.description'),
t('dashboard.name'),
]}
/>
</TableHeader>
<TableBody>
{dashboard.latestEvents &&
dashboard.latestEvents.map((event) => (
<TableRow
key={event.timestamp}
id="cells1"
bodycells={[
<>
<div
className="time"
onClick={() =>
this.openModal(
`${config.URL}/file/${event.key}`
)
}
>
<Ellipse status="success" />{' '}
<p data-tip="10m and 5s ago">{event.time}</p>
</div>
</>,
<>
<p
className="pointer event-description"
onClick={() =>
this.openModal(
`${config.URL}/file/${event.key}`
)
}
>
{t('dashboard.motion_detected')}
</p>
</>,
<>
<span className="version">{event.camera_name}</span>
&nbsp;
<Icon label="cameras" />
</>,
]}
/>
))}
</TableBody>
{open && (
<Modal>
<ModalHeader
title="View recording"
onClose={() => this.handleClose()}
/>
<ModalBody>
<video controls autoPlay>
<source src={currentRecording} type="video/mp4" />
</video>
</ModalBody>
<ModalFooter
right={
<>
<a
href={currentRecording}
download="video"
target="_blank"
rel="noreferrer"
>
<Button
label="Download"
icon="download"
type="button"
buttonType="button"
/>
</a>
<Button
label="Close"
icon="cross-circle"
type="button"
buttonType="button"
onClick={() => this.handleClose()}
/>
</>
}
/>
</Modal>
)}
</Table>
)}
</div>
<div>
<h2>Live view</h2>
<VideoCard
handleClickHD={() => {}}
handleClickSD={() => {}}
videoSrc="https://www.w3schools.com/html/mov_bbb.mp4"
videoStatus="recording"
videoStatusTitle="live"
/>
<h2>{t('dashboard.live_view')}</h2>
{!liveviewLoaded && (
<SetupBox
btnicon="preferences"
btnlabel={t('dashboard.configure_connection')}
dashed
url="/settings"
header={t('dashboard.loading_live_view')}
text={t('dashboard.loading_live_view_description')}
/>
)}
<div style={{ visibility: liveviewLoaded ? 'visible' : 'hidden' }}>
<ImageCard
imageSrc={`data:image/png;base64, ${
images.length ? images[0] : ''
}`}
onerror=""
/>
</div>
</div>
</div>
<ReactTooltip />
@@ -161,4 +322,25 @@ class Dashboard extends React.Component {
);
}
}
export default Dashboard;
const mapStateToProps = (state /* , ownProps */) => ({
dashboard: state.agent.dashboard,
connected: state.wss.connected,
images: state.wss.images,
});
const mapDispatchToProps = (dispatch) => ({
dispatchSend: (message) => dispatch(send(message)),
});
Dashboard.propTypes = {
dashboard: PropTypes.object.isRequired,
connected: PropTypes.bool.isRequired,
images: PropTypes.array.isRequired,
t: PropTypes.func.isRequired,
dispatchSend: PropTypes.func.isRequired,
};
export default withTranslation()(
withRouter(connect(mapStateToProps, mapDispatchToProps)(Dashboard))
);

View File

@@ -1,3 +1,44 @@
hr {
margin-top: 50px;
@import "../../app.variables";
#dashboard {
hr {
margin-top: 50px;
}
.dashed {
padding: 20%;
}
.pointer {
cursor: pointer;
}
video {
width: 100%;
}
p.event-description {
display: none;
@media (min-width: 800px) {
display: block;
}
}
a {
display: flex;
color: var(--text);
&:hover, &:active {
color: var(--text);
}
}
.time {
display: flex;
align-items: center;
.ellipse-container {
margin-right: 8px;
}
}
}

View File

@@ -108,8 +108,8 @@ class Login extends React.Component {
}
const mapStateToProps = (state) => ({
loginError: state.auth.loginError,
error: state.auth.error,
loginError: state.authentication.loginError,
error: state.authentication.error,
});
const mapDispatchToProps = (dispatch) => ({

View File

@@ -87,8 +87,8 @@ class LoginForm extends React.Component {
}
const mapStateToProps = (state) => ({
loginError: state.auth.loginError,
error: state.auth.error,
loginError: state.authentication.loginError,
error: state.authentication.error,
});
const mapDispatchToProps = (dispatch) => ({

Some files were not shown because too many files have changed in this diff Show More