Compare commits

...

1156 Commits

Author SHA1 Message Date
Koushik Dutta
53c4aa7066 Merge branch 'main' of github.com:koush/scrypted 2024-06-25 22:10:51 -07:00
Koushik Dutta
ce5547e4e7 server: Fix bug where mixins are not invalidated after a plugin restart fails, and then later succeeds. 2024-06-25 22:10:45 -07:00
Koushik Dutta
95bdf5c2b5 homekit: Update README.md 2024-06-25 19:18:51 -07:00
Koushik Dutta
8953a96089 homekit: Update README.md 2024-06-25 19:16:58 -07:00
Koushik Dutta
0d270454ab predict: switch everything to yolov9t/c 2024-06-25 15:46:25 -07:00
Koushik Dutta
e740a695c0 h264: refactor/cleanup common utils 2024-06-25 12:41:57 -07:00
Koushik Dutta
78118daa69 rebroadcast: fix hang if ffmpeg exits without any connection 2024-06-25 09:44:06 -07:00
Koushik Dutta
61a824d322 sdk: suppress storage event for hidden values 2024-06-25 09:04:00 -07:00
Koushik Dutta
06bac3c748 reolink: fix settings regression 2024-06-25 07:51:54 -07:00
Koushik Dutta
16b10dc353 postbeta 2024-06-25 00:16:54 -07:00
Koushik Dutta
6892b443e0 server: fix plugin fork storage desync 2024-06-25 00:16:20 -07:00
Koushik Dutta
8b303e037e rebroadcast: delete legacy code 2024-06-25 00:15:53 -07:00
Koushik Dutta
76efef37ea reolink: fix errant device provider on all devices 2024-06-24 18:15:47 -07:00
Koushik Dutta
e64a66aa66 reolink: simple password check, publish pull requests 2024-06-24 18:13:17 -07:00
Koushik Dutta
05578d28c6 rebroadcast: fix resolution reporting 2024-06-24 15:39:05 -07:00
Koushik Dutta
0889aea3be rebroadcast: reduce error logging 2024-06-24 12:24:01 -07:00
Koushik Dutta
a081e6e3c9 rebroadcast: refactor codec and resolution detection 2024-06-24 09:05:20 -07:00
Koushik Dutta
5dfa0889b7 homekit: window covering wip 2024-06-23 19:53:41 -07:00
Koushik Dutta
ed1d09b9be homekit: window covering wip 2024-06-23 19:53:07 -07:00
Koushik Dutta
2d8a986155 Merge branch 'main' of github.com:koush/scrypted 2024-06-23 17:43:38 -07:00
Koushik Dutta
1fb4cfd3b6 homekit: window covering wip 2024-06-23 17:43:34 -07:00
George Talusan
2d987747a2 reolink: add siren support (#1506) 2024-06-23 15:17:52 -07:00
Koushik Dutta
d39e4e3ff1 hikvision: fix channel id on old nvr 2024-06-22 16:48:37 -07:00
Koushik Dutta
012ca48f9a hikvision: Fix older nvr that send malformed boundary events 2024-06-22 12:46:12 -07:00
Koushik Dutta
cca1f3e000 wyze: update dwb and publish beta 2024-06-21 15:51:32 -07:00
Koushik Dutta
40a38cfd31 webrtc: fix icloud private relay 2024-06-20 20:36:56 -07:00
Koushik Dutta
d2b39e8fa3 cloud: handle case where cloud token comes populated from desktop app with no server id. 2024-06-20 13:04:01 -07:00
Koushik Dutta
20101cda2e common: fix audio only rtp parsing 2024-06-20 10:31:28 -07:00
Koushik Dutta
c90724daa6 common: createActivityTimeout 2024-06-20 09:21:21 -07:00
Koushik Dutta
fedb22fab2 common: fix rtp forwarder in some cases when audio does not exist 2024-06-19 20:20:59 -07:00
Koushik Dutta
994f1974d7 Merge branch 'main' of github.com:koush/scrypted 2024-06-19 20:03:30 -07:00
Koushik Dutta
d648fe552d common: fix double rtp packet delivery in some cases 2024-06-19 20:03:23 -07:00
Koushik Dutta
ccafff28cd cloud: update deps and publish 2024-06-19 09:13:29 -07:00
Koushik Dutta
3da49d47af cloud: fix cloudflared exit 2024-06-19 08:37:20 -07:00
George Talusan
e1918cfa89 reolink: add ONVIF objection detection for cameras that can support it (#1502) 2024-06-19 08:00:42 -07:00
Koushik Dutta
7b19204d77 webrtc: fixup for intercom? 2024-06-18 20:20:19 -07:00
Koushik Dutta
5dac1de87e rebroadcast/common: h265 keyframe search 2024-06-18 20:18:59 -07:00
Koushik Dutta
c9a2474f17 Merge branch 'main' of github.com:koush/scrypted 2024-06-18 13:56:12 -07:00
Koushik Dutta
e5d9d0d054 rebroadcast: handle basic h265 idr parsing 2024-06-18 13:56:08 -07:00
Koushik Dutta
1272582510 snapshot: log http endpoit errors 2024-06-18 11:03:33 -07:00
Koushik Dutta
51271a0e02 unif-protect: id remapping fix 2024-06-18 11:03:08 -07:00
Koushik Dutta
9b32952a22 Merge branch 'main' of github.com:koush/scrypted 2024-06-18 10:04:54 -07:00
Koushik Dutta
5b92aea54b webrtc: fix google device access leaks? 2024-06-18 10:04:48 -07:00
Brett Jia
61b59f4ca0 rknn: use numpy < 2.0.0 (#1500) 2024-06-16 18:38:34 -07:00
Koushik Dutta
93f8f43de2 onnx: derp 2024-06-16 16:53:45 -07:00
Koushik Dutta
dc88e0b07f detect: pin numpy to prevent usage of 2.0 2024-06-16 16:50:44 -07:00
Koushik Dutta
14a9f953a9 coreml: lock numpy, new 2.0 breaks stuff 2024-06-16 13:18:46 -07:00
George Talusan
528885d5e2 reolink: save GetAiState to hasObjectDetector so object detector can work (#1497) 2024-06-15 12:19:07 -07:00
Koushik Dutta
e779f37689 proxmox: no one can read 2024-06-14 07:54:26 -07:00
Koushik Dutta
c6c2a8dc49 predict: prevent face recognition on low score faces 2024-06-10 22:11:19 -07:00
Koushik Dutta
d8d2fd25cd predict: fix batch error reporting 2024-06-10 16:02:50 -07:00
Koushik Dutta
301a5b6685 predict: increase face recognition threshold 2024-06-10 13:10:08 -07:00
Koushik Dutta
2a4bac42ed core: opencl update 2024-06-07 13:18:36 -07:00
Koushik Dutta
f55cadedb5 linux: update intel opencl debs 2024-06-07 13:14:48 -07:00
Koushik Dutta
dd9ff45b21 predict: widen text input size from 256 to 384 2024-06-07 10:26:51 -07:00
Koushik Dutta
a0aada2f03 Merge branch 'main' of github.com:koush/scrypted 2024-06-06 10:26:07 -07:00
Koushik Dutta
8499843f31 predict: use locked pillow version 2024-06-06 10:26:01 -07:00
Koushik Dutta
672a33b93b ha: Update config.yaml 2024-06-05 22:56:02 -07:00
Koushik Dutta
f9a744c7dc core: make login 1 week 2024-06-05 21:37:16 -07:00
Koushik Dutta
5b124013b7 predict: fix lpr deskew bugs 2024-06-05 11:14:31 -07:00
Koushik Dutta
d2f1c69e98 predict: shuffle common files out of tflite 2024-06-05 08:30:39 -07:00
Koushik Dutta
2a2f96a771 predict: use smaller image for face detect 2024-06-04 22:15:43 -07:00
Koushik Dutta
dc9b5f447e postrelease 2024-06-04 15:55:09 -07:00
Koushik Dutta
1fb0c01e7e postbeta 2024-06-04 15:53:17 -07:00
Koushik Dutta
014d7b35ac server: ensure plugins get restarted if failing during reload 2024-06-04 15:53:04 -07:00
Koushik Dutta
b08267dab0 server: beta 2024-06-04 13:59:58 -07:00
Koushik Dutta
97d78516f2 postbeta 2024-06-04 13:59:53 -07:00
Koushik Dutta
360c2437c1 postbeta 2024-06-04 13:26:57 -07:00
Koushik Dutta
0b230bfc74 Merge branch 'main' of github.com:koush/scrypted 2024-06-04 12:58:12 -07:00
Koushik Dutta
d25dc8d266 postbeta 2024-06-04 12:57:01 -07:00
Koushik Dutta
5f4d1e99cd postbeta 2024-06-04 12:43:17 -07:00
Koushik Dutta
ee38ef7817 Update bug_report.md 2024-06-04 08:32:06 -07:00
Koushik Dutta
80af38d3e1 Merge branch 'main' of github.com:koush/scrypted 2024-06-03 23:34:05 -07:00
Koushik Dutta
2f19866f05 predict: relax face threshold 2024-06-03 23:34:01 -07:00
Long Zheng
cf1c500e9d common: Enable TypeScript strict for packages/auth-fetch (#1493)
* Add tsconfig strict to packages/auth-fetch

* Refactor switch case

* Revert "Refactor switch case"

This reverts commit b5004664bb.

* Revert switch changes
2024-06-03 17:48:38 -07:00
Koushik Dutta
9a770e9dc9 predict: update models 2024-06-03 15:08:58 -07:00
Koushik Dutta
6dbb8863a0 Merge branch 'main' of github.com:koush/scrypted 2024-06-03 10:38:44 -07:00
Koushik Dutta
5eac8d0ab9 predict: lock opencv version,
roll back to 9c flt
2024-06-03 10:38:36 -07:00
Long Zheng
272bad8f29 cli: Enable TypeScript strict for packages/cli (#1494)
* Enable strict mode on packages/cli

* Fix condition
2024-06-03 10:34:18 -07:00
Koushik Dutta
83a3352862 predict: extract rough text scores 2024-06-02 13:33:54 -07:00
Koushik Dutta
4d5a693208 core: add labels to detection preview 2024-06-02 08:07:48 -07:00
Koushik Dutta
70e7f944c0 postrelease 2024-06-01 22:02:17 -07:00
Koushik Dutta
5a52c03a3d postrelease 2024-06-01 20:09:34 -07:00
Koushik Dutta
f9f597ef01 server: guard entire plugin load block 2024-06-01 13:07:55 -07:00
Koushik Dutta
2e07788c0c server: log plugin load failure 2024-06-01 13:05:56 -07:00
Koushik Dutta
9c0fbc1cb6 common: listenZeroSingleClient configurable timeout 2024-06-01 09:44:51 -07:00
Koushik Dutta
239d49899d unifi-protect: fix id remapping 2024-06-01 09:19:32 -07:00
Koushik Dutta
2d3589b5a3 unifi-protect: fix id remapping 2024-06-01 08:49:37 -07:00
Koushik Dutta
96ec465a38 unifi: more logging 2024-06-01 08:07:24 -07:00
Koushik Dutta
5bb6b87c7d predict: yolov10m 2024-05-31 15:17:24 -07:00
Koushik Dutta
fcfedccaf8 postrelease 2024-05-31 14:01:24 -07:00
Koushik Dutta
98373833fd postrelease 2024-05-31 13:38:43 -07:00
Brett Jia
03588be125 rknn: use correct nativeId for text recognition (#1492) 2024-05-31 13:24:18 -07:00
Koushik Dutta
cdd81daec5 Merge branch 'main' of github.com:koush/scrypted 2024-05-31 10:49:12 -07:00
Koushik Dutta
d64f90c0c8 predict: republish with smaller plate/face models. fix openvino thread bugs 2024-05-31 10:49:08 -07:00
Brett Jia
ec31dee36e onnx: fix text recognition thread names (#1491) 2024-05-31 09:56:18 -07:00
Brett Jia
11f2e88590 rknn: add text recognition (#1490)
* rknn: add text recognition

* disable verbose
2024-05-31 09:56:09 -07:00
Koushik Dutta
bf51ddb2d5 server: checks to ensure plugin restart doesnt ignore zombie states 2024-05-31 08:26:20 -07:00
Koushik Dutta
26000f1828 predict: yolov10 2024-05-30 09:55:28 -07:00
Koushik Dutta
f65485af97 Merge remote-tracking branch 'origin/main' into rebroadcast 2024-05-30 09:37:02 -07:00
Koushik Dutta
72c5690d05 rebroadcast: beta 2024-05-30 09:29:48 -07:00
Koushik Dutta
e076d61122 rebroadcast: fixup reverts 2024-05-30 09:29:14 -07:00
Koushik Dutta
7071808514 Revert "rebroadcast: parser perf refactor"
This reverts commit f677cf7393.
2024-05-30 09:27:27 -07:00
Koushik Dutta
1e2fd46cd3 Revert "rebroadcast: more parser refactor"
This reverts commit 5432b5b917.
2024-05-30 09:24:53 -07:00
Koushik Dutta
e3cdd4326f videoanalysis: label scores 2024-05-30 09:21:07 -07:00
Koushik Dutta
227f932ad8 coreml: yolov10 2024-05-30 09:20:53 -07:00
Koushik Dutta
67cec188ce docker: fix partition detection 2024-05-30 07:49:38 -07:00
Koushik Dutta
1ee276185e sdk: label score 2024-05-28 21:59:59 -07:00
Brett Jia
42ed855b05 actions: replace local install test with setup-scrypted action (#1488)
* actions: replace local install test with setup-scrypted action

* update

* extract server version from package.json

* use package-lock.json
2024-05-28 12:59:13 -07:00
Jonathan Yip
93da4eed30 docker: Add security_opt to allow container to talk to host avahi daemon (#1487) 2024-05-28 09:21:31 -07:00
Long Zheng
a72a596578 homekit: Homekit camera close recording tweaks (#1486)
* Change throw to log

Throw will not work since the `handleFragmentsRequests` async generator is already closed/finished by HAP

* Move isOpen check

HAP still requests fragment after closing the recording stream. Skip processing it.

* Change catch message

* Add another !isOpen in case race condition with await
2024-05-27 10:12:00 -07:00
Brett Jia
72663dd68c installer: allow specifying exact server version to install (#1485)
* Update install-scrypted-dependencies-mac.sh

* Update install-scrypted-dependencies-linux.sh

* Update install-scrypted-dependencies-win.ps1

* Update install-scrypted-dependencies-win.ps1

* Update install-scrypted-dependencies-win.ps1

* Update install-scrypted-dependencies-win.ps1
2024-05-26 12:51:02 -07:00
Koushik Dutta
108d57dbdd Merge remote-tracking branch 'origin/main' into rebroadcast 2024-05-26 09:06:54 -07:00
Brett Jia
bc71fd8515 server: print python interpreter path (#1484) 2024-05-25 22:29:46 -07:00
Koushik Dutta
a51070767b homekit: change default advertiser back to ciao due to issues. use identifying material 2024-05-25 19:26:21 -07:00
Koushik Dutta
269cc4dbc9 rebroadcast: beta 2024-05-24 22:43:18 -07:00
Koushik Dutta
684961fa4b openvino: types 2024-05-24 22:43:11 -07:00
Koushik Dutta
4f60b7e379 sdk: update 2024-05-24 22:42:48 -07:00
Koushik Dutta
5d72061151 ha: publish 2024-05-21 09:19:43 -07:00
Brett Jia
f2c940c1d3 server: add SCRYPTED_COMPATIBILITY_FILE (#1479) 2024-05-19 13:38:57 -07:00
Koushik Dutta
7e817b0b30 rebroadcast: further removal of legacy code 2024-05-19 11:22:10 -07:00
Brett Jia
75bb15d3b7 Revert "server: make fetching network interfaces optional (#1474)" (#1478)
This reverts commit 0160502da8.
2024-05-17 17:39:24 -07:00
Koushik Dutta
ba1a1eff67 onnx: report device in use 2024-05-17 09:08:07 -07:00
Koushik Dutta
5432b5b917 rebroadcast: more parser refactor 2024-05-16 22:33:23 -07:00
Koushik Dutta
f677cf7393 rebroadcast: parser perf refactor 2024-05-15 14:17:06 -07:00
Koushik Dutta
bdf9278131 rebroadcast: initial pass and removing legacy parsers 2024-05-15 10:03:26 -07:00
Koushik Dutta
0ae93a9c3f cli: publish 2024-05-15 09:24:18 -07:00
Long Zheng
72422cdd8b windows: Fix Windows server install with installDir containing space (#1471)
* Fix server install with installDir containing space

* Revert "Fix server install with installDir containing space"

This reverts commit b99ccd3c3d.

* Alternate fix by wrapping each runCommand arg in a quote for Windows
2024-05-15 09:23:05 -07:00
Koushik Dutta
390d1b3329 onnx: add windows cuda support 2024-05-14 15:18:17 -07:00
Koushik Dutta
024e99766a amcrest: fix legacy boundary https://github.com/koush/scrypted/issues/1475 2024-05-14 15:06:21 -07:00
Brett Jia
0160502da8 server: make fetching network interfaces optional (#1474) 2024-05-14 13:40:12 -07:00
Koushik Dutta
f0d65982de postrelease 2024-05-13 19:31:55 -07:00
Koushik Dutta
1445933bd4 postbeta 2024-05-13 17:40:33 -07:00
Koushik Dutta
508f31c254 core: update intel opencl in lxc 2024-05-13 17:36:33 -07:00
Koushik Dutta
fd1aa10a2a postbeta 2024-05-13 17:08:32 -07:00
Koushik Dutta
fceed68d75 postbeta 2024-05-13 15:49:05 -07:00
Koushik Dutta
955e780c64 docker: fix missing intel dep 2024-05-13 13:22:37 -07:00
Koushik Dutta
452fe20e8f docker/lxc: update intel graphics install script 2024-05-13 12:44:36 -07:00
Koushik Dutta
9083e16cdb postbeta 2024-05-13 10:22:09 -07:00
Koushik Dutta
840a278e5d server: add methods to manage plugin engine.io connections 2024-05-13 10:21:43 -07:00
Koushik Dutta
6d036dbd60 server: fix python runtime worker setup 2024-05-13 10:21:29 -07:00
Koushik Dutta
d5ba6f34d6 onnx: cleanup 2024-05-13 10:00:53 -07:00
Koushik Dutta
0321846c22 storage-settings/videoanalysis: fix default value of 0 2024-05-12 21:43:55 -07:00
Koushik Dutta
714747fcee videoanalysis: fix bug 2024-05-12 21:20:37 -07:00
Koushik Dutta
e3906da3c4 videoanalysis: new option to reset smart motion sensor only when motion stops 2024-05-12 21:17:41 -07:00
Koushik Dutta
820ef70033 predict plugins: refactor recog, add onnx, fix spurious model leaks 2024-05-12 21:00:48 -07:00
Koushik Dutta
0c95f5c052 tapo: fix 2 way audio on some models 2024-05-11 19:11:58 -07:00
Koushik Dutta
4cfd7c4362 tapo: fix 2 way audio on some models 2024-05-11 19:11:42 -07:00
Koushik Dutta
1e8126dec8 common: header casing preservation 2024-05-11 19:11:30 -07:00
Koushik Dutta
d3fbc58736 openvino: fix yolo nas labels 2024-05-11 12:05:02 -07:00
Koushik Dutta
46113744b3 dev: fix setup script 2024-05-11 10:07:18 -07:00
Koushik Dutta
3947624ae0 openvino: rollback to stable openvino 2024-05-11 09:07:32 -07:00
Koushik Dutta
4ac5ded012 openvino/onnx: publish yolo nas 2024-05-10 20:47:41 -07:00
Koushik Dutta
aadfacf50a Merge branch 'main' of github.com:koush/scrypted 2024-05-10 19:46:01 -07:00
Koushik Dutta
bb1e0ac82b coreml: yolo-nas 2024-05-10 19:45:56 -07:00
Koushik Dutta
23a15a1533 docker: mount changes may need systemctl daemon-reload 2024-05-09 12:59:36 -07:00
Koushik Dutta
01dd480c01 Merge branch 'main' of github.com:koush/scrypted 2024-05-08 20:33:17 -07:00
Koushik Dutta
364cae3273 openvino: update pypi 2024-05-08 20:33:12 -07:00
Koushik Dutta
8a986ab707 windows: -y on choco install 2024-05-08 07:56:31 -07:00
Koushik Dutta
ca96959de8 openvino/onnx: move prep into separate threads 2024-05-07 20:42:06 -07:00
Koushik Dutta
2f0ae9ef50 snapshot: fix weird npm cache bug 2024-05-07 20:26:59 -07:00
Koushik Dutta
8b84bac2c2 snapshot/homekit: fix stale snapshots 2024-05-07 20:22:45 -07:00
Koushik Dutta
976ed7f1a5 onnx: multiple gpu support 2024-05-07 11:26:56 -07:00
Koushik Dutta
b4e6821da8 tensorflow-lite: use dict vs queue for perf 2024-05-07 10:52:06 -07:00
Koushik Dutta
540b990a08 ha: Update config.yaml 2024-05-06 18:26:18 -07:00
Koushik Dutta
ce75b072da various: publish 2024-05-06 16:31:37 -07:00
Greg Thornton
5bca9b7156 homekit: fix late 2way setup (#1461)
* homekit: fix late 2way setup

* homekit: use 2-way state rather than playing/intitializing
2024-05-06 16:28:38 -07:00
Greg Thornton
ae4914346b webrtc: don't store audio codec before intercom start (#1462) 2024-05-06 14:08:47 -07:00
slyoldfox
b593209558 Fix bticino intercom, clean up some dependencies (#1463)
* Allow setting the DEVADDR option

* Fix intercom by using startRtpForwarderProcess()
Clean up some dependencies

* Allow logging errors in sip-manager
Cleanup bloated and barely used dependencies
2024-05-06 13:07:30 -07:00
Koushik Dutta
9df399708f postrelease 2024-05-04 13:07:02 -07:00
Koushik Dutta
ea25682488 onnx: publish for cuda 11 2024-05-04 12:08:13 -07:00
Koushik Dutta
06e25e6a16 Merge branch 'main' of github.com:koush/scrypted 2024-05-04 12:05:37 -07:00
Koushik Dutta
10847ef3f2 tapo: publish 2024-05-04 12:05:28 -07:00
Koushik Dutta
78184390ac postbeta 2024-05-04 12:05:24 -07:00
Koushik Dutta
9a0c88ac61 docker: auto accept nvidia script 2024-05-04 10:24:24 -07:00
Koushik Dutta
646dd3613c linux: fix service files 2024-05-04 10:00:24 -07:00
Koushik Dutta
ab87abb859 core: publish lxc logging spam 2024-05-04 09:54:22 -07:00
Greg Thornton
5ce1a2b406 taco: Fix Tapo 2-way audio (#1460)
* tapo: update tapo intercom types

* tapo: update http-auth-fetch calls

* tapo: write extra crlf to 2way audio stream

* tapo: bump version
2024-05-04 08:56:05 -07:00
Koushik Dutta
1abda3b425 docker: add both nvidia libs 2024-05-03 23:54:06 -07:00
Koushik Dutta
c759becac6 docker: use separate amd64 builder 2024-05-03 23:27:59 -07:00
Koushik Dutta
b3a16c0000 docker: use separate amd64 builder 2024-05-03 23:24:36 -07:00
Koushik Dutta
0163a804cd Merge branch 'main' of github.com:koush/scrypted 2024-05-03 22:04:02 -07:00
Koushik Dutta
ab157b16f1 onnx: update 2024-05-03 22:03:56 -07:00
Koushik Dutta
905a9aec21 python plugins: fix linux platform check 2024-05-03 21:58:35 -07:00
Koushik Dutta
8e63dcdb15 docker: downgrade to allow cuda 11 2024-05-03 21:51:55 -07:00
Koushik Dutta
05cad811e8 postbeta 2024-05-03 18:10:05 -07:00
Koushik Dutta
69a3e1138b Merge branch 'main' of github.com:koush/scrypted 2024-05-03 18:08:24 -07:00
Koushik Dutta
9c9e29068b server: Improve plugin health check 2024-05-03 18:07:17 -07:00
Koushik Dutta
b8bb6dfa61 ha: remove arm7 2024-05-03 17:40:29 -07:00
Koushik Dutta
809956a2a4 docker: standardize versioning 2024-05-03 15:23:43 -07:00
Koushik Dutta
0be72a70a5 docker: fixup versioning to new format 2024-05-03 14:46:58 -07:00
Koushik Dutta
9d03566246 Merge branch 'main' of github.com:koush/scrypted 2024-05-03 14:40:35 -07:00
Koushik Dutta
7c023dbdf6 lxc: disable systemd logging 2024-05-03 14:31:38 -07:00
Koushik Dutta
1f2187fd6a docker: simplify build matrix 2024-05-03 14:12:21 -07:00
Koushik Dutta
83b60b7b2b docker: fixup args 2024-05-03 14:00:46 -07:00
Koushik Dutta
edfdd5c1a8 docker: move nvidia to scrypted-common 2024-05-03 13:59:33 -07:00
Koushik Dutta
cdd350f52b postbeta 2024-05-03 10:07:07 -07:00
Koushik Dutta
1594364194 Merge branch 'main' of github.com:koush/scrypted 2024-05-03 10:04:51 -07:00
Koushik Dutta
8dac20ed1c docker: fixup nvidia 2024-05-02 23:45:03 -07:00
Koushik Dutta
20beacb746 docker: add nvidia default tag 2024-05-02 23:40:11 -07:00
Koushik Dutta
ac51fa6355 docker: fix nvidia build checkout 2024-05-02 23:13:09 -07:00
Koushik Dutta
05a60831e6 docker: fix buildx 2024-05-02 22:57:52 -07:00
Koushik Dutta
dd13fee049 postbeta 2024-05-02 22:25:34 -07:00
Koushik Dutta
31fd833873 docker: nvidia build 2024-05-02 22:25:06 -07:00
Koushik Dutta
a0e5dd4c89 cli: publish 2024-05-02 22:18:16 -07:00
Koushik Dutta
215daf5af7 docker: nvidia buid 2024-05-02 22:09:44 -07:00
Koushik Dutta
a82972d967 Merge branch 'main' of github.com:koush/scrypted 2024-05-02 19:51:42 -07:00
Koushik Dutta
6fd6c7af14 onnx: publish 2024-05-02 19:51:37 -07:00
Koushik Dutta
6d1cf5d3c1 nvidia: docker cuda builder 2024-05-02 19:30:21 -07:00
Koushik Dutta
0cfef48954 openvino: add nvidia dgpu support 2024-05-02 10:47:06 -07:00
Koushik Dutta
e9722d3875 docker: remove obsolete version 2024-05-02 10:10:30 -07:00
Koushik Dutta
fa8d17bec9 docker: update compose file for nvidia opencl support 2024-05-02 10:04:51 -07:00
Koushik Dutta
d69ec69038 Merge branch 'main' of github.com:koush/scrypted 2024-05-01 23:25:40 -07:00
Koushik Dutta
106fc1bf58 onnx: initial commit 2024-05-01 23:25:35 -07:00
Long Zheng
4b055f55e1 server/cli: Fix Node 20.12.2 child_process.spawn .cmd EINVAL on Windows (#1455)
* Fix spawning .cmd on Windows

* Fix comment

* Fix quotes

* Fix quotes

* Fix quotes (really)

* Simplify variable
2024-04-30 11:11:58 -07:00
Koushik Dutta
3a70625308 Merge branch 'main' of github.com:koush/scrypted 2024-04-30 08:46:16 -07:00
Koushik Dutta
7a382a8eba rebroadcast: remove periodic restart 2024-04-30 08:46:11 -07:00
Brett Jia
6d520dc4b2 rknn: add more cpus (#1451)
* add additional cpus supported by rknn model converter

* use queue-based approach

* bump 0.0.3

* Revert "use queue-based approach"

This reverts commit 4ec77495e8.

* bump 0.0.4
2024-04-28 06:52:16 -07:00
Brett Jia
40c7132ec0 rknn: update docs to remove dependence on full privileged docker (#1444) 2024-04-24 10:30:37 -07:00
Koushik Dutta
4d2a038f19 Merge branch 'main' of github.com:koush/scrypted 2024-04-23 13:35:49 -07:00
Koushik Dutta
a8bfdb6610 coreml/openvino: trigger pip 2024-04-23 13:35:45 -07:00
owine
9817b0144e Home Assistant: Bump Add On to v0.99.0 (#1441) 2024-04-23 13:12:28 -07:00
Koushik Dutta
f662bd7de4 openvino/coreml: fix text threshold 2024-04-23 13:09:55 -07:00
Koushik Dutta
de52cec190 coreml/openvino: publish 2024-04-23 12:42:42 -07:00
Brett Jia
9a8e48e3c4 rknn: initial rockchip object detector implementation (#1440)
* rknn: initial rockchip object detector implementation

* update package-lock.json

* checkpoint fork-based implementation

* Revert "checkpoint fork-based implementation"

This reverts commit 9cc0493699.

* Revert "Revert "checkpoint fork-based implementation""

This reverts commit b6367f1d27.

* checkpoint new fork-based implementation

* checkpoint shared memory implementation

* Revert "checkpoint shared memory implementation"

This reverts commit 66f0c59421.

* Revert "checkpoint new fork-based implementation"

This reverts commit 158d64bea1.

* Revert "Revert "Revert "checkpoint fork-based implementation"""

This reverts commit ee86f383cb.

* Revert "Revert "checkpoint fork-based implementation""

This reverts commit b6367f1d27.

* Revert "checkpoint fork-based implementation"

This reverts commit 9cc0493699.

* refactor with ThreadPoolExecutors

* tell each runtime to use all cores

* Revert "tell each runtime to use all cores"

This reverts commit f7d0ce76f7.

* only install librknnrt.so if docker or lxc

* relax cpu requirements, update readme

* test rknn runtime on startup
2024-04-23 12:41:52 -07:00
Koushik Dutta
0560d857c1 text recognition: improve skew calc 2024-04-23 11:56:14 -07:00
Koushik Dutta
4ee72cd074 text: fixup skew angle calculation 2024-04-23 09:25:44 -07:00
Koushik Dutta
7120ff430f predict: fixup face nativeids 2024-04-23 08:58:04 -07:00
Koushik Dutta
167c66f8d6 predict: move face/text recognition into separate models 2024-04-23 08:34:54 -07:00
Koushik Dutta
4d98ccf86b predict: move face/text recognition into separate models 2024-04-23 08:33:09 -07:00
Koushik Dutta
ff2d1d5f97 predict: fix text skews 2024-04-22 20:50:52 -07:00
Koushik Dutta
ebe19532fc Merge branch 'main' of github.com:koush/scrypted 2024-04-22 13:07:41 -07:00
Koushik Dutta
1294fc291a openvino/coreml: wip refactor text recognition 2024-04-22 13:07:22 -07:00
Koushik Dutta
39c637a95f coreml: wip refactor text recognition 2024-04-22 12:57:11 -07:00
Koushik Dutta
2fb6331e7b videoanalysis: typo 2024-04-20 16:41:11 -07:00
Koushik Dutta
e7fd88bf2a tensorflow: remove 2024-04-20 16:40:57 -07:00
Koushik Dutta
96455dc38e dlib: remove 2024-04-20 16:40:15 -07:00
Koushik Dutta
4301911e86 pam-diff: remove 2024-04-20 16:39:28 -07:00
Koushik Dutta
1ddbe2fac8 postrelease 2024-04-19 20:33:25 -07:00
Koushik Dutta
b3276304d2 postrelease 2024-04-19 20:33:11 -07:00
Koushik Dutta
fcf87cc559 postbeta 2024-04-19 20:06:19 -07:00
Koushik Dutta
12c1d02a5b server: fix auto restart bug lol 2024-04-19 20:06:08 -07:00
Koushik Dutta
216504639b postbeta 2024-04-19 19:42:28 -07:00
Koushik Dutta
6eae1c7de3 server: plugin reload/deletion race. 2024-04-19 19:42:13 -07:00
Koushik Dutta
a5a1959bd0 predict: fix blank detections in dropdown 2024-04-19 11:48:44 -07:00
Koushik Dutta
62e23880fd coreml: handle batching hint failures 2024-04-19 10:33:37 -07:00
Koushik Dutta
9e652c3521 videoanalysis: fix model hints 2024-04-19 09:31:27 -07:00
Koushik Dutta
97004577f3 videoanalysis: id hint 2024-04-19 09:06:53 -07:00
Koushik Dutta
6f3eac4e43 predict: add yolov6s 2024-04-19 08:41:27 -07:00
Koushik Dutta
c435e351c7 server: fix potential race condition around plugin restart requests 2024-04-19 07:46:39 -07:00
Koushik Dutta
ffc9ca14b5 predict: fix double periodic restarts 2024-04-19 07:37:40 -07:00
Koushik Dutta
9b349fdadc Merge branch 'main' of github.com:koush/scrypted 2024-04-18 18:39:50 -07:00
Koushik Dutta
7cf0c427f9 detect: yolov6 2024-04-18 18:39:45 -07:00
Techno Tim
2fb4fbab15 fix(iface logic): Added net to the hlper functions to also detect ifaces that start with 'net' (#1437) 2024-04-18 15:35:50 -07:00
Koushik Dutta
4a50095049 Update build-plugins-changed.yml 2024-04-18 09:58:33 -07:00
Koushik Dutta
2510fafcf7 videonanalysis: notes on character casing todo. 2024-04-18 09:56:38 -07:00
Koushik Dutta
47897da6fb videoanalysis: improve similar character checker 2024-04-18 08:41:49 -07:00
Koushik Dutta
94055d032b unifi-protect: document license plate api 2024-04-17 22:36:28 -07:00
Koushik Dutta
3e7535cc42 unifi-protect: add lpr 2024-04-17 22:35:49 -07:00
Koushik Dutta
8d47e9c473 coreml/core: batching support 2024-04-17 11:27:57 -07:00
Koushik Dutta
3897e78bdc coreml/sdk: batching support 2024-04-17 10:59:54 -07:00
Koushik Dutta
2fbc0c2573 videoanalysis: fix settings order 2024-04-17 08:31:23 -07:00
Koushik Dutta
1c8fd2399d videoanalysis: add support for lpr on smart motion sensor 2024-04-17 08:26:53 -07:00
Koushik Dutta
3abb6472a7 postbeta 2024-04-16 23:24:24 -07:00
Koushik Dutta
6a221eee98 videoanalysis: wip license plate smart sensor 2024-04-16 23:24:12 -07:00
Koushik Dutta
ad9e9f2d1d predict: publish betas 2024-04-16 23:24:00 -07:00
Koushik Dutta
8c6afde1fc common: reduce logging 2024-04-16 23:23:40 -07:00
Koushik Dutta
b7a8f97198 server: fix potential race conditions around plugin restart 2024-04-16 23:23:28 -07:00
Koushik Dutta
f5fabfeedf homekit: fix hidden setting 2024-04-16 15:50:43 -07:00
Koushik Dutta
494f881d05 openvino: change default model 2024-04-16 15:49:47 -07:00
Koushik Dutta
7192c5ddc2 openvino: fix potential thread safety.
coreml/openvino: more recognition wip
2024-04-16 15:48:40 -07:00
Koushik Dutta
b4da52eaa2 snapshot: improve caching 2024-04-16 10:26:40 -07:00
Koushik Dutta
584ea97b08 mqtt: Fix autodiscvoery 2024-04-16 10:26:25 -07:00
Koushik Dutta
807ba81d92 homekit: publish 2024-04-15 11:07:51 -07:00
Koushik Dutta
0e35bac42a homekit: addIdentifyingMaterial false 2024-04-15 10:54:54 -07:00
Koushik Dutta
a5a464e000 homekit: undo revert for later publish 2024-04-15 10:53:58 -07:00
Koushik Dutta
a3a878cbd5 homekit: revert for longer staged rollout 2024-04-15 10:52:19 -07:00
Koushik Dutta
8abdab70e9 coreml/openvino: publish 2024-04-15 10:35:10 -07:00
Koushik Dutta
69fd86a684 homekit: handle mp4 generation shutdown 2024-04-15 07:52:25 -07:00
Koushik Dutta
f0e85f14a9 Merge branch 'main' of github.com:koush/scrypted 2024-04-15 07:22:45 -07:00
Koushik Dutta
6130b7fa0c homekit: add identifying material to prevent name clashing 2024-04-15 07:22:41 -07:00
slyoldfox
6dba80c277 Fixes handling the welcome message status from bticino (#1432)
* Fix voicemail status by parsing the VSC more accurately

* Implement video clip streaming by fetching and converting the voicemail message
2024-04-14 09:35:37 -07:00
Koushik Dutta
0f4ff0d4fc sdk: add missing dom types 2024-04-13 20:05:24 -07:00
Koushik Dutta
3d58600c5f postbeta 2024-04-13 12:53:34 -07:00
Koushik Dutta
9c9909e05b amcrest: Fix probe 2024-04-13 12:28:39 -07:00
Koushik Dutta
9c0d253cae webrtc: fix audio handling on unrecognized codec 2024-04-13 09:43:34 -07:00
Koushik Dutta
c1c9fec62f openvino: working lpr and face recog; 2024-04-12 22:12:07 -07:00
Koushik Dutta
27a1c5269a coreml: fixup detection test 2024-04-12 22:04:55 -07:00
Koushik Dutta
c0c938d9c4 snapshot: fix image resize defaults 2024-04-12 21:44:26 -07:00
Koushik Dutta
1dae1834ad predict: missing files 2024-04-12 20:45:31 -07:00
Koushik Dutta
250b2554d7 coreml: dead code 2024-04-12 18:43:11 -07:00
Koushik Dutta
35de80e94a openvino/coreml: refacotr 2024-04-12 18:41:55 -07:00
Koushik Dutta
ba2bf5692f openvino: update 2024-04-12 12:34:57 -07:00
Koushik Dutta
4684ea6592 coreml: recognition fixes 2024-04-12 12:22:37 -07:00
Koushik Dutta
2ab74bc0f8 core: add label support 2024-04-12 08:42:07 -07:00
Koushik Dutta
0a888364b2 coreml: working lpr 2024-04-11 23:53:30 -07:00
Koushik Dutta
c6ea727a0c mqtt: fix switch 2024-04-11 13:14:06 -07:00
Koushik Dutta
96a0a6bd90 snapshots/fetch: fix request teardown? 2024-04-11 12:54:10 -07:00
Koushik Dutta
bf783c7c3c mqtt: switch auto discovery 2024-04-11 10:07:04 -07:00
Koushik Dutta
cbd11908af homekit: fix aac transcoding for silent audio 2024-04-10 11:36:45 -07:00
Koushik Dutta
3367856715 webrtc: add temporary stun fallback 2024-04-10 10:35:45 -07:00
Koushik Dutta
16d38906fe postbeta 2024-04-09 22:19:09 -07:00
Koushik Dutta
fb37f9f58d coreml: remove yolo9c 2024-04-08 15:07:29 -07:00
Koushik Dutta
7514ccf804 detect: remove old models 2024-04-08 14:57:47 -07:00
Koushik Dutta
267a53e84b ha: publish 2024-04-08 11:33:06 -07:00
Koushik Dutta
10a7877522 tensorflow-lite: fix prediction crash 2024-04-08 09:29:52 -07:00
Koushik Dutta
f15526f78d openvino: switch to scrypted_yolov9c_320 2024-04-07 23:20:31 -07:00
Koushik Dutta
524f9122b7 server: update deps 2024-04-07 22:37:13 -07:00
Koushik Dutta
c35142a112 openvino/coreml: new models 2024-04-07 22:37:04 -07:00
Koushik Dutta
ae63e6004e amcrest: add motion pulse 2024-04-07 19:20:24 -07:00
Koushik Dutta
ab90e2ec02 amcrest: add face detection type 2024-04-07 13:30:07 -07:00
Koushik Dutta
96d536f4b2 tensorflow-lite: change default model for usb 2024-04-07 11:55:31 -07:00
Koushik Dutta
c678b31f6f core/sdk: additional scriptign improvements 2024-04-07 10:28:31 -07:00
Koushik Dutta
0315466b0a core: add storage settings to scripts 2024-04-07 10:19:09 -07:00
Koushik Dutta
0db3b7df5a homekit: datamigration for addIdentifyingMaterial 2024-04-06 20:46:58 -07:00
Koushik Dutta
00d8054de8 homekit: add identifying material to prevent mdns collision 2024-04-06 20:30:11 -07:00
Koushik Dutta
3907547c6f webrtc: fix potential crashes 2024-04-06 12:01:55 -07:00
Koushik Dutta
bd3bc0dcb3 coreml: handle empty face set error 2024-04-06 10:52:44 -07:00
Koushik Dutta
b36783df0a coreml: improve face recognition concurrency 2024-04-05 12:32:29 -07:00
Koushik Dutta
b676c27316 docker: initial nvidia support 2024-04-04 12:48:50 -07:00
Koushik Dutta
bcea7b869b coreml: fix threading 2024-04-04 12:48:11 -07:00
Koushik Dutta
2dd549c042 alexa: fix syncedDevices being undefined 2024-04-04 11:39:43 -07:00
Koushik Dutta
c06e3623b6 amcrest: additional dahua hackery 2024-04-03 10:40:03 -07:00
Koushik Dutta
008e0ecbf7 amcrest: Fix buggy htp firmware on some dahua 2024-04-03 09:48:10 -07:00
Koushik Dutta
e6cb41168f snapshot: better error reporting 2024-04-03 08:57:20 -07:00
Koushik Dutta
95ac72c5c8 coreml: encode embedding 2024-04-02 22:07:13 -07:00
Koushik Dutta
faa667f622 sdk: add embedding field 2024-04-02 21:04:09 -07:00
Koushik Dutta
32868c69fe coreml: working face recog 2024-04-02 20:31:40 -07:00
Koushik Dutta
207cb9d833 homekit: clean up late generator bug 2024-04-02 20:31:30 -07:00
Koushik Dutta
f2de58f59a homekit: fix annexb detection 2024-04-02 15:25:32 -07:00
Koushik Dutta
484682257b coreml: wip face recog 2024-04-02 15:08:54 -07:00
Koushik Dutta
b0b922d209 coreml: plug in inception v1 reset face recognition 2024-04-01 21:36:19 -07:00
Koushik Dutta
e37295fb20 coreml: move vision framework into coreml 2024-04-01 20:45:31 -07:00
Koushik Dutta
2e72366d41 vision-framework: initial release 2024-04-01 10:20:49 -07:00
Koushik Dutta
97b09442e8 tensorflow-lite: fix windows 2024-03-31 16:28:34 -07:00
Koushik Dutta
c2defb8c08 onvif: fix two way audio buffer mtu overflow 2024-03-31 13:24:49 -07:00
Koushik Dutta
aa255530aa postrelease 2024-03-30 20:13:03 -07:00
Koushik Dutta
0b26f4df39 snapshot: avoid internal api 2024-03-30 20:06:02 -07:00
Koushik Dutta
be98083557 webrtc: fix ffmpeg leaks? 2024-03-29 23:32:15 -07:00
Koushik Dutta
f4dcb8e662 openvino: publish new models 2024-03-29 23:16:23 -07:00
Koushik Dutta
45186316a6 tensorflow-lite: publish new models 2024-03-29 23:03:12 -07:00
Koushik Dutta
c6e6c881fe coreml: update models. publish. 2024-03-29 22:52:44 -07:00
Koushik Dutta
62b07ea609 core: fix node upgrade 2024-03-29 13:08:41 -07:00
Koushik Dutta
a00ae60ab0 ha/proxmox: bump versions 2024-03-29 12:53:44 -07:00
Brett Jia
878753a526 server: treat self.device as future (#1401)
* server: treat self.device as future

* simplify

* modify annotation

* modify annotation
2024-03-28 19:36:14 -07:00
Koushik Dutta
3c1801ad01 cameras: fix signal + timeout combined usage 2024-03-27 22:05:05 -07:00
Koushik Dutta
30f9e358b7 cameras: fix fetch timeout bugs 2024-03-27 22:02:26 -07:00
Koushik Dutta
456faea1fd amcrest: fix two way audio termination 2024-03-27 15:39:42 -07:00
Koushik Dutta
5e58b1426e amcrest: fix two way audio termination 2024-03-27 15:39:21 -07:00
Koushik Dutta
ec6d617c09 cameras: update onvif two way 2024-03-27 12:21:41 -07:00
Koushik Dutta
1238abedb1 hikvision: fix events crossing streams in camera channels 2024-03-27 10:02:33 -07:00
Koushik Dutta
3e18b9e6aa amcrest: fix vehicle detection class 2024-03-26 19:29:58 -07:00
Koushik Dutta
dce76b5d87 amcrest: fix object detector types 2024-03-26 18:13:16 -07:00
Koushik Dutta
de645dfacb hikvision: add vehicle support 2024-03-26 14:08:34 -07:00
Koushik Dutta
6fd66db896 amcrest/hikvision: add support for smart detections. publish. 2024-03-26 10:41:32 -07:00
Koushik Dutta
62850163d7 hikvision: implement smart events 2024-03-25 23:22:02 -07:00
Koushik Dutta
b46a385a81 onvif: increase 2 way audio buffer to reduce stutter. 2024-03-25 13:28:29 -07:00
Koushik Dutta
c94fb231c6 cli: fix updater 2024-03-25 12:45:10 -07:00
Koushik Dutta
a3df934a88 chromecast: fix audio playback 2024-03-25 12:44:25 -07:00
Koushik Dutta
a6143e103e postrelease 2024-03-25 12:09:11 -07:00
Koushik Dutta
df705cb0e7 server: rollback portable python to 3.10 2024-03-25 12:09:00 -07:00
Koushik Dutta
6e7f291f81 hikvision: fix two way audio duration 2024-03-25 11:02:58 -07:00
Koushik Dutta
fa5b9f66db python-codecs: Fix process exit leak 2024-03-23 17:45:38 -07:00
Koushik Dutta
f760840a6d ha: publish 2024-03-23 12:48:30 -07:00
Koushik Dutta
f36ee6ccb5 postrelease
postrelease

postrelease
2024-03-23 12:34:40 -07:00
Koushik Dutta
bb610f2bb1 python-codecs: gstreamer now optional 2024-03-23 12:33:37 -07:00
Koushik Dutta
6182369804 core: make lxc always restart 2024-03-23 12:21:22 -07:00
Koushik Dutta
70c4d62466 videonanalysis: add filtering options to smart motion sensor 2024-03-22 19:18:04 -07:00
Koushik Dutta
c20c960a4c core: Fix lxc upgrade 2024-03-22 19:08:57 -07:00
Koushik Dutta
da95729299 postbeta 2024-03-22 09:02:04 -07:00
Koushik Dutta
35444f3f1a server: load env from scrypted volume 2024-03-22 09:01:54 -07:00
Koushik Dutta
8dbf751cd9 core: update lxc with avahi support 2024-03-21 22:22:38 -07:00
Koushik Dutta
e9eecd145e postbeta 2024-03-21 22:07:53 -07:00
Koushik Dutta
94350669b1 postbeta 2024-03-21 19:45:15 -07:00
Koushik Dutta
5876fe9ff5 server: update deps 2024-03-21 19:44:57 -07:00
Koushik Dutta
04cd033565 postbeta 2024-03-21 19:27:30 -07:00
Koushik Dutta
1c3bfc5acb server: add flag to force portable 2024-03-21 19:25:02 -07:00
Koushik Dutta
41a09629bf server: fix comments 2024-03-21 14:15:32 -07:00
Koushik Dutta
fa4cf60c21 postbeta 2024-03-21 14:14:56 -07:00
Koushik Dutta
b2848c1496 ha: rollback accidental version change 2024-03-21 14:04:31 -07:00
Koushik Dutta
514483c69c windows: add choco vc redist 2024-03-21 14:02:57 -07:00
Koushik Dutta
6e73f2d95f docker: lite no longer pulls in 300mb of ffmpeg 2024-03-21 13:58:22 -07:00
Koushik Dutta
4535e9f50f docker: fixup build checks 2024-03-21 13:53:34 -07:00
Koushik Dutta
12fc6b1619 docker: fix lite build 2024-03-21 13:46:02 -07:00
Koushik Dutta
f0402564a8 install: upgrade scripts to node 20, provide explicit python paths 2024-03-21 13:41:48 -07:00
Koushik Dutta
86d900a299 postbeta 2024-03-21 13:21:50 -07:00
Koushik Dutta
2cde2b6824 server: add support for versioned python env vars. only use portable python if env is not set. 2024-03-21 13:21:37 -07:00
Koushik Dutta
ff0350abb9 postbeta 2024-03-21 13:04:20 -07:00
Brett Jia
6c6d2ba40e server: bump python runtime (#1389) 2024-03-21 13:02:52 -07:00
Koushik Dutta
857cc656bd client: update 2024-03-20 23:44:13 -07:00
Koushik Dutta
776356fc02 core: lxc avahi check 2024-03-20 20:39:07 -07:00
Koushik Dutta
50d9cee8ea thermostat: remove deprecated 2024-03-20 20:28:31 -07:00
Koushik Dutta
1cb5e43f90 postbeta 2024-03-20 19:19:42 -07:00
Brett Jia
c8df32e6ae server: fix windows color depth detection (#1388) 2024-03-20 17:47:17 -07:00
Koushik Dutta
77c30b4907 core: publish wiht new sdk 2024-03-20 15:24:31 -07:00
Koushik Dutta
96ae2fc89e unifi-protect: Implement privacy masking 2024-03-20 13:22:28 -07:00
Koushik Dutta
a54978e3f0 postbeta 2024-03-20 12:57:24 -07:00
Koushik Dutta
807b9c1950 Merge remote-tracking branch 'origin/main' into beta 2024-03-20 12:57:05 -07:00
Koushik Dutta
be05127147 postbeta 2024-03-20 11:34:36 -07:00
Koushik Dutta
ac1134aa41 server: add support for media object intrinsic conversions 2024-03-20 11:19:56 -07:00
Koushik Dutta
0487c95e00 sdk: update media object 2024-03-20 10:53:07 -07:00
Koushik Dutta
8add1419e9 sdk/server: implement MediaConverter 2024-03-19 22:38:25 -07:00
Koushik Dutta
50d980cc01 server: add support for MediaConverter 2024-03-19 21:25:30 -07:00
Koushik Dutta
3488a3b4ec sdk: MediaConverter 2024-03-19 21:21:11 -07:00
Koushik Dutta
b3abf5af9b videoanalysis: add support for builtin frame generators 2024-03-19 20:35:09 -07:00
Brett Jia
d494f46739 don't clobber global loop policy + propagate exceptions across loops (#1386) 2024-03-19 19:47:34 -07:00
Brett Jia
d3729f3ae7 server: isolate ptpython repl in its own event loop (#1385) 2024-03-19 19:32:35 -07:00
Koushik Dutta
a2fb900166 core: implement lxc udpater 2024-03-19 13:14:39 -07:00
Koushik Dutta
706e37ea68 cli: use nonzero exit to force restart 2024-03-19 13:09:34 -07:00
Koushik Dutta
b7509fbd12 server: restart should trigger npx exit 2024-03-19 12:12:34 -07:00
Koushik Dutta
d994f7c900 webrtc: publush 2024-03-19 12:12:09 -07:00
Koushik Dutta
4e21db52e2 cli: exit after updates 2024-03-19 12:11:51 -07:00
Koushik Dutta
a35fd3b79b reolink: reverse zoom 2024-03-18 16:43:12 -07:00
Koushik Dutta
eebcf1aac5 reolink: implement zoom 2024-03-18 16:34:21 -07:00
Koushik Dutta
704145ce5d postbeta 2024-03-18 14:45:29 -07:00
Koushik Dutta
8f2e15f9df server: use plugin volume for tf install 2024-03-18 14:45:11 -07:00
Koushik Dutta
c5cf8d01ea postbeta 2024-03-18 10:04:58 -07:00
Koushik Dutta
3356777021 server: use fixed python3.11. install custom pythons into module path. 2024-03-18 10:04:47 -07:00
Koushik Dutta
544570d435 webrtc: update werift 2024-03-17 20:13:01 -07:00
Koushik Dutta
e6b9eb6fb5 Merge branch 'beta' of github.com:koush/scrypted into beta 2024-03-17 20:10:56 -07:00
Koushik Dutta
64137c796e webrtc: update werift 2024-03-17 19:48:24 -07:00
Koushik Dutta
3d29478f24 Update install-scrypted-proxmox.sh 2024-03-17 14:17:37 -07:00
Koushik Dutta
862db817db postbeta 2024-03-17 13:30:20 -07:00
Koushik Dutta
7fcc61609e postbeta 2024-03-17 13:26:11 -07:00
Koushik Dutta
4448d82b48 server: fixup python installs 2024-03-17 13:26:00 -07:00
Koushik Dutta
370b63584a postbeta 2024-03-17 13:19:48 -07:00
Koushik Dutta
fda778cdaa postbeta 2024-03-17 13:06:34 -07:00
Koushik Dutta
58d2e14542 server: update deps 2024-03-17 13:06:25 -07:00
Koushik Dutta
577c6a1733 server: lazy install specific python versions 2024-03-17 13:05:01 -07:00
Koushik Dutta
03c4dd5ecc Merge remote-tracking branch 'origin/main' into beta 2024-03-17 10:36:09 -07:00
Koushik Dutta
5b1889e77b webrtc: add connection timeout 2024-03-17 09:42:38 -07:00
Koushik Dutta
d9203318e2 gda: publish 2024-03-17 07:41:22 -07:00
Koushik Dutta
dbce9dac03 gda: fix temperature unit 2024-03-17 07:40:57 -07:00
Koushik Dutta
6b5755cc4d openvino: yolov9 2024-03-16 22:04:02 -07:00
Koushik Dutta
8aee8f39a3 coreml: yolov9c_32 2024-03-16 21:22:21 -07:00
Koushik Dutta
7e9c23b490 sdk: add privacy mask support 2024-03-16 17:06:04 -07:00
Koushik Dutta
a87a88db2a homekit: fix wonky debug subgroup 2024-03-16 15:28:43 -07:00
Koushik Dutta
3af233cd4c homekit: update hap, use connection source address. 2024-03-16 15:23:11 -07:00
Koushik Dutta
67347817fe webrtc: publish 2024-03-16 11:52:50 -07:00
Koushik Dutta
f1121500e1 webrtc: publish 2024-03-16 11:52:30 -07:00
Koushik Dutta
a1cbfe7d26 Revert "webrtc: repacketize h264 (#1260)"
This reverts commit d3dee3a199.
2024-03-16 11:52:12 -07:00
Koushik Dutta
1fa2cae936 webrtc: fix unhandled rejection 2024-03-16 11:51:17 -07:00
Koushik Dutta
7490188986 snapshot: update for sharp, cache authenticated path 2024-03-16 08:15:32 -07:00
Koushik Dutta
374c5364f4 postbeta 2024-03-15 20:06:03 -07:00
Koushik Dutta
719c8af9c4 cli: set lxc ffmpeg path 2024-03-15 12:47:20 -07:00
Koushik Dutta
45c7117cd4 postbeta 2024-03-15 12:15:48 -07:00
Koushik Dutta
ff095a6157 server: switch to @scrypted/ffmpeg-static 2024-03-15 12:15:29 -07:00
Koushik Dutta
a04aa566a2 postbeta 2024-03-14 14:46:26 -07:00
Koushik Dutta
ec8344be7f server: switch to @scrypted/node-pty 2024-03-14 14:46:14 -07:00
Koushik Dutta
e21ac6283b core: use @scrypted/node-pty 2024-03-14 14:33:44 -07:00
Koushik Dutta
a23a73942d rebroadcast: fix content-base handling 2024-03-13 21:16:48 -07:00
Koushik Dutta
e90e9cd2e8 wyze: fix linux detection, python 3.9 2024-03-13 13:14:20 -07:00
Koushik Dutta
8308d5fa46 core: remove dead code 2024-03-13 13:13:35 -07:00
Koushik Dutta
acaebd5c48 server: fix custom runtime pipe 2024-03-13 13:13:18 -07:00
Koushik Dutta
a79bd66969 postbeta 2024-03-12 20:27:11 -07:00
Koushik Dutta
f37b21c0b2 server: plugin loading refacotr 2024-03-12 20:25:26 -07:00
Koushik Dutta
868403ecde core/common: dont crash on script parse failure, add more node types 2024-03-12 20:19:50 -07:00
Koushik Dutta
00aa766a6b coreml: bump coremltools 2024-03-12 20:19:21 -07:00
Koushik Dutta
5bad16859a core: add more node types 2024-03-12 10:35:00 -07:00
Koushik Dutta
ebf7063422 sdk: update 2024-03-12 10:34:35 -07:00
Koushik Dutta
441361e1ec server: plugin init cleanups 2024-03-11 12:56:21 -07:00
Koushik Dutta
3fb519e3b2 sdk: add support for custom runtimes 2024-03-11 12:09:32 -07:00
Koushik Dutta
fd67756ec6 sdk: add context to notification on triggering event, if any 2024-03-11 09:57:00 -07:00
Koushik Dutta
1f7625ca60 sdk/client: update 2024-03-10 19:34:50 -07:00
Koushik Dutta
5640a55507 external: remove face-api 2024-03-10 12:19:13 -07:00
Koushik Dutta
432eb8367e external: remove ffmpeg 2024-03-10 12:18:53 -07:00
Koushik Dutta
59d2657002 server: remove legacy shell endpoint 2024-03-09 17:24:15 -08:00
Koushik Dutta
9012eb9192 core: publish 2024-03-09 17:20:56 -08:00
Koushik Dutta
2918c8fd21 core: conditional pty buttons 2024-03-09 16:47:29 -08:00
Koushik Dutta
90c8e90af7 core: refactor console on top of pty 2024-03-09 16:44:33 -08:00
Koushik Dutta
b83b5196da core: remove legacy repl endpoint 2024-03-09 15:17:41 -08:00
Koushik Dutta
239124cbdc core: move repl to StreamService 2024-03-09 15:15:41 -08:00
Koushik Dutta
f6d931a1eb postbeta 2024-03-09 13:10:05 -08:00
Koushik Dutta
8e37623695 postbeta 2024-03-09 07:43:33 -08:00
Koushik Dutta
2f2c6545a4 server: move pty/wheel back into runtime install 2024-03-09 07:43:23 -08:00
Koushik Dutta
f8669ea693 postbeta 2024-03-09 00:51:14 -08:00
Koushik Dutta
1cb9985cf8 postbeta 2024-03-08 21:15:27 -08:00
Koushik Dutta
3e3e6504bf postbeta 2024-03-08 19:59:01 -08:00
Koushik Dutta
4856193e35 postbeta 2024-03-08 19:50:46 -08:00
Koushik Dutta
28166a1abc postbeta 2024-03-08 19:44:28 -08:00
Koushik Dutta
97de3c7bf6 postbeta 2024-03-08 18:17:10 -08:00
Koushik Dutta
8e75979f07 postbeta 2024-03-08 18:04:46 -08:00
Koushik Dutta
4c8eb9639f server: use separate python version for pip checks 2024-03-08 18:04:35 -08:00
Koushik Dutta
7a0d070c04 postbeta 2024-03-08 17:54:44 -08:00
Koushik Dutta
3052b954bf postbeta 2024-03-08 17:21:45 -08:00
Koushik Dutta
5f715669ee server: remove shim 2024-03-08 17:21:33 -08:00
Koushik Dutta
0de1c6bdd5 postbeta 2024-03-08 17:17:18 -08:00
Koushik Dutta
02f69c3077 postbeta 2024-03-08 17:16:17 -08:00
Koushik Dutta
af5d83ecc0 server: move postinstall into non-ignored path 2024-03-08 17:16:04 -08:00
Koushik Dutta
2143b4e2c2 postbeta 2024-03-08 12:29:53 -08:00
Koushik Dutta
86d38b5081 server: shim portable python ssl ca 2024-03-08 12:28:02 -08:00
Koushik Dutta
a61be80b24 server: postinstall python deps 2024-03-08 11:38:51 -08:00
Koushik Dutta
97e31ec51d server: use target rather than prefix 2024-03-08 09:36:36 -08:00
Koushik Dutta
dd1efe0756 unifi-protect: publish 2024-03-08 08:17:03 -08:00
Koushik Dutta
155cc89239 postbeta 2024-03-07 15:54:43 -08:00
Koushik Dutta
76cdbc6e96 Update bug_report.md 2024-03-07 10:47:46 -08:00
Koushik Dutta
c68a0286e8 Merge branch 'main' into beta 2024-03-07 10:43:15 -08:00
Koushik Dutta
90a7e44704 homekit: use avahi if available. 2024-03-07 10:43:02 -08:00
Koushik Dutta
35031427b2 docker: auto configure avahi 2024-03-07 10:37:34 -08:00
Koushik Dutta
954c7789ba docker: avahi daemon installer/support 2024-03-07 10:37:30 -08:00
Koushik Dutta
b9c4e1cd16 docker: improve avahi docs 2024-03-07 10:37:24 -08:00
Koushik Dutta
cd7e60781c docker: auto configure avahi 2024-03-07 10:28:12 -08:00
Koushik Dutta
4ae2de0467 docker: avahi daemon installer/support 2024-03-07 10:21:36 -08:00
Koushik Dutta
2fdf58db31 docker: improve avahi docs 2024-03-07 10:07:54 -08:00
Koushik Dutta
27af54e929 server/core: use new pty 2024-03-07 08:16:19 -08:00
Koushik Dutta
b7de4d92cf postbeta 2024-03-06 20:59:19 -08:00
Koushik Dutta
82544d2c1b server: switch to @homebridge/node-pty-prebuilt-multiarch 2024-03-06 20:59:07 -08:00
Koushik Dutta
61c32571d8 python-codecs: publish beta 2024-03-06 20:42:14 -08:00
Koushik Dutta
da8032f922 docker: use edgetpu std 2024-03-06 20:26:51 -08:00
Koushik Dutta
e016011f5a docker: add edgetpu and intel to lite? 2024-03-06 20:21:55 -08:00
Koushik Dutta
d8332898f7 docker: edgetpu max 2024-03-06 20:21:20 -08:00
Koushik Dutta
6903d56570 docker: remove python from lite 2024-03-06 20:17:27 -08:00
Koushik Dutta
0fa8a728f7 postbeta 2024-03-06 19:56:33 -08:00
Koushik Dutta
7081cd6605 server: fixup requirements 2024-03-06 19:55:33 -08:00
Koushik Dutta
83f24ebdaa server: use portable python, shim in debugpy 2024-03-06 19:54:57 -08:00
Koushik Dutta
958442b1bd google-device-access: cleanup 2024-03-06 19:07:12 -08:00
Koushik Dutta
b320fd425b cloud/etc: shuffle cors 2024-03-06 17:57:59 -08:00
Koushik Dutta
0e1305ec5e cloud: remove legacy param 2024-03-06 17:53:17 -08:00
Koushik Dutta
1c3c75db33 onvif/unifi: two way audio quality 2024-03-06 13:05:40 -08:00
Koushik Dutta
afd4927e5b github: remove references to dead thin builds 2024-03-06 12:25:22 -08:00
Koushik Dutta
1b647c902f postbeta 2024-03-06 12:23:30 -08:00
Koushik Dutta
45af364215 github: make node 20 default 2024-03-06 12:22:47 -08:00
Koushik Dutta
c5f33f8eb5 server/python-codecs: add support for optional requirements 2024-03-06 11:11:45 -08:00
Koushik Dutta
cb7ea1c624 unifi-protect: fix online spam 2024-03-06 09:27:34 -08:00
Koushik Dutta
e1571e62d3 postbeta 2024-03-06 08:32:17 -08:00
Koushik Dutta
3065ffef94 unifi-protect: missing file 2024-03-06 08:31:41 -08:00
Brett Jia
9c0a59a75a server: graceful repl exit + multi-repl support (#1362)
* server: graceful repl exit + hacky multi-repl support

* remove prints

* more multi-repl layout fixes, ignore benign CancelledError

* add missing import

* disable input function for safety
2024-03-06 07:55:28 -08:00
Koushik Dutta
e75c183511 postbeta 2024-03-05 19:58:59 -08:00
Koushik Dutta
e50c730c9f postbeta 2024-03-05 18:04:43 -08:00
Koushik Dutta
2da94cdc97 unifi-protect: debounce motion sensors, attempt to stabilize nativeids 2024-03-05 18:04:29 -08:00
Koushik Dutta
b4293e3363 server: cleanup python repl 2024-03-05 18:04:04 -08:00
Brett Jia
71ce995276 server: add Python REPL support + introduce optional requirements.txt (#1360)
* wip python repl

* reimplement with ptpython repl

* hide extra prompts, general cleanup

* add ptpython to dependencies

* Revert "add ptpython to dependencies"

This reverts commit 1b476e665b.

* inject system dependencies into requirements for run-time install

* write correct requirements.txt contents to disk

* Revert "write correct requirements.txt contents to disk"

This reverts commit 0ba7f0d91d.

* refactor to introduce optional system deps
2024-03-05 17:39:35 -08:00
Koushik Dutta
54d73f6692 google-home: fix duplicate doorbell. 2024-03-05 13:18:17 -08:00
Koushik Dutta
6ebab812b4 tensorflow-lite: switch usb edgetpu model 2024-03-05 12:55:24 -08:00
Koushik Dutta
9d921544ab postbeta 2024-03-05 10:19:31 -08:00
Koushik Dutta
93c371841c github: build node 20 2024-03-05 09:58:16 -08:00
Koushik Dutta
a73f421cee github: build node 20 2024-03-05 09:56:52 -08:00
Koushik Dutta
090362b0ce server: update deps, publish beta 2024-03-05 09:54:23 -08:00
Koushik Dutta
73607fd1aa snapshot: fix periodic snapshot timeout regression 2024-03-05 08:57:14 -08:00
Koushik Dutta
09c8c114f7 homekit: publish; 2024-03-05 08:50:10 -08:00
Koushik Dutta
dae40ba862 Merge branch 'main' of github.com:koush/scrypted 2024-03-05 08:49:00 -08:00
Koushik Dutta
fd48eee7b2 cameras: add default request timeouts on snapshots 2024-03-05 08:47:49 -08:00
Koushik Dutta
ec19410e0c snapshot: enforce a 5s timeout for web requests 2024-03-05 08:44:50 -08:00
Koushik Dutta
4e5f6885a9 homekit: Update README.md 2024-03-04 12:17:51 -08:00
Koushik Dutta
f41a6383ae homekit: Update README.md 2024-03-04 12:16:50 -08:00
Brett Jia
644f7d3304 homekit: merge child device only if child has homekit enabled (#1343) 2024-03-03 09:46:13 -08:00
ruby~
e2067c156b amcrest: Add support for Dahua VTO locks to Amcrest plugin (#1356) 2024-03-03 09:45:08 -08:00
Koushik Dutta
d325df083f install: use latest node 18 on windows 2024-03-02 18:23:48 -08:00
Koushik Dutta
04de63ae8e python-codecs: weight the image reader to prefer snapshot plugin. tf/ov publish log spam betas. 2024-03-02 10:06:26 -08:00
Koushik Dutta
803a2d7c51 snapshot: rebuild with fixed sdk 2024-03-02 08:27:04 -08:00
Koushik Dutta
a719026e01 mqtt: fix build 2024-03-01 20:47:30 -08:00
Koushik Dutta
1ac5b992d6 webhook: fix build 2024-03-01 20:46:43 -08:00
Koushik Dutta
6766b35438 hikvision: fix two way audio 2024-03-01 17:53:48 -08:00
Koushik Dutta
548ff489c4 client: send cached login info to cloud request as well 2024-03-01 14:08:03 -08:00
Brett Jia
cb742ab75e common: fix behavior of multiple createLocalDescription calls on firefox (#1078)
* use localDescription property

* debug

* debug

* debug

* cleanup
2024-03-01 12:57:31 -08:00
Koushik Dutta
625c1d4e57 google-home: support streaming to the android app! 2024-02-29 10:30:57 -08:00
Koushik Dutta
88604bcdcb cloud: better readme 2024-02-28 10:24:56 -08:00
Koushik Dutta
441cd0d169 cloud: add option to disable cloud registration completely to suppress warnings. 2024-02-28 09:50:46 -08:00
Koushik Dutta
2f1c45f9bd cloud: fix race conditions and error reporting 2024-02-28 09:30:12 -08:00
Koushik Dutta
c3bb9c96de snapshot: publish 2024-02-27 10:00:22 -08:00
Koushik Dutta
954be25d0c rebroadcast/webrtc: republish with sdk fix 2024-02-27 09:59:14 -08:00
Koushik Dutta
0b28454048 sdk: fix regression 2024-02-27 09:57:26 -08:00
Koushik Dutta
349c41657a webrtc/rebroadcast: fix sdp audio detection defaults 2024-02-26 20:11:23 -08:00
Koushik Dutta
acc7f0c4db cloud: support dev env var 2024-02-26 14:53:36 -08:00
Koushik Dutta
36ee539f0c Merge branch 'main' of github.com:koush/scrypted 2024-02-26 13:51:14 -08:00
Koushik Dutta
628c084764 cloud: prepare for multi server 2024-02-26 13:46:58 -08:00
Koushik Dutta
c541aa8b3b Update bug_report.md 2024-02-25 14:57:41 -08:00
Brett Jia
0dc719ca0d core: publish (#1339) 2024-02-24 19:11:27 -08:00
Brett Jia
ead2c5e76f workflows: test build ui with core (#1340)
* workflows: test build ui with core

* trigger dummy change

* Revert "trigger dummy change"

This reverts commit 622601062c.
2024-02-24 19:11:14 -08:00
Koushik Dutta
dbb314b4eb webrtc/common/rebroadcast: fix sdp parsing 2024-02-24 12:02:12 -08:00
Koushik Dutta
a05bcd6ce4 cloud: send server id and friendly name 2024-02-22 18:42:06 -08:00
Koushik Dutta
3a6b244a4a cloud: send server id for multiple servers. update upnp. 2024-02-21 21:21:04 -08:00
Koushik Dutta
d6b9900db5 various: fix sdp parsing issue around codec defaults 2024-02-21 10:02:01 -08:00
Koushik Dutta
8fa5e23797 alexa/google-home: fix potential vulnerability. do not allow local network control using cloud tokens belonging to a different user. the plugins are now locked to a specific scrypted cloud account once paired. 2024-02-21 10:01:03 -08:00
Koushik Dutta
41d042b5bd Merge branch 'main' of github.com:koush/scrypted 2024-02-20 21:42:44 -08:00
Koushik Dutta
81b235c548 alexa/google-home: additional auth token checks to harden endpoints for cloud sharing 2024-02-20 21:42:40 -08:00
Long Zheng
657921a5b3 sdk/server: Fix type of canMixin (#1333)
* Fix type of canMixin

* Allow undefined

* Add void
2024-02-20 13:31:22 -08:00
Long Zheng
a47f7e2566 sdk: define this type (#1332)
* sdk: define this type

* Fix indent
2024-02-19 08:17:05 -08:00
Long Zheng
eec6291d9e CI build changed plugins (#1323)
* Fix WritableDeviceState

* Fix tsconfig error

* Fix test

* Create build-plugins-changed.yml

* Update build-sdk.yml

* Update build-plugins-changed.yml
2024-02-18 23:12:39 -08:00
Brett Jia
064da326c0 core: reset base date on each reschedule call (#1331) 2024-02-18 19:18:57 -08:00
Koushik Dutta
cbf95e1186 homekit: reorder settins, restart rather than prompt. publish. 2024-02-18 17:38:19 -08:00
Koushik Dutta
70aa5b75bf typescript: update sample 2024-02-18 15:52:25 -08:00
Koushik Dutta
dfe34947cb videoanalysis: publish 2024-02-18 15:52:20 -08:00
Koushik Dutta
f7c0091b7c reolink: fix doorbell onvif detections 2024-02-18 15:52:13 -08:00
Koushik Dutta
3dd6f114d4 videoanalysis: beta 2024-02-18 09:53:04 -08:00
Koushik Dutta
a0a8e25e18 sdk: publish 2024-02-18 09:52:48 -08:00
Koushik Dutta
32f0d675bc videoanalysis: nre check release 2024-02-18 09:46:51 -08:00
Koushik Dutta
1306eda422 sdk: fix up revert regression 2024-02-18 09:46:26 -08:00
Koushik Dutta
79f4c27bed videoanalysis: more cpu throttling fixes 2024-02-18 08:45:19 -08:00
Koushik Dutta
eb57698c8b videoanalysis: update 2024-02-18 08:42:46 -08:00
Koushik Dutta
454d96c5d3 Merge branch 'main' of github.com:koush/scrypted 2024-02-17 21:49:54 -08:00
Koushik Dutta
85daf72d66 docker-mdns: remove prototype 2024-02-17 21:49:50 -08:00
Long Zheng
9d50ba79f7 snapshot: black background (#1324)
* Fix WritableDeviceState

* Fix tsconfig error

* Generate black background instead of using black.jpg

Remove redundant blur
2024-02-16 18:16:07 -08:00
Koushik Dutta
764fbbb21b Update bug_report.md 2024-02-16 10:38:34 -08:00
Koushik Dutta
89e9cf343d Update bug_report.md 2024-02-16 10:38:11 -08:00
Long Zheng
dd7d920480 sdk: Add strict types to sdk (#1308)
* Enable strict mode

* Add @types/node

Remove @types/rimraf

* Fix `include` path to be actual `src`

* Add strict to `sdk`

* Assert `getItem`

* Fix types in SDK

* Refactor SDK function to be type safe

* parseValue handle value null or undefined

* Fix types tsconfig

* Make getDeviceConsole required

* Add build-sdk workflow

* Set working directory

* Assert not undefined

* Remove optionals

* Undo addScryptedInterfaceProperties, revert to self executing function

* Use different type

* Make _deviceState private and add ts-ignore

* Remove unused function

* Remove non-null asserts

* Add tsconfig for sdk/types/src

* Get property isOptional from schema

Use typedoc types

* Type fixes

* Fix type

* Fix type

* Revert change
2024-02-15 15:17:31 -08:00
Koushik Dutta
426454f28f sdk: rebuikd 2024-02-15 14:51:01 -08:00
Koushik Dutta
66441ee177 webrtc: repacketize input 2024-02-15 14:50:52 -08:00
Brett Jia
d3dee3a199 webrtc: repacketize h264 (#1260)
* webrtc: repacketize h264 on nalu type 7

* always repacketize

* lower packet size to avoid uint16 overflows

* remove nalu logging

* Revert "remove nalu logging"

This reverts commit e6b6540696.
2024-02-15 11:27:09 -08:00
Koushik Dutta
b174fbc19b Merge branch 'main' of github.com:koush/scrypted 2024-02-15 09:29:44 -08:00
Koushik Dutta
88da7fc5b4 common: add polygon area 2024-02-15 09:29:40 -08:00
Nick Berardi
c8b799f857 mqtt: Added support for ColorSettingTemperature and ColorSettingHsv to the MQTT support. (#1317) 2024-02-15 08:43:11 -08:00
Koushik Dutta
b28eef9d10 unifi-protect: squelch logging 2024-02-15 08:39:31 -08:00
Long Zheng
f66d39f8d9 sdk: calculate required/optional fields from schema (#1321)
* Add tsconfig for sdk/types/src

* Get property isOptional from schema

Use typedoc types
2024-02-15 07:20:56 -08:00
Koushik Dutta
b6cbc126d6 Merge branch 'main' of github.com:koush/scrypted 2024-02-14 15:43:25 -08:00
Koushik Dutta
bee77e121e sdk/server: make various properties non-optional 2024-02-14 15:43:21 -08:00
Nick Berardi
a62f402982 alexa: removed unneeded packages (#1319) 2024-02-14 14:14:29 -08:00
Koushik Dutta
6c67ac6570 Merge branch 'main' of github.com:koush/scrypted 2024-02-14 12:29:06 -08:00
Koushik Dutta
abea872714 amcrest/hikvision: standardize 20s motion timeout 2024-02-14 12:29:01 -08:00
Koushik Dutta
22018ee573 docker: update fstab to nofail 2024-02-14 12:11:41 -08:00
Koushik Dutta
640b2d806d sdk: fix some signatures 2024-02-14 11:21:26 -08:00
Koushik Dutta
f317c8d9ee server/sdk: additional signature fixes 2024-02-14 08:33:31 -08:00
Koushik Dutta
7d3d7be1cd Merge branch 'main' of github.com:koush/scrypted 2024-02-14 08:25:22 -08:00
Koushik Dutta
1ec954ac98 sdk: fix method signatures 2024-02-14 08:25:18 -08:00
Koushik Dutta
7b2ce12f13 videoanalysis: fix min start 2024-02-13 18:00:25 -08:00
Koushik Dutta
3da2e48cf3 Merge branch 'main' of github.com:koush/scrypted 2024-02-13 15:59:14 -08:00
Koushik Dutta
50fcb6aeab betas 2024-02-13 15:59:08 -08:00
Nick Berardi
952b90fc98 alexa: added support for light, outlet, and fan device types (#1318) 2024-02-13 14:48:19 -08:00
Koushik Dutta
0ff95581b1 videoanalysis: add score filter to smart motion sensor 2024-02-13 13:18:09 -08:00
Koushik Dutta
2e02e7f4ef ring: phase out sip streaming 2024-02-13 09:33:22 -08:00
Koushik Dutta
fcc51418c3 videoanalysis: account for cpu throttling 2024-02-13 09:29:36 -08:00
Koushik Dutta
5c31e75f3d Update bug_report.md 2024-02-13 08:38:18 -08:00
Koushik Dutta
f590675198 Update bug_report.md 2024-02-13 06:29:40 -08:00
Rosemary Orchard
23ba720d4f various: Fix typos (#1311) 2024-02-12 15:52:11 -08:00
Koushik Dutta
a64f3e8082 Revert "sdk: Add tsconfig strict to sdk/types (#1306)" (#1307)
This reverts commit a8eb1a21d7.
2024-02-10 16:34:13 -08:00
Long Zheng
a8eb1a21d7 sdk: Add tsconfig strict to sdk/types (#1306)
* Enable strict mode

* Add @types/node

Remove @types/rimraf

* Fix `include` path to be actual `src`
2024-02-10 16:31:20 -08:00
Long Zheng
aa6cd770f8 Fix debugConsole error (#1305) 2024-02-10 12:25:59 -08:00
Koushik Dutta
a06e0d9138 Merge branch 'main' of github.com:koush/scrypted 2024-02-09 20:24:46 -08:00
Koushik Dutta
807a894eac cloud: get reverse proxy hint from callback message 2024-02-09 20:24:41 -08:00
Long Zheng
b1f216b671 homekit/snapshot: Periodic snapshot timeout (#1295)
* Add setting for periodic snapshot timeout

* Add debug logging for snapshot duration

* Revert "Add setting for periodic snapshot timeout"

This reverts commit 305e8817fd.

* Add periodicTimeout to RequestPictureOptions

HomeKit wait up to 2 seconds

* Add logging if fallback

* Rename to timeout

* Update HomeKit snapshot

* Change to log
2024-02-08 09:22:19 -08:00
Brett Jia
7d25053b5a webhook: bump 0.0.25 (#1303) 2024-02-07 22:21:47 -08:00
Koushik Dutta
3fe020c443 cloud: remove axios 2024-02-07 21:47:11 -08:00
Koushik Dutta
16812680d8 Merge branch 'main' of github.com:koush/scrypted 2024-02-07 18:36:02 -08:00
Koushik Dutta
36b36081eb cloud: use cloudflare tunnel for short lived urls 2024-02-07 18:35:57 -08:00
Brett Jia
baf65a0d33 webhook: minor consistency fixes (#1301)
* webhook: minor consistency fixes

* remove string conversion, don't delete if mixin is different

* bump 0.0.23 beta

* revert getMixin

* bump 0.0.24 beta
2024-02-07 12:10:08 -08:00
Koushik Dutta
21ab560671 install: fix disk setup script user account 2024-02-06 20:38:41 -08:00
Koushik Dutta
370401f034 install: remove old scrypted fstab when passing directory 2024-02-06 19:44:50 -08:00
Koushik Dutta
911e56f6fc Merge branch 'main' of github.com:koush/scrypted 2024-02-06 19:27:37 -08:00
Koushik Dutta
2cc229d39c install: remove old scrypted fstab when passing directory 2024-02-06 19:27:34 -08:00
Brett Jia
efd9afd1ea add bash shebang (#1300) 2024-02-05 20:54:48 -08:00
Koushik Dutta
3c49b87b44 snapshot: fix size to fit height 2024-02-05 20:19:15 -08:00
Koushik Dutta
dc5bbc375b homekit: support ipv6 only binding/streaming 2024-02-03 14:55:52 -08:00
Koushik Dutta
962ceb549e webrtc: fix assumption that pcm codecs are supported 2024-02-02 12:29:10 -08:00
Koushik Dutta
3e47855bc6 ha: publsih 2024-01-31 21:41:52 -08:00
Koushik Dutta
6996027626 videoanalysis: fix readme 2024-01-31 14:13:36 -08:00
Koushik Dutta
932b84d1e5 postrelease 2024-01-31 12:10:37 -08:00
Koushik Dutta
801bd46730 server: default auth should be last available option 2024-01-31 12:10:25 -08:00
Koushik Dutta
e5a764d82f reolink: use onvif events on doorbell 2024-01-31 12:10:08 -08:00
Koushik Dutta
7c9cd9f112 postrelease 2024-01-30 10:03:47 -08:00
Koushik Dutta
59e1391fae fix restore on lxc 2024-01-30 10:03:31 -08:00
Koushik Dutta
e0a6e66e8a core: fix lag with terminal input 2024-01-29 22:17:08 -08:00
Koushik Dutta
fa7071b335 Merge branch 'main' of github.com:koush/scrypted 2024-01-29 21:02:05 -08:00
Koushik Dutta
c28e60d875 tensorflow-lite: switch default model to efficientdet_lite0_320_ptq 2024-01-29 21:02:00 -08:00
Koushik Dutta
62cbb88207 install: ensure local/docker services cant run concurrently 2024-01-29 18:21:14 -08:00
Brett Jia
4b6a858f2b ui: add client-side flow control (#1290) 2024-01-29 13:59:51 -08:00
Matthew Lieder
97a254b5d2 synology-ss: make login more resilient (#1289)
Fixes #1266
2024-01-28 15:27:02 -08:00
Koushik Dutta
0ada6286e7 openvino: update dep 2024-01-25 19:57:16 -08:00
Koushik Dutta
9f12e6dd6e ha: publish 2024-01-25 08:51:41 -08:00
Koushik Dutta
604798e845 docker: fixup /dev/dri enabling 2024-01-25 08:26:40 -08:00
Koushik Dutta
d912266de1 postrelease 2024-01-24 23:47:11 -08:00
Koushik Dutta
f5a32489d7 server: prevent windows from clobbering python path 2024-01-24 23:46:58 -08:00
Koushik Dutta
135ad8e3a8 rebroadcast: add id suffix to rtsp urls to determine ffmpeg usage 2024-01-24 13:52:35 -08:00
Koushik Dutta
3c4021c66b videoanalysis: disable filters for objects that are in detector provided zones 2024-01-23 21:42:36 -08:00
Koushik Dutta
669ab17772 docker: remove nvr storage config prompt 2024-01-23 15:47:48 -08:00
Koushik Dutta
1860d7d8ea Merge branch 'main' of github.com:koush/scrypted 2024-01-23 15:46:53 -08:00
Koushik Dutta
fa266e9dd1 docker: validate the storage directory 2024-01-23 20:10:02 +00:00
Koushik Dutta
4e2f3bf2c7 docker: finish drive setup script 2024-01-23 19:40:16 +00:00
Koushik Dutta
146e27fd13 install: initial pass at disk setup 2024-01-23 19:00:51 +00:00
Koushik Dutta
e4bb50375f postbeta 2024-01-22 20:15:16 -08:00
Koushik Dutta
9686315c02 postbeta 2024-01-22 19:57:24 -08:00
Koushik Dutta
520895f3aa postbeta 2024-01-22 19:50:20 -08:00
Koushik Dutta
ddffc49bcf postbeta 2024-01-22 19:22:20 -08:00
Koushik Dutta
a07f52445d postbeta 2024-01-22 19:13:41 -08:00
Koushik Dutta
5e7b203f11 postbeta 2024-01-22 19:01:13 -08:00
Koushik Dutta
d752298960 postbeta 2024-01-22 17:45:46 -08:00
Koushik Dutta
5253f29831 remove usage of NODE_* env variables which get sanitized by electron. 2024-01-22 17:45:26 -08:00
Koushik Dutta
58d674746d postrelease 2024-01-22 17:22:09 -08:00
Koushik Dutta
8a640758d1 server/cli: fix login issues 2024-01-22 09:11:02 -08:00
Koushik Dutta
9be913af26 sample-cameraprovider: update 2024-01-21 15:39:48 -08:00
Koushik Dutta
da17bee516 sdk: publish 2024-01-21 15:38:28 -08:00
Koushik Dutta
48d9790051 cli: fix https://github.com/koush/scrypted/issues/1277 2024-01-21 14:52:10 -08:00
Koushik Dutta
c43014348d sdk: prevent unnecessary JSON exceptions 2024-01-21 14:42:44 -08:00
Koushik Dutta
cec3a592ba client: add missing dependency 2024-01-21 14:42:24 -08:00
Koushik Dutta
c446ddcdf4 Merge branch 'main' of github.com:koush/scrypted 2024-01-21 12:45:24 -08:00
Koushik Dutta
72f79ea8ef core: fix certificate login error, fix backup/restore in ha 2024-01-21 12:45:19 -08:00
Brett Jia
41988699d0 server: expose backup as a service (#1275)
* server: expose backup as a service

* move restore into new backup service
2024-01-20 21:37:56 -08:00
Koushik Dutta
5151c520d4 Update config.yaml 2024-01-18 19:21:11 -08:00
Koushik Dutta
e1abe717fa postrelease 2024-01-18 13:30:02 -08:00
Koushik Dutta
c7a9ca06be server: use existing service control restart 2024-01-18 13:29:50 -08:00
Koushik Dutta
9827f15f5f server: pass through restart hook 2024-01-18 13:25:22 -08:00
Koushik Dutta
d245a722e2 postrelease 2024-01-18 13:20:25 -08:00
Koushik Dutta
c8e94c0386 Merge branch 'main' of github.com:koush/scrypted 2024-01-18 13:15:41 -08:00
Koushik Dutta
8c6e7b997a ui: implement backup/restore 2024-01-18 13:15:37 -08:00
Johannes Bosecker
9abc7ca139 amcrest: Implemented other intercom codec for Dahua doorbells (G.711A). (#1273) 2024-01-18 12:36:11 -08:00
Koushik Dutta
2a943eb5e0 postbeta 2024-01-18 09:33:13 -08:00
Koushik Dutta
a4fe78a48b ha: publish 2024-01-17 22:07:56 -08:00
Koushik Dutta
50ff0833c9 server: new node min verison 2024-01-17 10:26:30 -08:00
Koushik Dutta
c94085a6c7 zwave: smoke alarm support 2024-01-17 10:25:48 -08:00
Koushik Dutta
c477437456 server: add hook for restart 2024-01-14 15:47:25 -08:00
Koushik Dutta
0da96130fe Merge branch 'main' of github.com:koush/scrypted 2024-01-14 15:36:17 -08:00
Koushik Dutta
fdbf7ab60b server: implement backup/restore 2024-01-14 15:36:08 -08:00
Long Zheng
0cecfb86ff npm-install.sh install auth-fetch package (#1267) 2024-01-14 14:46:23 -08:00
Koushik Dutta
9a195c6207 homekit: fix prune crash 2024-01-14 14:25:30 -08:00
Koushik Dutta
47021a7743 server: reduce deps 2024-01-14 14:25:19 -08:00
Koushik Dutta
01400cf206 core: prep for server fakefs removal 2024-01-14 14:24:43 -08:00
Koushik Dutta
99da29a738 postrelease 2024-01-14 08:06:50 -08:00
Koushik Dutta
6378c5953a server: bump core 2024-01-14 08:06:42 -08:00
Koushik Dutta
846034d7c8 core: fix login 2024-01-14 08:06:25 -08:00
Koushik Dutta
ad47f14922 ha: publish 2024-01-13 22:45:05 -08:00
Koushik Dutta
0066379b1e postrelease 2024-01-13 22:18:49 -08:00
Koushik Dutta
54193251ab server: bump minimum core version 2024-01-13 22:17:40 -08:00
Koushik Dutta
cd5e169439 core: publish 2024-01-13 22:16:18 -08:00
Koushik Dutta
249a87bd4c cameras: fix validation skip, update auth lib 2024-01-13 19:29:35 -08:00
Koushik Dutta
803400c2d8 homekit: bump deps and publish 2024-01-13 18:34:04 -08:00
Koushik Dutta
0e700a53d0 snapshot: give periodic snapshots a moment to return 2024-01-13 17:05:26 -08:00
Koushik Dutta
72647b0099 Update Dockerfile.lite 2024-01-13 16:17:38 -08:00
Koushik Dutta
85e41180b2 Update docker-common.yml 2024-01-13 16:14:38 -08:00
Koushik Dutta
18bf012bb5 docker: udpate base 2024-01-13 16:12:43 -08:00
Koushik Dutta
3f2b8de169 Merge branch 'main' of github.com:koush/scrypted 2024-01-13 16:01:37 -08:00
Koushik Dutta
c568c9a37d shrink lite build further 2024-01-13 16:01:12 -08:00
Koushik Dutta
a831c48f5f server: fix stupid esm mime dependency 2024-01-12 18:22:41 -08:00
Koushik Dutta
f0357d45f2 server: fix stupid esm mime dependency 2024-01-12 18:14:31 -08:00
Koushik Dutta
479b3ce1f3 postrelease 2024-01-12 16:39:30 -08:00
Koushik Dutta
bd7c7de8a5 Update package.json 2024-01-12 16:37:55 -08:00
Koushik Dutta
a06e786d19 client: Fix cors credentials 2024-01-12 15:51:06 -08:00
Koushik Dutta
dff05e733e server: update lockfile 2024-01-12 15:39:29 -08:00
Koushik Dutta
76e34af149 postrelease 2024-01-12 15:13:29 -08:00
Koushik Dutta
4f2e9e88e1 Merge branch 'main' of github.com:koush/scrypted 2024-01-12 09:27:04 -08:00
Koushik Dutta
2761b0745a client: remove http-auth-utils dependency 2024-01-12 09:26:09 -08:00
Brett Jia
ea78b7f59e core: fix scheduler (#1259) 2024-01-12 09:10:31 -08:00
Koushik Dutta
b8d233f08d videoanalysis: cpu usage wip 2024-01-11 20:08:57 -08:00
Koushik Dutta
f4e93c82a2 onvif: publish with latest http-auth-utils 2024-01-11 20:08:39 -08:00
Koushik Dutta
c72c34f954 common: remove node-fetch 2024-01-11 20:06:51 -08:00
Koushik Dutta
baec4e71da remove axios-digest-auth 2024-01-11 19:31:18 -08:00
Koushik Dutta
245c6e3006 doorbird: remove axios digest auth 2024-01-11 19:29:15 -08:00
Koushik Dutta
566c18251c snapshot: add support for periodic snapshots via http 2024-01-11 13:15:18 -08:00
Koushik Dutta
f18e58a108 sdk/homekit/snapshot: simplify periodic snapshot requests. remove homekit debouncer. 2024-01-11 11:29:03 -08:00
Koushik Dutta
5c6ea09d3e videoanalysis: implement dynamic cpu performance profiling 2024-01-11 11:04:41 -08:00
Koushik Dutta
646a9f214a snapshot: Update url fetcher 2024-01-11 09:58:23 -08:00
Koushik Dutta
6506c4236f various: fixup http lib 2024-01-11 00:37:21 -08:00
Koushik Dutta
a3e27ce8f8 Merge branch 'main' of github.com:koush/scrypted 2024-01-11 00:35:26 -08:00
Koushik Dutta
a54d5a5f59 cli: remove axios 2024-01-11 00:35:21 -08:00
Koushik Dutta
7136759f8f Update install-scrypted-proxmox.sh 2024-01-11 00:32:48 -08:00
Koushik Dutta
049d9898b3 http/auth: simplify 2024-01-10 20:45:50 -08:00
Koushik Dutta
6d9e21b7b8 server: Fix import 2024-01-10 16:27:10 -08:00
Koushik Dutta
bfd1aef5d1 client: fixup 2024-01-10 16:23:51 -08:00
Koushik Dutta
5f02e6a272 various: more http refactoring 2024-01-10 16:08:38 -08:00
Koushik Dutta
56bbf00edc various: update http auth utils usage 2024-01-10 13:16:00 -08:00
Koushik Dutta
0c66456a87 sdk: limit chunks to 1. add support for multiple chunks. 2024-01-10 13:06:04 -08:00
Koushik Dutta
6b589b8d5a postrelease 2024-01-10 12:56:02 -08:00
Koushik Dutta
aef218c653 server: update http fetch usage, add support for relative require 2024-01-10 12:50:45 -08:00
Koushik Dutta
aea24a84f0 cameras: update http utils again 2024-01-10 11:13:37 -08:00
Koushik Dutta
bab3bef0d1 cameras: update http utils again 2024-01-10 11:13:17 -08:00
Koushik Dutta
56bda46ae9 webrtc: fix multiple ipv4/ipv6 address usage 2024-01-09 22:44:33 -08:00
Koushik Dutta
368b0fc26a onvif: fix motion resbuscribe 2024-01-09 20:17:13 -08:00
Koushik Dutta
fa50d6faab various: remove axios digest auth 2024-01-09 13:52:51 -08:00
Koushik Dutta
115d168cd3 snapshot: remove axios 2024-01-09 13:12:44 -08:00
Koushik Dutta
7ab93e8883 Merge branch 'main' of github.com:koush/scrypted 2024-01-09 13:04:09 -08:00
Koushik Dutta
e25cf860f0 common: replacement implementation for axios digest auth 2024-01-09 13:04:00 -08:00
Koushik Dutta
b5b56d81a8 Proxmox: fix error check 2024-01-08 17:58:44 -08:00
Koushik Dutta
e7b6cb021c Update install-scrypted-proxmox.sh 2024-01-08 10:45:05 -08:00
Koushik Dutta
e96f374432 Update install-scrypted-proxmox.sh 2024-01-08 10:03:26 -08:00
Koushik Dutta
c4126d7569 onvif: publish 2024-01-08 08:54:36 -08:00
Billy Zoellers
074ba733a3 ONVIF: ignore invalid (array) ONVIF events from Axis cameras (#1253) 2024-01-08 08:50:47 -08:00
Koushik Dutta
622f494703 onvif: publish fixes 2024-01-07 20:03:35 -08:00
Koushik Dutta
28c8b97c26 ha: fix submodule 2024-01-07 20:02:03 -08:00
Brett Jia
c0af17b38d core: query latest docker image via scrypted server (#1247) 2024-01-06 23:54:38 -08:00
Koushik Dutta
44a82a1afa reolink: publish 2024-01-06 16:59:26 -08:00
Koushik Dutta
c9b4c14e35 Merge branch 'main' of github.com:koush/scrypted 2024-01-06 16:59:13 -08:00
Koushik Dutta
76534f1368 onvif: fix unsubscribe crash 2024-01-06 16:58:50 -08:00
Koushik Dutta
3f9a863961 onvif/reolink: fix onvif motion debouncing on motion stop 2024-01-06 10:28:17 -08:00
Koushik Dutta
83b0ebd5f0 docker: fix nvidia script 2024-01-06 09:33:43 -08:00
Koushik Dutta
b923a4ea27 docker: fix nvidia script 2024-01-06 09:32:05 -08:00
Koushik Dutta
941d213087 docker: fix nvidia script 2024-01-06 09:30:09 -08:00
Koushik Dutta
0e11b8b4c5 docker: remove pip reinstall step 2024-01-06 09:29:58 -08:00
Koushik Dutta
1be14878d1 docker: fix nvidia 2024-01-06 09:26:08 -08:00
Koushik Dutta
3e323911c7 proxmox: install script shoud auto boot 2024-01-05 12:27:11 -08:00
Koushik Dutta
ca36ab2d2d ha: publish 2024-01-04 12:27:17 -08:00
Koushik Dutta
a80e95912e python plugins: trigger redownload of deps 2024-01-04 11:35:24 -08:00
Koushik Dutta
4432d8dd67 postrelease 2024-01-04 10:38:49 -08:00
Koushik Dutta
2d83d3ba97 external: update axios digfest auth 2024-01-04 10:03:00 -08:00
Koushik Dutta
1078faef62 common: fix regression with not sending sigterm to ffmpeg 2024-01-04 10:00:41 -08:00
Koushik Dutta
47a981e15a various: Update axios digest auth 2024-01-04 09:59:27 -08:00
Koushik Dutta
e253cab555 opencv: use wheel for aarch64 2024-01-03 19:00:51 -08:00
Koushik Dutta
80124ca83b ha/proxmox: release 2024-01-03 18:55:51 -08:00
Koushik Dutta
f883d8738c docker: update base image 2024-01-03 13:15:05 -08:00
Koushik Dutta
bdca3b545c docker: update base image 2024-01-03 13:09:17 -08:00
Koushik Dutta
3ba02c44ab docker: disable node 20 buikds 2024-01-03 11:13:43 -08:00
Koushik Dutta
fe4733bb97 gha: enable ghcr common publishing 2024-01-03 11:12:48 -08:00
Koushik Dutta
7ff893fbd3 docker: switch to ghcr 2024-01-03 11:05:55 -08:00
Chris Jones
e79c544690 Fix Home Assistant Addon backup exclusions. Closes #1239 (#1240) 2024-01-03 07:23:09 -08:00
Koushik Dutta
13bf44ce50 postrelease 2024-01-02 23:08:53 -08:00
Koushik Dutta
544531122d server: stop console spam if mixin is deleted 2024-01-02 22:13:13 -08:00
Koushik Dutta
778f0b7ad1 proxmox: update script 2024-01-02 14:03:17 -08:00
Koushik Dutta
35e8a86593 snapshot: warn qemu cpu 2024-01-02 13:55:17 -08:00
Koushik Dutta
c370773af4 common: missing file 2024-01-02 12:12:51 -08:00
Koushik Dutta
184f293b92 core: fix new script creation 2024-01-02 09:13:06 -08:00
Koushik Dutta
6e10172f7e Merge branch 'main' of github.com:koush/scrypted 2024-01-01 21:53:12 -08:00
Koushik Dutta
c5ae2cd539 onvif: forgotten file re motion sensor reset 2024-01-01 21:52:54 -08:00
Koushik Dutta
e40566e89c reolink: ptz 2024-01-01 21:52:43 -08:00
Koushik Dutta
59ccd4e4d8 docker: remove armv7 2024-01-01 18:24:51 -08:00
Koushik Dutta
ae80eb7727 docker: remove armv7 2024-01-01 18:24:35 -08:00
Koushik Dutta
f054172dcf postrelease 2024-01-01 15:43:52 -08:00
Koushik Dutta
0d7fb9e13c postrelease 2024-01-01 14:46:06 -08:00
Koushik Dutta
a526816b07 sdk/server: add mechanism for requesting device refresh 2024-01-01 14:44:00 -08:00
Koushik Dutta
563e16b08f sdk: update 2024-01-01 14:42:33 -08:00
Koushik Dutta
fd56990d64 core: watch for script worker exits 2024-01-01 14:12:27 -08:00
Koushik Dutta
d7aaf57e8f core: move scripts into their own workers. 2024-01-01 14:10:17 -08:00
Koushik Dutta
a2d50d54d5 proxmox: delete coral, make user install it. 2024-01-01 00:21:59 -08:00
Koushik Dutta
1f86745252 proxmox: install script 2024-01-01 00:15:09 -08:00
Koushik Dutta
1f4343ba2e proxmox: install script 2024-01-01 00:14:54 -08:00
Koushik Dutta
3ad311898f docker: pillow simd 2023-12-31 22:12:54 -08:00
Koushik Dutta
799e5b53c7 Merge branch 'main' of github.com:koush/scrypted 2023-12-31 21:57:08 -08:00
Koushik Dutta
833e5b34ab docker/lxc: update 2023-12-31 21:57:03 -08:00
Koushik Dutta
c99ac28e89 wyze: write_eof may fail? 2023-12-30 18:53:53 -08:00
Koushik Dutta
841475cb97 wyze: better ffmpeg kill method 2023-12-30 18:53:15 -08:00
Koushik Dutta
4b03a3a458 reolink: debounce motion on motion end 2023-12-28 13:32:14 -08:00
Koushik Dutta
d686dd815c videoanalysis: fix bug with modified default classes 2023-12-28 12:20:28 -08:00
Koushik Dutta
e0386a8922 tensorflow-lite: remove python codecs dependency 2023-12-28 12:13:36 -08:00
Koushik Dutta
9ef3478c88 Merge branch 'main' of github.com:koush/scrypted 2023-12-28 12:08:55 -08:00
Koushik Dutta
690d160f33 openvino: update openvino dependency 2023-12-28 12:08:37 -08:00
Koushik Dutta
59ff987bca server: update deps 2023-12-28 09:56:42 -08:00
Koushik Dutta
1669f17c96 postbeta 2023-12-27 22:38:23 -08:00
Koushik Dutta
b0bfd4e05e wyze: update dwb 2023-12-27 21:56:32 -08:00
Koushik Dutta
7152671913 wyze: update dwb 2023-12-27 21:55:46 -08:00
Koushik Dutta
537c178699 postbeta 2023-12-27 21:51:37 -08:00
Koushik Dutta
77ecee110b videoanalysis: fixup detection types for nvr 2023-12-27 21:40:50 -08:00
Koushik Dutta
29b163a7d8 wyze: update dwb 2023-12-27 21:01:51 -08:00
Koushik Dutta
5d74e80e90 postbeta 2023-12-27 20:13:10 -08:00
Koushik Dutta
764b6441d5 postbeta 2023-12-27 20:12:58 -08:00
Koushik Dutta
e2c43cb4ff onvif: missing file 2023-12-27 20:12:34 -08:00
Koushik Dutta
7b6d094e8c wyze: improve cpu usage 2023-12-27 20:12:06 -08:00
Koushik Dutta
3dfb2db02a snapshot: update deps 2023-12-27 20:11:45 -08:00
Koushik Dutta
e5a549db6a update werift 2023-12-27 19:31:34 -08:00
Koushik Dutta
d500c815fe local: add support for intel and tflite installation 2023-12-26 16:23:59 -08:00
Koushik Dutta
5f71c59b5a local: add support for intel and tflite installation 2023-12-26 16:15:05 -08:00
Koushik Dutta
27407942a5 local: add support for intel and tflite installation 2023-12-26 16:14:55 -08:00
Koushik Dutta
11b6963744 docker: remove libvips 2023-12-26 15:28:39 -08:00
Koushik Dutta
b9ee8866f0 docker: logging 2023-12-26 15:20:21 -08:00
Koushik Dutta
bc80d31eaa docker: add logging 2023-12-26 15:14:19 -08:00
Koushik Dutta
327688232c docker: more prompt fixups 2023-12-26 14:25:30 -08:00
Koushik Dutta
2883a4ce46 docker: more prompt fixups 2023-12-26 14:24:04 -08:00
Koushik Dutta
1ad2fb915d docker: more prompt fixups 2023-12-26 14:23:28 -08:00
Koushik Dutta
fb701a32b7 docker: intel graphics script 2023-12-26 14:19:56 -08:00
Koushik Dutta
7a8c661bb3 docker: remove bash invocation 2023-12-26 14:06:53 -08:00
Koushik Dutta
54d72fb371 docker: gpg should overwrite 2023-12-26 13:56:44 -08:00
Koushik Dutta
e48812cec7 linux: SERVICE_USER_ROOT flag 2023-12-26 13:53:46 -08:00
Koushik Dutta
6c2db072c4 linux: warn root install 2023-12-26 13:51:33 -08:00
Koushik Dutta
4bf2c0b614 docker: add node gpg 2023-12-26 13:49:13 -08:00
Koushik Dutta
a93cdb0ae4 docker: fix quoting 2023-12-26 13:21:24 -08:00
Koushik Dutta
ff85b7abc6 docker: update all node install scripts 2023-12-26 13:17:32 -08:00
Koushik Dutta
46dfb8d98e docker: Fix node version arg 2023-12-26 13:11:51 -08:00
Koushik Dutta
5240200f0f docker: update node install script 2023-12-26 13:04:56 -08:00
Koushik Dutta
3bcb94fc6b reolink: increase motion timeout 2023-12-25 12:03:14 -08:00
Koushik Dutta
a596bc712c reolink: add support for native object detection 2023-12-25 12:02:25 -08:00
Koushik Dutta
f6d2dc456e server: fix bug with constantly reissuing certs 2023-12-24 21:49:08 -08:00
Koushik Dutta
441cce239e wyze: set video timeout to 5s 2023-12-23 19:15:27 -08:00
Koushik Dutta
3016df32d1 Merge branch 'main' of github.com:koush/scrypted 2023-12-23 18:38:11 -08:00
Koushik Dutta
5bd8ed0b1a wyze: fix video inactivity leaks 2023-12-23 18:38:07 -08:00
Koushik Dutta
79286a5138 docker: allow root install 2023-12-22 22:56:09 -08:00
Koushik Dutta
8874e01072 wyze: fix broken setting 2023-12-22 15:39:28 -08:00
Koushik Dutta
0223a9f0f6 wyze: use correct fps when fetching frames 2023-12-22 11:31:58 -08:00
Koushik Dutta
890c2667d0 wyze: implement ptz 2023-12-22 10:34:07 -08:00
Koushik Dutta
ca14764e17 wyze: suppress ffmpeg 2023-12-22 09:13:32 -08:00
Koushik Dutta
1030d7d03c rebroadcast: fix rtsp server with RFC4571 parser 2023-12-22 08:23:43 -08:00
Koushik Dutta
2d40320868 ha: update 2023-12-21 22:53:01 -08:00
Koushik Dutta
3e32c3d019 werift: update 2023-12-21 22:50:32 -08:00
Koushik Dutta
1f9fa3966f wyze: send codec info on startup 2023-12-21 22:49:59 -08:00
Koushik Dutta
c2d86237d6 wyze: refactor for multiprocessing 2023-12-21 21:55:34 -08:00
Koushik Dutta
5cfcfafc00 postrelease 2023-12-21 21:51:42 -08:00
Koushik Dutta
35b4028a47 rpc: how did this ever work? 2023-12-21 21:37:11 -08:00
Koushik Dutta
bf6038a5d3 postbeta 2023-12-21 21:37:01 -08:00
Koushik Dutta
e1b2216543 docker: correct gh action 2023-12-21 21:25:10 -08:00
Koushik Dutta
89c1682421 docker: fixup 2023-12-21 21:24:41 -08:00
Koushik Dutta
5a4c527c59 docker: fixup gh action 2023-12-21 21:22:29 -08:00
Koushik Dutta
9d9c10aa1e docker: remove armv7 2023-12-21 21:21:53 -08:00
Koushik Dutta
ccf20a5fca docker: remove arm7 2023-12-21 21:20:52 -08:00
Koushik Dutta
692e7964a7 rebroadcast: fixes for wyze 2023-12-21 21:10:17 -08:00
Koushik Dutta
57e38072b1 server: fix static vs instance properties 2023-12-21 21:10:09 -08:00
Koushik Dutta
4e8e862482 postbeta 2023-12-21 21:09:41 -08:00
Koushik Dutta
eddcef8e54 rebroadcast: add trigger to reload video streams 2023-12-21 10:39:19 -08:00
Koushik Dutta
09edc6d75e wyze: add bitrate select 2023-12-21 10:28:25 -08:00
Koushik Dutta
72c7c43d79 wyze: fix race condition around teardown 2023-12-21 00:20:49 -08:00
Koushik Dutta
805f471ff9 wyze: add audio support 2023-12-21 00:10:43 -08:00
Koushik Dutta
6f797d53ec rebroadcast/webrtc: fix audio sample rate assumptions 2023-12-21 00:09:20 -08:00
Koushik Dutta
4903a0efcd sdk: update 2023-12-20 23:54:52 -08:00
Koushik Dutta
36e3fcf429 rebroadcast: fix support for rfc4571 2023-12-20 23:50:08 -08:00
Koushik Dutta
78a126fe0a wyze: make plugin visible on npm 2023-12-20 19:09:51 -08:00
Koushik Dutta
5029baf2d4 wyze: add support for substream 2023-12-20 18:05:06 -08:00
Koushik Dutta
769bc014a8 wyze: disable substream 2023-12-20 14:51:37 -08:00
Koushik Dutta
096700486a wyze: initial commit 2023-12-20 14:51:20 -08:00
Koushik Dutta
b3a7d6be9c videoanalysis: smart motion sensor now retains the last thumbnail 2023-12-20 09:36:02 -08:00
Koushik Dutta
05751bce44 Merge branch 'main' of github.com:koush/scrypted 2023-12-19 09:19:51 -08:00
Koushik Dutta
dced62a527 videoanalysis: publish 2023-12-19 09:19:46 -08:00
1vivy
359f1cfc2f docker: fixup nvidia example (#1228) 2023-12-18 15:19:56 -08:00
Koushik Dutta
d4cae8abbb common: add packet loss util to browser signaling session 2023-12-18 12:36:57 -08:00
Koushik Dutta
0e6b3346ed common: add packet loss util to browser signaling session 2023-12-18 12:34:36 -08:00
Koushik Dutta
2409cc457c sdk: remove startId to simplify implementations 2023-12-18 09:41:51 -08:00
Koushik Dutta
0b794aa381 sdk: remove reverseOrder to simplify implementations 2023-12-18 09:34:55 -08:00
Koushik Dutta
98017a5aa6 snapshot: debounce pics for 2 seconds 2023-12-17 22:58:35 -08:00
Koushik Dutta
f2e7cc4017 rebroadcast: validate device is cam or doorbell 2023-12-16 10:16:10 -08:00
Koushik Dutta
d7201a16a7 snapshot/videoanalysis: publish 2023-12-15 10:56:20 -08:00
Koushik Dutta
99d1dc7282 mqtt: support default external brokers 2023-12-13 23:51:44 -08:00
Koushik Dutta
18ae09e41c snapshot: fixup internal invocation 2023-12-13 12:22:20 -08:00
Koushik Dutta
2ebe774e59 snapshot: beta plugin that bypasses media manager for local urls 2023-12-13 12:11:49 -08:00
Koushik Dutta
b887b8a47c core: add weight to core snapshot 2023-12-13 10:51:23 -08:00
Koushik Dutta
8e391dee2f Merge branch 'main' of github.com:koush/scrypted 2023-12-13 09:07:06 -08:00
Koushik Dutta
469f693d58 snapshot: use internal prebuffer converter rather than media manager 2023-12-13 09:07:02 -08:00
slyoldfox
1c96a7d492 bticino: Implement HKSV recording for the bticino and switch the stream to rtsp (#1220)
* Implement HKSV recording for the bticino and switch the stream to rtsp

* Implement HKSV recording for the bticino and switch the stream to rtsp

---------

Co-authored-by: Marc Vanbrabant <marc@foreach.be>
2023-12-12 09:53:53 -08:00
Koushik Dutta
3f1b45c435 rebroadcast: fix unhandled rejection on stream startup failure 2023-12-12 09:44:59 -08:00
Koushik Dutta
4b715e55d2 server: beta 2023-12-11 13:01:01 -08:00
Koushik Dutta
75dc63acc3 postbeta 2023-12-11 13:00:45 -08:00
Koushik Dutta
6c79f42bb7 videoanalysis: add min object detection time 2023-12-11 10:22:32 -08:00
Koushik Dutta
9d4f006caa snapshot: fix vips rgba/gray ops 2023-12-11 09:28:24 -08:00
Koushik Dutta
05b206f897 cloud: dont attempt to register with server if not logged in 2023-12-10 10:12:39 -08:00
Koushik Dutta
1f22218b23 server: recreate cert with valid date range on startup 2023-12-10 09:21:40 -08:00
Koushik Dutta
c9568df165 mqtt: add online stat 2023-12-08 18:47:45 -08:00
Koushik Dutta
c98e91cd39 videoanalysis: add zone choices to smart sensor 2023-12-07 22:35:15 -08:00
Koushik Dutta
e3ecff04ce videoanalysis: publish 2023-12-07 13:04:51 -08:00
Koushik Dutta
f9f50f34c3 common: update digest auth 2023-12-07 12:41:07 -08:00
Koushik Dutta
cd298f7d76 common: shuffle some polygon code 2023-12-07 12:33:58 -08:00
Koushik Dutta
c95248fce0 videoanalysis: use lib that supports convex polys 2023-12-07 12:27:44 -08:00
Koushik Dutta
e50f3fa793 sdk/videoanalysis: remove filterMode from sdk. internal to video analysis only. 2023-12-07 09:43:33 -08:00
Koushik Dutta
c74be7e90f objectdetector: add zone option to smart sensor 2023-12-07 09:37:02 -08:00
Koushik Dutta
4d288727ce sdk: use a filterMode rather than a new zone type 2023-12-07 09:02:11 -08:00
Koushik Dutta
1f19dc191d sdk: add zone that doesnt filter, only used for observation 2023-12-07 08:57:14 -08:00
Koushik Dutta
37d4e5be73 homekit: send client size hints to prevent apple tv crash 2023-12-06 10:10:13 -08:00
Koushik Dutta
e64ec98211 mqtt: add temp, humidity, flood 2023-12-05 22:29:36 -08:00
Koushik Dutta
8b6c0c4f7b homekit: add hint for adaptive bitrate 2023-12-05 22:09:23 -08:00
Koushik Dutta
3b16c68c75 sdk: add fingerprint to getVideoStream 2023-12-05 22:07:36 -08:00
Koushik Dutta
67be05880c core: handle node pty failure 2023-12-04 19:28:46 -08:00
Koushik Dutta
414a9403c2 mqtt: implement basic autodiscovery 2023-12-04 13:58:59 -08:00
Koushik Dutta
053106415c tapo: publish 2023-12-02 09:25:23 -08:00
S.Feng
f3690af92a tapo: fix new firmware using sha256 hash (#1208)
ref:
5d3953a948
2023-12-02 09:04:11 -08:00
Koushik Dutta
c4cc12fdff snapshot: publish 2023-12-01 16:57:04 -08:00
Koushik Dutta
58e8772f7c sdk: publish 2023-12-01 14:17:25 -08:00
Koushik Dutta
4ae9b72471 sdk: add stream resize feedback 2023-12-01 08:51:39 -08:00
Koushik Dutta
a8c64aa2d4 sdk: improve adaptive flags 2023-12-01 08:40:08 -08:00
Koushik Dutta
8ccbba485a snapshot: publish 2023-11-30 09:59:25 -08:00
Koushik Dutta
2ec192e0fd snapshot: fix thumbnail generation near leading bounds 2023-11-30 09:59:09 -08:00
Koushik Dutta
e257953338 sdk: add landmarks and clip paths to detections 2023-11-30 08:26:14 -08:00
Koushik Dutta
9e80eca8e1 Merge branch 'main' of github.com:koush/scrypted 2023-11-29 13:17:27 -08:00
Koushik Dutta
172b32fd47 sdk: update detection result fields 2023-11-29 13:17:22 -08:00
slyoldfox
a6bf055b85 Avoid 'No audio stream detected' in prebuffer when speex is the inputAudioCodec (#1203)
Co-authored-by: Marc Vanbrabant <marc@foreach.be>
2023-11-28 08:51:19 -08:00
Koushik Dutta
dab5be1103 alexa: fix potential response race 2023-11-27 19:42:11 -08:00
Koushik Dutta
126c489934 external: update axios digest auth 2023-11-27 19:06:36 -08:00
Koushik Dutta
7f714b3d6a Merge branch 'main' of github.com:koush/scrypted 2023-11-27 19:06:16 -08:00
Koushik Dutta
fde3c47d8c common: improve ffmpeg kill func, add queue end promise 2023-11-27 19:04:09 -08:00
Koushik Dutta
4b1623dfce Update bug_report.md 2023-11-27 08:55:31 -08:00
Koushik Dutta
1e62f7a418 Update bug_report.md 2023-11-27 08:52:04 -08:00
Koushik Dutta
83c9d9a4a6 external: update axios digest auth 2023-11-26 20:13:03 -08:00
Koushik Dutta
b42afe0ca0 external: update axios digest auth 2023-11-26 20:11:27 -08:00
Koushik Dutta
e8e5f9b33e snapshot: add imageOp util function 2023-11-26 18:53:44 -08:00
Koushik Dutta
15916d83b8 rebroadcast: rollback wallclocks change, it is preventing frame updates in webassembly decoder 2023-11-26 18:31:16 -08:00
Koushik Dutta
c1327974b2 ring: update ring-client-api 2023-11-26 18:31:04 -08:00
Koushik Dutta
33e2291912 webrtc: reduce preference of turn 2023-11-26 16:10:53 -08:00
Koushik Dutta
2d2c5c436f ring: publish 2023-11-25 08:18:50 -08:00
Koushik Dutta
8088ae20b1 reolink/rebroadcast: enable wallclock timestamps on rtmp 2023-11-24 19:16:28 -08:00
Koushik Dutta
4c658b8d99 mqtt: default to empty args 2023-11-24 09:04:42 -08:00
Koushik Dutta
aab78ec797 mqtt: support invoking methods 2023-11-24 09:02:26 -08:00
Koushik Dutta
11ecff985d snapshot: fix file pathing on windows 2023-11-23 19:38:17 -08:00
Koushik Dutta
80a1a78a79 install: fix env 2023-11-23 09:12:43 -08:00
Koushik Dutta
7875c51d62 install: prevent usage of global libvips 2023-11-23 08:50:28 -08:00
Koushik Dutta
b04aa75117 alexa: fix race condition in sendResponse 2023-11-22 21:23:01 -08:00
Koushik Dutta
fc7d1eaf32 snapshot: consolidate image ops 2023-11-22 20:26:53 -08:00
Koushik Dutta
e5a7a55be8 snapshot: refactor 2023-11-22 14:33:33 -08:00
Koushik Dutta
fa9a2eb947 ha: publish 2023-11-22 13:38:39 -08:00
Koushik Dutta
30891e0769 snapshot: lazy load sharp 2023-11-22 13:37:17 -08:00
Koushik Dutta
fb8256709a postrelease 2023-11-22 13:07:51 -08:00
Koushik Dutta
06d0a4a2f1 server: verup 2023-11-22 13:07:41 -08:00
Koushik Dutta
2fb6e0a368 server: fix connectRPCObject in python. cache/optimize connect code. 2023-11-22 13:00:33 -08:00
Koushik Dutta
c6ed0d8729 snapshot: publish latest with sharp fallbacks 2023-11-22 11:49:42 -08:00
Koushik Dutta
67c6f63dbe Merge branch 'main' of github.com:koush/scrypted 2023-11-22 11:16:10 -08:00
Koushik Dutta
e62b4ad68b snapshot: publish beta with sharp + fallback 2023-11-22 11:16:05 -08:00
slyoldfox
bfec5eb3f3 Support turning on/off ringer (#1193)
Support turning on/off answering machine

Co-authored-by: Marc Vanbrabant <marc@foreach.be>
2023-11-22 10:59:56 -08:00
Koushik Dutta
0f948ea672 ha: publish 2023-11-22 10:39:27 -08:00
Koushik Dutta
a28a476d80 core: publish 2023-11-22 09:59:53 -08:00
Koushik Dutta
fdab50bf8e cli/client: update 2023-11-22 09:59:34 -08:00
Koushik Dutta
189be80a40 core: fix rpc serialization issue 2023-11-22 09:10:22 -08:00
Koushik Dutta
dae1b87825 postbeta 2023-11-21 23:47:51 -08:00
Koushik Dutta
8853ca2775 server/core: bump core 2023-11-21 23:47:40 -08:00
Koushik Dutta
296652b550 github: disable some build flavors 2023-11-21 23:34:08 -08:00
Koushik Dutta
fb2646a69f postbeta 2023-11-21 23:12:58 -08:00
Koushik Dutta
9f5787227b server: bump min core version 2023-11-21 23:12:49 -08:00
Koushik Dutta
aedcc0709b webhook: ensure response is sent before onRequest returns 2023-11-21 22:54:36 -08:00
Koushik Dutta
756585ae95 postbeta 2023-11-21 22:52:47 -08:00
Koushik Dutta
4e8ee94012 server: prebeta 2023-11-21 22:52:34 -08:00
Koushik Dutta
5689792a77 core: ensure response is sent before onRequest returns 2023-11-21 22:51:44 -08:00
Koushik Dutta
ed40f29226 sdk: include sharp 2023-11-21 22:37:54 -08:00
Koushik Dutta
aad9a2123d postbeta 2023-11-21 22:37:03 -08:00
Koushik Dutta
602b5e4983 prebeta 2023-11-21 22:36:48 -08:00
Koushik Dutta
5f01cdc73b core: publish beta 2023-11-21 22:24:04 -08:00
Koushik Dutta
a1f82dd065 postbeta 2023-11-21 20:42:53 -08:00
Koushik Dutta
469305cc3b prebeta 2023-11-21 20:42:41 -08:00
Koushik Dutta
5ed4082918 snapshot: use forked sharp 2023-11-21 12:29:56 -08:00
Koushik Dutta
1bfdacc476 server: update deps 2023-11-21 12:29:47 -08:00
Koushik Dutta
2d03b55d8e sdk: remove comments 2023-11-21 11:03:08 -08:00
Koushik Dutta
a06894b165 sdk: disable typeof transform 2023-11-21 10:44:01 -08:00
Koushik Dutta
e2c0b4d1bf snapshot: rollback 2023-11-20 21:14:17 -08:00
Koushik Dutta
501509dcd0 snapshot: publish vips support 2023-11-20 20:51:31 -08:00
Koushik Dutta
9cbc38173b rpc: further alloc cleanups 2023-11-20 19:38:46 -08:00
Koushik Dutta
8c7a4dc21e snapshot: readd sharp, publish beta 2023-11-20 19:38:33 -08:00
Koushik Dutta
edfeacd075 rpc: further alloc cleanups 2023-11-20 19:38:15 -08:00
Koushik Dutta
20d1372d2a server: fix update signature 2023-11-20 08:44:31 -08:00
Koushik Dutta
3999cb6696 rpc: further cleanups on holding buffers 2023-11-19 20:11:42 -08:00
Koushik Dutta
167360a218 common: prevent runaway zygote 2023-11-19 19:03:43 -08:00
Koushik Dutta
9b168bb012 server: suppress noisy media manager 2023-11-19 19:03:25 -08:00
Koushik Dutta
31f2d33e57 core: update lockfiles 2023-11-19 18:55:17 -08:00
Koushik Dutta
513dd4867b rpc: remove debug 2023-11-19 18:55:03 -08:00
Koushik Dutta
08e723848f rpc: fix slice vs subarray behavior on web/babel 2023-11-19 18:50:54 -08:00
Koushik Dutta
fb37061a04 rpc: fix buffer gc trashing 2023-11-19 18:11:59 -08:00
Koushik Dutta
56c6cb8947 openvino: add ability to select specific device 2023-11-19 14:36:00 -08:00
Koushik Dutta
4f38c6eea8 snapshot: fix source id 2023-11-19 14:35:24 -08:00
Koushik Dutta
5eb2c586fa common: add zygote worker. fix async queue signal abort. 2023-11-19 14:34:50 -08:00
Koushik Dutta
8fd89e75b4 reolink: fix skip validation 2023-11-19 13:39:57 -08:00
Koushik Dutta
10c9143333 webrtc: publish 2023-11-18 14:33:02 -08:00
Brett Jia
eaeae02080 rtp marker tweaks on webrtc talkback (#1187)
* set rtp marker

* set marker if last packet was recevied 1s+ ago

* fix after merge

* reorder

* set marker if last packet was recevied 1s+ ago
2023-11-18 14:32:32 -08:00
Koushik Dutta
7460c714c1 Merge branch 'main' of github.com:koush/scrypted 2023-11-18 14:32:10 -08:00
Koushik Dutta
d7874eb7a2 server: catch ffmpeg shutdown errors 2023-11-18 14:32:04 -08:00
Koushik Dutta
5847b585c7 common: move zygote 2023-11-18 14:31:47 -08:00
Sahib B
901e0a2349 cloud: Improve clarity of Cloudflare token copying instructions (#1186)
The original wording implies that `sudo cloudflared service install` is part of the token which is incorrect.
2023-11-17 21:56:39 -08:00
Koushik Dutta
8c8c7934ff common: queue end should not clear the queue 2023-11-17 21:55:50 -08:00
Koushik Dutta
dd4efcd52f common: fix waiting dequeues on queue end 2023-11-17 20:55:28 -08:00
Koushik Dutta
eab0746a0a python-codecs: fix erroneous deletion 2023-11-17 20:48:01 -08:00
Koushik Dutta
385d331953 webrtc: disable marker bit on audio packets 2023-11-17 11:03:16 -08:00
Koushik Dutta
27a01a7df8 snapshot/python-codecs: move image writer 2023-11-17 10:41:16 -08:00
Koushik Dutta
fc13a230d7 common: support modifying server client opts 2023-11-17 09:46:50 -08:00
Koushik Dutta
f7d88273e4 webrtc: talkback fixes 2023-11-16 21:17:01 -08:00
Koushik Dutta
26124b7647 sdk: fix storage settings bug 2023-11-16 19:31:22 -08:00
Koushik Dutta
5ba30e6001 videoanalysis: remove snapshot pipeline, add support for new webassembly decoder 2023-11-16 19:22:15 -08:00
Koushik Dutta
cfb78ebb7f common: queue iterator throw or return should propagate to queue. 2023-11-15 23:13:10 -08:00
Koushik Dutta
83ad4ed7bc postbeta 2023-11-15 11:29:44 -08:00
Koushik Dutta
8612d8e1fb postbeta 2023-11-15 11:27:39 -08:00
Koushik Dutta
3aeddd0347 homekit: remove object detectors, feature is now in video analysis plugin 2023-11-15 10:41:55 -08:00
Koushik Dutta
f41fa9055e videoanalysis: fix var clobbering 2023-11-15 09:54:23 -08:00
Koushik Dutta
6655cba3b6 Merge branch 'main' of github.com:koush/scrypted 2023-11-15 09:43:37 -08:00
Koushik Dutta
4726630e29 videoanalysis: fix settings crash 2023-11-15 09:43:30 -08:00
Koushik Dutta
4989aa621e videoanalysis: add smart motion sensor feature 2023-11-15 09:33:22 -08:00
Brett Jia
772bfec55a cli, core: support invoking remote commands (#1185)
* cli, core: support launching remote commands

* fixes

* preserve buffer format for child process
2023-11-14 20:32:30 -08:00
Brett Jia
cf9a0653f2 cli, core, ui: add npx scrypted shell and support interactive/noninteractive shells (#1174)
* cli: add `npx scrypted shell`

* stdin tweaks

* buffer math tweaks

* listen to stdin eof only on noninteractive

* feedback + implement noninteractive use

* change logic per feedback
2023-11-13 10:46:21 -08:00
Koushik Dutta
c5bbe5619e werift: update 2023-11-13 09:39:05 -08:00
Koushik Dutta
61be7fa58d sdk/client: publish 2023-11-12 20:06:32 -08:00
Brett Jia
8cb2e1516a client, server, core: Add StreamService interface and TerminalService device (#1171)
* wip

* clean up shell on disconnect

* fix null reference

* remove debug logs

* use async queue in buffered buffer, add max buffer size before connection teardown

* Revert "use async queue in buffered buffer, add max buffer size before connection teardown"

This reverts commit 1b3c283542.

* reimplement per feedback

* feedback
2023-11-12 20:03:19 -08:00
Koushik Dutta
1b15453997 rpc: fix babel mucking up async generators 2023-11-10 17:00:25 -08:00
Koushik Dutta
7e65605ab8 sdk: update with node pty 2023-11-09 20:21:24 -08:00
Koushik Dutta
793c583491 server/client: fix inadvertent inclusion of node:net in client. consolidate connection setup code. 2023-11-09 15:33:58 -08:00
Koushik Dutta
77d4b0a995 server/client: fixup client deps 2023-11-09 15:32:58 -08:00
Koushik Dutta
79eda5d356 server: cleanup imports 2023-11-09 15:31:13 -08:00
Koushik Dutta
86f3318133 server/client: fix inadvertent inclusion of node:net in client. consolidate connection setup code. 2023-11-09 15:30:26 -08:00
Koushik Dutta
1cf0327d2e python-codecs: todo remove comments 2023-11-09 14:28:24 -08:00
Koushik Dutta
3244956b91 sdk: remove filter from video frame generator 2023-11-09 10:25:32 -08:00
Koushik Dutta
6d5fedc931 sdk: remove filter from VideoFrameGenerator 2023-11-09 10:24:55 -08:00
Koushik Dutta
7eca7f69c0 Merge branch 'main' of github.com:koush/scrypted 2023-11-09 09:54:48 -08:00
Brett Jia
7dec399ed7 server, client: send full ClusterObject on new eio endpoint (#1170)
* server: change connectRPCObject internal signature

* server, client: send ClusterObject + hash validation

---------

Co-authored-by: Koushik Dutta <koushd@gmail.com>
2023-11-09 09:47:18 -08:00
Koushik Dutta
9edc63bd90 update werift 2023-11-09 09:22:30 -08:00
Koushik Dutta
99d2f43699 snapshot: send accept header to prevent sending application/json by default 2023-11-09 09:22:14 -08:00
Koushik Dutta
ba1ecd54c5 server: change connectRPCObject internal signature 2023-11-08 12:12:02 -08:00
Brett Jia
e49f26b410 server, client: connectRPCObject for web api clients (#1166)
* initial pass at connectRPCObject proxy

* wip: connects to server but fails on pendingResults

* fix wrong rpcpeer bug + cleanup serialization

* small cleanups

* feedback, local object lookups

* rpc: fix up additional id gens

* feedback

* update example to use frame generator

---------

Co-authored-by: Koushik Dutta <koushd@gmail.com>
2023-11-08 09:22:07 -08:00
Koushik Dutta
d7a417c984 webhook: fix mixin race condition dangling 2023-11-07 21:27:45 -08:00
Koushik Dutta
1a7e0370c9 rpc: fix up additional id gens 2023-11-07 15:23:47 -08:00
Koushik Dutta
2fe4191f12 cameras: remove snapshot debouncing, it is in the snapshot plugin now 2023-11-07 09:32:34 -08:00
Brett Jia
b2b5cde303 server: fix python rpc id gen (#1165) 2023-11-06 12:53:11 -08:00
Koushik Dutta
33b77b64de rpc: id gen fix 2023-11-05 09:00:11 -08:00
Koushik Dutta
a41d4de97a rpc: use non deterministic object ids 2023-11-04 20:24:21 -07:00
Koushik Dutta
cf367fa481 Merge branch 'main' of github.com:koush/scrypted 2023-10-31 11:42:25 -07:00
Koushik Dutta
6f483f829b common: fix readLine performance 2023-10-31 11:42:18 -07:00
Brett Jia
be69c25076 server: fix crash on changing closed pty dimensions (#1158) 2023-10-31 08:52:11 -07:00
Brett Jia
96d292d39f server: best-effort allow older clients to write to shell (#1157) 2023-10-30 21:00:38 -07:00
Ben Dews
933c731fe6 reolink: Added device detection features + trackmix stream (#1154) 2023-10-30 20:46:21 -07:00
Sahib B
aa2c1c65f9 Docs: Update and simplify port forwarding guide for beginners (#1141)
* Update and simplify port forwarding guide for beginners

* Fix wrong step incrementation
2023-10-30 20:37:52 -07:00
Koushik Dutta
5228dbff62 rtp: negotiation null check 2023-10-25 20:16:06 -07:00
Brett Jia
d3593b9e40 server & core: handle binary terminal data (#1149)
* server & core: send terminal size info

* server & core: handle binary terminal data

* send all data as buffer

* add guard to not crash on mismatched core
2023-10-25 08:58:53 -07:00
Koushik Dutta
2ef482c47f Merge branch 'main' of github.com:koush/scrypted 2023-10-25 08:49:14 -07:00
Koushik Dutta
52692c0912 python-codecs: fix potential leak/hang 2023-10-25 08:49:10 -07:00
Brett Jia
98c901486a server & core: send terminal size info (#1148) 2023-10-24 20:43:04 -07:00
Koushik Dutta
476bd3b427 sdk/client: publish 2023-10-24 12:49:55 -07:00
Koushik Dutta
f71826f6a1 sdk: recordingActive state 2023-10-24 12:43:57 -07:00
Koushik Dutta
ed72643d3e unifi-protect: fix login on 3.2.5 2023-10-23 11:35:30 -07:00
Koushik Dutta
96219456f3 python-codecs: fix startup analyze duration and probe size 2023-10-23 09:34:11 -07:00
Koushik Dutta
0e797c6ac6 python-codecs: improve pyav for zero latency 2023-10-23 09:08:56 -07:00
Koushik Dutta
672f01fd3f webrtc: documentation on raw audio packet times 2023-10-22 22:28:01 -07:00
Koushik Dutta
327acaec76 webrtc: prototype packing opus packets. seems to work. 2023-10-22 22:23:19 -07:00
Koushik Dutta
aac10c4f16 plugins: pcm_mulaw rename, intercom fixes, h264 fix 2023-10-22 16:56:20 -07:00
Koushik Dutta
da4ba776f7 h264-repacketizer: stapa codec info fix and stapa repacketization assert 2023-10-22 16:21:53 -07:00
Koushik Dutta
6cd0af492b reolink: fixups for h265 mode cams 2023-10-19 19:44:54 -07:00
Koushik Dutta
6a2474d11e unifi-protect: typos 2023-10-19 15:01:03 -07:00
Koushik Dutta
e8a5d5cfd3 unifi-protect: make connecitonHost an options 2023-10-19 14:59:55 -07:00
Koushik Dutta
f07604de4c two-way audio improvements:
rename pcm_ulaw to pcm_mulaw per ffmpeg codec name
support transcode free rtp forwarding of audio only streams
onvif two audio codec negotiation with upstream
2023-10-19 14:00:36 -07:00
Koushik Dutta
ed35811296 webrtc: initial prep for negotiated intercom codecs 2023-10-19 10:57:20 -07:00
Koushik Dutta
ae2228f2e4 homekit: opus frame duration quirk doc 2023-10-17 14:40:50 -07:00
Koushik Dutta
c92c8f2b52 homekit: publish 2023-10-17 14:37:29 -07:00
Koushik Dutta
478f1f4ad7 homekit: fix opus repacketization 2023-10-17 14:36:57 -07:00
Koushik Dutta
06c8b397f0 python-codecs: h265 parsing fixes 2023-10-17 11:02:39 -07:00
Koushik Dutta
f8bcf196d3 python-codecs: use non hw accelerated h265 by default 2023-10-17 10:38:14 -07:00
Koushik Dutta
d1b57ed3ad snapshot: avoid ffmpeg for crop if possible 2023-10-17 09:49:56 -07:00
Koushik Dutta
190914efd1 ring: update webrtc stream endpoint, start phasing out rtsp stream 2023-10-17 09:12:03 -07:00
Koushik Dutta
e26e53899e webrtc: improve private address range check 2023-10-16 14:56:34 -07:00
Koushik Dutta
43c69914a4 webrtc: publish 2023-10-16 12:54:42 -07:00
Koushik Dutta
73f859b1f6 Merge branch 'main' of github.com:koush/scrypted 2023-10-16 12:10:37 -07:00
Koushik Dutta
a362b7d6d9 webrtc: add ability to filter candidate pairs 2023-10-16 12:10:23 -07:00
Koushik Dutta
efa8515aa0 Update install-scrypted-dependencies-mac.sh 2023-10-14 19:31:00 -07:00
Koushik Dutta
7987a78239 Merge branch 'main' of github.com:koush/scrypted 2023-10-14 12:48:02 -07:00
Koushik Dutta
21752a3e7e unifi: publish 2023-10-14 12:47:57 -07:00
Koushik Dutta
b4d8f99cd5 Revert "unifi-protect: Use connectionHost to support cameras distributed between stacked nvrs (#1128)"
This reverts commit 0349977a4d.
2023-10-14 12:47:41 -07:00
Koushik Dutta
6cf8f6db32 ha: publish 2023-10-12 20:32:29 -07:00
Koushik Dutta
feb3b8f601 postrelease 2023-10-12 19:53:22 -07:00
Koushik Dutta
9e0e9bc22a cameras: publish 2023-10-12 10:02:38 -07:00
Koushik Dutta
9e495c74d9 onvif: publish 2023-10-12 10:01:14 -07:00
Koushik Dutta
a9baeafe71 postbeta 2023-10-12 09:14:41 -07:00
Koushik Dutta
ee68fcd7d2 core: fix js redirect 2023-10-12 09:11:59 -07:00
Koushik Dutta
af6e18dc1a reolink: intercom teardown fixes 2023-10-12 09:04:16 -07:00
Koushik Dutta
ddb8c7cf58 webrtc: intercom teardown fixes 2023-10-12 09:04:06 -07:00
Koushik Dutta
2be3c7f3df unifi: publish 2023-10-11 17:19:32 -07:00
Koushik Dutta
274f449e2f reolink: missing file from intercom teardown fix 2023-10-11 17:19:18 -07:00
Koushik Dutta
1109333e0f Merge branch 'main' of github.com:koush/scrypted 2023-10-11 17:18:20 -07:00
Dan Wager
0349977a4d unifi-protect: Use connectionHost to support cameras distributed between stacked nvrs (#1128)
* Use connectionHost to support cameras distributed between stacked nvrs

* Add fallback to user-configured nvr ip

* remove whitespace
2023-10-11 17:18:16 -07:00
Koushik Dutta
48548aafd5 reolink: fix teardown 2023-10-11 15:45:25 -07:00
Koushik Dutta
ab70cce1b5 reolink: fix bug where rtmp does not support 4k 2023-10-11 12:53:24 -07:00
Koushik Dutta
83fe0c2b7a videoanalysis: fix rounding issue on cpu throttle 2023-10-11 12:53:12 -07:00
Koushik Dutta
77676a27c2 Update bug_report.md 2023-10-10 08:16:34 -07:00
Koushik Dutta
015dfab7a6 Update issue templates 2023-10-10 08:15:24 -07:00
Koushik Dutta
7f0f0cb6bd client: cache bust engine io requests 2023-10-09 19:49:00 -07:00
Koushik Dutta
e49e13a167 server: fix potential rce 2023-10-09 11:47:32 -07:00
Koushik Dutta
9fd353236b server: update deps 2023-10-09 11:31:45 -07:00
Koushik Dutta
e006d599d7 client: update and publish 2023-10-09 11:29:42 -07:00
Koushik Dutta
71cbe83a2a cloud: support disabling cloudflare 2023-10-04 09:35:13 -07:00
Koushik Dutta
1438af8aea cloud: preserve port setting when disabled 2023-10-04 09:21:43 -07:00
Koushik Dutta
2237eb3221 cloud: use permanent cloudflare hostname if token is provided 2023-10-04 09:15:18 -07:00
Koushik Dutta
7b56e86383 Merge branch 'main' of github.com:koush/scrypted 2023-10-03 19:22:49 -07:00
Koushik Dutta
3653fb83d3 rebroadcast: watch for nvr overflow 2023-10-03 19:22:43 -07:00
Brett Jia
cd766a603e arlo: migrate to standalone repo (#1102) 2023-09-28 10:40:49 -07:00
Koushik Dutta
3648492299 client: dedupe addresses 2023-09-28 09:26:31 -07:00
Koushik Dutta
88e8530677 cloud: addresses should be urls not hosts 2023-09-28 09:03:38 -07:00
Koushik Dutta
325f84ca7e client: consider external addresses during negotiation 2023-09-28 08:48:21 -07:00
Koushik Dutta
0a4b862fd8 cloud: report external addresses 2023-09-28 08:38:37 -07:00
Koushik Dutta
e7d7fd6a00 openvino: bump openvino version and publish. note: 2023.1.0 is available but currently nonfunctional with yolov8 2023-09-26 10:06:02 -07:00
Koushik Dutta
f9dda8d1ca openvino: use builtin async, log execution unit 2023-09-26 09:56:42 -07:00
Koushik Dutta
8b7decd077 Merge branch 'main' of github.com:koush/scrypted 2023-09-25 07:12:12 -07:00
Koushik Dutta
9dd5e10eba python-codecs: fix float being passed to pil resize args 2023-09-25 07:12:05 -07:00
Brett Jia
475b833508 sdk: configurable webpack entrypoint (#1076) 2023-09-21 20:07:32 -07:00
Koushik Dutta
5f9006148a Merge branch 'main' of github.com:koush/scrypted 2023-09-21 16:04:15 -07:00
Koushik Dutta
b77f1a55c1 client: add missing address on cloud connect 2023-09-21 16:04:11 -07:00
Koushik Dutta
6b9163e84e server: rename fetch helper 2023-09-20 08:07:09 -07:00
Koushik Dutta
bc03bdd235 ha: publish 2023-09-20 00:21:30 -07:00
Koushik Dutta
2592a7c228 postrelease 2023-09-19 23:32:51 -07:00
Koushik Dutta
0a4336879c client: allow direct login on chrome if flag is explicitly true 2023-09-19 19:03:16 -07:00
Koushik Dutta
e5cef3f217 client: fixup alt address usage 2023-09-19 18:57:15 -07:00
Koushik Dutta
d34396afbc postbeta 2023-09-19 18:56:45 -07:00
Koushik Dutta
2622fc9256 postbeta 2023-09-19 16:46:09 -07:00
Koushik Dutta
410b1a4813 client: check token presence before using direct address 2023-09-19 16:25:08 -07:00
Koushik Dutta
403c742be3 server: token comment 2023-09-19 16:21:10 -07:00
Koushik Dutta
50a471b78f client: use long term token for direct connection 2023-09-19 15:26:23 -07:00
Koushik Dutta
9b7ead26e0 postbeta 2023-09-19 15:23:07 -07:00
Koushik Dutta
3127bc38cb server: include token for basic auth login result 2023-09-19 15:22:48 -07:00
Koushik Dutta
fb8b1a893d cloud: fix misleading port forward test error 2023-09-19 13:46:26 -07:00
Koushik Dutta
779d8eaa42 postrelease 2023-09-19 13:39:29 -07:00
573 changed files with 39638 additions and 38760 deletions

57
.github/ISSUE_TEMPLATE/bug_report.md vendored Normal file
View File

@@ -0,0 +1,57 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''
---
# Github Issues are not a Support or Discussion Forum
Before opening an issue, view the device's Console logs in the Scrypted Management web interface.
**DO NOT OPEN ISSUES FOR ANY OF THE FOLLOWING:**
* Server or hardware setup assistance. Use Discord, Reddit, or Github Discussions.
* Feature Requests. Use Discord, Reddit, or Github Discussions.
* Packet loss in your camera logs. This is wifi/network congestion.
* HomeKit weirdness. See HomeKit troubleshooting guide.
* Release schedules or timelines. Releases are rolled out unevenly across the different server platforms.
However, if something **was working**, and is now **no longer working**, you may create a Github issue.
Created issues that do not meet these requirements or are improperly filled out will be immediately closed.
# New Issue Instructions
1. Delete this section and everything above it.
2. Fill out the sections below.
**Describe the bug**
A clear and concise description of what the bug is. The issue tracker is only for reporting bugs in Scrypted, for general support check Discord. Hardrware support requests or assistance requests will be immediately closed.
**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
**Expected behavior**
A clear and concise description of what you expected to happen.
**Screenshots**
If applicable, add screenshots to help explain your problem.
**Server (please complete the following information):**
- OS: [e.g. Ubuntu]
- Installation Method: [e.g. Desktop App, Docker, Local]
**Hardware Model (please complete the following information):**
- Device: [e.g. Amcrest]
**Client (please complete the following information, if applicable):**
- Software: [e.g. Home app, NVR app, Alexa, Browser]
**Additional context**
Add any other context about the problem here.

View File

@@ -0,0 +1,51 @@
name: Build changed plugins
on:
# push:
# branches: ["main"]
# paths: ["plugins/**"]
# pull_request:
# paths: ["plugins/**"]
workflow_dispatch:
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 2
- uses: actions/setup-node@v4
with:
node-version: 18
- name: Set up base packages
run: ./npm-install.sh
- name: Build changed plugins
run: |
# Get the list of changed directories in /plugins
changed_dirs=$(git diff --name-only HEAD^ HEAD ./plugins | awk -F/ '{print $2}' | uniq)
# Loop through each changed directory
for dir in $changed_dirs; do
pushd "./plugins/$dir"
if [[ "$dir" == "core" ]]; then
# core plugin requires ui to be built
pushd "./ui"
echo "plugins/$dir/ui > npm install"
npm install
echo "plugins/$dir/ui > npm run build"
npm run build
popd
fi
echo "plugins/$dir > npm install"
npm install
echo "plugins/$dir > npm run build"
npm run build
popd
done

25
.github/workflows/build-sdk.yml vendored Normal file
View File

@@ -0,0 +1,25 @@
name: Build SDK
on:
push:
branches: ["main"]
paths: ["sdk/**"]
pull_request:
paths: ["sdk/**"]
workflow_dispatch:
jobs:
build:
name: Build
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./sdk
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18
- run: npm ci
- run: npm run build

View File

@@ -7,12 +7,12 @@ jobs:
build:
name: Push Docker image to Docker Hub
runs-on: self-hosted
# runs-on: ubuntu-latest
env:
NODE_VERSION: '20'
strategy:
matrix:
NODE_VERSION: ["18", "20"]
BASE: ["jammy"]
FLAVOR: ["full", "lite", "thin"]
FLAVOR: ["full", "lite"]
steps:
- name: Check out the repo
uses: actions/checkout@v3
@@ -23,24 +23,30 @@ jobs:
- name: Set up SSH
uses: MrSquaare/ssh-setup-action@v2
with:
host: ${{ secrets.DOCKER_SSH_HOST_ARM64 }}
host: ${{ secrets.DOCKER_SSH_HOST_AMD64 }}
private-key: ${{ secrets.DOCKER_SSH_PRIVATE_KEY }}
- name: Set up SSH
uses: MrSquaare/ssh-setup-action@v2
with:
host: ${{ secrets.DOCKER_SSH_HOST_ARM7 }}
host: ${{ secrets.DOCKER_SSH_HOST_ARM64 }}
private-key: ${{ secrets.DOCKER_SSH_PRIVATE_KEY }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
with:
platforms: linux/arm64,linux/armhf
platforms: linux/amd64
append: |
- endpoint: ssh://${{ secrets.DOCKER_SSH_USER }}@${{ secrets.DOCKER_SSH_HOST_AMD64 }}
platforms: linux/amd64
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
with:
platforms: linux/arm64
append: |
- endpoint: ssh://${{ secrets.DOCKER_SSH_USER }}@${{ secrets.DOCKER_SSH_HOST_ARM64 }}
platforms: linux/arm64
- endpoint: ssh://${{ secrets.DOCKER_SSH_USER }}@${{ secrets.DOCKER_SSH_HOST_ARM7 }}
platforms: linux/armhf
- name: Login to Docker Hub
uses: docker/login-action@v2
@@ -59,13 +65,84 @@ jobs:
uses: docker/build-push-action@v4
with:
build-args: |
NODE_VERSION=${{ matrix.NODE_VERSION }}
NODE_VERSION=${{ env.NODE_VERSION }}
BASE=${{ matrix.BASE }}
context: install/docker/
file: install/docker/Dockerfile.${{ matrix.FLAVOR }}
platforms: linux/amd64,linux/armhf,linux/arm64
platforms: linux/amd64,linux/arm64
push: true
tags: |
koush/scrypted-common:${{ matrix.NODE_VERSION }}-${{ matrix.BASE }}-${{ matrix.FLAVOR }}
koush/scrypted-common:${{ matrix.BASE }}-${{ matrix.FLAVOR }}
ghcr.io/koush/scrypted-common:${{ matrix.BASE }}-${{ matrix.FLAVOR }}
cache-from: type=gha
cache-to: type=gha,mode=max
build-nvidia:
name: Push NVIDIA Docker image to Docker Hub
needs: build
runs-on: self-hosted
strategy:
matrix:
BASE: ["jammy"]
steps:
- name: Check out the repo
uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up SSH
uses: MrSquaare/ssh-setup-action@v2
with:
host: ${{ secrets.DOCKER_SSH_HOST_AMD64 }}
private-key: ${{ secrets.DOCKER_SSH_PRIVATE_KEY }}
- name: Set up SSH
uses: MrSquaare/ssh-setup-action@v2
with:
host: ${{ secrets.DOCKER_SSH_HOST_ARM64 }}
private-key: ${{ secrets.DOCKER_SSH_PRIVATE_KEY }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
with:
platforms: linux/amd64
append: |
- endpoint: ssh://${{ secrets.DOCKER_SSH_USER }}@${{ secrets.DOCKER_SSH_HOST_AMD64 }}
platforms: linux/amd64
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
with:
platforms: linux/arm64
append: |
- endpoint: ssh://${{ secrets.DOCKER_SSH_USER }}@${{ secrets.DOCKER_SSH_HOST_ARM64 }}
platforms: linux/arm64
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Login to Github Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Docker image (scrypted-common)
uses: docker/build-push-action@v4
with:
build-args: |
BASE=ghcr.io/koush/scrypted-common:${{ matrix.BASE }}-full
context: install/docker/
file: install/docker/Dockerfile.nvidia
platforms: linux/amd64,linux/arm64
push: true
tags: |
koush/scrypted-common:${{ matrix.BASE }}-nvidia
ghcr.io/koush/scrypted-common:${{ matrix.BASE }}-nvidia
cache-from: type=gha
cache-to: type=gha,mode=max

View File

@@ -19,8 +19,11 @@ jobs:
# runs-on: ubuntu-latest
strategy:
matrix:
BASE: ["18-jammy-full", "18-jammy-lite", "18-jammy-thin", "20-jammy-full", "20-jammy-lite", "20-jammy-thin"]
SUPERVISOR: ["", ".s6"]
BASE: [
["jammy-nvidia", ".s6"],
["jammy-full", ".s6"],
["jammy-lite", ""],
]
steps:
- name: Check out the repo
uses: actions/checkout@v3
@@ -42,24 +45,30 @@ jobs:
- name: Set up SSH
uses: MrSquaare/ssh-setup-action@v2
with:
host: ${{ secrets.DOCKER_SSH_HOST_ARM64 }}
host: ${{ secrets.DOCKER_SSH_HOST_AMD64 }}
private-key: ${{ secrets.DOCKER_SSH_PRIVATE_KEY }}
- name: Set up SSH
uses: MrSquaare/ssh-setup-action@v2
with:
host: ${{ secrets.DOCKER_SSH_HOST_ARM7 }}
host: ${{ secrets.DOCKER_SSH_HOST_ARM64 }}
private-key: ${{ secrets.DOCKER_SSH_PRIVATE_KEY }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
with:
platforms: linux/arm64,linux/armhf
platforms: linux/amd64
append: |
- endpoint: ssh://${{ secrets.DOCKER_SSH_USER }}@${{ secrets.DOCKER_SSH_HOST_AMD64 }}
platforms: linux/amd64
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
with:
platforms: linux/arm64
append: |
- endpoint: ssh://${{ secrets.DOCKER_SSH_USER }}@${{ secrets.DOCKER_SSH_HOST_ARM64 }}
platforms: linux/arm64
- endpoint: ssh://${{ secrets.DOCKER_SSH_USER }}@${{ secrets.DOCKER_SSH_HOST_ARM7 }}
platforms: linux/armhf
- name: Login to Docker Hub
uses: docker/login-action@v2
@@ -78,27 +87,23 @@ jobs:
uses: docker/build-push-action@v4
with:
build-args: |
BASE=${{ matrix.BASE }}
BASE=${{ matrix.BASE[0] }}
SCRYPTED_INSTALL_VERSION=${{ steps.package-version.outputs.NPM_VERSION }}
context: install/docker/
file: install/docker/Dockerfile${{ matrix.SUPERVISOR }}
platforms: linux/amd64,linux/arm64,linux/armhf
file: install/docker/Dockerfile${{ matrix.BASE[1] }}
platforms: linux/amd64,linux/arm64
push: true
tags: |
${{ format('koush/scrypted:{0}{1}-v{2}', matrix.BASE, matrix.SUPERVISOR, github.event.inputs.publish_tag || steps.package-version.outputs.NPM_VERSION) }}
${{ matrix.BASE == '18-jammy-full' && matrix.SUPERVISOR == '.s6' && format('koush/scrypted:{0}', github.event.inputs.tag) || '' }}
${{ github.event.inputs.tag == 'latest' && matrix.BASE == '18-jammy-full' && matrix.SUPERVISOR == '' && 'koush/scrypted:full' || '' }}
${{ github.event.inputs.tag == 'latest' && matrix.BASE == '18-jammy-lite' && matrix.SUPERVISOR == '' && 'koush/scrypted:lite' || '' }}
${{ github.event.inputs.tag == 'latest' && matrix.BASE == '18-jammy-thin' && matrix.SUPERVISOR == '' && 'koush/scrypted:thin' || '' }}
${{ github.event.inputs.tag == 'latest' && matrix.BASE == '18-jammy-lite' && matrix.SUPERVISOR == '.s6' && 'koush/scrypted:lite-s6' || '' }}
${{ github.event.inputs.tag == 'latest' && matrix.BASE == '18-jammy-thin' && matrix.SUPERVISOR == '.s6' && 'koush/scrypted:thin-s6' || '' }}
${{ format('koush/scrypted:v{1}-{0}', matrix.BASE[0], github.event.inputs.publish_tag || steps.package-version.outputs.NPM_VERSION) }}
${{ matrix.BASE[0] == 'jammy-full' && format('koush/scrypted:{0}', github.event.inputs.tag) || '' }}
${{ github.event.inputs.tag == 'latest' && matrix.BASE[0] == 'jammy-nvidia' && 'koush/scrypted:nvidia' || '' }}
${{ github.event.inputs.tag == 'latest' && matrix.BASE[0] == 'jammy-full' && 'koush/scrypted:full' || '' }}
${{ github.event.inputs.tag == 'latest' && matrix.BASE[0] == 'jammy-lite' && 'koush/scrypted:lite' || '' }}
${{ format('ghcr.io/koush/scrypted:{0}{1}-v{2}', matrix.BASE, matrix.SUPERVISOR, github.event.inputs.publish_tag || steps.package-version.outputs.NPM_VERSION) }}
${{ matrix.BASE == '18-jammy-full' && matrix.SUPERVISOR == '.s6' && format('ghcr.io/koush/scrypted:{0}', github.event.inputs.tag) || '' }}
${{ github.event.inputs.tag == 'latest' && matrix.BASE == '18-jammy-full' && matrix.SUPERVISOR == '' && 'ghcr.io/koush/scrypted:full' || '' }}
${{ github.event.inputs.tag == 'latest' && matrix.BASE == '18-jammy-lite' && matrix.SUPERVISOR == '' && 'ghcr.io/koush/scrypted:lite' || '' }}
${{ github.event.inputs.tag == 'latest' && matrix.BASE == '18-jammy-thin' && matrix.SUPERVISOR == '' && 'ghcr.io/koush/scrypted:thin' || '' }}
${{ github.event.inputs.tag == 'latest' && matrix.BASE == '18-jammy-lite' && matrix.SUPERVISOR == '.s6' && 'ghcr.io/koush/scrypted:lite-s6' || '' }}
${{ github.event.inputs.tag == 'latest' && matrix.BASE == '18-jammy-thin' && matrix.SUPERVISOR == '.s6' && 'ghcr.io/koush/scrypted:thin-s6' || '' }}
${{ format('ghcr.io/koush/scrypted:v{1}-{0}', matrix.BASE[0], github.event.inputs.publish_tag || steps.package-version.outputs.NPM_VERSION) }}
${{ matrix.BASE[0] == 'jammy-full' && format('ghcr.io/koush/scrypted:{0}', github.event.inputs.tag) || '' }}
${{ github.event.inputs.tag == 'latest' && matrix.BASE[0] == 'jammy-nvidia' && 'ghcr.io/koush/scrypted:nvidia' || '' }}
${{ github.event.inputs.tag == 'latest' && matrix.BASE[0] == 'jammy-full' && 'ghcr.io/koush/scrypted:full' || '' }}
${{ github.event.inputs.tag == 'latest' && matrix.BASE[0] == 'jammy-lite' && 'ghcr.io/koush/scrypted:lite' || '' }}
cache-from: type=gha
cache-to: type=gha,mode=max

View File

@@ -9,52 +9,28 @@ on:
workflow_dispatch:
jobs:
test_linux_local:
name: Test Linux local installation
runs-on: ubuntu-latest
test_local:
name: Test local installation on ${{ matrix.runner }}
runs-on: ${{ matrix.runner }}
strategy:
fail-fast: false
matrix:
runner: [ubuntu-latest, macos-14, macos-13, windows-latest]
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Run install script
- name: Parse latest server release
id: parse_server
shell: bash
run: |
cat ./install/local/install-scrypted-dependencies-linux.sh | sudo SERVICE_USER=$USER bash
- name: Test server is running
run: |
systemctl status scrypted.service
curl -k --retry 20 --retry-all-errors --retry-max-time 600 https://localhost:10443/
test_mac_local:
name: Test Mac local installation
runs-on: macos-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Run install script
run: |
mkdir -p ~/.scrypted
bash ./install/local/install-scrypted-dependencies-mac.sh
- name: Test server is running
run: |
curl -k --retry 20 --retry-all-errors --retry-max-time 600 https://localhost:10443/
test_windows_local:
name: Test Windows local installation
runs-on: windows-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Run install script
run: |
.\install\local\install-scrypted-dependencies-win.ps1
- name: Test server is running
run: |
curl -k --retry 20 --retry-all-errors --retry-max-time 600 https://localhost:10443/
VERSION=$(cat ./server/package-lock.json | jq -r '.version')
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
echo "Will test @scrypted/server@$VERSION"
- name: Install scrypted server
uses: scryptedapp/setup-scrypted@v0.0.2
with:
branch: ${{ github.sha }}
version: ${{ steps.parse_server.outputs.version }}

15
.gitmodules vendored
View File

@@ -4,15 +4,6 @@
[submodule "plugins/myq/src/myq"]
path = plugins/myq/src/myq
url = ../../koush/myq.git
[submodule "plugins/tensorflow/face-api.js"]
path = external/face-api.js
url = ../../koush/face-api.js
[submodule "external/axios-digest-auth"]
path = external/axios-digest-auth
url = ../../koush/axios-digest-auth
[submodule "external/scrypted-ffmpeg"]
path = external/scrypted-ffmpeg
url = ../../koush/scrypted-ffmpeg
[submodule "external/ring-client-api"]
path = external/ring-client-api
url = ../../koush/ring
@@ -35,3 +26,9 @@
[submodule "plugins/cloud/node-nat-upnp"]
path = plugins/cloud/external/node-nat-upnp
url = ../../koush/node-nat-upnp.git
[submodule "plugins/wyze/docker-wyze-bridge"]
path = plugins/wyze/docker-wyze-bridge
url = ../../koush/docker-wyze-bridge.git
[submodule "plugins/onvif/onvif"]
path = plugins/onvif/onvif
url = ../../koush/onvif.git

View File

@@ -5,17 +5,19 @@
"version": "0.2.0",
"configurations": [
{
"type": "pwa-node",
"name": "ts-node",
"type": "node",
"request": "launch",
"name": "Launch Program",
"skipFiles": [
"<node_internals>/**"
"args": [
"${workspaceFolder}/src/test.ts",
],
"program": "${workspaceFolder}/dist/common/src/test.js",
"preLaunchTask": "npm: build",
"outFiles": [
"${workspaceFolder}/**/*.js"
]
}
"runtimeArgs": [
"-r",
"ts-node/register"
],
"cwd": "${workspaceRoot}",
"protocol": "inspector",
"internalConsoleOptions": "openOnSessionStart"
},
]
}

1
common/fs/@types/sdk/settings-mixin.d.ts vendored Symbolic link
View File

@@ -0,0 +1 @@
../../../../sdk/dist/src/settings-mixin.d.ts

View File

@@ -0,0 +1 @@
../../../../sdk/dist/src/storage-settings.d.ts

621
common/package-lock.json generated
View File

@@ -1,22 +1,22 @@
{
"name": "@scrypted/common",
"version": "1.0.2",
"version": "1.0.1",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "@scrypted/common",
"version": "1.0.2",
"version": "1.0.1",
"license": "ISC",
"dependencies": {
"@scrypted/sdk": "file:../sdk",
"@scrypted/server": "file:../server",
"http-auth-utils": "^3.0.2",
"node-fetch-commonjs": "^3.1.1",
"typescript": "^4.4.3"
"http-auth-utils": "^5.0.1",
"typescript": "^5.3.3"
},
"devDependencies": {
"@types/node": "^16.9.0"
"@types/node": "^20.11.0",
"ts-node": "^10.9.2"
}
},
"../external/werift/packages/webrtc": {
@@ -74,12 +74,12 @@
},
"../sdk": {
"name": "@scrypted/sdk",
"version": "0.2.68",
"version": "0.3.29",
"license": "ISC",
"dependencies": {
"@babel/preset-typescript": "^7.18.6",
"adm-zip": "^0.4.13",
"axios": "^0.21.4",
"axios": "^1.6.5",
"babel-loader": "^9.1.0",
"babel-plugin-const-enum": "^1.1.0",
"esbuild": "^0.15.9",
@@ -111,66 +111,94 @@
},
"../server": {
"name": "@scrypted/server",
"version": "0.6.19",
"version": "0.106.0",
"hasInstallScript": true,
"license": "ISC",
"dependencies": {
"@ffmpeg-installer/ffmpeg": "^1.1.0",
"@mapbox/node-pre-gyp": "^1.0.10",
"@scrypted/types": "^0.2.63",
"adm-zip": "^0.5.9",
"axios": "^0.21.4",
"body-parser": "^1.19.0",
"@mapbox/node-pre-gyp": "^1.0.11",
"@scrypted/ffmpeg-static": "^6.1.0-build1",
"@scrypted/node-pty": "^1.0.10",
"@scrypted/types": "^0.3.28",
"adm-zip": "^0.5.12",
"body-parser": "^1.20.2",
"cookie-parser": "^1.4.6",
"debug": "^4.3.4",
"engine.io": "^6.2.0",
"express": "^4.18.2",
"ffmpeg-static": "^5.1.0",
"dotenv": "^16.4.5",
"engine.io": "^6.5.4",
"express": "^4.19.2",
"follow-redirects": "^1.15.6",
"http-auth": "^4.2.0",
"ip": "^1.1.8",
"level": "^6.0.1",
"linkfs": "^2.1.0",
"ip": "^2.0.1",
"level": "^8.0.1",
"lodash": "^4.17.21",
"memfs": "^3.4.7",
"mime": "^3.0.0",
"mkdirp": "^1.0.4",
"nan": "^2.17.0",
"nan": "^2.19.0",
"node-dijkstra": "^2.5.0",
"node-forge": "^1.3.1",
"node-gyp": "^8.4.1",
"router": "^1.3.7",
"semver": "^7.3.8",
"node-gyp": "^10.1.0",
"py": "npm:@bjia56/portable-python@^0.1.31",
"router": "^1.3.8",
"semver": "^7.6.2",
"sharp": "^0.33.3",
"source-map-support": "^0.5.21",
"tar": "^6.1.11",
"tslib": "^2.4.0",
"typescript": "^4.8.4",
"whatwg-mimetype": "^2.3.0",
"ws": "^8.9.0"
"tar": "^7.1.0",
"tslib": "^2.6.2",
"typescript": "^5.4.5",
"whatwg-mimetype": "^4.0.0",
"ws": "^8.17.0"
},
"bin": {
"scrypted-serve": "bin/scrypted-serve"
},
"devDependencies": {
"@types/adm-zip": "^0.4.34",
"@types/cookie-parser": "^1.4.3",
"@types/debug": "^4.1.7",
"@types/express": "^4.17.14",
"@types/http-auth": "^4.1.1",
"@types/ip": "^1.1.0",
"@types/lodash": "^4.14.186",
"@types/mime": "^3.0.1",
"@types/mkdirp": "^1.0.2",
"@types/node-dijkstra": "^2.5.3",
"@types/node-forge": "^1.3.0",
"@types/pem": "^1.9.6",
"@types/rimraf": "^3.0.2",
"@types/semver": "^7.3.12",
"@types/source-map-support": "^0.5.6",
"@types/tar": "^4.0.5",
"@types/whatwg-mimetype": "^2.1.1",
"@types/ws": "^7.4.7"
"@types/adm-zip": "^0.5.5",
"@types/cookie-parser": "^1.4.7",
"@types/express": "^4.17.21",
"@types/follow-redirects": "^1.14.4",
"@types/http-auth": "^4.1.4",
"@types/ip": "^1.1.3",
"@types/lodash": "^4.17.1",
"@types/node-dijkstra": "^2.5.6",
"@types/node-forge": "^1.3.11",
"@types/semver": "^7.5.8",
"@types/source-map-support": "^0.5.10",
"@types/whatwg-mimetype": "^3.0.2",
"@types/ws": "^8.5.10"
}
},
"node_modules/@cspotcode/source-map-support": {
"version": "0.8.1",
"resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz",
"integrity": "sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==",
"dev": true,
"dependencies": {
"@jridgewell/trace-mapping": "0.3.9"
},
"optionalDependencies": {
"node-pty-prebuilt-multiarch": "^0.10.1-pre.5"
"engines": {
"node": ">=12"
}
},
"node_modules/@jridgewell/resolve-uri": {
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.1.tgz",
"integrity": "sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA==",
"dev": true,
"engines": {
"node": ">=6.0.0"
}
},
"node_modules/@jridgewell/sourcemap-codec": {
"version": "1.4.15",
"resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz",
"integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==",
"dev": true
},
"node_modules/@jridgewell/trace-mapping": {
"version": "0.3.9",
"resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz",
"integrity": "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==",
"dev": true,
"dependencies": {
"@jridgewell/resolve-uri": "^3.0.3",
"@jridgewell/sourcemap-codec": "^1.4.10"
}
},
"node_modules/@scrypted/sdk": {
@@ -181,120 +209,215 @@
"resolved": "../server",
"link": true
},
"node_modules/@types/node": {
"version": "16.9.0",
"resolved": "https://registry.npmjs.org/@types/node/-/node-16.9.0.tgz",
"integrity": "sha512-nmP+VR4oT0pJUPFbKE4SXj3Yb4Q/kz3M9dSAO1GGMebRKWHQxLfDNmU/yh3xxCJha3N60nQ/JwXWwOE/ZSEVag==",
"node_modules/@tsconfig/node10": {
"version": "1.0.9",
"resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.9.tgz",
"integrity": "sha512-jNsYVVxU8v5g43Erja32laIDHXeoNvFEpX33OK4d6hljo3jDhCBDhx5dhCCTMWUojscpAagGiRkBKxpdl9fxqA==",
"dev": true
},
"node_modules/fetch-blob": {
"version": "3.1.4",
"resolved": "https://registry.npmjs.org/fetch-blob/-/fetch-blob-3.1.4.tgz",
"integrity": "sha512-Eq5Xv5+VlSrYWEqKrusxY1C3Hm/hjeAsCGVG3ft7pZahlUAChpGZT/Ms1WmSLnEAisEXszjzu/s+ce6HZB2VHA==",
"funding": [
{
"type": "github",
"url": "https://github.com/sponsors/jimmywarting"
},
{
"type": "paypal",
"url": "https://paypal.me/jimmywarting"
}
],
"node_modules/@tsconfig/node12": {
"version": "1.0.11",
"resolved": "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.11.tgz",
"integrity": "sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==",
"dev": true
},
"node_modules/@tsconfig/node14": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.3.tgz",
"integrity": "sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==",
"dev": true
},
"node_modules/@tsconfig/node16": {
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.4.tgz",
"integrity": "sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==",
"dev": true
},
"node_modules/@types/node": {
"version": "20.11.0",
"resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.0.tgz",
"integrity": "sha512-o9bjXmDNcF7GbM4CNQpmi+TutCgap/K3w1JyKgxAjqx41zp9qlIAVFi0IhCNsJcXolEqLWhbFbEeL0PvYm4pcQ==",
"dev": true,
"dependencies": {
"node-domexception": "^1.0.0",
"web-streams-polyfill": "^3.0.3"
},
"engines": {
"node": "^12.20 || >= 14.13"
"undici-types": "~5.26.4"
}
},
"node_modules/formdata-polyfill": {
"version": "4.0.10",
"resolved": "https://registry.npmjs.org/formdata-polyfill/-/formdata-polyfill-4.0.10.tgz",
"integrity": "sha512-buewHzMvYL29jdeQTVILecSaZKnt/RJWjoZCF5OW60Z67/GmSLBkOFM7qh1PI3zFNtJbaZL5eQu1vLfazOwj4g==",
"dependencies": {
"fetch-blob": "^3.1.2"
"node_modules/acorn": {
"version": "8.11.3",
"resolved": "https://registry.npmjs.org/acorn/-/acorn-8.11.3.tgz",
"integrity": "sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg==",
"dev": true,
"bin": {
"acorn": "bin/acorn"
},
"engines": {
"node": ">=12.20.0"
"node": ">=0.4.0"
}
},
"node_modules/acorn-walk": {
"version": "8.3.1",
"resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.1.tgz",
"integrity": "sha512-TgUZgYvqZprrl7YldZNoa9OciCAyZR+Ejm9eXzKCmjsF5IKp/wgQ7Z/ZpjpGTIUPwrHQIcYeI8qDh4PsEwxMbw==",
"dev": true,
"engines": {
"node": ">=0.4.0"
}
},
"node_modules/arg": {
"version": "4.1.3",
"resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz",
"integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==",
"dev": true
},
"node_modules/create-require": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz",
"integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==",
"dev": true
},
"node_modules/diff": {
"version": "4.0.2",
"resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz",
"integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==",
"dev": true,
"engines": {
"node": ">=0.3.1"
}
},
"node_modules/http-auth-utils": {
"version": "3.0.2",
"resolved": "https://registry.npmjs.org/http-auth-utils/-/http-auth-utils-3.0.2.tgz",
"integrity": "sha512-cQ8957aiUX0lgV1620uIGKGJc0sEuD/QK4ueZ0hb60MGbO0f6ahcuIgPjamAD98D/AUGizKVm+dNvUVHs0f4Ow==",
"version": "5.0.1",
"resolved": "https://registry.npmjs.org/http-auth-utils/-/http-auth-utils-5.0.1.tgz",
"integrity": "sha512-YPiLVYdwpBEWB85iWYg7V/ZW3mBfPLCTFQWEiPAA5CKXHJOAPbnJ0xDHLiE6KbPRvrYCwLuWqTG0fLfXVjMUcQ==",
"dependencies": {
"yerror": "^6.0.0"
"yerror": "^8.0.0"
},
"engines": {
"node": ">=12.19.0"
"node": ">=18.16.0"
}
},
"node_modules/node-domexception": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/node-domexception/-/node-domexception-1.0.0.tgz",
"integrity": "sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==",
"funding": [
{
"type": "github",
"url": "https://github.com/sponsors/jimmywarting"
"node_modules/make-error": {
"version": "1.3.6",
"resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz",
"integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==",
"dev": true
},
"node_modules/ts-node": {
"version": "10.9.2",
"resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.2.tgz",
"integrity": "sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ==",
"dev": true,
"dependencies": {
"@cspotcode/source-map-support": "^0.8.0",
"@tsconfig/node10": "^1.0.7",
"@tsconfig/node12": "^1.0.7",
"@tsconfig/node14": "^1.0.0",
"@tsconfig/node16": "^1.0.2",
"acorn": "^8.4.1",
"acorn-walk": "^8.1.1",
"arg": "^4.1.0",
"create-require": "^1.1.0",
"diff": "^4.0.1",
"make-error": "^1.1.1",
"v8-compile-cache-lib": "^3.0.1",
"yn": "3.1.1"
},
"bin": {
"ts-node": "dist/bin.js",
"ts-node-cwd": "dist/bin-cwd.js",
"ts-node-esm": "dist/bin-esm.js",
"ts-node-script": "dist/bin-script.js",
"ts-node-transpile-only": "dist/bin-transpile.js",
"ts-script": "dist/bin-script-deprecated.js"
},
"peerDependencies": {
"@swc/core": ">=1.2.50",
"@swc/wasm": ">=1.2.50",
"@types/node": "*",
"typescript": ">=2.7"
},
"peerDependenciesMeta": {
"@swc/core": {
"optional": true
},
{
"type": "github",
"url": "https://paypal.me/jimmywarting"
"@swc/wasm": {
"optional": true
}
],
"engines": {
"node": ">=10.5.0"
}
},
"node_modules/node-fetch-commonjs": {
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/node-fetch-commonjs/-/node-fetch-commonjs-3.1.1.tgz",
"integrity": "sha512-TgkdVJdiEaauzWwB9NoD4TvHZFtG6KKEffvotWf9WNIyoRZHsCFjGfb3bhkIXrMt3YFgFi8ZApbwWoe1h3XTpA==",
"dependencies": {
"formdata-polyfill": "^4.0.10",
"web-streams-polyfill": "^3.1.1"
},
"engines": {
"node": "^12.20.0 || ^14.13.1 || >=16.0.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/node-fetch"
}
},
"node_modules/typescript": {
"version": "4.4.3",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.4.3.tgz",
"integrity": "sha512-4xfscpisVgqqDfPaJo5vkd+Qd/ItkoagnHpufr+i2QCHBsNYp+G7UAoyFl8aPtx879u38wPV65rZ8qbGZijalA==",
"version": "5.3.3",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.3.3.tgz",
"integrity": "sha512-pXWcraxM0uxAS+tN0AG/BF2TyqmHO014Z070UsJ+pFvYuRSq8KH8DmWpnbXe0pEPDHXZV3FcAbJkijJ5oNEnWw==",
"bin": {
"tsc": "bin/tsc",
"tsserver": "bin/tsserver"
},
"engines": {
"node": ">=4.2.0"
"node": ">=14.17"
}
},
"node_modules/web-streams-polyfill": {
"version": "3.2.0",
"resolved": "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-3.2.0.tgz",
"integrity": "sha512-EqPmREeOzttaLRm5HS7io98goBgZ7IVz79aDvqjD0kYXLtFZTc0T/U6wHTPKyIjb+MdN7DFIIX6hgdBEpWmfPA==",
"engines": {
"node": ">= 8"
}
"node_modules/undici-types": {
"version": "5.26.5",
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz",
"integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==",
"dev": true
},
"node_modules/v8-compile-cache-lib": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz",
"integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==",
"dev": true
},
"node_modules/yerror": {
"version": "6.0.1",
"resolved": "https://registry.npmjs.org/yerror/-/yerror-6.0.1.tgz",
"integrity": "sha512-0Bxo+NyeucjxhmPB5z3lmI/N/cOu8L1Q8JVta6/I5G6J/JhCSSPwk8qt9N4yOFSjwkvhDwzUSQglfBIAllvi1Q==",
"version": "8.0.0",
"resolved": "https://registry.npmjs.org/yerror/-/yerror-8.0.0.tgz",
"integrity": "sha512-FemWD5/UqNm8ffj8oZIbjWXIF2KE0mZssggYpdaQkWDDgXBQ/35PNIxEuz6/YLn9o0kOxDBNJe8x8k9ljD7k/g==",
"engines": {
"node": ">=12.19.0"
"node": ">=18.16.0"
}
},
"node_modules/yn": {
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz",
"integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==",
"dev": true,
"engines": {
"node": ">=6"
}
}
},
"dependencies": {
"@cspotcode/source-map-support": {
"version": "0.8.1",
"resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz",
"integrity": "sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==",
"dev": true,
"requires": {
"@jridgewell/trace-mapping": "0.3.9"
}
},
"@jridgewell/resolve-uri": {
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.1.tgz",
"integrity": "sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA==",
"dev": true
},
"@jridgewell/sourcemap-codec": {
"version": "1.4.15",
"resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz",
"integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==",
"dev": true
},
"@jridgewell/trace-mapping": {
"version": "0.3.9",
"resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz",
"integrity": "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==",
"dev": true,
"requires": {
"@jridgewell/resolve-uri": "^3.0.3",
"@jridgewell/sourcemap-codec": "^1.4.10"
}
},
"@scrypted/sdk": {
"version": "file:../sdk",
"requires": {
@@ -302,7 +425,7 @@
"@types/node": "^18.11.18",
"@types/stringify-object": "^4.0.0",
"adm-zip": "^0.4.13",
"axios": "^0.21.4",
"axios": "^1.6.5",
"babel-loader": "^9.1.0",
"babel-plugin-const-enum": "^1.1.0",
"esbuild": "^0.15.9",
@@ -322,117 +445,175 @@
"@scrypted/server": {
"version": "file:../server",
"requires": {
"@ffmpeg-installer/ffmpeg": "^1.1.0",
"@mapbox/node-pre-gyp": "^1.0.10",
"@scrypted/types": "^0.2.63",
"@types/adm-zip": "^0.4.34",
"@types/cookie-parser": "^1.4.3",
"@types/debug": "^4.1.7",
"@types/express": "^4.17.14",
"@types/http-auth": "^4.1.1",
"@types/ip": "^1.1.0",
"@types/lodash": "^4.14.186",
"@types/mime": "^3.0.1",
"@types/mkdirp": "^1.0.2",
"@types/node-dijkstra": "^2.5.3",
"@types/node-forge": "^1.3.0",
"@types/pem": "^1.9.6",
"@types/rimraf": "^3.0.2",
"@types/semver": "^7.3.12",
"@types/source-map-support": "^0.5.6",
"@types/tar": "^4.0.5",
"@types/whatwg-mimetype": "^2.1.1",
"@types/ws": "^7.4.7",
"adm-zip": "^0.5.9",
"axios": "^0.21.4",
"body-parser": "^1.19.0",
"@mapbox/node-pre-gyp": "^1.0.11",
"@scrypted/ffmpeg-static": "^6.1.0-build1",
"@scrypted/node-pty": "^1.0.10",
"@scrypted/types": "^0.3.28",
"@types/adm-zip": "^0.5.5",
"@types/cookie-parser": "^1.4.7",
"@types/express": "^4.17.21",
"@types/follow-redirects": "^1.14.4",
"@types/http-auth": "^4.1.4",
"@types/ip": "^1.1.3",
"@types/lodash": "^4.17.1",
"@types/node-dijkstra": "^2.5.6",
"@types/node-forge": "^1.3.11",
"@types/semver": "^7.5.8",
"@types/source-map-support": "^0.5.10",
"@types/whatwg-mimetype": "^3.0.2",
"@types/ws": "^8.5.10",
"adm-zip": "^0.5.12",
"body-parser": "^1.20.2",
"cookie-parser": "^1.4.6",
"debug": "^4.3.4",
"engine.io": "^6.2.0",
"express": "^4.18.2",
"ffmpeg-static": "^5.1.0",
"dotenv": "^16.4.5",
"engine.io": "^6.5.4",
"express": "^4.19.2",
"follow-redirects": "^1.15.6",
"http-auth": "^4.2.0",
"ip": "^1.1.8",
"level": "^6.0.1",
"linkfs": "^2.1.0",
"ip": "^2.0.1",
"level": "^8.0.1",
"lodash": "^4.17.21",
"memfs": "^3.4.7",
"mime": "^3.0.0",
"mkdirp": "^1.0.4",
"nan": "^2.17.0",
"nan": "^2.19.0",
"node-dijkstra": "^2.5.0",
"node-forge": "^1.3.1",
"node-gyp": "^8.4.1",
"node-pty-prebuilt-multiarch": "^0.10.1-pre.5",
"router": "^1.3.7",
"semver": "^7.3.8",
"node-gyp": "^10.1.0",
"py": "npm:@bjia56/portable-python@^0.1.31",
"router": "^1.3.8",
"semver": "^7.6.2",
"sharp": "^0.33.3",
"source-map-support": "^0.5.21",
"tar": "^6.1.11",
"tslib": "^2.4.0",
"typescript": "^4.8.4",
"whatwg-mimetype": "^2.3.0",
"ws": "^8.9.0"
"tar": "^7.1.0",
"tslib": "^2.6.2",
"typescript": "^5.4.5",
"whatwg-mimetype": "^4.0.0",
"ws": "^8.17.0"
}
},
"@types/node": {
"version": "16.9.0",
"resolved": "https://registry.npmjs.org/@types/node/-/node-16.9.0.tgz",
"integrity": "sha512-nmP+VR4oT0pJUPFbKE4SXj3Yb4Q/kz3M9dSAO1GGMebRKWHQxLfDNmU/yh3xxCJha3N60nQ/JwXWwOE/ZSEVag==",
"@tsconfig/node10": {
"version": "1.0.9",
"resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.9.tgz",
"integrity": "sha512-jNsYVVxU8v5g43Erja32laIDHXeoNvFEpX33OK4d6hljo3jDhCBDhx5dhCCTMWUojscpAagGiRkBKxpdl9fxqA==",
"dev": true
},
"fetch-blob": {
"version": "3.1.4",
"resolved": "https://registry.npmjs.org/fetch-blob/-/fetch-blob-3.1.4.tgz",
"integrity": "sha512-Eq5Xv5+VlSrYWEqKrusxY1C3Hm/hjeAsCGVG3ft7pZahlUAChpGZT/Ms1WmSLnEAisEXszjzu/s+ce6HZB2VHA==",
"@tsconfig/node12": {
"version": "1.0.11",
"resolved": "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.11.tgz",
"integrity": "sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==",
"dev": true
},
"@tsconfig/node14": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.3.tgz",
"integrity": "sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==",
"dev": true
},
"@tsconfig/node16": {
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.4.tgz",
"integrity": "sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==",
"dev": true
},
"@types/node": {
"version": "20.11.0",
"resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.0.tgz",
"integrity": "sha512-o9bjXmDNcF7GbM4CNQpmi+TutCgap/K3w1JyKgxAjqx41zp9qlIAVFi0IhCNsJcXolEqLWhbFbEeL0PvYm4pcQ==",
"dev": true,
"requires": {
"node-domexception": "^1.0.0",
"web-streams-polyfill": "^3.0.3"
"undici-types": "~5.26.4"
}
},
"formdata-polyfill": {
"version": "4.0.10",
"resolved": "https://registry.npmjs.org/formdata-polyfill/-/formdata-polyfill-4.0.10.tgz",
"integrity": "sha512-buewHzMvYL29jdeQTVILecSaZKnt/RJWjoZCF5OW60Z67/GmSLBkOFM7qh1PI3zFNtJbaZL5eQu1vLfazOwj4g==",
"requires": {
"fetch-blob": "^3.1.2"
}
"acorn": {
"version": "8.11.3",
"resolved": "https://registry.npmjs.org/acorn/-/acorn-8.11.3.tgz",
"integrity": "sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg==",
"dev": true
},
"acorn-walk": {
"version": "8.3.1",
"resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.1.tgz",
"integrity": "sha512-TgUZgYvqZprrl7YldZNoa9OciCAyZR+Ejm9eXzKCmjsF5IKp/wgQ7Z/ZpjpGTIUPwrHQIcYeI8qDh4PsEwxMbw==",
"dev": true
},
"arg": {
"version": "4.1.3",
"resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz",
"integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==",
"dev": true
},
"create-require": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz",
"integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==",
"dev": true
},
"diff": {
"version": "4.0.2",
"resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz",
"integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==",
"dev": true
},
"http-auth-utils": {
"version": "3.0.2",
"resolved": "https://registry.npmjs.org/http-auth-utils/-/http-auth-utils-3.0.2.tgz",
"integrity": "sha512-cQ8957aiUX0lgV1620uIGKGJc0sEuD/QK4ueZ0hb60MGbO0f6ahcuIgPjamAD98D/AUGizKVm+dNvUVHs0f4Ow==",
"version": "5.0.1",
"resolved": "https://registry.npmjs.org/http-auth-utils/-/http-auth-utils-5.0.1.tgz",
"integrity": "sha512-YPiLVYdwpBEWB85iWYg7V/ZW3mBfPLCTFQWEiPAA5CKXHJOAPbnJ0xDHLiE6KbPRvrYCwLuWqTG0fLfXVjMUcQ==",
"requires": {
"yerror": "^6.0.0"
"yerror": "^8.0.0"
}
},
"node-domexception": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/node-domexception/-/node-domexception-1.0.0.tgz",
"integrity": "sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ=="
"make-error": {
"version": "1.3.6",
"resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz",
"integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==",
"dev": true
},
"node-fetch-commonjs": {
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/node-fetch-commonjs/-/node-fetch-commonjs-3.1.1.tgz",
"integrity": "sha512-TgkdVJdiEaauzWwB9NoD4TvHZFtG6KKEffvotWf9WNIyoRZHsCFjGfb3bhkIXrMt3YFgFi8ZApbwWoe1h3XTpA==",
"ts-node": {
"version": "10.9.2",
"resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.2.tgz",
"integrity": "sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ==",
"dev": true,
"requires": {
"formdata-polyfill": "^4.0.10",
"web-streams-polyfill": "^3.1.1"
"@cspotcode/source-map-support": "^0.8.0",
"@tsconfig/node10": "^1.0.7",
"@tsconfig/node12": "^1.0.7",
"@tsconfig/node14": "^1.0.0",
"@tsconfig/node16": "^1.0.2",
"acorn": "^8.4.1",
"acorn-walk": "^8.1.1",
"arg": "^4.1.0",
"create-require": "^1.1.0",
"diff": "^4.0.1",
"make-error": "^1.1.1",
"v8-compile-cache-lib": "^3.0.1",
"yn": "3.1.1"
}
},
"typescript": {
"version": "4.4.3",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.4.3.tgz",
"integrity": "sha512-4xfscpisVgqqDfPaJo5vkd+Qd/ItkoagnHpufr+i2QCHBsNYp+G7UAoyFl8aPtx879u38wPV65rZ8qbGZijalA=="
"version": "5.3.3",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.3.3.tgz",
"integrity": "sha512-pXWcraxM0uxAS+tN0AG/BF2TyqmHO014Z070UsJ+pFvYuRSq8KH8DmWpnbXe0pEPDHXZV3FcAbJkijJ5oNEnWw=="
},
"web-streams-polyfill": {
"version": "3.2.0",
"resolved": "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-3.2.0.tgz",
"integrity": "sha512-EqPmREeOzttaLRm5HS7io98goBgZ7IVz79aDvqjD0kYXLtFZTc0T/U6wHTPKyIjb+MdN7DFIIX6hgdBEpWmfPA=="
"undici-types": {
"version": "5.26.5",
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz",
"integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==",
"dev": true
},
"v8-compile-cache-lib": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz",
"integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==",
"dev": true
},
"yerror": {
"version": "6.0.1",
"resolved": "https://registry.npmjs.org/yerror/-/yerror-6.0.1.tgz",
"integrity": "sha512-0Bxo+NyeucjxhmPB5z3lmI/N/cOu8L1Q8JVta6/I5G6J/JhCSSPwk8qt9N4yOFSjwkvhDwzUSQglfBIAllvi1Q=="
"version": "8.0.0",
"resolved": "https://registry.npmjs.org/yerror/-/yerror-8.0.0.tgz",
"integrity": "sha512-FemWD5/UqNm8ffj8oZIbjWXIF2KE0mZssggYpdaQkWDDgXBQ/35PNIxEuz6/YLn9o0kOxDBNJe8x8k9ljD7k/g=="
},
"yn": {
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz",
"integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==",
"dev": true
}
}
}

View File

@@ -11,13 +11,13 @@
"author": "",
"license": "ISC",
"dependencies": {
"@scrypted/server": "file:../server",
"@scrypted/sdk": "file:../sdk",
"http-auth-utils": "^3.0.2",
"node-fetch-commonjs": "^3.1.1",
"typescript": "^4.4.3"
"@scrypted/server": "file:../server",
"http-auth-utils": "^5.0.1",
"typescript": "^5.3.3"
},
"devDependencies": {
"@types/node": "^16.9.0"
"@types/node": "^20.11.0",
"ts-node": "^10.9.2"
}
}

View File

@@ -0,0 +1,28 @@
export function createActivityTimeout(timeout: number, timeoutCallback: () => void) {
let dataTimeout: NodeJS.Timeout;
let lastTime = Date.now();
function resetActivityTimer() {
lastTime = Date.now();
}
function clearActivityTimer() {
clearInterval(dataTimeout);
}
if (timeout) {
dataTimeout = setInterval(() => {
if (Date.now() > lastTime + timeout) {
clearInterval(dataTimeout);
dataTimeout = undefined;
timeoutCallback();
}
}, timeout);
}
resetActivityTimer();
return {
resetActivityTimer,
clearActivityTimer,
}
}

View File

@@ -1,30 +0,0 @@
import sdk from "@scrypted/sdk";
const { systemManager, log } = sdk;
export async function alertRecommendedPlugins(plugins: { [pkg: string]: string }) {
const pluginsComponent = await systemManager.getComponent('plugins');
let recommended: any;
try {
recommended = JSON.parse(localStorage.getItem('alert-recommended'));
}
catch (e) {
recommended = {};
}
for (const plugin of Object.keys(plugins)) {
try {
if (recommended[plugin])
continue;
recommended[plugin] = true;
localStorage.setItem('alert-recommended', JSON.stringify(recommended));
const id = await pluginsComponent.getIdForPluginId(plugin);
if (id)
continue;
const name = plugins[plugin];
log.a(`Installation of the ${name} plugin is also recommended. origin:/#/component/plugin/install/${plugin}`)
}
catch (e) {
}
}
}

View File

@@ -5,6 +5,7 @@ class EndError extends Error {
export function createAsyncQueue<T>() {
let ended: Error | undefined;
const endDeferred = new Deferred<void>();
const waiting: Deferred<T>[] = [];
const queued: { item: T, dequeued?: Deferred<void> }[] = [];
@@ -23,6 +24,17 @@ export function createAsyncQueue<T>() {
return deferred.promise;
}
const take = () => {
if (queued.length) {
const { item, dequeued: enqueue } = queued.shift()!;
enqueue?.resolve();
return item;
}
if (ended)
throw ended;
}
const submit = (item: T, dequeued?: Deferred<void>, signal?: AbortSignal) => {
if (ended)
return false;
@@ -34,36 +46,65 @@ export function createAsyncQueue<T>() {
return true;
}
if (signal)
dequeued ||= new Deferred();
const qi = {
item,
dequeued,
};
queued!.push(qi);
signal?.addEventListener('abort', () => {
if (!signal)
return true;
const h = () => {
const index = queued.indexOf(qi);
if (index === -1)
return;
queued.splice(index, 1);
dequeued?.reject(new Error('abort'));
});
};
dequeued.promise.catch(() => {}).finally(() => signal.removeEventListener('abort', h));
signal.addEventListener('abort', h);
return true;
}
function end(e?: Error) {
if (ended)
return false;
// catch to prevent unhandled rejection.
ended = e || new EndError();
endDeferred.resolve();
while (waiting.length) {
waiting.shift().reject(ended);
}
return true;
}
function queue() {
return (async function* () {
while (true) {
try {
const item = await dequeue();
yield item;
}
catch (e) {
if (e instanceof EndError)
return;
throw e;
try {
while (true) {
try {
const item = await dequeue();
yield item;
}
catch (e) {
// the yield above may raise an error, and the queue should be ended.
end(e);
if (e instanceof EndError)
return;
throw e;
}
}
}
finally {
// the yield above may cause an iterator return, and the queue should be ended.
end();
}
})();
}
@@ -82,6 +123,11 @@ export function createAsyncQueue<T>() {
}
return {
get ended() {
return ended;
},
endPromise: endDeferred.promise,
take,
clear() {
return clear();
},
@@ -94,14 +140,7 @@ export function createAsyncQueue<T>() {
submit(item: T, signal?: AbortSignal) {
return submit(item, undefined, signal);
},
end(e?: Error) {
if (ended)
return false;
// catch to prevent unhandled rejection.
ended = e || new EndError()
clear(e);
return true;
},
end,
async enqueue(item: T, signal?: AbortSignal) {
const dequeued = new Deferred<void>();
if (!submit(item, dequeued, signal))

View File

@@ -73,5 +73,5 @@ export abstract class AutoenableMixinProvider extends ScryptedDeviceBase {
this.storage.setItem('hasEnabledMixin', JSON.stringify(this.hasEnabledMixin));
}
abstract canMixin(type: ScryptedDeviceType, interfaces: string[]): Promise<string[]>;
abstract canMixin(type: ScryptedDeviceType, interfaces: string[]): Promise<string[] | null | undefined | void>;
}

View File

@@ -1,12 +1,10 @@
import type { TranspileOptions } from "typescript";
import sdk, { ScryptedDeviceBase, MixinDeviceBase, ScryptedInterface, ScryptedDeviceType } from "@scrypted/sdk";
import vm from "vm";
import sdk, { MixinDeviceBase, ScryptedDeviceBase, ScryptedDeviceType, ScryptedInterface, ScryptedInterfaceDescriptors, ScryptedMimeTypes } from "@scrypted/sdk";
import { StorageSettings } from "@scrypted/sdk/storage-settings";
import { SettingsMixinDeviceBase } from "@scrypted/sdk/settings-mixin";
import fs from 'fs';
import type { TranspileOptions } from "typescript";
import vm from "vm";
import { ScriptDevice } from "./monaco/script-device";
import { ScryptedInterfaceDescriptors } from "@scrypted/sdk";
import fetch from 'node-fetch-commonjs';
import { PluginAPIProxy } from '../../../server/src/plugin/plugin-api';
import { SystemManagerImpl } from '../../../server/src/plugin/system';
const { systemManager, deviceManager, mediaManager, endpointManager } = sdk;
@@ -26,10 +24,18 @@ export async function tsCompile(source: string, options: TranspileOptions = null
return ts.transpileModule(source, options).outputText;
}
export function readFileAsString(f: string) {
return fs.readFileSync(f).toString();;
}
function getTypeDefs() {
const scryptedTypesDefs = fs.readFileSync('@types/sdk/types.d.ts').toString();
const scryptedIndexDefs = fs.readFileSync('@types/sdk/index.d.ts').toString();
const settingsMixinDefs = readFileAsString('@types/sdk/settings-mixin.d.ts');
const storageSettingsDefs = readFileAsString('@types/sdk/storage-settings.d.ts');
const scryptedTypesDefs = readFileAsString('@types/sdk/types.d.ts');
const scryptedIndexDefs = readFileAsString('@types/sdk/index.d.ts');
return {
settingsMixinDefs,
storageSettingsDefs,
scryptedIndexDefs,
scryptedTypesDefs,
};
@@ -58,18 +64,13 @@ export async function scryptedEval(device: ScryptedDeviceBase, script: string, e
worker.worker.terminate();
}
const smProxy = new SystemManagerImpl();
smProxy.state = systemManager.getSystemState();
const apiProxy = new PluginAPIProxy(sdk.pluginHostAPI);
smProxy.api = apiProxy;
const allParams = Object.assign({}, params, {
sdk,
fs: require('realfs'),
fetch,
ScryptedDeviceBase,
MixinDeviceBase,
systemManager: smProxy,
StorageSettings,
systemManager,
deviceManager,
endpointManager,
mediaManager,
@@ -78,6 +79,8 @@ export async function scryptedEval(device: ScryptedDeviceBase, script: string, e
localStorage: device.storage,
device,
exports: {} as any,
SettingsMixinDeviceBase,
ScryptedMimeTypes,
ScryptedInterface,
ScryptedDeviceType,
// @ts-expect-error
@@ -104,7 +107,6 @@ export async function scryptedEval(device: ScryptedDeviceBase, script: string, e
return {
value,
defaultExport,
apiProxy,
};
}
catch (e) {
@@ -115,11 +117,20 @@ export async function scryptedEval(device: ScryptedDeviceBase, script: string, e
}
export function createMonacoEvalDefaults(extraLibs: { [lib: string]: string }) {
const bufferTypeDefs = fs.readFileSync('@types/node/buffer.d.ts').toString();
const safeLibs: any = {};
const safeLibs = {
bufferTypeDefs,
};
for (const safeLib of [
'@types/node/globals.d.ts',
'@types/node/buffer.d.ts',
'@types/node/process.d.ts',
'@types/node/events.d.ts',
'@types/node/stream.d.ts',
'@types/node/fs.d.ts',
'@types/node/net.d.ts',
'@types/node/child_process.d.ts',
]) {
safeLibs[`node_modules/${safeLib}`] = readFileAsString(safeLib)
}
const libs = Object.assign(getTypeDefs(), extraLibs);
@@ -170,15 +181,27 @@ export function createMonacoEvalDefaults(extraLibs: { [lib: string]: string }) {
"node_modules/@types/scrypted__sdk/types/index.d.ts"
);
monaco.languages.typescript.typescriptDefaults.addExtraLib(
libs['settingsMixin'],
"node_modules/@types/scrypted__sdk/settings-mixin.d.ts"
);
monaco.languages.typescript.typescriptDefaults.addExtraLib(
libs['storageSettings'],
"node_modules/@types/scrypted__sdk/storage-settings.d.ts"
);
monaco.languages.typescript.typescriptDefaults.addExtraLib(
libs['sdk'],
"node_modules/@types/scrypted__sdk/index.d.ts"
);
monaco.languages.typescript.typescriptDefaults.addExtraLib(
safeLibs.bufferTypeDefs,
"node_modules/@types/node/buffer.d.ts"
);
for (const lib of Object.keys(safeLibs)) {
monaco.languages.typescript.typescriptDefaults.addExtraLib(
safeLibs[lib],
lib,
);
}
}
return `(function() {

View File

@@ -0,0 +1,50 @@
import { httpFetch, httpFetchParseIncomingMessage } from '../../server/src/fetch/http-fetch';
import type { IncomingMessage } from 'http';
import type { Readable } from 'stream';
import { createAuthFetch } from '../../packages/auth-fetch/src/auth-fetch';
export type { HttpFetchOptions, HttpFetchResponseType } from '../../server/src/fetch/http-fetch';
export type { AuthFetchCredentialState, AuthFetchOptions } from '../../packages/auth-fetch/src/auth-fetch';
export const authHttpFetch = createAuthFetch<Readable, IncomingMessage>(httpFetch, httpFetchParseIncomingMessage);
function ensureType<T>(v: T) {
}
async function test() {
const a = await authHttpFetch({
credential: undefined,
url: 'http://example.com',
});
ensureType<Buffer>(a.body);
const b = await authHttpFetch({
credential: undefined,
url: 'http://example.com',
responseType: 'json',
});
ensureType<any>(b.body);
const c = await authHttpFetch({
credential: undefined,
url: 'http://example.com',
responseType: 'readable',
});
ensureType<IncomingMessage>(c.body);
const d = await authHttpFetch({
credential: undefined,
url: 'http://example.com',
responseType: 'buffer',
});
ensureType<Buffer>(d.body);
const e = await authHttpFetch({
credential: undefined,
url: 'http://example.com',
responseType: 'text',
});
ensureType<string>(e.body);
}

View File

@@ -78,11 +78,17 @@ export function createPromiseDebouncer<T>() {
export function createMapPromiseDebouncer<T>() {
const map = new Map<string, Promise<T>>();
return (key: any, func: () => Promise<T>): Promise<T> => {
return (key: any, debounce: number, func: () => Promise<T>): Promise<T> => {
const keyStr = JSON.stringify(key);
let value = map.get(keyStr);
if (!value) {
value = func().finally(() => map.delete(keyStr));
value = func().finally(() => {
if (!debounce) {
map.delete(keyStr);
return;
}
setTimeout(() => map.delete(keyStr), debounce);
});
map.set(keyStr, value);
}
return value;

View File

@@ -19,7 +19,7 @@ export async function read16BELengthLoop(readable: Readable, options: {
let length: number;
let skipCount = 0;
let readCount = 0;
const resumeRead = () => {
readCount++;
read();
@@ -59,13 +59,13 @@ export async function read16BELengthLoop(readable: Readable, options: {
export class StreamEndError extends Error {
constructor() {
super()
super('stream ended');
}
}
export async function readLength(readable: Readable, length: number): Promise<Buffer> {
if (readable.readableEnded || readable.destroyed)
throw new Error("stream ended");
throw new StreamEndError();
if (!length) {
return Buffer.alloc(0);
@@ -109,17 +109,26 @@ export async function readLength(readable: Readable, length: number): Promise<Bu
const CHARCODE_NEWLINE = '\n'.charCodeAt(0);
export async function readUntil(readable: Readable, charCode: number) {
const data = [];
let count = 0;
const queued: Buffer[] = [];
while (true) {
const buffer = await readLength(readable, 1);
if (!buffer)
throw new Error("end of stream");
if (buffer[0] === charCode)
break;
data[count++] = buffer[0];
const available: Buffer = readable.read();
if (!available) {
await once(readable, 'readable');
continue;
}
const index = available.findIndex(b => b === charCode);
if (index === -1) {
queued.push(available);
continue;
}
const before = available.subarray(0, index);
queued.push(before);
const after = available.subarray(index + 1);
readable.unshift(after);
return Buffer.concat(queued).toString();
}
return Buffer.from(data).toString();
}
export async function readLine(readable: Readable) {
@@ -127,12 +136,17 @@ export async function readLine(readable: Readable) {
}
export async function readString(readable: Readable | Promise<Readable>) {
let data = '';
const buffer = await readBuffer(readable);
return buffer.toString();
}
export async function readBuffer(readable: Readable | Promise<Readable>) {
const buffers: Buffer[] = [];
readable = await readable;
readable.on('data', buffer => {
data += buffer.toString();
buffers.push(buffer);
});
readable.resume();
await once(readable, 'end')
return data;
return Buffer.concat(buffers);
}

View File

@@ -73,6 +73,14 @@ function createOptions() {
return options;
}
// can be called on anything with getStats, ie for receiver specific reports or connection reports.
export async function getPacketsLost(t: { getStats(): Promise<RTCStatsReport> }) {
const stats = await t.getStats();
const packetsLost = ([...stats.values()] as { packetsLost: number }[]).filter(stat => 'packetsLost' in stat).map(stat => stat.packetsLost);
const total = packetsLost.reduce((p, c) => p + c, 0);
return total;
}
export class BrowserSignalingSession implements RTCSignalingSession {
private pc: RTCPeerConnection;
pcDeferred = new Deferred<RTCPeerConnection>();
@@ -90,6 +98,10 @@ export class BrowserSignalingSession implements RTCSignalingSession {
return this.options;
}
async getPacketsLost() {
return getPacketsLost(this.pc);
}
async setMicrophone(enabled: boolean) {
if (this.microphone && enabled && !this.micEnabled) {
this.micEnabled = true;
@@ -211,7 +223,12 @@ export class BrowserSignalingSession implements RTCSignalingSession {
}
if (type === 'offer') {
let offer = await this.pc.createOffer({
let offer: RTCSessionDescriptionInit = this.pc.localDescription;
if (offer) {
// fast path for duplicate calls to createLocalDescription
return toDescription(this.pc.localDescription);
}
offer = await this.pc.createOffer({
offerToReceiveAudio: !!setup.audio,
offerToReceiveVideo: !!setup.video,
});
@@ -220,7 +237,7 @@ export class BrowserSignalingSession implements RTCSignalingSession {
return toDescription(offer);
await set;
await gatheringPromise;
offer = await this.pc.createOffer({
offer = this.pc.localDescription || await this.pc.createOffer({
offerToReceiveAudio: !!setup.audio,
offerToReceiveVideo: !!setup.video,
});

View File

@@ -1,8 +1,6 @@
import crypto, { randomBytes } from 'crypto';
import dgram from 'dgram';
import { once } from 'events';
import { BASIC } from 'http-auth-utils/dist/index';
import { parseHTTPHeadersQuotedKeyValueSet } from 'http-auth-utils/dist/utils';
import net from 'net';
import { Duplex, Readable, Writable } from 'stream';
import tls from 'tls';
@@ -91,27 +89,44 @@ export const H264_NAL_TYPE_FU_B = 29;
export const H264_NAL_TYPE_MTAP16 = 26;
export const H264_NAL_TYPE_MTAP32 = 27;
export const H265_NAL_TYPE_AGG = 48;
export const H265_NAL_TYPE_VPS = 32;
export const H265_NAL_TYPE_SPS = 33;
export const H265_NAL_TYPE_PPS = 34;
export const H265_NAL_TYPE_IDR_N = 19;
export const H265_NAL_TYPE_IDR_W = 20;
export function findH264NaluType(streamChunk: StreamChunk, naluType: number) {
if (streamChunk.type !== 'h264')
return;
return findH264NaluTypeInNalu(streamChunk.chunks[streamChunk.chunks.length - 1].subarray(12), naluType);
}
export function findH265NaluType(streamChunk: StreamChunk, naluType: number) {
if (streamChunk.type !== 'h265')
return;
return findH265NaluTypeInNalu(streamChunk.chunks[streamChunk.chunks.length - 1].subarray(12), naluType);
}
export function parseH264NaluType(firstNaluByte: number) {
return firstNaluByte & 0x1f;
}
export function findH264NaluTypeInNalu(nalu: Buffer, naluType: number) {
const checkNaluType = nalu[0] & 0x1f;
const checkNaluType = parseH264NaluType(nalu[0]);
if (checkNaluType === H264_NAL_TYPE_STAP_A) {
let pos = 1;
while (pos < nalu.length) {
const naluLength = nalu.readUInt16BE(pos);
pos += 2;
const stapaType = nalu[pos] & 0x1f;
const stapaType = parseH264NaluType(nalu[pos]);
if (stapaType === naluType)
return nalu.subarray(pos, pos + naluLength);
pos += naluLength;
}
}
else if (checkNaluType === H264_NAL_TYPE_FU_A) {
const fuaType = nalu[1] & 0x1f;
const fuaType = parseH264NaluType(nalu[1]);
const isFuStart = !!(nalu[1] & 0x80);
if (fuaType === naluType && isFuStart)
@@ -123,39 +138,52 @@ export function findH264NaluTypeInNalu(nalu: Buffer, naluType: number) {
return;
}
function parseH265NaluType(firstNaluByte: number) {
return (firstNaluByte & 0b01111110) >> 1;
}
export function findH265NaluTypeInNalu(nalu: Buffer, naluType: number) {
const checkNaluType = parseH265NaluType(nalu[0]);
if (checkNaluType === H265_NAL_TYPE_AGG) {
let pos = 1;
while (pos < nalu.length) {
const naluLength = nalu.readUInt16BE(pos);
pos += 2;
const stapaType = parseH265NaluType(nalu[pos]);
if (stapaType === naluType)
return nalu.subarray(pos, pos + naluLength);
pos += naluLength;
}
}
else if (checkNaluType === naluType) {
return nalu;
}
return;
}
export function getNaluTypes(streamChunk: StreamChunk) {
if (streamChunk.type !== 'h264')
return new Set<number>();
return getNaluTypesInNalu(streamChunk.chunks[streamChunk.chunks.length - 1].subarray(12))
}
export function getNaluFragmentInformation(nalu: Buffer) {
const naluType = nalu[0] & 0x1f;
const fua = naluType === H264_NAL_TYPE_FU_A;
return {
fua,
fuaStart: fua && !!(nalu[1] & 0x80),
fuaEnd: fua && !!(nalu[1] & 0x40),
}
}
export function getNaluTypesInNalu(nalu: Buffer, fuaRequireStart = false, fuaRequireEnd = false) {
const ret = new Set<number>();
const naluType = nalu[0] & 0x1f;
const naluType = parseH264NaluType(nalu[0]);
if (naluType === H264_NAL_TYPE_STAP_A) {
ret.add(H264_NAL_TYPE_STAP_A);
let pos = 1;
while (pos < nalu.length) {
const naluLength = nalu.readUInt16BE(pos);
pos += 2;
const stapaType = nalu[pos] & 0x1f;
const stapaType = parseH264NaluType(nalu[pos]);
ret.add(stapaType);
pos += naluLength;
}
}
else if (naluType === H264_NAL_TYPE_FU_A) {
ret.add(H264_NAL_TYPE_FU_A);
const fuaType = nalu[1] & 0x1f;
const fuaType = parseH264NaluType(nalu[1]);
if (fuaRequireStart) {
const isFuStart = !!(nalu[1] & 0x80);
if (isFuStart)
@@ -177,6 +205,33 @@ export function getNaluTypesInNalu(nalu: Buffer, fuaRequireStart = false, fuaReq
return ret;
}
export function getH265NaluTypes(streamChunk: StreamChunk) {
if (streamChunk.type !== 'h265')
return new Set<number>();
return getNaluTypesInH265Nalu(streamChunk.chunks[streamChunk.chunks.length - 1].subarray(12))
}
export function getNaluTypesInH265Nalu(nalu: Buffer, fuaRequireStart = false, fuaRequireEnd = false) {
const ret = new Set<number>();
const naluType = parseH265NaluType(nalu[0]);
if (naluType === H265_NAL_TYPE_AGG) {
ret.add(H265_NAL_TYPE_AGG);
let pos = 1;
while (pos < nalu.length) {
const naluLength = nalu.readUInt16BE(pos);
pos += 2;
const stapaType = parseH265NaluType(nalu[pos]);
ret.add(stapaType);
pos += naluLength;
}
}
else {
ret.add(naluType);
}
return ret;
}
export function createRtspParser(options?: StreamParserOptions): RtspStreamParser {
let resolve: any;
@@ -197,12 +252,23 @@ export function createRtspParser(options?: StreamParserOptions): RtspStreamParse
findSyncFrame(streamChunks: StreamChunk[]) {
for (let prebufferIndex = 0; prebufferIndex < streamChunks.length; prebufferIndex++) {
const streamChunk = streamChunks[prebufferIndex];
if (streamChunk.type !== 'h264') {
continue;
if (streamChunk.type === 'h264') {
const naluTypes = getNaluTypes(streamChunk);
if (naluTypes.has(H264_NAL_TYPE_SPS) || naluTypes.has(H264_NAL_TYPE_IDR)) {
return streamChunks.slice(prebufferIndex);
}
}
else if (streamChunk.type === 'h265') {
const naluTypes = getH265NaluTypes(streamChunk);
if (findH264NaluType(streamChunk, H264_NAL_TYPE_SPS) || findH264NaluType(streamChunk, H264_NAL_TYPE_IDR)) {
return streamChunks.slice(prebufferIndex);
if (naluTypes.has(H265_NAL_TYPE_VPS)
|| naluTypes.has(H265_NAL_TYPE_SPS)
|| naluTypes.has(H265_NAL_TYPE_PPS)
|| naluTypes.has(H265_NAL_TYPE_IDR_N)
|| naluTypes.has(H265_NAL_TYPE_IDR_W)
) {
return streamChunks.slice(prebufferIndex);
}
}
}
@@ -326,6 +392,7 @@ export class RtspClient extends RtspBase {
setupOptions = new Map<number, RtspClientTcpSetupOptions>();
issuedTeardown = false;
hasGetParameter = true;
contentBase: string;
constructor(public url: string) {
super();
@@ -363,16 +430,21 @@ export class RtspClient extends RtspBase {
}
}
writeRequest(method: string, headers?: Headers, path?: string, body?: Buffer) {
async writeRequest(method: string, headers?: Headers, path?: string, body?: Buffer) {
headers = headers || {};
let fullUrl = this.url;
if (path) {
let fullUrl: string;
if (!path) {
fullUrl = this.url;
}
else {
// a=control may be a full or "relative" url.
if (path.includes('rtsp://') || path.includes('rtsps://')) {
if (path.includes('rtsp://') || path.includes('rtsps://') || path === '*') {
fullUrl = path;
}
else {
fullUrl = this.contentBase || this.url;
// strangely, relative RTSP urls do not behave like expected from an HTTP-ish server.
// ffmpeg will happily suffix path segments after query strings:
// SETUP rtsp://localhost:5554/cam/realmonitor?channel=1&subtype=0/trackID=0 RTSP/1.0
@@ -390,7 +462,7 @@ export class RtspClient extends RtspBase {
headers['User-Agent'] = 'Scrypted';
if (this.wwwAuthenticate)
headers['Authorization'] = this.createAuthorizationHeader(method, new URL(fullUrl));
headers['Authorization'] = await this.createAuthorizationHeader(method, new URL(fullUrl));
if (this.session)
headers['Session'] = this.session;
@@ -531,10 +603,14 @@ export class RtspClient extends RtspBase {
}
}
createAuthorizationHeader(method: string, url: URL) {
async createAuthorizationHeader(method: string, url: URL) {
if (!this.wwwAuthenticate)
throw new Error('no WWW-Authenticate found');
const { BASIC } = await import('http-auth-utils');
// @ts-ignore
const { parseHTTPHeadersQuotedKeyValueSet } = await import('http-auth-utils/dist/utils');
if (this.wwwAuthenticate.includes('Basic')) {
const hash = BASIC.computeHash(url);
return `Basic ${hash}`;
@@ -586,7 +662,7 @@ export class RtspClient extends RtspBase {
}
async request(method: string, headers?: Headers, path?: string, body?: Buffer, authenticating?: boolean): Promise<RtspServerResponse> {
this.writeRequest(method, headers, path, body);
await this.writeRequest(method, headers, path, body);
const message = this.requestTimeout ? await timeoutPromise(this.requestTimeout, this.readMessage()) : await this.readMessage();
const statusLine = message[0];
@@ -644,10 +720,13 @@ export class RtspClient extends RtspBase {
}
async describe(headers?: Headers) {
return this.request('DESCRIBE', {
const response = await this.request('DESCRIBE', {
...(headers || {}),
Accept: 'application/sdp',
});
this.contentBase = response.headers['content-base'] || response.headers['content-location'];;
return response;
}
async setup(options: RtspClientTcpSetupOptions | RtspClientUdpSetupOptions, headers?: Headers) {

View File

@@ -149,7 +149,7 @@ export function parseFmtp(msection: string[]) {
const paramLine = fmtpLine.substring(firstSpace + 1);
const payloadType = parseInt(fmtp.split(':')[1]);
if (!fmtp || !paramLine || Number.isNaN( payloadType )) {
if (!fmtp || !paramLine || Number.isNaN(payloadType)) {
return;
}
@@ -170,28 +170,48 @@ export function parseFmtp(msection: string[]) {
}
export type MSection = ReturnType<typeof parseMSection>;
export type RTPMap = ReturnType<typeof parseRtpMap>;
export function parseRtpMap(mlineType: string, rtpmap: string) {
const match = rtpmap?.match(/a=rtpmap:([\d]+) (.*?)\/([\d]+)/);
export function parseRtpMap(mline: ReturnType<typeof parseMLine>, rtpmap: string) {
const mlineType = mline.type;
const match = rtpmap?.match(/a=rtpmap:([\d]+) (.*?)\/([\d]+)(\/([\d]+))?/);
rtpmap = rtpmap?.toLowerCase();
let codec: string;
let ffmpegEncoder: string;
if (rtpmap?.includes('mpeg4')) {
codec = 'aac';
ffmpegEncoder = 'aac';
}
else if (rtpmap?.includes('opus')) {
codec = 'opus';
ffmpegEncoder = 'libopus';
}
else if (rtpmap?.includes('pcma')) {
codec = 'pcm_alaw';
ffmpegEncoder = 'pcm_alaw';
}
else if (rtpmap?.includes('pcmu')) {
codec = 'pcm_ulaw';
codec = 'pcm_mulaw';
ffmpegEncoder = 'pcm_mulaw';
}
else if (rtpmap?.includes('g726')) {
codec = 'g726';
// disabled since it 48000 is non compliant in ffmpeg and fails.
// ffmpegEncoder = 'g726';
}
else if (rtpmap?.includes('pcm')) {
codec = 'pcm';
}
else if (rtpmap?.includes('l16')) {
codec = 'pcm_s16be';
ffmpegEncoder = 'pcm_s16be';
}
else if (rtpmap?.includes('speex')) {
codec = 'speex';
ffmpegEncoder = 'libspeex';
}
else if (rtpmap?.includes('h264')) {
codec = 'h264';
}
@@ -199,16 +219,32 @@ export function parseRtpMap(mlineType: string, rtpmap: string) {
codec = 'h265';
}
else if (!rtpmap && mlineType === 'audio') {
// ffmpeg seems to omit the rtpmap type for pcm alaw when creating sdp?
// is this the default?
codec = 'pcm_alaw';
if (mline.payloadTypes?.includes(0)) {
codec = 'pcm_mulaw';
ffmpegEncoder = 'pcm_mulaw';
}
else if (mline.payloadTypes?.includes(8)) {
codec = 'pcm_alaw';
ffmpegEncoder = 'pcm_alaw';
}
else {
// ffmpeg seems to omit the rtpmap type for pcm alaw when creating sdp?
// is this the default?
// 2/21/2024: the paylaod types are included in the mline, and this is legacy code
// that maybe should be updated to use the mline payload types when no rtpmap(s) are available.
// https://en.wikipedia.org/wiki/RTP_payload_formats
codec = 'pcm_alaw';
ffmpegEncoder = 'pcm_alaw';
}
}
return {
line: rtpmap,
codec,
ffmpegEncoder,
rawCodec: match?.[2],
clock: parseInt(match?.[3]),
channels: parseInt(match?.[5]) || undefined,
payloadType: parseInt(match?.[1]),
}
}
@@ -219,10 +255,12 @@ export function parseMSection(msection: string[]) {
const control = msection.find(line => line.startsWith(acontrol))?.substring(acontrol.length);
const mline = parseMLine(msection[0]);
const rawRtpmaps = msection.filter(line => line.startsWith(artpmap));
const rtpmaps = rawRtpmaps.map(line => parseRtpMap(mline.type, line));
const codec = parseRtpMap(mline.type, rawRtpmaps[0]).codec;
const rtpmaps = rawRtpmaps.map(line => parseRtpMap(mline, line));
// if no rtp map is specified, pcm_alaw is used. parsing a null rtpmap is valid.
const rtpmap = parseRtpMap(mline, rawRtpmaps[0]);
const { codec } = rtpmap;
let direction: string;
for (const checkDirection of ['sendonly', 'sendrecv', 'recvonly', 'inactive']) {
const found = msection.find(line => line === 'a=' + checkDirection);
if (found) {
@@ -239,6 +277,7 @@ export function parseMSection(msection: string[]) {
contents: msection.join('\r\n'),
control,
codec,
rtpmap,
direction,
toSdp: () => {
return ret.lines.join('\r\n');

77
common/src/zygote.ts Normal file
View File

@@ -0,0 +1,77 @@
import sdk, { PluginFork } from '@scrypted/sdk';
import worker_threads from 'worker_threads';
import { createAsyncQueue } from './async-queue';
import os from 'os';
export type Zygote<T> = () => PluginFork<T>;
export function createZygote<T>(): Zygote<T> {
if (!worker_threads.isMainThread)
return;
let zygote = sdk.fork<T>();
function* next() {
while (true) {
const cur = zygote;
zygote = sdk.fork<T>();
yield cur;
}
}
const gen = next();
return () => gen.next().value as PluginFork<T>;
}
export function createZygoteWorkQueue<T>(maxWorkers: number = os.cpus().length >> 1) {
const queue = createAsyncQueue<(doWork: (fork: PluginFork<T>) => Promise<any>) => Promise<any>>();
let forks = 0;
return async <R>(doWork: (fork: PluginFork<T>) => Promise<R>): Promise<R> => {
const check = queue.take();
if (check)
return check(doWork);
if (maxWorkers && forks < maxWorkers) {
let exited = false;
const controller = new AbortController();
// necessary to prevent unhandledrejection errors
controller.signal.addEventListener('abort', () => { });
const fork = sdk.fork<T>();
forks++;
fork.worker.on('exit', () => {
forks--;
exited = true;
controller.abort();
});
let timeout: NodeJS.Timeout;
const queueFork = () => {
clearTimeout(timeout);
timeout = setTimeout(() => {
// keep one alive.
if (forks === 1)
return;
fork.worker.terminate();
}, 30000);
queue.submit(async v2 => {
clearTimeout(timeout);
try {
return await v2(fork);
}
finally {
if (!exited) {
queueFork();
}
}
}, controller.signal);
}
queueFork();
}
const d = await queue.dequeue();
return d(doWork);
};
}

View File

@@ -1,6 +1,7 @@
{
"compilerOptions": {
"module": "commonjs",
"module": "Node16",
"moduleResolution": "Node16",
"target": "esnext",
"noImplicitAny": true,
"outDir": "./dist",

Submodule external/face-api.js deleted from a86687eea2

View File

@@ -1,13 +1,12 @@
# Home Assistant Addon Configuration
name: Scrypted
version: "18-jammy-full.s6-v0.50.0"
version: "v0.111.0-jammy-full"
slug: scrypted
description: Scrypted is a high performance home video integration and automation platform
url: "https://github.com/koush/scrypted"
arch:
- amd64
- aarch64
- armv7
init: false
ingress: true
ingress_port: 11080
@@ -29,9 +28,9 @@ environment:
SCRYPTED_ADMIN_USERNAME: "homeassistant"
SCRYPTED_INSTALL_ENVIRONMENT: "ha"
backup_exclude:
- '/server/**'
- '/data/scrypted_nvr/**'
- '/data/scrypted_data/plugins/**'
- '*/server/**'
- '*/scrypted_nvr/**'
- '*/scrypted_data/plugins/**'
map:
- config:rw
- media:rw

View File

@@ -1,5 +1,5 @@
ARG BASE="18-jammy-full"
FROM koush/scrypted-common:${BASE}
ARG BASE="20-jammy-full"
FROM ghcr.io/koush/scrypted-common:${BASE}
WORKDIR /
# cache bust
@@ -14,4 +14,8 @@ WORKDIR /server
# https://github.com/nodejs/node/issues/41145#issuecomment-992948130
ENV NODE_OPTIONS="--dns-result-order=ipv4first"
# changing this forces pip and npm to perform reinstalls.
# if this base image changes, this version must be updated.
ENV SCRYPTED_BASE_VERSION="20240321"
CMD npm --prefix /server exec scrypted-serve

View File

@@ -1,5 +1,5 @@
ARG BASE="16-jammy"
FROM koush/scrypted-common:${BASE}
FROM ghcr.io/koush/scrypted-common:${BASE}
WORKDIR /
RUN git clone --depth=1 https://github.com/koush/scrypted

View File

@@ -7,7 +7,8 @@
# install script.
################################################################
ARG BASE="jammy"
FROM ubuntu:${BASE} as header
ARG REPO="ubuntu"
FROM ${REPO}:${BASE} as header
ENV DEBIAN_FRONTEND=noninteractive
@@ -24,11 +25,15 @@ RUN apt-get update && apt-get -y install \
apt-get -y update && \
apt-get -y upgrade
ARG NODE_VERSION=18
RUN curl -fsSL https://deb.nodesource.com/setup_${NODE_VERSION}.x | bash -
ARG NODE_VERSION=20
RUN apt-get install -y ca-certificates curl gnupg
RUN mkdir -p /etc/apt/keyrings
RUN curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor --yes -o /etc/apt/keyrings/nodesource.gpg
RUN echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_"$NODE_VERSION".x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list
RUN apt-get update && apt-get install -y nodejs
# python native
RUN echo "Installing python."
RUN apt-get -y install \
python3 \
python3-dev \
@@ -38,44 +43,25 @@ RUN apt-get -y install \
# these are necessary for pillow-simd, additional on disk size is small
# but could consider removing this.
RUN echo "Installing pillow-simd dependencies."
RUN apt-get -y install \
libjpeg-dev zlib1g-dev
# plugins support fallback to pillow, but vips is faster.
RUN apt-get -y install \
libvips
# gstreamer native https://gstreamer.freedesktop.org/documentation/installing/on-linux.html?gi-language=c#install-gstreamer-on-ubuntu-or-debian
RUN echo "Installing gstreamer."
RUN apt-get -y install \
gstreamer1.0-tools gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-libav gstreamer1.0-alsa \
gstreamer1.0-vaapi
# python3 gstreamer bindings
RUN echo "Installing gstreamer bindings."
RUN apt-get -y install \
python3-gst-1.0
# armv7l does not have wheels for any of these
# and compile times would forever, if it works at all.
# furthermore, it's possible to run 32bit docker on 64bit arm,
# which causes weird behavior in python which looks at the arch version
# which still reports 64bit, even if running in 32bit docker.
# this scenario is not supported and will be reported at runtime.
# this bit is not necessary on amd64, but leaving it for consistency.
RUN apt-get -y install \
python3-matplotlib \
python3-numpy \
python3-opencv \
python3-pil \
python3-skimage
# allow pip to install to system
RUN rm -f /usr/lib/python**/EXTERNALLY-MANAGED
# pyvips is broken on x86 due to mismatch ffi
# https://stackoverflow.com/questions/62658237/it-seems-that-the-version-of-the-libffi-library-seen-at-runtime-is-different-fro
RUN python3 -m pip install --upgrade pip
RUN python3 -m pip install --force-reinstall --no-binary :all: cffi
RUN python3 -m pip install debugpy typing_extensions psutil
################################################################
@@ -87,20 +73,11 @@ RUN python3 -m pip install debugpy typing_extensions psutil
FROM header as base
# intel opencl gpu for openvino
RUN bash -c "if [ \"$(uname -m)\" == \"x86_64\" ]; \
then \
apt-get update && apt-get install -y gpg-agent && \
rm -f /usr/share/keyrings/intel-graphics.gpg && \
curl -L https://repositories.intel.com/graphics/intel-graphics.key | gpg --dearmor --output /usr/share/keyrings/intel-graphics.gpg && \
echo 'deb [arch=amd64,i386 signed-by=/usr/share/keyrings/intel-graphics.gpg] https://repositories.intel.com/graphics/ubuntu jammy arc' | tee /etc/apt/sources.list.d/intel.gpu.jammy.list && \
apt-get -y update && \
apt-get -y install intel-opencl-icd intel-media-va-driver-non-free && \
apt-get -y dist-upgrade; \
fi"
RUN curl https://raw.githubusercontent.com/koush/scrypted/main/install/docker/install-intel-graphics.sh | bash
# python 3.9 from ppa.
# 3.9 is the version with prebuilt support for tensorflow lite
RUN add-apt-repository ppa:deadsnakes/ppa && \
RUN add-apt-repository -y ppa:deadsnakes/ppa && \
apt-get -y install \
python3.9 \
python3.9-dev \
@@ -110,7 +87,6 @@ RUN add-apt-repository ppa:deadsnakes/ppa && \
RUN rm -f /usr/lib/python**/EXTERNALLY-MANAGED
RUN python3.9 -m pip install --upgrade pip
RUN python3.9 -m pip install --force-reinstall --no-binary :all: cffi
RUN python3.9 -m pip install debugpy typing_extensions psutil
# Coral Edge TPU
@@ -124,12 +100,12 @@ ENV SCRYPTED_CAN_RESTART="true"
ENV SCRYPTED_VOLUME="/server/volume"
ENV SCRYPTED_INSTALL_PATH="/server"
RUN test -f "/usr/bin/ffmpeg"
RUN test -f "/usr/bin/ffmpeg" && test -f "/usr/bin/python3" && test -f "/usr/bin/python3.9" && test -f "/usr/bin/python3.10"
ENV SCRYPTED_FFMPEG_PATH="/usr/bin/ffmpeg"
ENV SCRYPTED_PYTHON_PATH="/usr/bin/python3"
ENV SCRYPTED_PYTHON39_PATH="/usr/bin/python3.9"
ENV SCRYPTED_PYTHON310_PATH="/usr/bin/python3.10"
# changing this forces pip and npm to perform reinstalls.
# if this base image changes, this version must be updated.
ENV SCRYPTED_BASE_VERSION="20230727"
ENV SCRYPTED_DOCKER_FLAVOR="full"
################################################################

View File

@@ -6,42 +6,27 @@ ENV DEBIAN_FRONTEND=noninteractive
# base tools and development stuff
RUN apt-get update && apt-get -y install \
curl software-properties-common apt-utils \
build-essential \
cmake \
ffmpeg \
gcc \
libcairo2-dev \
libgirepository1.0-dev \
pkg-config && \
python3 && \
apt-get -y update && \
apt-get -y upgrade
ARG NODE_VERSION=18
RUN curl -fsSL https://deb.nodesource.com/setup_${NODE_VERSION}.x | bash -
ARG NODE_VERSION=20
RUN apt-get install -y ca-certificates curl gnupg
RUN mkdir -p /etc/apt/keyrings
RUN curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor --yes -o /etc/apt/keyrings/nodesource.gpg
RUN echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_"$NODE_VERSION".x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list
RUN apt-get update && apt-get install -y nodejs
# python native
RUN apt-get -y install \
python3 \
python3-dev \
python3-pip \
python3-setuptools \
python3-wheel
# python pip
RUN rm -f /usr/lib/python**/EXTERNALLY-MANAGED
RUN python3 -m pip install --upgrade pip
RUN python3 -m pip install debugpy typing_extensions psutil
# intel opencl gpu for openvino
RUN curl https://raw.githubusercontent.com/koush/scrypted/main/install/docker/install-intel-graphics.sh | bash
ENV SCRYPTED_INSTALL_ENVIRONMENT="docker"
ENV SCRYPTED_CAN_RESTART="true"
ENV SCRYPTED_VOLUME="/server/volume"
ENV SCRYPTED_INSTALL_PATH="/server"
RUN test -f "/usr/bin/ffmpeg"
ENV SCRYPTED_FFMPEG_PATH="/usr/bin/ffmpeg"
RUN test -f "/usr/bin/python3" && test -f "/usr/bin/python3.10"
ENV SCRYPTED_PYTHON_PATH="/usr/bin/python3"
ENV SCRYPTED_PYTHON310_PATH="/usr/bin/python3.10"
# changing this forces pip and npm to perform reinstalls.
# if this base image changes, this version must be updated.
ENV SCRYPTED_BASE_VERSION="20230727"
ENV SCRYPTED_DOCKER_FLAVOR="lite"

View File

@@ -1,4 +1,4 @@
FROM koush/scrypted-common
FROM ghcr.io/koush/scrypted-common
WORKDIR /
COPY . .

View File

@@ -1,22 +1,6 @@
FROM koush/18-jammy-full.s6
ARG BASE="ghcr.io/koush/scrypted-common:20-jammy-full"
FROM $BASE
WORKDIR /
# Install miniconda
ENV CONDA_DIR /opt/conda
RUN wget --quiet https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O ~/miniconda.sh && \
/bin/bash ~/miniconda.sh -b -p /opt/conda
# Put conda in path so we can use conda activate
ENV PATH=$CONDA_DIR/bin:$PATH
RUN conda install -c conda-forge cudatoolkit=11.2.2 cudnn=8.1.0
ENV CONDA_PREFIX=/opt/conda
ENV LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$CONDA_PREFIX/lib/
# this is a copy pasta, seems to need a reinstall.
# python pip
RUN python3 -m pip install --upgrade pip
# pyvips is broken on x86 due to mismatch ffi
# https://stackoverflow.com/questions/62658237/it-seems-that-the-version-of-the-libffi-library-seen-at-runtime-is-different-fro
RUN python3 -m pip install --force-reinstall --no-binary :all: cffi
RUN python3 -m pip install debugpy typing_extensions psutil
# nvidia cudnn/libcublas etc.
# for some reason this is not provided by the nvidia container toolkit
RUN curl https://raw.githubusercontent.com/koush/scrypted/main/install/docker/install-nvidia-graphics.sh | bash

View File

@@ -1,5 +1,5 @@
ARG BASE="18-jammy-full"
FROM koush/scrypted-common:${BASE}
ARG BASE="20-jammy-full"
FROM ghcr.io/koush/scrypted-common:${BASE}
# avahi advertiser support
RUN apt-get update && apt-get -y install \
@@ -44,4 +44,8 @@ WORKDIR /server
# https://github.com/nodejs/node/issues/41145#issuecomment-992948130
ENV NODE_OPTIONS="--dns-result-order=ipv4first"
# changing this forces pip and npm to perform reinstalls.
# if this base image changes, this version must be updated.
ENV SCRYPTED_BASE_VERSION="20240321"
CMD npm --prefix /server exec scrypted-serve

View File

@@ -1,25 +0,0 @@
ARG BASE="jammy"
FROM ubuntu:${BASE} as header
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get -y update && \
apt-get -y upgrade && \
apt-get -y install curl software-properties-common apt-utils ffmpeg
# switch to nvm?
ARG NODE_VERSION=18
RUN curl -fsSL https://deb.nodesource.com/setup_${NODE_VERSION}.x | bash - && apt-get update && apt-get install -y nodejs
ENV SCRYPTED_INSTALL_ENVIRONMENT="docker"
ENV SCRYPTED_CAN_RESTART="true"
ENV SCRYPTED_VOLUME="/server/volume"
ENV SCRYPTED_INSTALL_PATH="/server"
RUN test -f "/usr/bin/ffmpeg"
ENV SCRYPTED_FFMPEG_PATH="/usr/bin/ffmpeg"
# changing this forces pip and npm to perform reinstalls.
# if this base image changes, this version must be updated.
ENV SCRYPTED_BASE_VERSION="20230727"
ENV SCRYPTED_DOCKER_FLAVOR="thin"

View File

@@ -1,4 +1,4 @@
./template/generate-dockerfile.sh
docker build -t koush/scrypted-common -f Dockerfile.common . && \
docker build -t koush/scrypted -f Dockerfile.local .
docker build -t ghcr.io/koush/scrypted-common -f Dockerfile.full . && \
docker build -t ghcr.io/koush/scrypted -f Dockerfile.local .

View File

@@ -1,3 +1,3 @@
./docker-build.sh
docker build -t koush/scrypted:18-jammy-full.nvidia -f Dockerfile.nvidia
docker build -t ghcr.io/koush/scrypted:20-jammy-full.nvidia -f Dockerfile.nvidia .

View File

@@ -2,7 +2,7 @@
set -x
NODE_VERSION=18
NODE_VERSION=20
SCRYPTED_INSTALL_VERSION=beta
IMAGE_BASE=jammy
FLAVOR=full
@@ -11,8 +11,8 @@ echo $BASE
SUPERVISOR=.s6
SUPERVISOR_BASE=$BASE$SUPERVISOR
docker build -t koush/scrypted-common:$BASE -f Dockerfile.$FLAVOR \
docker build -t ghcr.io/koush/scrypted-common:$BASE -f Dockerfile.$FLAVOR \
--build-arg NODE_VERSION=$NODE_VERSION --build-arg BASE=$IMAGE_BASE . && \
\
docker build -t koush/scrypted:$SUPERVISOR_BASE -f Dockerfile$SUPERVISOR \
docker build -t ghcr.io/koush/scrypted:$SUPERVISOR_BASE -f Dockerfile$SUPERVISOR \
--build-arg BASE=$BASE --build-arg SCRYPTED_INSTALL_VERSION=$SCRYPTED_INSTALL_VERSION .

View File

@@ -1,5 +1,3 @@
version: "3.5"
# The Scrypted docker-compose.yml file typically resides at:
# ~/.scrypted/docker-compose.yml
@@ -34,17 +32,27 @@ services:
- SCRYPTED_WEBHOOK_UPDATE_AUTHORIZATION=Bearer SET_THIS_TO_SOME_RANDOM_TEXT
- SCRYPTED_WEBHOOK_UPDATE=http://localhost:10444/v1/update
# Uncomment next 3 lines for Nvidia GPU support.
# Avahi can be used for network discovery by passing in the host daemon
# or running the daemon inside the container. Choose one or the other.
# Uncomment next line to run avahi-daemon inside the container.
# See volumes and security_opt section below to use the host daemon.
# - SCRYPTED_DOCKER_AVAHI=true
# NVIDIA (Part 1 of 4)
# - NVIDIA_VISIBLE_DEVICES=all
# - NVIDIA_DRIVER_CAPABILITIES=all
# Uncomment next line to run avahi-daemon inside the container
# Don't use if dbus and avahi run on the host and are bind-mounted
# (see below under "volumes")
# - SCRYPTED_DOCKER_AVAHI=true
# NVIDIA (Part 2 of 4)
# runtime: nvidia
# NVIDIA (Part 3 of 4) - Use NVIDIA image, and remove subsequent default image.
# image: ghcr.io/koush/scrypted:nvidia
image: ghcr.io/koush/scrypted
volumes:
# NVIDIA (Part 4 of 4)
# - /etc/OpenCL/vendors/nvidia.icd:/etc/OpenCL/vendors/nvidia.icd
# Scrypted NVR Storage (Part 3 of 3)
# Modify to add the additional volume for Scrypted NVR.
@@ -59,14 +67,20 @@ services:
# volume:
# nocopy: true
# uncomment the following lines to expose Avahi, an mDNS advertiser.
# make sure Avahi is running on the host machine, otherwise this will not work.
# not compatible with Avahi enabled via SCRYPTED_DOCKER_AVAHI=true
# Uncomment the following lines to use Avahi daemon from the host.
# Ensure Avahi is running on the host machine:
# It can be installed with: sudo apt-get install avahi-daemon
# This is not compatible with running avahi inside the container (see above).
# Also, uncomment the lines under security_opt
# - /var/run/dbus:/var/run/dbus
# - /var/run/avahi-daemon/socket:/var/run/avahi-daemon/socket
# Default volume for the Scrypted database. Typically should not be changed.
- ~/.scrypted/volume:/server/volume
# Uncomment the following lines to use Avahi daemon from the host
# Without this, AppArmor will block the container's attempt to talk to Avahi via dbus
# security_opt:
# - apparmor:unconfined
devices: [
# uncomment the common systems devices to pass
# them through to docker.
@@ -90,15 +104,16 @@ services:
container_name: scrypted
restart: unless-stopped
network_mode: host
image: koush/scrypted
# logging is noisy and will unnecessarily wear on flash storage.
# scrypted has per device in memory logging that is preferred.
# enable the log file if enhanced debugging is necessary.
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "10"
driver: "none"
# driver: "json-file"
# options:
# max-size: "10m"
# max-file: "10"
labels:
- "com.centurylinklabs.watchtower.scope=scrypted"

View File

@@ -0,0 +1,38 @@
if [ "$(uname -m)" = "x86_64" ]
then
# this script previvously apt install intel-media-va-driver-non-free, but that seems to no longer be necessary.
# the intel provided script is disabled since it does not work with the 6.8 kernel in Ubuntu 24.04 or Proxmox 8.2.
# manual installation of the Intel graphics stuff is required.
# echo "Installing Intel graphics packages."
# apt-get update && apt-get install -y gpg-agent &&
# rm -f /usr/share/keyrings/intel-graphics.gpg &&
# curl -L https://repositories.intel.com/graphics/intel-graphics.key | gpg --dearmor --yes --output /usr/share/keyrings/intel-graphics.gpg &&
# echo 'deb [arch=amd64,i386 signed-by=/usr/share/keyrings/intel-graphics.gpg] https://repositories.intel.com/graphics/ubuntu jammy arc' | tee /etc/apt/sources.list.d/intel.gpu.jammy.list &&
# apt-get -y update &&
# apt-get -y install intel-opencl-icd &&
# apt-get -y dist-upgrade;
# manual installation
# https://github.com/intel/compute-runtime/releases/tag/24.13.29138.7
rm -rf /tmp/neo && mkdir -p /tmp/neo && cd /tmp/neo &&
apt-get install -y ocl-icd-libopencl1 &&
curl -O -L https://github.com/intel/intel-graphics-compiler/releases/download/igc-1.0.16695.4/intel-igc-core_1.0.16695.4_amd64.deb &&
curl -O -L https://github.com/intel/intel-graphics-compiler/releases/download/igc-1.0.16695.4/intel-igc-opencl_1.0.16695.4_amd64.deb &&
curl -O -L https://github.com/intel/compute-runtime/releases/download/24.17.29377.6/intel-level-zero-gpu-dbgsym_1.3.29377.6_amd64.ddeb &&
curl -O -L https://github.com/intel/compute-runtime/releases/download/24.17.29377.6/intel-level-zero-gpu_1.3.29377.6_amd64.deb &&
curl -O -L https://github.com/intel/compute-runtime/releases/download/24.17.29377.6/intel-opencl-icd-dbgsym_24.17.29377.6_amd64.ddeb &&
curl -O -L https://github.com/intel/compute-runtime/releases/download/24.17.29377.6/intel-opencl-icd_24.17.29377.6_amd64.deb &&
curl -O -L https://github.com/intel/compute-runtime/releases/download/24.17.29377.6/libigdgmm12_22.3.19_amd64.deb &&
dpkg -i *.deb &&
cd /tmp && rm -rf /tmp/neo &&
apt-get -y dist-upgrade;
exit $?
else
echo "Intel graphics will not be installed on this architecture."
fi
exit 0

View File

@@ -0,0 +1,16 @@
if [ "$(uname -m)" = "x86_64" ]
then
echo "Installing NVIDIA graphics packages."
apt update -q \
&& apt install -y wget \
&& wget -qO /cuda-keyring.deb https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/$(uname -m)/cuda-keyring_1.1-1_all.deb \
&& dpkg -i /cuda-keyring.deb \
&& apt update -q \
&& apt install -y cuda-nvcc-11-8 libcublas-11-8 libcudnn8 cuda-libraries-11-8 \
&& apt install -y cuda-nvcc-12-4 libcublas-12-4 libcudnn8 cuda-libraries-12-4;
exit $?
else
echo "NVIDIA graphics will not be installed on this architecture."
fi
exit 0

View File

@@ -6,19 +6,6 @@ then
exit 0
fi
if [ "$SERVICE_USER" == "root" ]
then
echo "Scrypted SERVICE_USER root is not allowed."
exit 1
fi
USER_HOME=$(eval echo ~$SERVICE_USER)
SCRYPTED_HOME=$USER_HOME/.scrypted
mkdir -p $SCRYPTED_HOME
set -e
cd $SCRYPTED_HOME
function readyn() {
while true; do
read -p "$1 (y/n) " yn
@@ -30,6 +17,26 @@ function readyn() {
done
}
if [ "$SERVICE_USER" == "root" ]
then
readyn "Scrypted will store its files in the root user home directory. Running as a non-root user is recommended. Are you sure?"
if [ "$yn" == "n" ]
then
exit 1
fi
fi
echo "Stopping local service if it is running..."
systemctl stop scrypted.service 2> /dev/null
systemctl disable scrypted.service 2> /dev/null
USER_HOME=$(eval echo ~$SERVICE_USER)
SCRYPTED_HOME=$USER_HOME/.scrypted
mkdir -p $SCRYPTED_HOME
set -e
cd $SCRYPTED_HOME
readyn "Install Docker?"
if [ "$yn" == "y" ]
@@ -45,21 +52,22 @@ echo "Created $DOCKER_COMPOSE_YML"
curl -s https://raw.githubusercontent.com/koush/scrypted/main/install/docker/docker-compose.yml | sed s/SET_THIS_TO_SOME_RANDOM_TEXT/"$(echo $RANDOM | md5sum | head -c 32)"/g > $DOCKER_COMPOSE_YML
if [ -d /dev/dri ]
then
sed -i 's/'#' - \/dev\/dri/- \/dev\/dri/g' $DOCKER_COMPOSE_YML
sed -i 's/'#' "\/dev\/dri/"\/dev\/dri/g' $DOCKER_COMPOSE_YML
fi
readyn "Install avahi-daemon? This is the recommended for reliable HomeKit discovery and pairing."
if [ "$yn" == "y" ]
then
sudo apt-get -y install avahi-daemon
sed -i 's/'#' - \/var\/run\/dbus/- \/var\/run\/dbus/g' $DOCKER_COMPOSE_YML
sed -i 's/'#' - \/var\/run\/avahi-daemon/- \/var\/run\/avahi-daemon/g' $DOCKER_COMPOSE_YML
sed -i 's/'#' security_opt:/security_opt:/g' $DOCKER_COMPOSE_YML
sed -i 's/'#' - apparmor:unconfined/ - apparmor:unconfined/g' $DOCKER_COMPOSE_YML
fi
echo "Setting permissions on $SCRYPTED_HOME"
chown -R $SERVICE_USER $SCRYPTED_HOME
echo "Optional:"
readyn "Edit docker-compose.yml to add external storage for Scrypted NVR?"
if [ "$yn" == "y" ]
then
apt install nano
nano $DOCKER_COMPOSE_YML
fi
set +e
echo "docker compose down"
@@ -82,3 +90,6 @@ echo "Scrypted is now running at: https://localhost:10443/"
echo "Note that it is https and that you'll be asked to approve/ignore the website certificate."
echo
echo
echo "Optional:"
echo "Scrypted NVR Recording storage directory can be configured with an additional script:"
echo "https://docs.scrypted.app/scrypted-nvr/installation.html#docker-volume"

View File

@@ -0,0 +1,159 @@
if [ -z "$SERVICE_USER" ]
then
echo "Scrypted SERVICE_USER environment variable was not specified. NVR Storage can not be configured."
exit 0
fi
if [ "$USER" != "root" ]
then
echo "$USER"
echo "This script must be run as sudo or root."
exit 1
fi
USER_HOME=$(eval echo ~$SERVICE_USER)
SCRYPTED_HOME=$USER_HOME/.scrypted
DOCKER_COMPOSE_YML=$SCRYPTED_HOME/docker-compose.yml
if [ ! -f "$DOCKER_COMPOSE_YML" ]
then
echo "$DOCKER_COMPOSE_YML not found. Install Scrypted first."
exit 1
fi
NVR_MOUNT_LINE=$(cat "$DOCKER_COMPOSE_YML" | grep :/nvr)
if [ -z "$NVR_MOUNT_LINE" ]
then
echo "Unexpected contents in $DOCKER_COMPOSE_YML. Rerun the Scrypted docker compose installer."
exit 1
fi
function backup() {
BACKUP_FILE="$1".scrypted-bak
if [ ! -f "$BACKUP_FILE" ]
then
cp "$1" "$BACKUP_FILE"
fi
}
backup "$DOCKER_COMPOSE_YML"
function readyn() {
while true; do
read -p "$1 (y/n) " yn
case $yn in
[Yy]* ) break;;
[Nn]* ) break;;
* ) echo "Please answer yes or no. (y/n)";;
esac
done
}
if [ -z "$1" ]
then
lsblk
echo ""
echo "Please run the script with an existing mount path or the 'disk' device to format (e.g. sdx)."
exit 1
fi
function stopscrypted() {
cd $SCRYPTED_HOME
echo ""
echo "Stopping the Scrypted container. If there are any errors during disk setup, Scrypted will need to be manually restarted with:"
echo "cd $SCRYPTED_HOME && docker compose up -d"
echo ""
sudo -u $SERVICE_USER docker compose down 2> /dev/null
}
function removescryptedfstab() {
backup "/etc/fstab"
grep -v "scrypted-nvr" /etc/fstab > /tmp/fstab && cp /tmp/fstab /etc/fstab
# ensure newline
sed -i -e '$a\' /etc/fstab
systemctl daemon-reload
}
BLOCK_DEVICE="/dev/$1"
if [ -b "$BLOCK_DEVICE" ]
then
readyn "Format $BLOCK_DEVICE?"
if [ "$yn" == "n" ]
then
exit 1
fi
stopscrypted
umount "$BLOCK_DEVICE"1 2> /dev/null
umount "$BLOCK_DEVICE"2 2> /dev/null
umount /mnt/scrypted-nvr 2> /dev/null
set -e
parted "$BLOCK_DEVICE" --script mklabel gpt
parted -a optimal "$BLOCK_DEVICE" mkpart scrypted-nvr "0%" "100%"
set +e
sync
PARTITION_DEVICE="$BLOCK_DEVICE"1
if [ ! -e "$PARTITION_DEVICE" ]
then
PARTITION_DEVICE="$BLOCK_DEVICE"p1
if [ ! -e "$PARTITION_DEVICE" ]
then
echo "Unable to determine block device partition from block device: $BLOCK_DEVICE"
exit 1
fi
fi
mkfs -F -t ext4 "$PARTITION_DEVICE"
sync
# parse/evaluate blkid line as env vars
for attr in $(blkid | grep "$BLOCK_DEVICE")
do
e=$(echo $attr | grep =)
if [ ! -z "$e" ]
then
export "$e"
fi
done
if [ -z "$UUID" ]
then
echo "Error parsing disk UUID."
exit 1
fi
echo "UUID: $UUID"
set -e
removescryptedfstab
mkdir -p /mnt/scrypted-nvr
echo "PARTLABEL=scrypted-nvr /mnt/scrypted-nvr ext4 defaults,nofail 0 0" >> /etc/fstab
mount -a
systemctl daemon-reload
set +e
DIR="/mnt/scrypted-nvr"
else
if [ ! -d "$1" ]
then
echo "$1 is not a valid directory."
exit 1
fi
stopscrypted
removescryptedfstab
DIR="$1"
fi
ESCAPED_DIR=$(echo "$DIR" | sed s/\\//\\\\\\//g)
set -e
sed -i s/'^.*:\/nvr'/" - $ESCAPED_DIR:\/nvr"/ "$DOCKER_COMPOSE_YML"
sed -i s/'^.*SCRYPTED_NVR_VOLUME.*$'/" - SCRYPTED_NVR_VOLUME=\/nvr"/ "$DOCKER_COMPOSE_YML"
set +e
cd $SCRYPTED_HOME
sudo -u $SERVICE_USER docker compose up -d

View File

@@ -4,20 +4,11 @@
FROM header as base
# intel opencl gpu for openvino
RUN bash -c "if [ \"$(uname -m)\" == \"x86_64\" ]; \
then \
apt-get update && apt-get install -y gpg-agent && \
rm -f /usr/share/keyrings/intel-graphics.gpg && \
curl -L https://repositories.intel.com/graphics/intel-graphics.key | gpg --dearmor --output /usr/share/keyrings/intel-graphics.gpg && \
echo 'deb [arch=amd64,i386 signed-by=/usr/share/keyrings/intel-graphics.gpg] https://repositories.intel.com/graphics/ubuntu jammy arc' | tee /etc/apt/sources.list.d/intel.gpu.jammy.list && \
apt-get -y update && \
apt-get -y install intel-opencl-icd intel-media-va-driver-non-free && \
apt-get -y dist-upgrade; \
fi"
RUN curl https://raw.githubusercontent.com/koush/scrypted/main/install/docker/install-intel-graphics.sh | bash
# python 3.9 from ppa.
# 3.9 is the version with prebuilt support for tensorflow lite
RUN add-apt-repository ppa:deadsnakes/ppa && \
RUN add-apt-repository -y ppa:deadsnakes/ppa && \
apt-get -y install \
python3.9 \
python3.9-dev \
@@ -27,7 +18,6 @@ RUN add-apt-repository ppa:deadsnakes/ppa && \
RUN rm -f /usr/lib/python**/EXTERNALLY-MANAGED
RUN python3.9 -m pip install --upgrade pip
RUN python3.9 -m pip install --force-reinstall --no-binary :all: cffi
RUN python3.9 -m pip install debugpy typing_extensions psutil
# Coral Edge TPU
@@ -41,12 +31,12 @@ ENV SCRYPTED_CAN_RESTART="true"
ENV SCRYPTED_VOLUME="/server/volume"
ENV SCRYPTED_INSTALL_PATH="/server"
RUN test -f "/usr/bin/ffmpeg"
RUN test -f "/usr/bin/ffmpeg" && test -f "/usr/bin/python3" && test -f "/usr/bin/python3.9" && test -f "/usr/bin/python3.10"
ENV SCRYPTED_FFMPEG_PATH="/usr/bin/ffmpeg"
ENV SCRYPTED_PYTHON_PATH="/usr/bin/python3"
ENV SCRYPTED_PYTHON39_PATH="/usr/bin/python3.9"
ENV SCRYPTED_PYTHON310_PATH="/usr/bin/python3.10"
# changing this forces pip and npm to perform reinstalls.
# if this base image changes, this version must be updated.
ENV SCRYPTED_BASE_VERSION="20230727"
ENV SCRYPTED_DOCKER_FLAVOR="full"
################################################################

View File

@@ -21,11 +21,15 @@ RUN apt-get update && apt-get -y install \
apt-get -y update && \
apt-get -y upgrade
ARG NODE_VERSION=18
RUN curl -fsSL https://deb.nodesource.com/setup_${NODE_VERSION}.x | bash -
ARG NODE_VERSION=20
RUN apt-get install -y ca-certificates curl gnupg
RUN mkdir -p /etc/apt/keyrings
RUN curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor --yes -o /etc/apt/keyrings/nodesource.gpg
RUN echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_"$NODE_VERSION".x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list
RUN apt-get update && apt-get install -y nodejs
# python native
RUN echo "Installing python."
RUN apt-get -y install \
python3 \
python3-dev \
@@ -35,44 +39,25 @@ RUN apt-get -y install \
# these are necessary for pillow-simd, additional on disk size is small
# but could consider removing this.
RUN echo "Installing pillow-simd dependencies."
RUN apt-get -y install \
libjpeg-dev zlib1g-dev
# plugins support fallback to pillow, but vips is faster.
RUN apt-get -y install \
libvips
# gstreamer native https://gstreamer.freedesktop.org/documentation/installing/on-linux.html?gi-language=c#install-gstreamer-on-ubuntu-or-debian
RUN echo "Installing gstreamer."
RUN apt-get -y install \
gstreamer1.0-tools gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-libav gstreamer1.0-alsa \
gstreamer1.0-vaapi
# python3 gstreamer bindings
RUN echo "Installing gstreamer bindings."
RUN apt-get -y install \
python3-gst-1.0
# armv7l does not have wheels for any of these
# and compile times would forever, if it works at all.
# furthermore, it's possible to run 32bit docker on 64bit arm,
# which causes weird behavior in python which looks at the arch version
# which still reports 64bit, even if running in 32bit docker.
# this scenario is not supported and will be reported at runtime.
# this bit is not necessary on amd64, but leaving it for consistency.
RUN apt-get -y install \
python3-matplotlib \
python3-numpy \
python3-opencv \
python3-pil \
python3-skimage
# allow pip to install to system
RUN rm -f /usr/lib/python**/EXTERNALLY-MANAGED
# pyvips is broken on x86 due to mismatch ffi
# https://stackoverflow.com/questions/62658237/it-seems-that-the-version-of-the-libffi-library-seen-at-runtime-is-different-fro
RUN python3 -m pip install --upgrade pip
RUN python3 -m pip install --force-reinstall --no-binary :all: cffi
RUN python3 -m pip install debugpy typing_extensions psutil
################################################################

View File

@@ -12,6 +12,26 @@ then
exit 1
fi
function readyn() {
while true; do
read -p "$1 (y/n) " yn
case $yn in
[Yy]* ) break;;
[Nn]* ) break;;
* ) echo "Please answer yes or no. (y/n)";;
esac
done
}
if [ "$SERVICE_USER" = "root" ] && [ -z "$SERVICE_USER_ROOT" ]
then
readyn "Scrypted will store its files in the root user home directory. Running as a non-root user is recommended. Are you sure?"
if [ "$yn" == "n" ]
then
exit 1
fi
fi
echo "Stopping existing service if it is running..."
systemctl stop scrypted.service
@@ -49,6 +69,14 @@ ENV() {
}
source <(curl -s https://raw.githubusercontent.com/koush/scrypted/main/install/docker/template/Dockerfile.full.header)
if [ -z "$SCRYPTED_INSTALL_ENVIRONMENT" ]
then
SCRYPTED_INSTALL_ENVIRONMENT=local
fi
if [ "$SCRYPTED_INSTALL_ENVIRONMENT" = "lxc" ]
then
source <(curl -s https://raw.githubusercontent.com/koush/scrypted/main/install/docker/template/Dockerfile.full.footer)
fi
if [ -z "$SERVICE_USER" ]
then
@@ -56,19 +84,20 @@ then
exit 0
fi
if [ "$SERVICE_USER" == "root" ]
then
echo "Scrypted SERVICE_USER root is not allowed."
exit 1
fi
# this is not RUN as we do not care about the result
USER_HOME=$(eval echo ~$SERVICE_USER)
echo "Setting permissions on $USER_HOME/.scrypted"
chown -R $SERVICE_USER $USER_HOME/.scrypted
echo "Stopping docker service if it exists..."
cd $USER_HOME/.scrypted
echo "docker compose down"
sudo -u $SERVICE_USER docker compose down 2> /dev/null
echo "docker compose rm -rf"
sudo -u $SERVICE_USER docker rm -f /scrypted /scrypted-watchtower 2> /dev/null
echo "Installing Scrypted..."
RUN sudo -u $SERVICE_USER npx -y scrypted@latest install-server
RUN sudo -u $SERVICE_USER npx -y scrypted@latest install-server $SCRYPTED_INSTALL_VERSION
cat > /etc/systemd/system/scrypted.service <<EOT
@@ -81,9 +110,12 @@ User=$SERVICE_USER
Group=$SERVICE_USER
Type=simple
ExecStart=/usr/bin/npx -y scrypted serve
Restart=on-failure
Restart=always
RestartSec=3
Environment="NODE_OPTIONS=$NODE_OPTIONS"
Environment="SCRYPTED_INSTALL_ENVIRONMENT=$SCRYPTED_INSTALL_ENVIRONMENT"
StandardOutput=null
StandardError=null
[Install]
WantedBy=multi-user.target

View File

@@ -39,32 +39,17 @@ launchctl unload ~/Library/LaunchAgents/app.scrypted.server.plist || echo ""
echo "Installing Scrypted dependencies..."
RUN_IGNORE xcode-select --install
RUN brew update
RUN_IGNORE brew install node@18
RUN_IGNORE brew install node@20
# snapshot plugin and others
RUN brew install libvips
# dlib
RUN brew install cmake
### HACK WORKAROUND
### https://github.com/koush/scrypted/issues/544
brew unpin gstreamer
brew unpin gst-plugins-base
brew unpin gst-plugins-good
brew unpin gst-plugins-bad
brew unpin gst-plugins-ugly
brew unpin gst-libav
brew unpin gst-python
### END HACK WORKAROUND
# seems to be necessary for python-codecs' pycairo dependency or something?
RUN_IGNORE gobject-introspection libffi pkg-config
# gstreamer plugins
RUN_IGNORE brew install gstreamer gst-plugins-base gst-plugins-good gst-plugins-bad gst-libav
# gst python bindings
RUN_IGNORE brew install gst-python
RUN_IGNORE brew install gstreamer
ARCH=$(arch)
if [ "$ARCH" = "arm64" ]
@@ -96,17 +81,17 @@ echo "Installing Scrypted Launch Agent..."
RUN mkdir -p ~/Library/LaunchAgents
NODE_PATH=$(brew --prefix node@18)
NODE_PATH=$(brew --prefix node@20)
if [ ! -d "$NODE_PATH" ]
then
echo "Unable to determine node@18 path."
echo "Unable to determine node@20 path."
exit 1
fi
NODE_BIN_PATH=$NODE_PATH/bin
if [ ! -d "$NODE_BIN_PATH" ]
then
echo "Unable to determine node@18 bin path."
echo "Unable to determine node@20 bin path."
echo "$NODE_BIN_PATH does not exist."
exit 1
fi
@@ -136,7 +121,7 @@ then
fi
echo "Installing Scrypted..."
RUN $NPX_PATH -y scrypted@latest install-server
RUN $NPX_PATH -y scrypted@latest install-server $SCRYPTED_INSTALL_VERSION
cat > ~/Library/LaunchAgents/app.scrypted.server.plist <<EOT
<?xml version="1.0" encoding="UTF-8"?>

View File

@@ -8,8 +8,12 @@ sc.exe stop scrypted.exe
iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
# Install node.js
choco upgrade -y nodejs-lts --version=18.14.0
choco upgrade -y nodejs-lts --version=20.11.1
# Install VC Redist, which is necessary for portable python
choco install -y vcredist140
# TODO: remove python install, and use portable python
# Install Python
choco upgrade -y python39
# Run py.exe with a specific version
@@ -22,7 +26,12 @@ $env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";"
py $SCRYPTED_WINDOWS_PYTHON_VERSION -m pip install --upgrade pip
py $SCRYPTED_WINDOWS_PYTHON_VERSION -m pip install debugpy typing_extensions typing opencv-python
npx -y scrypted@latest install-server
$SCRYPTED_INSTALL_VERSION=[System.Environment]::GetEnvironmentVariable("SCRYPTED_INSTALL_VERSION","User")
if ($SCRYPTED_INSTALL_VERSION -eq $null) {
npx -y scrypted@latest install-server
} else {
npx -y scrypted@latest install-server $SCRYPTED_INSTALL_VERSION
}
$USER_HOME_ESCAPED = $env:USERPROFILE.replace('\', '\\')
$SCRYPTED_HOME = $env:USERPROFILE + '\.scrypted'
@@ -30,7 +39,8 @@ $SCRYPTED_HOME_ESCAPED_PATH = $SCRYPTED_HOME.replace('\', '\\')
npm install --prefix $SCRYPTED_HOME @koush/node-windows --save
$NPX_PATH = (Get-Command npx).Path
$NPX_PATH_ESCAPED = $NPX_PATH.replace('\', '\\')
# The path needs double quotes to handle spaces in the directory path
$NPX_PATH_ESCAPED = '"' + $NPX_PATH.replace('\', '\\') + '"'
$SERVICE_JS = @"
const fs = require('fs');
@@ -40,8 +50,10 @@ try {
catch (e) {
}
const child_process = require('child_process');
child_process.spawn('$($NPX_PATH_ESCAPED)', ['-y', 'scrypted', 'serve'], {
child_process.spawn('$NPX_PATH_ESCAPED', ['-y', 'scrypted', 'serve'], {
stdio: 'inherit',
// allow spawning .cmd https://nodejs.org/en/blog/vulnerability/april-2024-security-releases-2
shell: true,
});
"@

View File

@@ -0,0 +1,91 @@
function readyn() {
while true; do
read -p "$1 (y/n) " yn
case $yn in
[Yy]* ) break;;
[Nn]* ) break;;
* ) echo "Please answer yes or no. (y/n)";;
esac
done
}
cd /tmp
SCRYPTED_VERSION=v0.96.0
SCRYPTED_TAR_ZST=scrypted-$SCRYPTED_VERSION.tar.zst
if [ -z "$VMID" ]
then
VMID=10443
fi
echo "Downloading scrypted container backup."
if [ ! -f "$SCRYPTED_TAR_ZST" ]
then
curl -O -L https://github.com/koush/scrypted/releases/download/$SCRYPTED_VERSION/scrypted.tar.zst
mv scrypted.tar.zst $SCRYPTED_TAR_ZST
fi
echo "Checking for existing container."
pct config $VMID
if [ "$?" == "0" ]
then
echo ""
echo "Existing container $VMID found. Run this script with --force to overwrite the existing container."
echo "This will wipe all existing data. Clone the existing container to retain the data, then reassign the owner of the scrypted volume after installation is complete."
echo ""
echo "bash $0 --force"
echo ""
fi
pct restore $VMID $SCRYPTED_TAR_ZST $@
if [ "$?" != "0" ]
then
echo ""
echo "The Scrypted container installation failed (pct restore error)."
echo ""
echo "This may be because the server's 'local' storage device is not being a valid"
echo "location for containers."
echo "Try running this script again with a different storage device like"
echo "'local-lvm' or 'local-zfs'."
echo ""
echo "#############################################################################"
echo "Paste the following command into this shell to install to local-lvm instead:"
echo ""
echo "bash $0 --storage local-lvm"
echo "#############################################################################"
echo ""
echo ""
exit 1
fi
pct set $VMID -net0 name=eth0,bridge=vmbr0,ip=dhcp,ip6=auto
if [ "$?" != "0" ]
then
echo ""
echo "pct set network failed"
echo ""
echo "Ignoring... Please verify your container's network settings."
fi
CONF=/etc/pve/lxc/$VMID.conf
if [ -f "$CONF" ]
then
echo "onboot: 1" >> $CONF
else
echo "$CONF not found? Start on boot must be enabled manually."
fi
echo "Adding udev rule: /etc/udev/rules.d/65-scrypted.rules"
readyn "Add udev rule for hardware acceleration? This may conflict with existing rules."
if [ "$yn" == "y" ]
then
sh -c "echo 'SUBSYSTEM==\"apex\", MODE=\"0666\"' > /etc/udev/rules.d/65-scrypted.rules"
sh -c "echo 'KERNEL==\"renderD128\", MODE=\"0666\"' >> /etc/udev/rules.d/65-scrypted.rules"
sh -c "echo 'KERNEL==\"card0\", MODE=\"0666\"' >> /etc/udev/rules.d/65-scrypted.rules"
sh -c "echo 'SUBSYSTEM==\"usb\", ATTRS{idVendor}==\"1a6e\", ATTRS{idProduct}==\"089a\", MODE=\"0666\"' >> /etc/udev/rules.d/65-scrypted.rules"
sh -c "echo 'SUBSYSTEM==\"usb\", ATTRS{idVendor}==\"18d1\", ATTRS{idProduct}==\"9302\", MODE=\"0666\"' >> /etc/udev/rules.d/65-scrypted.rules"
udevadm control --reload-rules && udevadm trigger
fi
echo "Scrypted setup is complete and the container resources can be started."
echo "Scrypted NVR users should provide at least 4 cores and 16GB RAM prior to starting."

View File

@@ -1,9 +1,4 @@
echo 'if (!process.version.startsWith("v18")) throw new Error("Node 18 is required. Install Node Version Manager (nvm) for versioned node installations. See https://github.com/koush/scrypted/pull/498#issuecomment-1373854020")' | node
if [ "$?" != 0 ]
then
exit
fi
#!/bin/bash
echo ######################################
echo "Setting up popular plugins."
echo "Additional will need npm install manually."
@@ -14,7 +9,7 @@ cd $(dirname $0)
git submodule init
git submodule update
for directory in sdk common server packages/client
for directory in sdk server common packages/client packages/auth-fetch
do
echo "$directory > npm install"
pushd $directory

11
packages/auth-fetch/.gitignore vendored Normal file
View File

@@ -0,0 +1,11 @@
node_modules
.DS_Store
.gcloud/
dist/
volume
scrypted.db
out
scrypted.db.bak
.exit
.update
.venv

580
packages/auth-fetch/package-lock.json generated Normal file
View File

@@ -0,0 +1,580 @@
{
"name": "@scrypted/auth-fetch",
"version": "1.0.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "@scrypted/auth-fetch",
"version": "1.0.0",
"license": "ISC",
"dependencies": {
"follow-redirects": "^1.15.4",
"http-auth-utils": "^5.0.1"
},
"devDependencies": {
"@types/node": "^20.9.4",
"rimraf": "^5.0.5",
"typescript": "^5.3.2"
}
},
"node_modules/@isaacs/cliui": {
"version": "8.0.2",
"resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz",
"integrity": "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==",
"dev": true,
"dependencies": {
"string-width": "^5.1.2",
"string-width-cjs": "npm:string-width@^4.2.0",
"strip-ansi": "^7.0.1",
"strip-ansi-cjs": "npm:strip-ansi@^6.0.1",
"wrap-ansi": "^8.1.0",
"wrap-ansi-cjs": "npm:wrap-ansi@^7.0.0"
},
"engines": {
"node": ">=12"
}
},
"node_modules/@pkgjs/parseargs": {
"version": "0.11.0",
"resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz",
"integrity": "sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==",
"dev": true,
"optional": true,
"engines": {
"node": ">=14"
}
},
"node_modules/@types/node": {
"version": "20.10.8",
"resolved": "https://registry.npmjs.org/@types/node/-/node-20.10.8.tgz",
"integrity": "sha512-f8nQs3cLxbAFc00vEU59yf9UyGUftkPaLGfvbVOIDdx2i1b8epBqj2aNGyP19fiyXWvlmZ7qC1XLjAzw/OKIeA==",
"dev": true,
"dependencies": {
"undici-types": "~5.26.4"
}
},
"node_modules/ansi-regex": {
"version": "6.0.1",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz",
"integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==",
"dev": true,
"engines": {
"node": ">=12"
},
"funding": {
"url": "https://github.com/chalk/ansi-regex?sponsor=1"
}
},
"node_modules/ansi-styles": {
"version": "6.2.1",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz",
"integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==",
"dev": true,
"engines": {
"node": ">=12"
},
"funding": {
"url": "https://github.com/chalk/ansi-styles?sponsor=1"
}
},
"node_modules/balanced-match": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz",
"integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==",
"dev": true
},
"node_modules/brace-expansion": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz",
"integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==",
"dev": true,
"dependencies": {
"balanced-match": "^1.0.0"
}
},
"node_modules/color-convert": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
"integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
"dev": true,
"dependencies": {
"color-name": "~1.1.4"
},
"engines": {
"node": ">=7.0.0"
}
},
"node_modules/color-name": {
"version": "1.1.4",
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
"dev": true
},
"node_modules/cross-spawn": {
"version": "7.0.3",
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz",
"integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==",
"dev": true,
"dependencies": {
"path-key": "^3.1.0",
"shebang-command": "^2.0.0",
"which": "^2.0.1"
},
"engines": {
"node": ">= 8"
}
},
"node_modules/eastasianwidth": {
"version": "0.2.0",
"resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz",
"integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==",
"dev": true
},
"node_modules/emoji-regex": {
"version": "9.2.2",
"resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz",
"integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==",
"dev": true
},
"node_modules/follow-redirects": {
"version": "1.15.4",
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.4.tgz",
"integrity": "sha512-Cr4D/5wlrb0z9dgERpUL3LrmPKVDsETIJhaCMeDfuFYcqa5bldGV6wBsAN6X/vxlXQtFBMrXdXxdL8CbDTGniw==",
"funding": [
{
"type": "individual",
"url": "https://github.com/sponsors/RubenVerborgh"
}
],
"engines": {
"node": ">=4.0"
},
"peerDependenciesMeta": {
"debug": {
"optional": true
}
}
},
"node_modules/foreground-child": {
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.1.1.tgz",
"integrity": "sha512-TMKDUnIte6bfb5nWv7V/caI169OHgvwjb7V4WkeUvbQQdjr5rWKqHFiKWb/fcOwB+CzBT+qbWjvj+DVwRskpIg==",
"dev": true,
"dependencies": {
"cross-spawn": "^7.0.0",
"signal-exit": "^4.0.1"
},
"engines": {
"node": ">=14"
},
"funding": {
"url": "https://github.com/sponsors/isaacs"
}
},
"node_modules/glob": {
"version": "10.3.10",
"resolved": "https://registry.npmjs.org/glob/-/glob-10.3.10.tgz",
"integrity": "sha512-fa46+tv1Ak0UPK1TOy/pZrIybNNt4HCv7SDzwyfiOZkvZLEbjsZkJBPtDHVshZjbecAoAGSC20MjLDG/qr679g==",
"dev": true,
"dependencies": {
"foreground-child": "^3.1.0",
"jackspeak": "^2.3.5",
"minimatch": "^9.0.1",
"minipass": "^5.0.0 || ^6.0.2 || ^7.0.0",
"path-scurry": "^1.10.1"
},
"bin": {
"glob": "dist/esm/bin.mjs"
},
"engines": {
"node": ">=16 || 14 >=14.17"
},
"funding": {
"url": "https://github.com/sponsors/isaacs"
}
},
"node_modules/http-auth-utils": {
"version": "5.0.1",
"resolved": "https://registry.npmjs.org/http-auth-utils/-/http-auth-utils-5.0.1.tgz",
"integrity": "sha512-YPiLVYdwpBEWB85iWYg7V/ZW3mBfPLCTFQWEiPAA5CKXHJOAPbnJ0xDHLiE6KbPRvrYCwLuWqTG0fLfXVjMUcQ==",
"dependencies": {
"yerror": "^8.0.0"
},
"engines": {
"node": ">=18.16.0"
}
},
"node_modules/is-fullwidth-code-point": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz",
"integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==",
"dev": true,
"engines": {
"node": ">=8"
}
},
"node_modules/isexe": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz",
"integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==",
"dev": true
},
"node_modules/jackspeak": {
"version": "2.3.6",
"resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-2.3.6.tgz",
"integrity": "sha512-N3yCS/NegsOBokc8GAdM8UcmfsKiSS8cipheD/nivzr700H+nsMOxJjQnvwOcRYVuFkdH0wGUvW2WbXGmrZGbQ==",
"dev": true,
"dependencies": {
"@isaacs/cliui": "^8.0.2"
},
"engines": {
"node": ">=14"
},
"funding": {
"url": "https://github.com/sponsors/isaacs"
},
"optionalDependencies": {
"@pkgjs/parseargs": "^0.11.0"
}
},
"node_modules/lru-cache": {
"version": "10.1.0",
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.1.0.tgz",
"integrity": "sha512-/1clY/ui8CzjKFyjdvwPWJUYKiFVXG2I2cY0ssG7h4+hwk+XOIX7ZSG9Q7TW8TW3Kp3BUSqgFWBLgL4PJ+Blag==",
"dev": true,
"engines": {
"node": "14 || >=16.14"
}
},
"node_modules/minimatch": {
"version": "9.0.3",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz",
"integrity": "sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==",
"dev": true,
"dependencies": {
"brace-expansion": "^2.0.1"
},
"engines": {
"node": ">=16 || 14 >=14.17"
},
"funding": {
"url": "https://github.com/sponsors/isaacs"
}
},
"node_modules/minipass": {
"version": "7.0.4",
"resolved": "https://registry.npmjs.org/minipass/-/minipass-7.0.4.tgz",
"integrity": "sha512-jYofLM5Dam9279rdkWzqHozUo4ybjdZmCsDHePy5V/PbBcVMiSZR97gmAy45aqi8CK1lG2ECd356FU86avfwUQ==",
"dev": true,
"engines": {
"node": ">=16 || 14 >=14.17"
}
},
"node_modules/path-key": {
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz",
"integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==",
"dev": true,
"engines": {
"node": ">=8"
}
},
"node_modules/path-scurry": {
"version": "1.10.1",
"resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.10.1.tgz",
"integrity": "sha512-MkhCqzzBEpPvxxQ71Md0b1Kk51W01lrYvlMzSUaIzNsODdd7mqhiimSZlr+VegAz5Z6Vzt9Xg2ttE//XBhH3EQ==",
"dev": true,
"dependencies": {
"lru-cache": "^9.1.1 || ^10.0.0",
"minipass": "^5.0.0 || ^6.0.2 || ^7.0.0"
},
"engines": {
"node": ">=16 || 14 >=14.17"
},
"funding": {
"url": "https://github.com/sponsors/isaacs"
}
},
"node_modules/rimraf": {
"version": "5.0.5",
"resolved": "https://registry.npmjs.org/rimraf/-/rimraf-5.0.5.tgz",
"integrity": "sha512-CqDakW+hMe/Bz202FPEymy68P+G50RfMQK+Qo5YUqc9SPipvbGjCGKd0RSKEelbsfQuw3g5NZDSrlZZAJurH1A==",
"dev": true,
"dependencies": {
"glob": "^10.3.7"
},
"bin": {
"rimraf": "dist/esm/bin.mjs"
},
"engines": {
"node": ">=14"
},
"funding": {
"url": "https://github.com/sponsors/isaacs"
}
},
"node_modules/shebang-command": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz",
"integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==",
"dev": true,
"dependencies": {
"shebang-regex": "^3.0.0"
},
"engines": {
"node": ">=8"
}
},
"node_modules/shebang-regex": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz",
"integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==",
"dev": true,
"engines": {
"node": ">=8"
}
},
"node_modules/signal-exit": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz",
"integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==",
"dev": true,
"engines": {
"node": ">=14"
},
"funding": {
"url": "https://github.com/sponsors/isaacs"
}
},
"node_modules/string-width": {
"version": "5.1.2",
"resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz",
"integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==",
"dev": true,
"dependencies": {
"eastasianwidth": "^0.2.0",
"emoji-regex": "^9.2.2",
"strip-ansi": "^7.0.1"
},
"engines": {
"node": ">=12"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/string-width-cjs": {
"name": "string-width",
"version": "4.2.3",
"resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz",
"integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==",
"dev": true,
"dependencies": {
"emoji-regex": "^8.0.0",
"is-fullwidth-code-point": "^3.0.0",
"strip-ansi": "^6.0.1"
},
"engines": {
"node": ">=8"
}
},
"node_modules/string-width-cjs/node_modules/ansi-regex": {
"version": "5.0.1",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz",
"integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==",
"dev": true,
"engines": {
"node": ">=8"
}
},
"node_modules/string-width-cjs/node_modules/emoji-regex": {
"version": "8.0.0",
"resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz",
"integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==",
"dev": true
},
"node_modules/string-width-cjs/node_modules/strip-ansi": {
"version": "6.0.1",
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz",
"integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==",
"dev": true,
"dependencies": {
"ansi-regex": "^5.0.1"
},
"engines": {
"node": ">=8"
}
},
"node_modules/strip-ansi": {
"version": "7.1.0",
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz",
"integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==",
"dev": true,
"dependencies": {
"ansi-regex": "^6.0.1"
},
"engines": {
"node": ">=12"
},
"funding": {
"url": "https://github.com/chalk/strip-ansi?sponsor=1"
}
},
"node_modules/strip-ansi-cjs": {
"name": "strip-ansi",
"version": "6.0.1",
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz",
"integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==",
"dev": true,
"dependencies": {
"ansi-regex": "^5.0.1"
},
"engines": {
"node": ">=8"
}
},
"node_modules/strip-ansi-cjs/node_modules/ansi-regex": {
"version": "5.0.1",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz",
"integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==",
"dev": true,
"engines": {
"node": ">=8"
}
},
"node_modules/typescript": {
"version": "5.3.3",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.3.3.tgz",
"integrity": "sha512-pXWcraxM0uxAS+tN0AG/BF2TyqmHO014Z070UsJ+pFvYuRSq8KH8DmWpnbXe0pEPDHXZV3FcAbJkijJ5oNEnWw==",
"dev": true,
"bin": {
"tsc": "bin/tsc",
"tsserver": "bin/tsserver"
},
"engines": {
"node": ">=14.17"
}
},
"node_modules/undici-types": {
"version": "5.26.5",
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz",
"integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==",
"dev": true
},
"node_modules/which": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz",
"integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==",
"dev": true,
"dependencies": {
"isexe": "^2.0.0"
},
"bin": {
"node-which": "bin/node-which"
},
"engines": {
"node": ">= 8"
}
},
"node_modules/wrap-ansi": {
"version": "8.1.0",
"resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz",
"integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==",
"dev": true,
"dependencies": {
"ansi-styles": "^6.1.0",
"string-width": "^5.0.1",
"strip-ansi": "^7.0.1"
},
"engines": {
"node": ">=12"
},
"funding": {
"url": "https://github.com/chalk/wrap-ansi?sponsor=1"
}
},
"node_modules/wrap-ansi-cjs": {
"name": "wrap-ansi",
"version": "7.0.0",
"resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz",
"integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==",
"dev": true,
"dependencies": {
"ansi-styles": "^4.0.0",
"string-width": "^4.1.0",
"strip-ansi": "^6.0.0"
},
"engines": {
"node": ">=10"
},
"funding": {
"url": "https://github.com/chalk/wrap-ansi?sponsor=1"
}
},
"node_modules/wrap-ansi-cjs/node_modules/ansi-regex": {
"version": "5.0.1",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz",
"integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==",
"dev": true,
"engines": {
"node": ">=8"
}
},
"node_modules/wrap-ansi-cjs/node_modules/ansi-styles": {
"version": "4.3.0",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
"integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
"dev": true,
"dependencies": {
"color-convert": "^2.0.1"
},
"engines": {
"node": ">=8"
},
"funding": {
"url": "https://github.com/chalk/ansi-styles?sponsor=1"
}
},
"node_modules/wrap-ansi-cjs/node_modules/emoji-regex": {
"version": "8.0.0",
"resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz",
"integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==",
"dev": true
},
"node_modules/wrap-ansi-cjs/node_modules/string-width": {
"version": "4.2.3",
"resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz",
"integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==",
"dev": true,
"dependencies": {
"emoji-regex": "^8.0.0",
"is-fullwidth-code-point": "^3.0.0",
"strip-ansi": "^6.0.1"
},
"engines": {
"node": ">=8"
}
},
"node_modules/wrap-ansi-cjs/node_modules/strip-ansi": {
"version": "6.0.1",
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz",
"integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==",
"dev": true,
"dependencies": {
"ansi-regex": "^5.0.1"
},
"engines": {
"node": ">=8"
}
},
"node_modules/yerror": {
"version": "8.0.0",
"resolved": "https://registry.npmjs.org/yerror/-/yerror-8.0.0.tgz",
"integrity": "sha512-FemWD5/UqNm8ffj8oZIbjWXIF2KE0mZssggYpdaQkWDDgXBQ/35PNIxEuz6/YLn9o0kOxDBNJe8x8k9ljD7k/g==",
"engines": {
"node": ">=18.16.0"
}
}
}
}

View File

@@ -0,0 +1,23 @@
{
"name": "@scrypted/auth-fetch",
"version": "1.0.0",
"description": "",
"main": "dist/index.js",
"scripts": {
"prebuild": "rimraf dist",
"build": "tsc --outDir dist",
"prepublishOnly": "npm run build",
"test": "echo \"Error: no test specified\" && exit 1"
},
"devDependencies": {
"@types/node": "^20.9.4",
"rimraf": "^5.0.5",
"typescript": "^5.3.2"
},
"dependencies": {
"follow-redirects": "^1.15.4",
"http-auth-utils": "^5.0.1"
},
"author": "",
"license": "ISC"
}

View File

@@ -0,0 +1,135 @@
import { HttpFetchOptions, HttpFetchResponseType, checkStatus, createHeadersArray, fetcher, getFetchMethod, hasHeader, setDefaultHttpFetchAccept, setHeader } from '../../../server/src/fetch';
export interface AuthFetchCredentialState {
username: string;
password: string;
}
export interface AuthFetchOptions {
credential?: AuthFetchCredentialState;
}
async function getAuth(options: AuthFetchOptions, url: string | URL, method: string) {
if (!options.credential)
return;
const { BASIC, DIGEST, parseWWWAuthenticateHeader } = await import('http-auth-utils');
const credential = options.credential as AuthFetchCredentialState & {
count?: number;
digest?: ReturnType<typeof parseWWWAuthenticateHeader<typeof DIGEST>>;
basic?: ReturnType<typeof parseWWWAuthenticateHeader<typeof BASIC>>;
};
const { digest, basic } = credential;
if (digest) {
credential.count ||= 0;
++credential.count;
const nc = ('00000000' + credential.count).slice(-8);
const cnonce = [...Array(24)].map(() => Math.floor(Math.random() * 16).toString(16)).join('');
const uri = new URL(url).pathname;
const { DIGEST, buildAuthorizationHeader } = await import('http-auth-utils');
const response = DIGEST.computeHash({
username: options.credential.username,
password: options.credential.password,
method,
uri,
nc,
cnonce,
algorithm: 'MD5',
qop: digest.data.qop!,
...digest.data,
});
const header = buildAuthorizationHeader(DIGEST, {
username: options.credential.username,
uri,
nc,
cnonce,
algorithm: digest.data.algorithm!,
qop: digest.data.qop!,
response,
...digest.data,
});
return header;
}
else if (basic) {
const { BASIC, buildAuthorizationHeader } = await import('http-auth-utils');
const header = buildAuthorizationHeader(BASIC, {
username: options.credential.username,
password: options.credential.password,
});
return header;
}
}
export function createAuthFetch<B, M>(
h: fetcher<B, M>,
parser: (body: M, responseType: HttpFetchResponseType | undefined) => Promise<any>
) {
const authHttpFetch = async <T extends HttpFetchOptions<B>>(options: T & AuthFetchOptions): ReturnType<typeof h<T>> => {
const method = getFetchMethod(options);
const headers = createHeadersArray(options.headers);
options.headers = headers;
setDefaultHttpFetchAccept(headers, options.responseType);
const initialHeader = await getAuth(options, options.url, method);
// try to provide an authorization if a session exists, but don't override Authorization if provided already.
// 401 will trigger a proper auth.
if (initialHeader && !hasHeader(headers, 'Authorization'))
setHeader(headers, 'Authorization', initialHeader);
const initialResponse = await h({
...options,
ignoreStatusCode: true,
responseType: 'readable',
});
if (initialResponse.statusCode !== 401 || !options.credential) {
if (!options?.ignoreStatusCode)
checkStatus(initialResponse.statusCode);
return {
...initialResponse,
body: await parser(initialResponse.body, options.responseType),
};
}
let authenticateHeaders: string | string[] | null = initialResponse.headers.get('www-authenticate');
if (!authenticateHeaders)
throw new Error('Did not find WWW-Authenticate header.');
if (typeof authenticateHeaders === 'string')
authenticateHeaders = [authenticateHeaders];
const { BASIC, DIGEST, parseWWWAuthenticateHeader } = await import('http-auth-utils');
const parsedHeaders = authenticateHeaders.map(h => parseWWWAuthenticateHeader(h));
const digest = parsedHeaders.find(p => p.type === 'Digest') as ReturnType<typeof parseWWWAuthenticateHeader<typeof DIGEST>>;
const basic = parsedHeaders.find(p => p.type === 'Basic') as ReturnType<typeof parseWWWAuthenticateHeader<typeof BASIC>>;
const credential = options.credential as AuthFetchCredentialState & {
count?: number;
digest?: ReturnType<typeof parseWWWAuthenticateHeader<typeof DIGEST>>;
basic?: ReturnType<typeof parseWWWAuthenticateHeader<typeof BASIC>>;
};
credential.digest = digest;
credential.basic = basic;
if (!digest && !basic)
throw new Error(`Unknown WWW-Authenticate type: ${parsedHeaders[0]?.type}`);
const header = await getAuth(options, options.url, method);
if (header)
setHeader(headers, 'Authorization', header);
return h(options);
}
return authHttpFetch;
}

View File

@@ -0,0 +1,19 @@
import { createAuthFetch } from "./auth-fetch";
import { httpFetch, httpFetchParseIncomingMessage } from '../../../server/src/fetch/http-fetch';
import type { Readable } from "stream";
import type { IncomingMessage } from "http";
import { domFetch, domFetchParseIncomingMessage } from "../../../server/src/fetch";
function init() {
try {
require('net');
require('events');
return createAuthFetch<Readable, IncomingMessage>(httpFetch, httpFetchParseIncomingMessage);
}
catch (e) {
}
return createAuthFetch<BodyInit, Response>(domFetch, domFetchParseIncomingMessage);
}
export const authFetch = init();

View File

@@ -0,0 +1,17 @@
{
"compilerOptions": {
"module": "commonjs",
"target": "esnext",
"noImplicitAny": true,
"outDir": "./dist",
"esModuleInterop": true,
"sourceMap": true,
"inlineSources": true,
"declaration": true,
"resolveJsonModule": true,
"strict": true
},
"include": [
"src/**/*"
],
}

View File

@@ -21,9 +21,7 @@
],
"preLaunchTask": "npm: build",
"args": [
"ffplay",
"Baby Camera@192.168.2.109",
"getVideoStream",
"login",
],
"sourceMaps": true,
"resolveSourceMapLocations": [

View File

@@ -1,37 +1,31 @@
{
"name": "scrypted",
"version": "1.0.69",
"version": "1.3.16",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "scrypted",
"version": "1.0.69",
"version": "1.3.16",
"license": "ISC",
"dependencies": {
"@scrypted/client": "^1.1.43",
"@scrypted/types": "^0.2.66",
"adm-zip": "^0.5.10",
"axios": "^0.21.4",
"engine.io-client": "^5.2.0",
"ip": "^1.1.8",
"mkdirp": "^1.0.4",
"@scrypted/client": "^1.3.3",
"@scrypted/types": "^0.3.30",
"engine.io-client": "^6.5.3",
"readline-sync": "^1.4.10",
"rimraf": "^3.0.2",
"semver": "^7.3.8",
"tslib": "^2.5.0"
"semver": "^7.5.4",
"tslib": "^2.6.2"
},
"bin": {
"scrypted": "dist/main.js"
"scrypted": "dist/packages/cli/src/main.js"
},
"devDependencies": {
"@types/mkdirp": "^1.0.2",
"@types/node": "^18.14.2",
"@types/readline-sync": "^1.4.4",
"@types/rimraf": "^3.0.2",
"@types/semver": "^7.3.13",
"@types/node": "^20.9.4",
"@types/readline-sync": "^1.4.8",
"@types/semver": "^7.5.6",
"rimraf": "^5.0.5",
"ts-node": "^10.9.1",
"typescript": "^4.9.5"
"typescript": "^5.3.2"
}
},
"node_modules/@cspotcode/source-map-support": {
@@ -46,6 +40,22 @@
"node": ">=12"
}
},
"node_modules/@isaacs/cliui": {
"version": "8.0.2",
"resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz",
"integrity": "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==",
"dependencies": {
"string-width": "^5.1.2",
"string-width-cjs": "npm:string-width@^4.2.0",
"strip-ansi": "^7.0.1",
"strip-ansi-cjs": "npm:strip-ansi@^6.0.1",
"wrap-ansi": "^8.1.0",
"wrap-ansi-cjs": "npm:wrap-ansi@^7.0.0"
},
"engines": {
"node": ">=12"
}
},
"node_modules/@jridgewell/resolve-uri": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.0.tgz",
@@ -71,69 +81,31 @@
"@jridgewell/sourcemap-codec": "^1.4.10"
}
},
"node_modules/@pkgjs/parseargs": {
"version": "0.11.0",
"resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz",
"integrity": "sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==",
"optional": true,
"engines": {
"node": ">=14"
}
},
"node_modules/@scrypted/client": {
"version": "1.1.43",
"resolved": "https://registry.npmjs.org/@scrypted/client/-/client-1.1.43.tgz",
"integrity": "sha512-qpeGdqFga/Fx51MoF3E0iBPCjE/SDEIVdGh8Ws5dqw38bxUJD264c9NsNyCguLKyYguErKTAWnQkzqhO0bUbaA==",
"version": "1.3.3",
"resolved": "https://registry.npmjs.org/@scrypted/client/-/client-1.3.3.tgz",
"integrity": "sha512-Wuy7x02TCRy1buaDNX8NOIaL1j4ZXu4dqTTJsKHlPe3+umsBvpwbylD+YyyU8ghQJC6a40Bs5UMsvnCvNa/1fg==",
"dependencies": {
"@scrypted/types": "^0.2.66",
"axios": "^0.25.0",
"engine.io-client": "^6.4.0",
"rimraf": "^3.0.2"
}
},
"node_modules/@scrypted/client/node_modules/axios": {
"version": "0.25.0",
"resolved": "https://registry.npmjs.org/axios/-/axios-0.25.0.tgz",
"integrity": "sha512-cD8FOb0tRH3uuEe6+evtAbgJtfxr7ly3fQjYcMcuPlgkwVS9xboaVIpcDV+cYQe+yGykgwZCs1pzjntcGa6l5g==",
"dependencies": {
"follow-redirects": "^1.14.7"
}
},
"node_modules/@scrypted/client/node_modules/engine.io-client": {
"version": "6.4.0",
"resolved": "https://registry.npmjs.org/engine.io-client/-/engine.io-client-6.4.0.tgz",
"integrity": "sha512-GyKPDyoEha+XZ7iEqam49vz6auPnNJ9ZBfy89f+rMMas8AuiMWOZ9PVzu8xb9ZC6rafUqiGHSCfu22ih66E+1g==",
"dependencies": {
"@socket.io/component-emitter": "~3.1.0",
"debug": "~4.3.1",
"engine.io-parser": "~5.0.3",
"ws": "~8.11.0",
"xmlhttprequest-ssl": "~2.0.0"
}
},
"node_modules/@scrypted/client/node_modules/engine.io-parser": {
"version": "5.0.6",
"resolved": "https://registry.npmjs.org/engine.io-parser/-/engine.io-parser-5.0.6.tgz",
"integrity": "sha512-tjuoZDMAdEhVnSFleYPCtdL2GXwVTGtNjoeJd9IhIG3C1xs9uwxqRNEu5WpnDZCaozwVlK/nuQhpodhXSIMaxw==",
"engines": {
"node": ">=10.0.0"
}
},
"node_modules/@scrypted/client/node_modules/ws": {
"version": "8.11.0",
"resolved": "https://registry.npmjs.org/ws/-/ws-8.11.0.tgz",
"integrity": "sha512-HPG3wQd9sNQoT9xHyNCXoDUa+Xw/VevmY9FoHyQ+g+rrMn4j6FB4np7Z0OhdTgjx6MgQLK7jwSy1YecU1+4Asg==",
"engines": {
"node": ">=10.0.0"
},
"peerDependencies": {
"bufferutil": "^4.0.1",
"utf-8-validate": "^5.0.2"
},
"peerDependenciesMeta": {
"bufferutil": {
"optional": true
},
"utf-8-validate": {
"optional": true
}
"@scrypted/types": "^0.3.4",
"engine.io-client": "^6.5.3",
"follow-redirects": "^1.15.4",
"rimraf": "^5.0.5"
}
},
"node_modules/@scrypted/types": {
"version": "0.2.66",
"resolved": "https://registry.npmjs.org/@scrypted/types/-/types-0.2.66.tgz",
"integrity": "sha512-AL2iD7OmpqZlQMlpZKUBHpzL7H1IHhwKOi9uhRbVwG7EIDwenTspqtziH2Hyu0+XeCLf+gN69uQB6Qlz+QPf9A=="
"version": "0.3.30",
"resolved": "https://registry.npmjs.org/@scrypted/types/-/types-0.3.30.tgz",
"integrity": "sha512-1k+JVSR6WSNmE/5mLdqfrTmV3uRbvZp0OwKb8ikNi39ysBuC000tQGcEdXZqhYqRgWdhDTWtxXe9XsYoAZGKmA==",
"license": "ISC"
},
"node_modules/@socket.io/component-emitter": {
"version": "3.1.0",
@@ -164,57 +136,25 @@
"integrity": "sha512-yOlFc+7UtL/89t2ZhjPvvB/DeAr3r+Dq58IgzsFkOAvVC6NMJXmCGjbptdXdR9qsX7pKcTL+s87FtYREi2dEEQ==",
"dev": true
},
"node_modules/@types/glob": {
"version": "8.1.0",
"resolved": "https://registry.npmjs.org/@types/glob/-/glob-8.1.0.tgz",
"integrity": "sha512-IO+MJPVhoqz+28h1qLAcBEH2+xHMK6MTyHJc7MTnnYb6wsoLR29POVGJ7LycmVXIqyy/4/2ShP5sUwTXuOwb/w==",
"dev": true,
"dependencies": {
"@types/minimatch": "^5.1.2",
"@types/node": "*"
}
},
"node_modules/@types/minimatch": {
"version": "5.1.2",
"resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-5.1.2.tgz",
"integrity": "sha512-K0VQKziLUWkVKiRVrx4a40iPaxTUefQmjtkQofBkYRcoaaL/8rhwDWww9qWbrgicNOgnpIsMxyNIUM4+n6dUIA==",
"dev": true
},
"node_modules/@types/mkdirp": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/@types/mkdirp/-/mkdirp-1.0.2.tgz",
"integrity": "sha512-o0K1tSO0Dx5X6xlU5F1D6625FawhC3dU3iqr25lluNv/+/QIVH8RLNEiVokgIZo+mz+87w/3Mkg/VvQS+J51fQ==",
"dev": true,
"dependencies": {
"@types/node": "*"
}
},
"node_modules/@types/node": {
"version": "18.14.2",
"resolved": "https://registry.npmjs.org/@types/node/-/node-18.14.2.tgz",
"integrity": "sha512-1uEQxww3DaghA0RxqHx0O0ppVlo43pJhepY51OxuQIKHpjbnYLA7vcdwioNPzIqmC2u3I/dmylcqjlh0e7AyUA==",
"dev": true
"version": "20.9.4",
"resolved": "https://registry.npmjs.org/@types/node/-/node-20.9.4.tgz",
"integrity": "sha512-wmyg8HUhcn6ACjsn8oKYjkN/zUzQeNtMy44weTJSM6p4MMzEOuKbA3OjJ267uPCOW7Xex9dyrNTful8XTQYoDA==",
"dev": true,
"dependencies": {
"undici-types": "~5.26.4"
}
},
"node_modules/@types/readline-sync": {
"version": "1.4.4",
"resolved": "https://registry.npmjs.org/@types/readline-sync/-/readline-sync-1.4.4.tgz",
"integrity": "sha512-cFjVIoiamX7U6zkO2VPvXyTxbFDdiRo902IarJuPVxBhpDnXhwSaVE86ip+SCuyWBbEioKCkT4C88RNTxBM1Dw==",
"version": "1.4.8",
"resolved": "https://registry.npmjs.org/@types/readline-sync/-/readline-sync-1.4.8.tgz",
"integrity": "sha512-BL7xOf0yKLA6baAX6MMOnYkoflUyj/c7y3pqMRfU0va7XlwHAOTOIo4x55P/qLfMsuaYdJJKubToLqRVmRtRZA==",
"dev": true
},
"node_modules/@types/rimraf": {
"version": "3.0.2",
"resolved": "https://registry.npmjs.org/@types/rimraf/-/rimraf-3.0.2.tgz",
"integrity": "sha512-F3OznnSLAUxFrCEu/L5PY8+ny8DtcFRjx7fZZ9bycvXRi3KPTRS9HOitGZwvPg0juRhXFWIeKX58cnX5YqLohQ==",
"dev": true,
"dependencies": {
"@types/glob": "*",
"@types/node": "*"
}
},
"node_modules/@types/semver": {
"version": "7.3.13",
"resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.3.13.tgz",
"integrity": "sha512-21cFJr9z3g5dW8B0CVI9g2O9beqaThGQ6ZFBqHfwhzLDKUxaqTIy3vnfah/UPkfOiF2pLq+tGz+W8RyCskuslw==",
"version": "7.5.6",
"resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.5.6.tgz",
"integrity": "sha512-dn1l8LaMea/IjDoHNd9J52uBbInB796CDffS6VdIxvqYCPSG0V0DzHp76GpaWnlhg88uYyPbXCDIowa86ybd5A==",
"dev": true
},
"node_modules/acorn": {
@@ -238,12 +178,26 @@
"node": ">=0.4.0"
}
},
"node_modules/adm-zip": {
"version": "0.5.10",
"resolved": "https://registry.npmjs.org/adm-zip/-/adm-zip-0.5.10.tgz",
"integrity": "sha512-x0HvcHqVJNTPk/Bw8JbLWlWoo6Wwnsug0fnYYro1HBrjxZ3G7/AZk7Ahv8JwDe1uIcz8eBqvu86FuF1POiG7vQ==",
"node_modules/ansi-regex": {
"version": "6.0.1",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz",
"integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==",
"engines": {
"node": ">=6.0"
"node": ">=12"
},
"funding": {
"url": "https://github.com/chalk/ansi-regex?sponsor=1"
}
},
"node_modules/ansi-styles": {
"version": "6.2.1",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz",
"integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==",
"engines": {
"node": ">=12"
},
"funding": {
"url": "https://github.com/chalk/ansi-styles?sponsor=1"
}
},
"node_modules/arg": {
@@ -252,45 +206,34 @@
"integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==",
"dev": true
},
"node_modules/axios": {
"version": "0.21.4",
"resolved": "https://registry.npmjs.org/axios/-/axios-0.21.4.tgz",
"integrity": "sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg==",
"dependencies": {
"follow-redirects": "^1.14.0"
}
},
"node_modules/balanced-match": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz",
"integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw=="
},
"node_modules/base64-arraybuffer": {
"version": "0.1.4",
"resolved": "https://registry.npmjs.org/base64-arraybuffer/-/base64-arraybuffer-0.1.4.tgz",
"integrity": "sha512-a1eIFi4R9ySrbiMuyTGx5e92uRH5tQY6kArNcFaKBUleIoLjdjBg7Zxm3Mqm3Kmkf27HLR/1fnxX9q8GQ7Iavg==",
"engines": {
"node": ">= 0.6.0"
}
},
"node_modules/brace-expansion": {
"version": "1.1.11",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
"integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz",
"integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==",
"dependencies": {
"balanced-match": "^1.0.0",
"concat-map": "0.0.1"
"balanced-match": "^1.0.0"
}
},
"node_modules/component-emitter": {
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz",
"integrity": "sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg=="
"node_modules/color-convert": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
"integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
"dependencies": {
"color-name": "~1.1.4"
},
"engines": {
"node": ">=7.0.0"
}
},
"node_modules/concat-map": {
"version": "0.0.1",
"resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
"integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg=="
"node_modules/color-name": {
"version": "1.1.4",
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA=="
},
"node_modules/create-require": {
"version": "1.1.1",
@@ -298,6 +241,19 @@
"integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==",
"dev": true
},
"node_modules/cross-spawn": {
"version": "7.0.3",
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz",
"integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==",
"dependencies": {
"path-key": "^3.1.0",
"shebang-command": "^2.0.0",
"which": "^2.0.1"
},
"engines": {
"node": ">= 8"
}
},
"node_modules/debug": {
"version": "4.3.4",
"resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz",
@@ -323,38 +279,40 @@
"node": ">=0.3.1"
}
},
"node_modules/eastasianwidth": {
"version": "0.2.0",
"resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz",
"integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA=="
},
"node_modules/emoji-regex": {
"version": "9.2.2",
"resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz",
"integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg=="
},
"node_modules/engine.io-client": {
"version": "5.2.0",
"resolved": "https://registry.npmjs.org/engine.io-client/-/engine.io-client-5.2.0.tgz",
"integrity": "sha512-BcIBXGBkT7wKecwnfrSV79G2X5lSUSgeAGgoo60plXf8UsQEvCQww/KMwXSMhVjb98fFYNq20CC5eo8IOAPqsg==",
"version": "6.5.3",
"resolved": "https://registry.npmjs.org/engine.io-client/-/engine.io-client-6.5.3.tgz",
"integrity": "sha512-9Z0qLB0NIisTRt1DZ/8U2k12RJn8yls/nXMZLn+/N8hANT3TcYjKFKcwbw5zFQiN4NTde3TSY9zb79e1ij6j9Q==",
"dependencies": {
"base64-arraybuffer": "0.1.4",
"component-emitter": "~1.3.0",
"@socket.io/component-emitter": "~3.1.0",
"debug": "~4.3.1",
"engine.io-parser": "~4.0.1",
"has-cors": "1.1.0",
"parseqs": "0.0.6",
"parseuri": "0.0.6",
"ws": "~7.4.2",
"xmlhttprequest-ssl": "~2.0.0",
"yeast": "0.1.2"
"engine.io-parser": "~5.2.1",
"ws": "~8.11.0",
"xmlhttprequest-ssl": "~2.0.0"
}
},
"node_modules/engine.io-parser": {
"version": "4.0.3",
"resolved": "https://registry.npmjs.org/engine.io-parser/-/engine.io-parser-4.0.3.tgz",
"integrity": "sha512-xEAAY0msNnESNPc00e19y5heTPX4y/TJ36gr8t1voOaNmTojP9b3oK3BbJLFufW2XFPQaaijpFewm2g2Um3uqA==",
"dependencies": {
"base64-arraybuffer": "0.1.4"
},
"version": "5.2.1",
"resolved": "https://registry.npmjs.org/engine.io-parser/-/engine.io-parser-5.2.1.tgz",
"integrity": "sha512-9JktcM3u18nU9N2Lz3bWeBgxVgOKpw7yhRaoxQA3FUDZzzw+9WlA6p4G4u0RixNkg14fH7EfEc/RhpurtiROTQ==",
"engines": {
"node": ">=8.0.0"
"node": ">=10.0.0"
}
},
"node_modules/follow-redirects": {
"version": "1.15.2",
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.2.tgz",
"integrity": "sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA==",
"version": "1.15.4",
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.4.tgz",
"integrity": "sha512-Cr4D/5wlrb0z9dgERpUL3LrmPKVDsETIJhaCMeDfuFYcqa5bldGV6wBsAN6X/vxlXQtFBMrXdXxdL8CbDTGniw==",
"funding": [
{
"type": "individual",
@@ -370,53 +328,71 @@
}
}
},
"node_modules/fs.realpath": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
"integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw=="
},
"node_modules/glob": {
"version": "7.2.3",
"resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz",
"integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==",
"node_modules/foreground-child": {
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.1.1.tgz",
"integrity": "sha512-TMKDUnIte6bfb5nWv7V/caI169OHgvwjb7V4WkeUvbQQdjr5rWKqHFiKWb/fcOwB+CzBT+qbWjvj+DVwRskpIg==",
"dependencies": {
"fs.realpath": "^1.0.0",
"inflight": "^1.0.4",
"inherits": "2",
"minimatch": "^3.1.1",
"once": "^1.3.0",
"path-is-absolute": "^1.0.0"
"cross-spawn": "^7.0.0",
"signal-exit": "^4.0.1"
},
"engines": {
"node": "*"
"node": ">=14"
},
"funding": {
"url": "https://github.com/sponsors/isaacs"
}
},
"node_modules/has-cors": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/has-cors/-/has-cors-1.1.0.tgz",
"integrity": "sha512-g5VNKdkFuUuVCP9gYfDJHjK2nqdQJ7aDLTnycnc2+RvsOQbuLdF5pm7vuE5J76SEBIQjs4kQY/BWq74JUmjbXA=="
},
"node_modules/inflight": {
"version": "1.0.6",
"resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz",
"integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==",
"node_modules/glob": {
"version": "10.3.10",
"resolved": "https://registry.npmjs.org/glob/-/glob-10.3.10.tgz",
"integrity": "sha512-fa46+tv1Ak0UPK1TOy/pZrIybNNt4HCv7SDzwyfiOZkvZLEbjsZkJBPtDHVshZjbecAoAGSC20MjLDG/qr679g==",
"dependencies": {
"once": "^1.3.0",
"wrappy": "1"
"foreground-child": "^3.1.0",
"jackspeak": "^2.3.5",
"minimatch": "^9.0.1",
"minipass": "^5.0.0 || ^6.0.2 || ^7.0.0",
"path-scurry": "^1.10.1"
},
"bin": {
"glob": "dist/esm/bin.mjs"
},
"engines": {
"node": ">=16 || 14 >=14.17"
},
"funding": {
"url": "https://github.com/sponsors/isaacs"
}
},
"node_modules/inherits": {
"version": "2.0.4",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
"integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ=="
"node_modules/is-fullwidth-code-point": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz",
"integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==",
"engines": {
"node": ">=8"
}
},
"node_modules/ip": {
"version": "1.1.8",
"resolved": "https://registry.npmjs.org/ip/-/ip-1.1.8.tgz",
"integrity": "sha512-PuExPYUiu6qMBQb4l06ecm6T6ujzhmh+MeJcW9wa89PoAz5pvd4zPgN5WJV104mb6S2T1AwNIAaB70JNrLQWhg=="
"node_modules/isexe": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz",
"integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw=="
},
"node_modules/jackspeak": {
"version": "2.3.6",
"resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-2.3.6.tgz",
"integrity": "sha512-N3yCS/NegsOBokc8GAdM8UcmfsKiSS8cipheD/nivzr700H+nsMOxJjQnvwOcRYVuFkdH0wGUvW2WbXGmrZGbQ==",
"dependencies": {
"@isaacs/cliui": "^8.0.2"
},
"engines": {
"node": ">=14"
},
"funding": {
"url": "https://github.com/sponsors/isaacs"
},
"optionalDependencies": {
"@pkgjs/parseargs": "^0.11.0"
}
},
"node_modules/lru-cache": {
"version": "6.0.0",
@@ -436,25 +412,25 @@
"dev": true
},
"node_modules/minimatch": {
"version": "3.1.2",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz",
"integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==",
"version": "9.0.3",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz",
"integrity": "sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==",
"dependencies": {
"brace-expansion": "^1.1.7"
"brace-expansion": "^2.0.1"
},
"engines": {
"node": "*"
"node": ">=16 || 14 >=14.17"
},
"funding": {
"url": "https://github.com/sponsors/isaacs"
}
},
"node_modules/mkdirp": {
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz",
"integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==",
"bin": {
"mkdirp": "bin/cmd.js"
},
"node_modules/minipass": {
"version": "7.0.4",
"resolved": "https://registry.npmjs.org/minipass/-/minipass-7.0.4.tgz",
"integrity": "sha512-jYofLM5Dam9279rdkWzqHozUo4ybjdZmCsDHePy5V/PbBcVMiSZR97gmAy45aqi8CK1lG2ECd356FU86avfwUQ==",
"engines": {
"node": ">=10"
"node": ">=16 || 14 >=14.17"
}
},
"node_modules/ms": {
@@ -462,30 +438,35 @@
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
"integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w=="
},
"node_modules/once": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
"integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==",
"dependencies": {
"wrappy": "1"
"node_modules/path-key": {
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz",
"integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==",
"engines": {
"node": ">=8"
}
},
"node_modules/parseqs": {
"version": "0.0.6",
"resolved": "https://registry.npmjs.org/parseqs/-/parseqs-0.0.6.tgz",
"integrity": "sha512-jeAGzMDbfSHHA091hr0r31eYfTig+29g3GKKE/PPbEQ65X0lmMwlEoqmhzu0iztID5uJpZsFlUPDP8ThPL7M8w=="
},
"node_modules/parseuri": {
"version": "0.0.6",
"resolved": "https://registry.npmjs.org/parseuri/-/parseuri-0.0.6.tgz",
"integrity": "sha512-AUjen8sAkGgao7UyCX6Ahv0gIK2fABKmYjvP4xmy5JaKvcbTRueIqIPHLAfq30xJddqSE033IOMUSOMCcK3Sow=="
},
"node_modules/path-is-absolute": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
"integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==",
"node_modules/path-scurry": {
"version": "1.10.1",
"resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.10.1.tgz",
"integrity": "sha512-MkhCqzzBEpPvxxQ71Md0b1Kk51W01lrYvlMzSUaIzNsODdd7mqhiimSZlr+VegAz5Z6Vzt9Xg2ttE//XBhH3EQ==",
"dependencies": {
"lru-cache": "^9.1.1 || ^10.0.0",
"minipass": "^5.0.0 || ^6.0.2 || ^7.0.0"
},
"engines": {
"node": ">=0.10.0"
"node": ">=16 || 14 >=14.17"
},
"funding": {
"url": "https://github.com/sponsors/isaacs"
}
},
"node_modules/path-scurry/node_modules/lru-cache": {
"version": "10.0.3",
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.0.3.tgz",
"integrity": "sha512-B7gr+F6MkqB3uzINHXNctGieGsRTMwIBgxkp0yq/5BwcuDzD4A8wQpHQW6vDAm1uKSLQghmRdD9sKqf2vJ1cEg==",
"engines": {
"node": "14 || >=16.14"
}
},
"node_modules/readline-sync": {
@@ -497,23 +478,26 @@
}
},
"node_modules/rimraf": {
"version": "3.0.2",
"resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz",
"integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==",
"version": "5.0.5",
"resolved": "https://registry.npmjs.org/rimraf/-/rimraf-5.0.5.tgz",
"integrity": "sha512-CqDakW+hMe/Bz202FPEymy68P+G50RfMQK+Qo5YUqc9SPipvbGjCGKd0RSKEelbsfQuw3g5NZDSrlZZAJurH1A==",
"dependencies": {
"glob": "^7.1.3"
"glob": "^10.3.7"
},
"bin": {
"rimraf": "bin.js"
"rimraf": "dist/esm/bin.mjs"
},
"engines": {
"node": ">=14"
},
"funding": {
"url": "https://github.com/sponsors/isaacs"
}
},
"node_modules/semver": {
"version": "7.3.8",
"resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz",
"integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==",
"version": "7.5.4",
"resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz",
"integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==",
"dependencies": {
"lru-cache": "^6.0.0"
},
@@ -524,6 +508,124 @@
"node": ">=10"
}
},
"node_modules/shebang-command": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz",
"integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==",
"dependencies": {
"shebang-regex": "^3.0.0"
},
"engines": {
"node": ">=8"
}
},
"node_modules/shebang-regex": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz",
"integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==",
"engines": {
"node": ">=8"
}
},
"node_modules/signal-exit": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz",
"integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==",
"engines": {
"node": ">=14"
},
"funding": {
"url": "https://github.com/sponsors/isaacs"
}
},
"node_modules/string-width": {
"version": "5.1.2",
"resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz",
"integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==",
"dependencies": {
"eastasianwidth": "^0.2.0",
"emoji-regex": "^9.2.2",
"strip-ansi": "^7.0.1"
},
"engines": {
"node": ">=12"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/string-width-cjs": {
"name": "string-width",
"version": "4.2.3",
"resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz",
"integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==",
"dependencies": {
"emoji-regex": "^8.0.0",
"is-fullwidth-code-point": "^3.0.0",
"strip-ansi": "^6.0.1"
},
"engines": {
"node": ">=8"
}
},
"node_modules/string-width-cjs/node_modules/ansi-regex": {
"version": "5.0.1",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz",
"integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==",
"engines": {
"node": ">=8"
}
},
"node_modules/string-width-cjs/node_modules/emoji-regex": {
"version": "8.0.0",
"resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz",
"integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A=="
},
"node_modules/string-width-cjs/node_modules/strip-ansi": {
"version": "6.0.1",
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz",
"integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==",
"dependencies": {
"ansi-regex": "^5.0.1"
},
"engines": {
"node": ">=8"
}
},
"node_modules/strip-ansi": {
"version": "7.1.0",
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz",
"integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==",
"dependencies": {
"ansi-regex": "^6.0.1"
},
"engines": {
"node": ">=12"
},
"funding": {
"url": "https://github.com/chalk/strip-ansi?sponsor=1"
}
},
"node_modules/strip-ansi-cjs": {
"name": "strip-ansi",
"version": "6.0.1",
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz",
"integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==",
"dependencies": {
"ansi-regex": "^5.0.1"
},
"engines": {
"node": ">=8"
}
},
"node_modules/strip-ansi-cjs/node_modules/ansi-regex": {
"version": "5.0.1",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz",
"integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==",
"engines": {
"node": ">=8"
}
},
"node_modules/ts-node": {
"version": "10.9.1",
"resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.1.tgz",
@@ -568,40 +670,139 @@
}
},
"node_modules/tslib": {
"version": "2.5.0",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.5.0.tgz",
"integrity": "sha512-336iVw3rtn2BUK7ORdIAHTyxHGRIHVReokCR3XjbckJMK7ms8FysBfhLR8IXnAgy7T0PTPNBWKiH514FOW/WSg=="
"version": "2.6.2",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz",
"integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q=="
},
"node_modules/typescript": {
"version": "4.9.5",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz",
"integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==",
"version": "5.3.2",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.3.2.tgz",
"integrity": "sha512-6l+RyNy7oAHDfxC4FzSJcz9vnjTKxrLpDG5M2Vu4SHRVNg6xzqZp6LYSR9zjqQTu8DU/f5xwxUdADOkbrIX2gQ==",
"dev": true,
"bin": {
"tsc": "bin/tsc",
"tsserver": "bin/tsserver"
},
"engines": {
"node": ">=4.2.0"
"node": ">=14.17"
}
},
"node_modules/undici-types": {
"version": "5.26.5",
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz",
"integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==",
"dev": true
},
"node_modules/v8-compile-cache-lib": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz",
"integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==",
"dev": true
},
"node_modules/wrappy": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
"integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ=="
"node_modules/which": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz",
"integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==",
"dependencies": {
"isexe": "^2.0.0"
},
"bin": {
"node-which": "bin/node-which"
},
"engines": {
"node": ">= 8"
}
},
"node_modules/wrap-ansi": {
"version": "8.1.0",
"resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz",
"integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==",
"dependencies": {
"ansi-styles": "^6.1.0",
"string-width": "^5.0.1",
"strip-ansi": "^7.0.1"
},
"engines": {
"node": ">=12"
},
"funding": {
"url": "https://github.com/chalk/wrap-ansi?sponsor=1"
}
},
"node_modules/wrap-ansi-cjs": {
"name": "wrap-ansi",
"version": "7.0.0",
"resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz",
"integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==",
"dependencies": {
"ansi-styles": "^4.0.0",
"string-width": "^4.1.0",
"strip-ansi": "^6.0.0"
},
"engines": {
"node": ">=10"
},
"funding": {
"url": "https://github.com/chalk/wrap-ansi?sponsor=1"
}
},
"node_modules/wrap-ansi-cjs/node_modules/ansi-regex": {
"version": "5.0.1",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz",
"integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==",
"engines": {
"node": ">=8"
}
},
"node_modules/wrap-ansi-cjs/node_modules/ansi-styles": {
"version": "4.3.0",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
"integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
"dependencies": {
"color-convert": "^2.0.1"
},
"engines": {
"node": ">=8"
},
"funding": {
"url": "https://github.com/chalk/ansi-styles?sponsor=1"
}
},
"node_modules/wrap-ansi-cjs/node_modules/emoji-regex": {
"version": "8.0.0",
"resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz",
"integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A=="
},
"node_modules/wrap-ansi-cjs/node_modules/string-width": {
"version": "4.2.3",
"resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz",
"integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==",
"dependencies": {
"emoji-regex": "^8.0.0",
"is-fullwidth-code-point": "^3.0.0",
"strip-ansi": "^6.0.1"
},
"engines": {
"node": ">=8"
}
},
"node_modules/wrap-ansi-cjs/node_modules/strip-ansi": {
"version": "6.0.1",
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz",
"integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==",
"dependencies": {
"ansi-regex": "^5.0.1"
},
"engines": {
"node": ">=8"
}
},
"node_modules/ws": {
"version": "7.4.6",
"resolved": "https://registry.npmjs.org/ws/-/ws-7.4.6.tgz",
"integrity": "sha512-YmhHDO4MzaDLB+M9ym/mDA5z0naX8j7SIlT8f8z+I0VtzsRbekxEutHSme7NPS2qE8StCYQNUnfWdXta/Yu85A==",
"version": "8.11.0",
"resolved": "https://registry.npmjs.org/ws/-/ws-8.11.0.tgz",
"integrity": "sha512-HPG3wQd9sNQoT9xHyNCXoDUa+Xw/VevmY9FoHyQ+g+rrMn4j6FB4np7Z0OhdTgjx6MgQLK7jwSy1YecU1+4Asg==",
"engines": {
"node": ">=8.3.0"
"node": ">=10.0.0"
},
"peerDependencies": {
"bufferutil": "^4.0.1",
@@ -629,11 +830,6 @@
"resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz",
"integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A=="
},
"node_modules/yeast": {
"version": "0.1.2",
"resolved": "https://registry.npmjs.org/yeast/-/yeast-0.1.2.tgz",
"integrity": "sha512-8HFIh676uyGYP6wP13R/j6OJ/1HwJ46snpvzE7aHAN3Ryqh2yX6Xox2B4CUmTwwOIzlG3Bs7ocsP5dZH/R1Qbg=="
},
"node_modules/yn": {
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz",

View File

@@ -1,10 +1,10 @@
{
"name": "scrypted",
"version": "1.0.69",
"version": "1.3.16",
"description": "",
"main": "./dist/main.js",
"main": "./dist/packages/cli/src/main.js",
"bin": {
"scrypted": "./dist/main.js"
"scrypted": "./dist/packages/cli/src/main.js"
},
"scripts": {
"prebuild": "rimraf dist",
@@ -16,25 +16,19 @@
"author": "",
"license": "ISC",
"dependencies": {
"@scrypted/client": "^1.1.43",
"@scrypted/types": "^0.2.66",
"adm-zip": "^0.5.10",
"axios": "^0.21.4",
"engine.io-client": "^5.2.0",
"ip": "^1.1.8",
"mkdirp": "^1.0.4",
"@scrypted/client": "^1.3.3",
"@scrypted/types": "^0.3.30",
"engine.io-client": "^6.5.3",
"readline-sync": "^1.4.10",
"rimraf": "^3.0.2",
"semver": "^7.3.8",
"tslib": "^2.5.0"
"semver": "^7.5.4",
"tslib": "^2.6.2"
},
"devDependencies": {
"@types/mkdirp": "^1.0.2",
"@types/node": "^18.14.2",
"@types/readline-sync": "^1.4.4",
"@types/rimraf": "^3.0.2",
"@types/semver": "^7.3.13",
"@types/node": "^20.9.4",
"@types/readline-sync": "^1.4.8",
"@types/semver": "^7.5.6",
"rimraf": "^5.0.5",
"ts-node": "^10.9.1",
"typescript": "^4.9.5"
"typescript": "^5.3.2"
}
}

View File

@@ -1,20 +1,15 @@
#!/usr/bin/env node
import { connectScryptedClient } from '@scrypted/client';
import { FFmpegInput, ScryptedMimeTypes } from '@scrypted/types';
import child_process from 'child_process';
import fs from 'fs';
import path from 'path';
import axios, { AxiosRequestConfig } from 'axios';
import readline from 'readline-sync';
import https from 'https';
import mkdirp from 'mkdirp';
import { installServe, serveMain } from './service';
import { connectScryptedClient } from '@scrypted/client';
import { ScryptedMimeTypes, FFmpegInput } from '@scrypted/types';
import semver from 'semver';
import child_process from 'child_process';
const httpsAgent = new https.Agent({
rejectUnauthorized: false,
});
import { httpFetch } from '../../../server/src/fetch/http-fetch';
import { installServe, serveMain } from './service';
import { connectShell } from './shell';
if (!semver.gte(process.version, '16.0.0')) {
throw new Error('"node" version out of date. Please update node to v16 or higher.')
@@ -45,6 +40,12 @@ interface LoginFile {
[host: string]: Login;
}
function basicAuthHeaders(username: string, password: string) {
const headers = new Headers();
headers.set('Authorization', `Basic ${Buffer.from(username + ":" + password).toString('base64')}`);
return headers;
}
async function doLogin(host: string) {
host = toIpAndPort(host);
@@ -54,17 +55,19 @@ async function doLogin(host: string) {
});
const url = `https://${host}/login`;
const response = await axios(Object.assign({
const response = await httpFetch({
method: 'GET',
auth: {
username,
password,
},
headers: basicAuthHeaders(username, password),
url,
httpsAgent,
}, axiosConfig));
rejectUnauthorized: false,
responseType: 'json',
});
if (response.body.error)
throw new Error(response.body.error);
mkdirp.sync(scryptedHome);
fs.mkdirSync(scryptedHome, {
recursive: true,
});
let login: LoginFile;
try {
login = JSON.parse(fs.readFileSync(loginPath).toString());
@@ -76,15 +79,12 @@ async function doLogin(host: string) {
login = {};
login = login || {};
login[host] = response.data;
login[host] = response.body;
fs.writeFileSync(loginPath, JSON.stringify(login));
return login;
return login[host];
}
async function getOrDoLogin(host: string): Promise<{
username: string,
token: string,
}> {
async function getOrDoLogin(host: string): Promise<Login> {
let login: LoginFile;
try {
login = JSON.parse(fs.readFileSync(loginPath).toString());
@@ -93,17 +93,12 @@ async function getOrDoLogin(host: string): Promise<{
if (!login[host].username || !login[host].token)
throw new Error();
return login[host];
}
catch (e) {
login = await doLogin(host);
return doLogin(host);
}
return login[host];
}
const axiosConfig: AxiosRequestConfig = {
httpsAgent: new https.Agent({
rejectUnauthorized: false
})
}
async function runCommand() {
@@ -117,9 +112,6 @@ async function runCommand() {
pluginId: '@scrypted/core',
username: login.username,
password: login.token,
axiosConfig: {
httpsAgent,
}
});
const device: any = sdk.systemManager.getDeviceById(idOrName) || sdk.systemManager.getDeviceByName(idOrName);
@@ -156,8 +148,8 @@ async function main() {
}
else if (process.argv[2] === 'login') {
const ip = process.argv[3] || '127.0.0.1';
const token = await doLogin(ip);
console.log('login successful. token:', token);
const login = await doLogin(ip);
console.log('login successful. token:', login.token);
}
else if (process.argv[2] === 'command') {
const { sdk, pendingResult } = await runCommand();
@@ -168,11 +160,11 @@ async function main() {
const ffmpegInput = await sdk.mediaManager.convertMediaObjectToJSON<FFmpegInput>(await pendingResult, ScryptedMimeTypes.FFmpegInput);
if (ffmpegInput.url && ffmpegInput.urls?.[0]) {
const url = new URL(ffmpegInput.url);
if (url.hostname === '127.0.0.1' && ffmpegInput.urls?.[0]) {
ffmpegInput.inputArguments = ffmpegInput.inputArguments.map(i => i === ffmpegInput.url ? ffmpegInput.urls?.[0] : i);
if (url.hostname === '127.0.0.1' && ffmpegInput.urls?.[0] && ffmpegInput.inputArguments) {
ffmpegInput.inputArguments = ffmpegInput.inputArguments.map(i => i === ffmpegInput.url && ffmpegInput.urls ? ffmpegInput.urls?.[0] : i);
}
}
const args = [...ffmpegInput.inputArguments];
const args = ffmpegInput.inputArguments ? [...ffmpegInput.inputArguments] : [];
if (ffmpegInput.h264FilterArguments)
args.push(...ffmpegInput.h264FilterArguments);
console.log('ffplay', ...args);
@@ -209,16 +201,33 @@ async function main() {
const login = await getOrDoLogin(ip);
const url = `https://${ip}/web/component/script/install/${pkg}`;
const response = await axios(Object.assign({
const response = await httpFetch({
method: 'POST',
auth: {
username: login.username,
password: login.token,
},
headers: basicAuthHeaders(login.username, login.token),
url,
}, axiosConfig));
rejectUnauthorized: false,
responseType: 'json',
});
if (response.body.error)
throw new Error(response.body.error);
console.log('install successful. id:', response.data.id);
console.log('install successful. id:', response.body.id);
}
else if (process.argv[2] === 'shell') {
console.log = () => { };
const host = toIpAndPort(process.argv[3] || '127.0.0.1');
const login = await getOrDoLogin(host);
const sdk = await connectScryptedClient({
baseUrl: `https://${host}`,
pluginId: '@scrypted/core',
username: login.username,
password: login.token,
});
const separator = process.argv.indexOf("--");
const cmd = separator != -1 ? process.argv.slice(separator + 1) : [];
await connectShell(sdk, ...cmd);
}
else {
console.log('usage:');
@@ -231,12 +240,12 @@ async function main() {
console.log(' npx scrypted command name-or-id[@127.0.0.1[:10443]] method-name [...method-arguments]');
console.log(' npx scrypted ffplay name-or-id[@127.0.0.1[:10443]] method-name [...method-arguments]');
console.log(' npx scrypted create-cert-json /path/to/key.pem /path/to/cert.pem');
console.log(' npx scrypted shell [127.0.0.1[:10443]] [-- cmd [...cmd-args]]');
console.log();
console.log('examples:');
console.log(' npx scrypted install @scrypted/rtsp');
console.log(' npx scrypted install @scrypted/rtsp/0.0.51');
console.log(' npx scrypted install @scrypted/rtsp/0.0.51 192.168.2.100');
process.exit(1);
}
}

View File

@@ -2,10 +2,8 @@
import child_process from 'child_process';
import { once } from 'events';
import fs from 'fs';
import rimraf from 'rimraf';
import path from 'path';
import os from 'os';
import mkdirp from 'mkdirp';
import semver from 'semver';
async function sleep(ms: number) {
@@ -16,11 +14,22 @@ const EXIT_FILE = '.exit';
const UPDATE_FILE = '.update';
async function runCommand(command: string, ...args: string[]) {
if (os.platform() === 'win32')
if (os.platform() === 'win32') {
command += '.cmd';
// wrap each argument in a quote to handle spaces in paths
// https://github.com/nodejs/node/issues/38490#issuecomment-927330248
args = args.map(arg => '"' + arg + '"');
}
console.log('running', command, ...args);
const cp = child_process.spawn(command, args, {
stdio: 'inherit'
stdio: 'inherit',
env: {
...process.env,
// https://github.com/lovell/sharp/blob/eefaa998725cf345227d94b40615e090495c6d09/lib/libvips.js#L115C19-L115C46
SHARP_IGNORE_GLOBAL_LIBVIPS: 'true',
},
// allow spawning .cmd https://nodejs.org/en/blog/vulnerability/april-2024-security-releases-2
shell: os.platform() === 'win32' ? true : undefined,
});
await once(cp, 'exit');
if (cp.exitCode)
@@ -57,28 +66,43 @@ export function getInstallDir() {
export function cwdInstallDir(): { volume: string, installDir: string } {
const installDir = getInstallDir();
const volume = path.join(installDir, 'volume');
mkdirp.sync(volume);
fs.mkdirSync(volume, {
recursive: true,
});
process.chdir(installDir);
return { volume, installDir };
}
function rimrafSync(p: string) {
fs.rmSync(p, {
recursive: true,
force: true,
});
}
export async function installServe(installVersion: string, ignoreError?: boolean) {
const { installDir } = cwdInstallDir();
const packageLockJson = path.join(installDir, 'package-lock.json');
// apparently corrupted or old version of package-lock.json prevents upgrades, so
// nuke it before installing.
rimraf.sync(packageLockJson);
rimrafSync(packageLockJson);
const installJson = path.join(installDir, 'install.json');
try {
const { version } = JSON.parse(fs.readFileSync(installJson).toString());
if (semver.parse(process.version).major !== semver.parse(version).major)
const processSemver = semver.parse(process.version);
if (!processSemver)
throw new Error('error parsing process version');
const installSemver = semver.parse(version);
if (!installSemver)
throw new Error('error parsing install.json version');
if (processSemver.major !== installSemver.major)
throw new Error('mismatch');
}
catch (e) {
const nodeModules = path.join(installDir, 'node_modules');
console.log('Node version mismatch, missing, or corrupt. Clearing node_modules.');
rimraf.sync(nodeModules);
rimrafSync(nodeModules);
}
fs.writeFileSync(installJson, JSON.stringify({
version: process.version,
@@ -93,18 +117,38 @@ export async function installServe(installVersion: string, ignoreError?: boolean
}
export async function serveMain(installVersion?: string) {
let install = !!installVersion;
const options = ((): { install: true; version: string } | { install: false } => {
if (installVersion) {
console.log(`Installing @scrypted/server@${installVersion}`);
return {
install: true,
version: installVersion
};
}
if (!fs.existsSync('node_modules/@scrypted/server')) {
console.log('Package @scrypted/server not found. Installing.');
return {
install: true,
version: 'latest',
};
}
return {
install: false,
}
})();
const { installDir, volume } = cwdInstallDir();
if (!fs.existsSync('node_modules/@scrypted/server')) {
install = true;
installVersion ||= 'latest';
console.log('Package @scrypted/server not found. Installing.');
}
if (install) {
await installServe(installVersion, true);
if (options.install) {
await installServe(options.version, true);
}
// todo: remove at some point after core lxc updater rolls out.
if (process.env.SCRYPTED_INSTALL_ENVIRONMENT === 'lxc')
process.env.SCRYPTED_FFMPEG_PATH = '/usr/bin/ffmpeg';
process.env.SCRYPTED_NPM_SERVE = 'true';
process.env.SCRYPTED_VOLUME = volume;
process.env.SCRYPTED_CAN_EXIT = 'true';
@@ -112,21 +156,25 @@ export async function serveMain(installVersion?: string) {
console.log('cwd', process.cwd());
while (true) {
rimraf.sync(EXIT_FILE);
rimraf.sync(UPDATE_FILE);
rimrafSync(EXIT_FILE);
rimrafSync(UPDATE_FILE);
await startServer(installDir);
if (fs.existsSync(EXIT_FILE)) {
console.log('Exiting.');
process.exit();
}
else if (fs.existsSync(UPDATE_FILE)) {
if (fs.existsSync(UPDATE_FILE)) {
console.log('Update requested. Installing.');
await runCommandEatError('npm', '--prefix', installDir, 'install', '--production', '@scrypted/server@latest');
await runCommandEatError('npm', '--prefix', installDir, 'install', '--production', '@scrypted/server@latest').catch(e => {
console.error('Update failed', e);
});
console.log('Exiting.');
process.exit(1);
}
else if (fs.existsSync(EXIT_FILE)) {
console.log('Exiting.');
process.exit(1);
}
else {
console.log(`Service exited. Restarting momentarily.`);
console.log(`Service unexpectedly exited. Restarting momentarily.`);
await sleep(10000);
}
}

90
packages/cli/src/shell.ts Normal file
View File

@@ -0,0 +1,90 @@
import { DeviceProvider, ScryptedStatic, StreamService } from "@scrypted/types";
import { createAsyncQueue } from '../../../common/src/async-queue';
export async function connectShell(sdk: ScryptedStatic, ...cmd: string[]) {
const termSvc = await sdk.systemManager.getDeviceByName<DeviceProvider>("@scrypted/core").getDevice("terminalservice");
if (!termSvc) {
throw Error("@scrypted/core does not provide a Terminal Service");
}
const termSvcDirect = await sdk.connectRPCObject<StreamService>(termSvc);
const dataQueue = createAsyncQueue<Buffer>();
const ctrlQueue = createAsyncQueue<any>();
if (process.stdin.isTTY) {
process.stdin.setRawMode(true);
} else {
process.stdin.on("end", () => {
ctrlQueue.enqueue({ eof: true });
dataQueue.enqueue(Buffer.alloc(0));
});
}
ctrlQueue.enqueue({ interactive: Boolean(process.stdin.isTTY), cmd: cmd });
const dim = { cols: process.stdout.columns, rows: process.stdout.rows };
ctrlQueue.enqueue({ dim });
let bufferedLength = 0;
const MAX_BUFFERED_LENGTH = 64000;
process.stdin.on('data', async data => {
bufferedLength += data.length;
const promise = dataQueue.enqueue(data).then(() => bufferedLength -= data.length);
if (bufferedLength >= MAX_BUFFERED_LENGTH) {
process.stdin.pause();
await promise;
if (bufferedLength < MAX_BUFFERED_LENGTH)
process.stdin.resume();
}
});
async function* generator() {
while (true) {
const ctrlBuffers = ctrlQueue.clear();
if (ctrlBuffers.length) {
for (const ctrl of ctrlBuffers) {
if (ctrl.eof) {
// flush the buffer before sending eof
const dataBuffers = dataQueue.clear();
const concat = Buffer.concat(dataBuffers);
if (concat.length) {
yield concat;
}
}
yield JSON.stringify(ctrl);
}
continue;
}
const dataBuffers = dataQueue.clear();
if (dataBuffers.length === 0) {
const buf = await dataQueue.dequeue();
if (buf.length)
yield buf;
continue;
}
const concat = Buffer.concat(dataBuffers);
if (concat.length)
yield concat;
}
}
process.stdout.on('resize', () => {
const dim = { cols: process.stdout.columns, rows: process.stdout.rows };
ctrlQueue.enqueue({ dim });
dataQueue.enqueue(Buffer.alloc(0));
});
try {
for await (const message of await termSvcDirect.connectStream(generator())) {
if (!message) {
process.exit();
}
process.stdout.write(new Uint8Array(Buffer.from(message)));
}
} catch {
// ignore
} finally {
process.exit();
}
}

View File

@@ -1,6 +1,6 @@
{
"compilerOptions": {
"module": "commonjs",
"module": "Node16",
"target": "esnext",
"noImplicitAny": true,
"outDir": "./dist",
@@ -8,7 +8,8 @@
"sourceMap": true,
"inlineSources": true,
"declaration": true,
"resolveJsonModule": true,
"moduleResolution": "Node16",
"strict": true
},
"include": [
"src/**/*"

View File

@@ -9,3 +9,4 @@ scrypted.db.bak
.exit
.update
.venv
.vscode/launch.json

View File

@@ -0,0 +1,25 @@
import { Camera, VideoCamera, VideoFrameGenerator } from '@scrypted/types';
import { connectScryptedClient } from '../dist/packages/client/src';
async function example() {
const sdk = await connectScryptedClient({
baseUrl: 'https://localhost:10443',
pluginId: "@scrypted/core",
username: process.env.SCRYPTED_USERNAME || 'admin',
password: process.env.SCRYPTED_PASSWORD || 'swordfish',
});
console.log('server version', sdk.serverVersion);
const office = sdk.systemManager.getDeviceByName<VideoCamera & Camera>("Office");
const libav = sdk.systemManager.getDeviceByName<VideoFrameGenerator>("Libav");
const mo = await office.getVideoStream();
const generator = await libav.generateVideoFrames(mo);
const remote = await sdk.connectRPCObject!(generator);
for await (const frame of remote) {
console.log(frame);
}
}
example();

View File

@@ -1,25 +1,16 @@
import { ObjectDetector, ObjectsDetected, ScryptedInterface } from '@scrypted/types';
import { connectScryptedClient } from '../dist/packages/client/src';
import https from 'https';
const httpsAgent = new https.Agent({
rejectUnauthorized: false,
})
async function example() {
const sdk = await connectScryptedClient({
baseUrl: 'https://localhost:10443',
pluginId: "@scrypted/core",
username: process.env.SCRYPTED_USERNAME || 'admin',
password: process.env.SCRYPTED_PASSWORD || 'swordfish',
axiosConfig: {
httpsAgent,
}
});
console.log('server version', sdk.serverVersion);
const backyard = sdk.systemManager.getDeviceByName<ObjectDetector>("Hikvision Test");
const backyard = sdk.systemManager.getDeviceByName<ObjectDetector>("IP CAMERA");
if (!backyard)
throw new Error('Device not found');

View File

@@ -1,21 +1,12 @@
import { connectScryptedClient } from '../dist/packages/client/src';
import { OnOff } from '@scrypted/types';
import https from 'https';
const httpsAgent = new https.Agent({
rejectUnauthorized: false,
})
async function example() {
const sdk = await connectScryptedClient({
baseUrl: 'https://localhost:10443',
pluginId: "@scrypted/core",
username: process.env.SCRYPTED_USERNAME || 'admin',
password: process.env.SCRYPTED_PASSWORD || 'swordfish',
axiosConfig: {
httpsAgent,
}
});
console.log('server version', sdk.serverVersion);

View File

@@ -1,76 +1,236 @@
{
"name": "@scrypted/client",
"version": "1.1.55",
"version": "1.3.5",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "@scrypted/client",
"version": "1.1.55",
"version": "1.3.5",
"license": "ISC",
"dependencies": {
"@scrypted/types": "^0.2.94",
"axios": "^0.25.0",
"engine.io-client": "^6.4.0",
"rimraf": "^3.0.2"
"@scrypted/types": "^0.3.27",
"engine.io-client": "^6.5.3",
"follow-redirects": "^1.15.6",
"rimraf": "^5.0.5"
},
"devDependencies": {
"@types/ip": "^1.1.0",
"@types/node": "^18.14.2",
"typescript": "^4.9.5"
"@types/ip": "^1.1.3",
"@types/node": "^20.11.30",
"ts-node": "^10.9.2",
"typescript": "^5.4.3"
}
},
"node_modules/@cspotcode/source-map-support": {
"version": "0.8.1",
"resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz",
"integrity": "sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==",
"dev": true,
"dependencies": {
"@jridgewell/trace-mapping": "0.3.9"
},
"engines": {
"node": ">=12"
}
},
"node_modules/@isaacs/cliui": {
"version": "8.0.2",
"resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz",
"integrity": "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==",
"dependencies": {
"string-width": "^5.1.2",
"string-width-cjs": "npm:string-width@^4.2.0",
"strip-ansi": "^7.0.1",
"strip-ansi-cjs": "npm:strip-ansi@^6.0.1",
"wrap-ansi": "^8.1.0",
"wrap-ansi-cjs": "npm:wrap-ansi@^7.0.0"
},
"engines": {
"node": ">=12"
}
},
"node_modules/@jridgewell/resolve-uri": {
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.1.tgz",
"integrity": "sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA==",
"dev": true,
"engines": {
"node": ">=6.0.0"
}
},
"node_modules/@jridgewell/sourcemap-codec": {
"version": "1.4.15",
"resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz",
"integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==",
"dev": true
},
"node_modules/@jridgewell/trace-mapping": {
"version": "0.3.9",
"resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz",
"integrity": "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==",
"dev": true,
"dependencies": {
"@jridgewell/resolve-uri": "^3.0.3",
"@jridgewell/sourcemap-codec": "^1.4.10"
}
},
"node_modules/@pkgjs/parseargs": {
"version": "0.11.0",
"resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz",
"integrity": "sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==",
"optional": true,
"engines": {
"node": ">=14"
}
},
"node_modules/@scrypted/types": {
"version": "0.2.94",
"resolved": "https://registry.npmjs.org/@scrypted/types/-/types-0.2.94.tgz",
"integrity": "sha512-615C6lLnJGk0qhp+Y72B3xeD2CS9p/h8JUmFDjKh4H4IjL6zlV10tZVAXWQt3Q5rmy1WAaS3nScR6NgxZ5woOA=="
"version": "0.3.27",
"resolved": "https://registry.npmjs.org/@scrypted/types/-/types-0.3.27.tgz",
"integrity": "sha512-XNtlqzqt6rHyNYwWrz3iiickh1h9ACwcLC3rfwxUbFk/Vq/UbDZgp0kGyj9UW6eLVNHzWFSE2dKqyyDS6V2KAg=="
},
"node_modules/@socket.io/component-emitter": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/@socket.io/component-emitter/-/component-emitter-3.1.0.tgz",
"integrity": "sha512-+9jVqKhRSpsc591z5vX+X5Yyw+he/HCB4iQ/RYxw35CEPaY1gnsNE43nf9n9AaYjAQrTiI/mOwKUKdUs9vf7Xg=="
},
"node_modules/@tsconfig/node10": {
"version": "1.0.9",
"resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.9.tgz",
"integrity": "sha512-jNsYVVxU8v5g43Erja32laIDHXeoNvFEpX33OK4d6hljo3jDhCBDhx5dhCCTMWUojscpAagGiRkBKxpdl9fxqA==",
"dev": true
},
"node_modules/@tsconfig/node12": {
"version": "1.0.11",
"resolved": "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.11.tgz",
"integrity": "sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==",
"dev": true
},
"node_modules/@tsconfig/node14": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.3.tgz",
"integrity": "sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==",
"dev": true
},
"node_modules/@tsconfig/node16": {
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.4.tgz",
"integrity": "sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==",
"dev": true
},
"node_modules/@types/ip": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/@types/ip/-/ip-1.1.0.tgz",
"integrity": "sha512-dwNe8gOoF70VdL6WJBwVHtQmAX4RMd62M+mAB9HQFjG1/qiCLM/meRy95Pd14FYBbEDwCq7jgJs89cHpLBu4HQ==",
"version": "1.1.3",
"resolved": "https://registry.npmjs.org/@types/ip/-/ip-1.1.3.tgz",
"integrity": "sha512-64waoJgkXFTYnCYDUWgSATJ/dXEBanVkaP5d4Sbk7P6U7cTTMhxVyROTckc6JKdwCrgnAjZMn0k3177aQxtDEA==",
"dev": true,
"dependencies": {
"@types/node": "*"
}
},
"node_modules/@types/node": {
"version": "18.14.2",
"resolved": "https://registry.npmjs.org/@types/node/-/node-18.14.2.tgz",
"integrity": "sha512-1uEQxww3DaghA0RxqHx0O0ppVlo43pJhepY51OxuQIKHpjbnYLA7vcdwioNPzIqmC2u3I/dmylcqjlh0e7AyUA==",
"dev": true
},
"node_modules/axios": {
"version": "0.25.0",
"resolved": "https://registry.npmjs.org/axios/-/axios-0.25.0.tgz",
"integrity": "sha512-cD8FOb0tRH3uuEe6+evtAbgJtfxr7ly3fQjYcMcuPlgkwVS9xboaVIpcDV+cYQe+yGykgwZCs1pzjntcGa6l5g==",
"version": "20.11.30",
"resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.30.tgz",
"integrity": "sha512-dHM6ZxwlmuZaRmUPfv1p+KrdD1Dci04FbdEm/9wEMouFqxYoFl5aMkt0VMAUtYRQDyYvD41WJLukhq/ha3YuTw==",
"dev": true,
"dependencies": {
"follow-redirects": "^1.14.7"
"undici-types": "~5.26.4"
}
},
"node_modules/acorn": {
"version": "8.11.3",
"resolved": "https://registry.npmjs.org/acorn/-/acorn-8.11.3.tgz",
"integrity": "sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg==",
"dev": true,
"bin": {
"acorn": "bin/acorn"
},
"engines": {
"node": ">=0.4.0"
}
},
"node_modules/acorn-walk": {
"version": "8.3.1",
"resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.1.tgz",
"integrity": "sha512-TgUZgYvqZprrl7YldZNoa9OciCAyZR+Ejm9eXzKCmjsF5IKp/wgQ7Z/ZpjpGTIUPwrHQIcYeI8qDh4PsEwxMbw==",
"dev": true,
"engines": {
"node": ">=0.4.0"
}
},
"node_modules/ansi-regex": {
"version": "6.0.1",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz",
"integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==",
"engines": {
"node": ">=12"
},
"funding": {
"url": "https://github.com/chalk/ansi-regex?sponsor=1"
}
},
"node_modules/ansi-styles": {
"version": "6.2.1",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz",
"integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==",
"engines": {
"node": ">=12"
},
"funding": {
"url": "https://github.com/chalk/ansi-styles?sponsor=1"
}
},
"node_modules/arg": {
"version": "4.1.3",
"resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz",
"integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==",
"dev": true
},
"node_modules/balanced-match": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz",
"integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw=="
},
"node_modules/brace-expansion": {
"version": "1.1.11",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
"integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz",
"integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==",
"dependencies": {
"balanced-match": "^1.0.0",
"concat-map": "0.0.1"
"balanced-match": "^1.0.0"
}
},
"node_modules/concat-map": {
"version": "0.0.1",
"resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
"integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg=="
"node_modules/color-convert": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
"integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
"dependencies": {
"color-name": "~1.1.4"
},
"engines": {
"node": ">=7.0.0"
}
},
"node_modules/color-name": {
"version": "1.1.4",
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA=="
},
"node_modules/create-require": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz",
"integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==",
"dev": true
},
"node_modules/cross-spawn": {
"version": "7.0.3",
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz",
"integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==",
"dependencies": {
"path-key": "^3.1.0",
"shebang-command": "^2.0.0",
"which": "^2.0.1"
},
"engines": {
"node": ">= 8"
}
},
"node_modules/debug": {
"version": "4.3.4",
@@ -88,30 +248,49 @@
}
}
},
"node_modules/diff": {
"version": "4.0.2",
"resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz",
"integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==",
"dev": true,
"engines": {
"node": ">=0.3.1"
}
},
"node_modules/eastasianwidth": {
"version": "0.2.0",
"resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz",
"integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA=="
},
"node_modules/emoji-regex": {
"version": "9.2.2",
"resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz",
"integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg=="
},
"node_modules/engine.io-client": {
"version": "6.4.0",
"resolved": "https://registry.npmjs.org/engine.io-client/-/engine.io-client-6.4.0.tgz",
"integrity": "sha512-GyKPDyoEha+XZ7iEqam49vz6auPnNJ9ZBfy89f+rMMas8AuiMWOZ9PVzu8xb9ZC6rafUqiGHSCfu22ih66E+1g==",
"version": "6.5.3",
"resolved": "https://registry.npmjs.org/engine.io-client/-/engine.io-client-6.5.3.tgz",
"integrity": "sha512-9Z0qLB0NIisTRt1DZ/8U2k12RJn8yls/nXMZLn+/N8hANT3TcYjKFKcwbw5zFQiN4NTde3TSY9zb79e1ij6j9Q==",
"dependencies": {
"@socket.io/component-emitter": "~3.1.0",
"debug": "~4.3.1",
"engine.io-parser": "~5.0.3",
"engine.io-parser": "~5.2.1",
"ws": "~8.11.0",
"xmlhttprequest-ssl": "~2.0.0"
}
},
"node_modules/engine.io-parser": {
"version": "5.0.6",
"resolved": "https://registry.npmjs.org/engine.io-parser/-/engine.io-parser-5.0.6.tgz",
"integrity": "sha512-tjuoZDMAdEhVnSFleYPCtdL2GXwVTGtNjoeJd9IhIG3C1xs9uwxqRNEu5WpnDZCaozwVlK/nuQhpodhXSIMaxw==",
"version": "5.2.1",
"resolved": "https://registry.npmjs.org/engine.io-parser/-/engine.io-parser-5.2.1.tgz",
"integrity": "sha512-9JktcM3u18nU9N2Lz3bWeBgxVgOKpw7yhRaoxQA3FUDZzzw+9WlA6p4G4u0RixNkg14fH7EfEc/RhpurtiROTQ==",
"engines": {
"node": ">=10.0.0"
}
},
"node_modules/follow-redirects": {
"version": "1.15.2",
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.2.tgz",
"integrity": "sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA==",
"version": "1.15.6",
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.6.tgz",
"integrity": "sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA==",
"funding": [
{
"type": "individual",
@@ -127,53 +306,106 @@
}
}
},
"node_modules/fs.realpath": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
"integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw=="
},
"node_modules/glob": {
"version": "7.2.3",
"resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz",
"integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==",
"node_modules/foreground-child": {
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.1.1.tgz",
"integrity": "sha512-TMKDUnIte6bfb5nWv7V/caI169OHgvwjb7V4WkeUvbQQdjr5rWKqHFiKWb/fcOwB+CzBT+qbWjvj+DVwRskpIg==",
"dependencies": {
"fs.realpath": "^1.0.0",
"inflight": "^1.0.4",
"inherits": "2",
"minimatch": "^3.1.1",
"once": "^1.3.0",
"path-is-absolute": "^1.0.0"
"cross-spawn": "^7.0.0",
"signal-exit": "^4.0.1"
},
"engines": {
"node": "*"
"node": ">=14"
},
"funding": {
"url": "https://github.com/sponsors/isaacs"
}
},
"node_modules/inflight": {
"version": "1.0.6",
"resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz",
"integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==",
"node_modules/glob": {
"version": "10.3.10",
"resolved": "https://registry.npmjs.org/glob/-/glob-10.3.10.tgz",
"integrity": "sha512-fa46+tv1Ak0UPK1TOy/pZrIybNNt4HCv7SDzwyfiOZkvZLEbjsZkJBPtDHVshZjbecAoAGSC20MjLDG/qr679g==",
"dependencies": {
"once": "^1.3.0",
"wrappy": "1"
}
},
"node_modules/inherits": {
"version": "2.0.4",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
"integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ=="
},
"node_modules/minimatch": {
"version": "3.1.2",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz",
"integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==",
"dependencies": {
"brace-expansion": "^1.1.7"
"foreground-child": "^3.1.0",
"jackspeak": "^2.3.5",
"minimatch": "^9.0.1",
"minipass": "^5.0.0 || ^6.0.2 || ^7.0.0",
"path-scurry": "^1.10.1"
},
"bin": {
"glob": "dist/esm/bin.mjs"
},
"engines": {
"node": "*"
"node": ">=16 || 14 >=14.17"
},
"funding": {
"url": "https://github.com/sponsors/isaacs"
}
},
"node_modules/is-fullwidth-code-point": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz",
"integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==",
"engines": {
"node": ">=8"
}
},
"node_modules/isexe": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz",
"integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw=="
},
"node_modules/jackspeak": {
"version": "2.3.6",
"resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-2.3.6.tgz",
"integrity": "sha512-N3yCS/NegsOBokc8GAdM8UcmfsKiSS8cipheD/nivzr700H+nsMOxJjQnvwOcRYVuFkdH0wGUvW2WbXGmrZGbQ==",
"dependencies": {
"@isaacs/cliui": "^8.0.2"
},
"engines": {
"node": ">=14"
},
"funding": {
"url": "https://github.com/sponsors/isaacs"
},
"optionalDependencies": {
"@pkgjs/parseargs": "^0.11.0"
}
},
"node_modules/lru-cache": {
"version": "10.0.1",
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.0.1.tgz",
"integrity": "sha512-IJ4uwUTi2qCccrioU6g9g/5rvvVl13bsdczUUcqbciD9iLr095yj8DQKdObriEvuNSx325N1rV1O0sJFszx75g==",
"engines": {
"node": "14 || >=16.14"
}
},
"node_modules/make-error": {
"version": "1.3.6",
"resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz",
"integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==",
"dev": true
},
"node_modules/minimatch": {
"version": "9.0.3",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz",
"integrity": "sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==",
"dependencies": {
"brace-expansion": "^2.0.1"
},
"engines": {
"node": ">=16 || 14 >=14.17"
},
"funding": {
"url": "https://github.com/sponsors/isaacs"
}
},
"node_modules/minipass": {
"version": "7.0.4",
"resolved": "https://registry.npmjs.org/minipass/-/minipass-7.0.4.tgz",
"integrity": "sha512-jYofLM5Dam9279rdkWzqHozUo4ybjdZmCsDHePy5V/PbBcVMiSZR97gmAy45aqi8CK1lG2ECd356FU86avfwUQ==",
"engines": {
"node": ">=16 || 14 >=14.17"
}
},
"node_modules/ms": {
@@ -181,53 +413,329 @@
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
"integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w=="
},
"node_modules/once": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
"integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==",
"dependencies": {
"wrappy": "1"
}
},
"node_modules/path-is-absolute": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
"integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==",
"node_modules/path-key": {
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz",
"integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==",
"engines": {
"node": ">=0.10.0"
"node": ">=8"
}
},
"node_modules/rimraf": {
"version": "3.0.2",
"resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz",
"integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==",
"node_modules/path-scurry": {
"version": "1.10.1",
"resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.10.1.tgz",
"integrity": "sha512-MkhCqzzBEpPvxxQ71Md0b1Kk51W01lrYvlMzSUaIzNsODdd7mqhiimSZlr+VegAz5Z6Vzt9Xg2ttE//XBhH3EQ==",
"dependencies": {
"glob": "^7.1.3"
"lru-cache": "^9.1.1 || ^10.0.0",
"minipass": "^5.0.0 || ^6.0.2 || ^7.0.0"
},
"bin": {
"rimraf": "bin.js"
"engines": {
"node": ">=16 || 14 >=14.17"
},
"funding": {
"url": "https://github.com/sponsors/isaacs"
}
},
"node_modules/rimraf": {
"version": "5.0.5",
"resolved": "https://registry.npmjs.org/rimraf/-/rimraf-5.0.5.tgz",
"integrity": "sha512-CqDakW+hMe/Bz202FPEymy68P+G50RfMQK+Qo5YUqc9SPipvbGjCGKd0RSKEelbsfQuw3g5NZDSrlZZAJurH1A==",
"dependencies": {
"glob": "^10.3.7"
},
"bin": {
"rimraf": "dist/esm/bin.mjs"
},
"engines": {
"node": ">=14"
},
"funding": {
"url": "https://github.com/sponsors/isaacs"
}
},
"node_modules/shebang-command": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz",
"integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==",
"dependencies": {
"shebang-regex": "^3.0.0"
},
"engines": {
"node": ">=8"
}
},
"node_modules/shebang-regex": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz",
"integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==",
"engines": {
"node": ">=8"
}
},
"node_modules/signal-exit": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz",
"integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==",
"engines": {
"node": ">=14"
},
"funding": {
"url": "https://github.com/sponsors/isaacs"
}
},
"node_modules/string-width": {
"version": "5.1.2",
"resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz",
"integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==",
"dependencies": {
"eastasianwidth": "^0.2.0",
"emoji-regex": "^9.2.2",
"strip-ansi": "^7.0.1"
},
"engines": {
"node": ">=12"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/string-width-cjs": {
"name": "string-width",
"version": "4.2.3",
"resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz",
"integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==",
"dependencies": {
"emoji-regex": "^8.0.0",
"is-fullwidth-code-point": "^3.0.0",
"strip-ansi": "^6.0.1"
},
"engines": {
"node": ">=8"
}
},
"node_modules/string-width-cjs/node_modules/ansi-regex": {
"version": "5.0.1",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz",
"integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==",
"engines": {
"node": ">=8"
}
},
"node_modules/string-width-cjs/node_modules/emoji-regex": {
"version": "8.0.0",
"resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz",
"integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A=="
},
"node_modules/string-width-cjs/node_modules/strip-ansi": {
"version": "6.0.1",
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz",
"integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==",
"dependencies": {
"ansi-regex": "^5.0.1"
},
"engines": {
"node": ">=8"
}
},
"node_modules/strip-ansi": {
"version": "7.1.0",
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz",
"integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==",
"dependencies": {
"ansi-regex": "^6.0.1"
},
"engines": {
"node": ">=12"
},
"funding": {
"url": "https://github.com/chalk/strip-ansi?sponsor=1"
}
},
"node_modules/strip-ansi-cjs": {
"name": "strip-ansi",
"version": "6.0.1",
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz",
"integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==",
"dependencies": {
"ansi-regex": "^5.0.1"
},
"engines": {
"node": ">=8"
}
},
"node_modules/strip-ansi-cjs/node_modules/ansi-regex": {
"version": "5.0.1",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz",
"integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==",
"engines": {
"node": ">=8"
}
},
"node_modules/ts-node": {
"version": "10.9.2",
"resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.2.tgz",
"integrity": "sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ==",
"dev": true,
"dependencies": {
"@cspotcode/source-map-support": "^0.8.0",
"@tsconfig/node10": "^1.0.7",
"@tsconfig/node12": "^1.0.7",
"@tsconfig/node14": "^1.0.0",
"@tsconfig/node16": "^1.0.2",
"acorn": "^8.4.1",
"acorn-walk": "^8.1.1",
"arg": "^4.1.0",
"create-require": "^1.1.0",
"diff": "^4.0.1",
"make-error": "^1.1.1",
"v8-compile-cache-lib": "^3.0.1",
"yn": "3.1.1"
},
"bin": {
"ts-node": "dist/bin.js",
"ts-node-cwd": "dist/bin-cwd.js",
"ts-node-esm": "dist/bin-esm.js",
"ts-node-script": "dist/bin-script.js",
"ts-node-transpile-only": "dist/bin-transpile.js",
"ts-script": "dist/bin-script-deprecated.js"
},
"peerDependencies": {
"@swc/core": ">=1.2.50",
"@swc/wasm": ">=1.2.50",
"@types/node": "*",
"typescript": ">=2.7"
},
"peerDependenciesMeta": {
"@swc/core": {
"optional": true
},
"@swc/wasm": {
"optional": true
}
}
},
"node_modules/typescript": {
"version": "4.9.5",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz",
"integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==",
"version": "5.4.3",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.4.3.tgz",
"integrity": "sha512-KrPd3PKaCLr78MalgiwJnA25Nm8HAmdwN3mYUYZgG/wizIo9EainNVQI9/yDavtVFRN2h3k8uf3GLHuhDMgEHg==",
"dev": true,
"bin": {
"tsc": "bin/tsc",
"tsserver": "bin/tsserver"
},
"engines": {
"node": ">=4.2.0"
"node": ">=14.17"
}
},
"node_modules/wrappy": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
"integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ=="
"node_modules/undici-types": {
"version": "5.26.5",
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz",
"integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==",
"dev": true
},
"node_modules/v8-compile-cache-lib": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz",
"integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==",
"dev": true
},
"node_modules/which": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz",
"integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==",
"dependencies": {
"isexe": "^2.0.0"
},
"bin": {
"node-which": "bin/node-which"
},
"engines": {
"node": ">= 8"
}
},
"node_modules/wrap-ansi": {
"version": "8.1.0",
"resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz",
"integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==",
"dependencies": {
"ansi-styles": "^6.1.0",
"string-width": "^5.0.1",
"strip-ansi": "^7.0.1"
},
"engines": {
"node": ">=12"
},
"funding": {
"url": "https://github.com/chalk/wrap-ansi?sponsor=1"
}
},
"node_modules/wrap-ansi-cjs": {
"name": "wrap-ansi",
"version": "7.0.0",
"resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz",
"integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==",
"dependencies": {
"ansi-styles": "^4.0.0",
"string-width": "^4.1.0",
"strip-ansi": "^6.0.0"
},
"engines": {
"node": ">=10"
},
"funding": {
"url": "https://github.com/chalk/wrap-ansi?sponsor=1"
}
},
"node_modules/wrap-ansi-cjs/node_modules/ansi-regex": {
"version": "5.0.1",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz",
"integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==",
"engines": {
"node": ">=8"
}
},
"node_modules/wrap-ansi-cjs/node_modules/ansi-styles": {
"version": "4.3.0",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
"integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
"dependencies": {
"color-convert": "^2.0.1"
},
"engines": {
"node": ">=8"
},
"funding": {
"url": "https://github.com/chalk/ansi-styles?sponsor=1"
}
},
"node_modules/wrap-ansi-cjs/node_modules/emoji-regex": {
"version": "8.0.0",
"resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz",
"integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A=="
},
"node_modules/wrap-ansi-cjs/node_modules/string-width": {
"version": "4.2.3",
"resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz",
"integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==",
"dependencies": {
"emoji-regex": "^8.0.0",
"is-fullwidth-code-point": "^3.0.0",
"strip-ansi": "^6.0.1"
},
"engines": {
"node": ">=8"
}
},
"node_modules/wrap-ansi-cjs/node_modules/strip-ansi": {
"version": "6.0.1",
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz",
"integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==",
"dependencies": {
"ansi-regex": "^5.0.1"
},
"engines": {
"node": ">=8"
}
},
"node_modules/ws": {
"version": "8.11.0",
@@ -256,6 +764,15 @@
"engines": {
"node": ">=0.4.0"
}
},
"node_modules/yn": {
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz",
"integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==",
"dev": true,
"engines": {
"node": ">=6"
}
}
}
}

View File

@@ -1,6 +1,6 @@
{
"name": "@scrypted/client",
"version": "1.1.55",
"version": "1.3.5",
"description": "",
"main": "dist/packages/client/src/index.js",
"scripts": {
@@ -12,14 +12,15 @@
"author": "",
"license": "ISC",
"devDependencies": {
"@types/ip": "^1.1.0",
"@types/node": "^18.14.2",
"typescript": "^4.9.5"
"@types/ip": "^1.1.3",
"@types/node": "^20.11.30",
"ts-node": "^10.9.2",
"typescript": "^5.4.3"
},
"dependencies": {
"@scrypted/types": "^0.2.94",
"axios": "^0.25.0",
"engine.io-client": "^6.4.0",
"rimraf": "^3.0.2"
"@scrypted/types": "^0.3.27",
"engine.io-client": "^6.5.3",
"follow-redirects": "^1.15.6",
"rimraf": "^5.0.5"
}
}

View File

@@ -1,11 +1,11 @@
import { MediaObjectOptions, RTCConnectionManagement, RTCSignalingSession, ScryptedStatic } from "@scrypted/types";
import axios, { AxiosRequestConfig, AxiosRequestHeaders } from 'axios';
import { MediaObjectCreateOptions, RTCConnectionManagement, RTCSignalingSession, ScryptedStatic } from "@scrypted/types";
import * as eio from 'engine.io-client';
import { SocketOptions } from 'engine.io-client';
import { Deferred } from "../../../common/src/deferred";
import { timeoutPromise } from "../../../common/src/promise-utils";
import { BrowserSignalingSession, waitPeerConnectionIceConnected, waitPeerIceConnectionClosed } from "../../../common/src/rtc-signaling";
import { DataChannelDebouncer } from "../../../plugins/webrtc/src/datachannel-debouncer";
import type { ClusterObject, ConnectRPCObject } from '../../../server/src/cluster/connect-rpc-object';
import type { IOSocket } from '../../../server/src/io';
import { MediaObject } from '../../../server/src/plugin/mediaobject';
import { attachPluginRemote } from '../../../server/src/plugin/plugin-remote';
@@ -14,6 +14,23 @@ import { createRpcDuplexSerializer, createRpcSerializer } from '../../../server/
import packageJson from '../package.json';
import { isIPAddress } from "./ip";
import { domFetch } from "../../../server/src/fetch";
import { httpFetch } from '../../../server/src/fetch/http-fetch';
let fetcher: typeof httpFetch | typeof domFetch;
try {
if (process.arch === 'browser' as any)
throw new Error();
require('net');
require('events');
fetcher = httpFetch;
}
catch (e) {
fetcher = domFetch;
}
const sourcePeerId = RpcPeer.generateId();
type IOClientSocket = eio.Socket & IOSocket;
function once(socket: IOClientSocket, event: 'open' | 'message') {
@@ -56,7 +73,6 @@ export interface ScryptedConnectionOptions {
local?: boolean;
webrtc?: boolean;
baseUrl?: string;
axiosConfig?: AxiosRequestConfig;
previousLoginResult?: ScryptedClientLoginResult;
}
@@ -87,10 +103,13 @@ function isRunningStandalone() {
export async function logoutScryptedClient(baseUrl?: string) {
const url = combineBaseUrl(baseUrl, 'logout');
const response = await axios(url, {
const response = await fetcher({
url,
withCredentials: true,
responseType: 'json',
rejectUnauthorized: false,
});
return response.data;
return response.body;
}
export function getCurrentBaseUrl() {
@@ -119,75 +138,90 @@ export async function loginScryptedClient(options: ScryptedLoginOptions) {
maxAge = 365 * 24 * 60 * 60 * 1000;
const url = combineBaseUrl(baseUrl, 'login');
const response = await axios.post(url, {
username,
password,
change_password,
maxAge,
}, {
const response = await fetcher({
url,
body: {
username,
password,
change_password,
maxAge,
},
rejectUnauthorized: false,
withCredentials: true,
...options.axiosConfig,
responseType: 'json',
});
if (response.status !== 200)
throw new Error('status ' + response.status);
if (response.statusCode !== 200)
throw new Error('status ' + response.statusCode);
const addresses = response.data.addresses as string[] || [];
// the cloud plugin will include this header.
// should maybe move this into the cloud server itself.
const scryptedCloud = response.headers['x-scrypted-cloud'] === 'true';
const directAddress = response.headers['x-scrypted-direct-address'];
const cloudAddress = response.headers['x-scrypted-cloud-address'];
const { body } = response;
return {
error: response.data.error as string,
authorization: response.data.authorization as string,
queryToken: response.data.queryToken as any,
token: response.data.token as string,
addresses,
scryptedCloud,
directAddress,
cloudAddress,
error: body.error as string,
authorization: body.authorization as string,
queryToken: body.queryToken as any,
token: body.token as string,
addresses: body.addresses as string[],
externalAddresses: body.externalAddresses as string[],
// the cloud plugin will include this header.
// should maybe move this into the cloud server itself.
scryptedCloud: response.headers.get('x-scrypted-cloud') === 'true',
directAddress: response.headers.get('x-scrypted-direct-address'),
cloudAddress: response.headers.get('x-scrypted-cloud-address'),
};
}
export async function checkScryptedClientLogin(options?: ScryptedConnectionOptions) {
let { baseUrl } = options || {};
const url = combineBaseUrl(baseUrl, 'login');
const headers: AxiosRequestHeaders = {};
if (options?.previousLoginResult?.authorization)
headers.Authorization = options?.previousLoginResult?.authorization;
const response = await axios.get(url, {
let url = combineBaseUrl(baseUrl, 'login');
const headers = new Headers();
if (options?.previousLoginResult?.queryToken) {
// headers.Authorization = options?.previousLoginResult?.authorization;
// const search = new URLSearchParams(options.previousLoginResult.queryToken);
// url += '?' + search.toString();
const token = options?.previousLoginResult.username + ":" + options.previousLoginResult.token;
const hash = Buffer.from(token).toString('base64');
headers.set('Authorization', `Basic ${hash}`);
}
const response = await fetcher({
url,
withCredentials: true,
headers,
...options?.axiosConfig,
rejectUnauthorized: false,
responseType: 'json',
});
const scryptedCloud = response.headers['x-scrypted-cloud'] === 'true';
const directAddress = response.headers['x-scrypted-direct-address'];
const cloudAddress = response.headers['x-scrypted-cloud-address'];
const { body } = response;
return {
baseUrl,
hostname: response.data.hostname as string,
redirect: response.data.redirect as string,
username: response.data.username as string,
expiration: response.data.expiration as number,
hasLogin: !!response.data.hasLogin,
error: response.data.error as string,
authorization: response.data.authorization as string,
queryToken: response.data.queryToken as any,
token: response.data.token as string,
addresses: response.data.addresses as string[],
scryptedCloud,
directAddress,
cloudAddress,
hostname: body.hostname as string,
redirect: body.redirect as string,
username: body.username as string,
expiration: body.expiration as number,
hasLogin: !!body.hasLogin,
error: body.error as string,
authorization: body.authorization as string,
queryToken: body.queryToken as any,
token: body.token as string,
addresses: body.addresses as string[],
externalAddresses: body.externalAddresses as string[],
// the cloud plugin will include this header.
// should maybe move this into the cloud server itself.
scryptedCloud: response.headers.get('x-scrypted-cloud') === 'true',
directAddress: response.headers.get('x-scrypted-direct-address'),
cloudAddress: response.headers.get('x-scrypted-cloud-address'),
};
}
export interface ScryptedClientLoginResult {
username: string;
token: string;
authorization: string;
queryToken: { [parameter: string]: string };
localAddresses: string[];
externalAddresses: string[];
scryptedCloud: boolean;
directAddress: string;
cloudAddress: string;
@@ -232,46 +266,59 @@ export async function connectScryptedClient(options: ScryptedClientOptions): Pro
let authorization: string;
let queryToken: any;
let localAddresses: string[];
let externalAddresses: string[];
let scryptedCloud: boolean;
let directAddress: string;
let cloudAddress: string;
let token: string;
console.log('@scrypted/client', packageJson.version);
const extraHeaders: { [header: string]: string } = {};
// Chrome will complain about websites making xhr requests to self signed https sites, even
// if the cert has been accepted. Other browsers seem fine.
// So the default is not to connect to IP addresses on Chrome, but do so on other browsers.
const isChrome = globalThis.navigator?.userAgent.includes('Chrome');
const isNotChromeOrIsInstalledApp = !isChrome || isInstalledApp();
let tryAlternateAddresses = false;
if (username && password) {
const loginResult = await loginScryptedClient(options as ScryptedLoginOptions);
if (loginResult.authorization)
extraHeaders['Authorization'] = loginResult.authorization;
localAddresses = loginResult.addresses;
externalAddresses = loginResult.externalAddresses;
scryptedCloud = loginResult.scryptedCloud;
directAddress = loginResult.directAddress;
cloudAddress = loginResult.cloudAddress;
authorization = loginResult.authorization;
queryToken = loginResult.queryToken;
token = loginResult.token;
console.log('login result', Date.now() - start, loginResult);
}
else {
const urlsToCheck = new Set<string>();
for (const u of [
...options?.previousLoginResult?.localAddresses || [],
options?.previousLoginResult?.directAddress,
options?.previousLoginResult?.cloudAddress,
]) {
if (u)
urlsToCheck.add(u);
if (options?.previousLoginResult?.token) {
for (const u of [
...options?.previousLoginResult?.localAddresses || [],
options?.previousLoginResult?.directAddress,
]) {
if (u && (isNotChromeOrIsInstalledApp || options.direct))
urlsToCheck.add(u);
}
for (const u of [
...options?.previousLoginResult?.externalAddresses || [],
options?.previousLoginResult?.cloudAddress,
]) {
if (u)
urlsToCheck.add(u);
}
}
// the alternate urls must have a valid response.
const loginCheckPromises = [...urlsToCheck].map(async baseUrl => {
const loginCheck = await checkScryptedClientLogin({
baseUrl,
previousLoginResult: options?.previousLoginResult,
});
function validateLoginResult(loginCheck: Awaited<ReturnType<typeof checkScryptedClientLogin>>) {
if (loginCheck.error || loginCheck.redirect)
throw new Error('login error');
throw new ScryptedClientLoginError(loginCheck);
if (!loginCheck.authorization || !loginCheck.username || !loginCheck.queryToken) {
console.error(loginCheck);
@@ -279,38 +326,60 @@ export async function connectScryptedClient(options: ScryptedClientOptions): Pro
}
return loginCheck;
}
// the alternate urls must have a valid response.
const loginCheckPromises = [...urlsToCheck].map(baseUrl => {
return checkScryptedClientLogin({
baseUrl,
previousLoginResult: options?.previousLoginResult,
})
.then(validateLoginResult);
});
const baseUrlCheck = checkScryptedClientLogin({
baseUrl,
});
previousLoginResult: options?.previousLoginResult,
})
.then(validateLoginResult);
loginCheckPromises.push(baseUrlCheck);
let loginCheck: Awaited<ReturnType<typeof checkScryptedClientLogin>>;
try {
loginCheck = await Promise.any(loginCheckPromises);
tryAlternateAddresses ||= loginCheck.baseUrl !== baseUrl;
}
catch (e) {
loginCheck = await baseUrlCheck;
}
if (tryAlternateAddresses)
console.log('Found direct login. Allowing alternate addresses.')
if (loginCheck.error || loginCheck.redirect)
throw new ScryptedClientLoginError(loginCheck);
localAddresses = loginCheck.addresses;
externalAddresses = loginCheck.externalAddresses;
scryptedCloud = loginCheck.scryptedCloud;
directAddress = loginCheck.directAddress;
cloudAddress = loginCheck.cloudAddress;
username = loginCheck.username;
authorization = loginCheck.authorization;
queryToken = loginCheck.queryToken;
token = loginCheck.token;
console.log('login checked', Date.now() - start, loginCheck);
}
let socket: IOClientSocket;
const eioPath = `endpoint/${pluginId}/engine.io/api`;
const eioEndpoint = baseUrl ? new URL(eioPath, baseUrl).pathname : '/' + eioPath;
// https://github.com/socketio/engine.io/issues/690
const cacehBust = Math.random().toString(36).substring(3, 10);
const eioOptions: Partial<SocketOptions> = {
path: eioEndpoint,
query: {
cacehBust,
},
withCredentials: true,
extraHeaders,
rejectUnauthorized: false,
@@ -323,25 +392,26 @@ export async function connectScryptedClient(options: ScryptedClientOptions): Pro
// watch for this flush.
const flush = new Deferred<void>();
// Chrome will complain about websites making xhr requests to self signed https sites, even
// if the cert has been accepted. Other browsers seem fine.
// So the default is not to connect to IP addresses on Chrome, but do so on other browsers.
const isChrome = globalThis.navigator?.userAgent.includes('Chrome');
const isNotChromeOrIsInstalledApp = !isChrome || isInstalledApp();
const addresses: string[] = [];
const localAddressDefault = isNotChromeOrIsInstalledApp;
if (((scryptedCloud && options.local === undefined && localAddressDefault) || options.local) && localAddresses) {
tryAlternateAddresses ||= scryptedCloud;
if (((tryAlternateAddresses && options.local === undefined && localAddressDefault) || options.local) && localAddresses) {
addresses.push(...localAddresses);
}
const directAddressDefault = directAddress && (isNotChromeOrIsInstalledApp || !isIPAddress(directAddress));
if (((scryptedCloud && options.direct === undefined && directAddressDefault) || options.direct) && directAddress) {
if (((tryAlternateAddresses && options.direct === undefined && directAddressDefault) || options.direct) && directAddress) {
addresses.push(directAddress);
}
if (((scryptedCloud && options.direct === undefined) || options.direct) && cloudAddress) {
addresses.push(cloudAddress);
if ((tryAlternateAddresses && options.direct === undefined) || options.direct) {
if (cloudAddress)
addresses.push(cloudAddress);
for (const externalAddress of externalAddresses || []) {
addresses.push(externalAddress);
}
}
const tryAddresses = !!addresses.length;
@@ -388,7 +458,7 @@ export async function connectScryptedClient(options: ScryptedClientOptions): Pro
// It is probably better to simply prompt and redirect to the LAN address
// if it is reacahble.
for (const address of addresses) {
for (const address of new Set(addresses)) {
console.log('trying', address);
const check = new eio.Socket(address, localEioOptions);
sockets.push(check);
@@ -407,6 +477,9 @@ export async function connectScryptedClient(options: ScryptedClientOptions): Pro
console.log('trying webrtc');
const webrtcEioOptions: Partial<SocketOptions> = {
path: '/endpoint/@scrypted/webrtc/engine.io/',
query: {
cacehBust,
},
withCredentials: true,
extraHeaders,
rejectUnauthorized: false,
@@ -557,6 +630,7 @@ export async function connectScryptedClient(options: ScryptedClientOptions): Pro
await once(check, 'open');
return {
ready: check,
address: explicitBaseUrl,
connectionType: 'http',
};
})());
@@ -617,7 +691,7 @@ export async function connectScryptedClient(options: ScryptedClientOptions): Pro
} = scrypted;
console.log('api attached', Date.now() - start);
mediaManager.createMediaObject = async<T extends MediaObjectOptions>(data: any, mimeType: string, options: T) => {
mediaManager.createMediaObject = async<T extends MediaObjectCreateOptions>(data: any, mimeType: string, options: T) => {
return new MediaObject(mimeType, data, options) as any;
}
@@ -666,6 +740,105 @@ export async function connectScryptedClient(options: ScryptedClientOptions): Pro
.map(id => systemManager.getDeviceById(id))
.find(device => device.pluginId === '@scrypted/core' && device.nativeId === `user:${username}`);
const clusterPeers = new Map<number, Promise<RpcPeer>>();
const ensureClusterPeer = (clusterObject: ClusterObject) => {
let clusterPeerPromise = clusterPeers.get(clusterObject.port);
if (!clusterPeerPromise) {
clusterPeerPromise = (async () => {
const eioPath = 'engine.io/connectRPCObject';
const eioEndpoint = baseUrl ? new URL(eioPath, baseUrl).pathname : '/' + eioPath;
const clusterPeerOptions = {
path: eioEndpoint,
query: {
cacehBust,
clusterObject: JSON.stringify(clusterObject),
},
withCredentials: true,
extraHeaders,
rejectUnauthorized: false,
transports: options?.transports,
};
const clusterPeerSocket = new eio.Socket(explicitBaseUrl, clusterPeerOptions);
let peerReady = false;
clusterPeerSocket.on('close', () => {
clusterPeers.delete(clusterObject.port);
if (!peerReady) {
throw new Error("peer disconnected before setup completed");
}
});
try {
await once(clusterPeerSocket, 'open');
const serializer = createRpcDuplexSerializer({
write: data => clusterPeerSocket.send(data),
});
clusterPeerSocket.on('message', data => serializer.onData(Buffer.from(data)));
const clusterPeer = new RpcPeer(clientName || 'engine.io-client', "cluster-proxy", (message, reject, serializationContext) => {
try {
serializer.sendMessage(message, reject, serializationContext);
}
catch (e) {
reject?.(e);
}
});
serializer.setupRpcPeer(clusterPeer);
clusterPeer.tags.localPort = sourcePeerId;
peerReady = true;
return clusterPeer;
}
catch (e) {
console.error('failure ipc connect', e);
clusterPeerSocket.close();
throw e;
}
})();
clusterPeers.set(clusterObject.port, clusterPeerPromise);
}
return clusterPeerPromise;
};
const resolveObject = async (proxyId: string, sourcePeerPort: number) => {
const sourcePeer = await clusterPeers.get(sourcePeerPort);
if (sourcePeer?.remoteWeakProxies) {
return Object.values(sourcePeer.remoteWeakProxies).find(
v => v.deref()?.__cluster?.proxyId == proxyId
)?.deref();
}
return null;
}
const connectRPCObject = async (value: any) => {
const clusterObject: ClusterObject = value?.__cluster;
if (!clusterObject) {
return value;
}
const { port, proxyId } = clusterObject;
// check if object is already connected
const resolved = await resolveObject(proxyId, port);
if (resolved) {
return resolved;
}
try {
const clusterPeerPromise = ensureClusterPeer(clusterObject);
const clusterPeer = await clusterPeerPromise;
const connectRPCObject: ConnectRPCObject = await clusterPeer.getParam('connectRPCObject');
const newValue = await connectRPCObject(clusterObject);
if (!newValue)
throw new Error('ipc object not found?');
return newValue;
}
catch (e) {
console.error('failure ipc', e);
return value;
}
}
const ret: ScryptedClientStatic = {
userId: userDevice?.id,
serverVersion,
@@ -686,13 +859,19 @@ export async function connectScryptedClient(options: ScryptedClientOptions): Pro
browserSignalingSession,
rpcPeer,
loginResult: {
username,
token,
directAddress,
localAddresses,
externalAddresses,
scryptedCloud,
queryToken,
authorization,
cloudAddress,
}
},
connectRPCObject,
fork: undefined,
connect: undefined,
}
socket.on('close', () => {

View File

@@ -1,4 +1,4 @@
{
"scrypted.debugHost": "koushik-ubuntu",
"scrypted.debugHost": "127.0.0.1",
}

153
plugins/alexa/CHANGELOG.md Normal file
View File

@@ -0,0 +1,153 @@
<details>
<summary>Changelog</summary>
### 0.3.1
alexa/google-home: fix potential vulnerability. do not allow local network control using cloud tokens belonging to a different user. the plugins are now locked to a specific scrypted cloud account once paired.
### 0.3.0
alexa/google-home: additional auth token checks to harden endpoints for cloud sharing
alexa: removed unneeded packages (#1319)
alexa: added support for `light`, `outlet`, and `fan` device types (#1318)
### 0.2.10
alexa: fix potential response race
### 0.2.9
alexa: fix race condition in sendResponse
### 0.2.8
alexa: display camera on doorbell press (#1066)
### 0.2.7
alexa: added helpful error messages regarding token expiration (#1007)
### 0.2.6
alexa: fix doorbells
### 0.2.5
alexa: publish w/ storage fix
### 0.2.4
alexa: add setting to publish debug events to console (#685)
### 0.2.3
webrtc/alexa: add option to disable TURN on peers that already have externally reachable addresses
### 0.2.1
alexa: set screen ratio to 720p (#625)
### 0.2.0
alexa: refactor code structure (#606)
### 0.1.0
alexa: ensure we are talking to the correct API endpoint (#580)
### 0.0.20
alexa: provide hint that medium resolution is always used.
### 0.0.19
various: minor cleanups
alexa: added logging around `tokenInfo` resets (#488)
sdk: rename sdk.version to sdk.serverVersion
plugins: update tsconfig.json
alexa: publish beta
### 0.0.18
alexa: rethrow login failure error
added support for type `Garage` and refactored the controller for future support (#479)
updated install instructions (#478)
webrtc/alexa: fix race condition with intercoms and track not received yet.
### 0.0.17
alexa: close potential security hole if scrypted is exposed to the internet directly (ie, user is not using the cloud plugin against recommendations)
### 0.0.16
plugins: remove postinstall
plugins: add tsconfig.json
alexa: doorbell motion sensor support
### 0.0.15
alexa: fix harmless crash in log
### 0.0.14
alexa: fix empty endpoint list
### 0.0.13
all: prune package.json
alexa: fix doorbell syncing
### 0.0.12
alexa: publish
### 0.0.10
alexa: 2 way audio
### 0.0.4
alexa: 2 way audio
alexa: motion events
### 0.0.3
webrtc: refactor
alexa: use rtc signaling channel
alexa: publish
### 0.0.1
alexa: doorbells
alexa: sync devices properly
alexa: add camera/doorbell, fix webrtc to work with amazon reqs
alexa: initial pass with working cameras
cloud: stub out alexa
</details>

View File

@@ -1,30 +1,48 @@
{
"name": "@scrypted/alexa",
"version": "0.2.7",
"version": "0.3.2",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "@scrypted/alexa",
"version": "0.2.7",
"version": "0.3.2",
"dependencies": {
"axios": "^1.3.4",
"uuid": "^9.0.0"
},
"devDependencies": {
"@scrypted/common": "../../common",
"@scrypted/sdk": "../../sdk",
"@types/debug": "^4.1.12",
"@types/node": "^18.4.2"
}
},
"../../common": {
"name": "@scrypted/common",
"version": "1.0.1",
"dev": true,
"license": "ISC",
"dependencies": {
"@scrypted/sdk": "file:../sdk",
"@scrypted/server": "file:../server",
"http-auth-utils": "^5.0.1",
"typescript": "^5.3.3"
},
"devDependencies": {
"@types/node": "^20.11.0",
"ts-node": "^10.9.2"
}
},
"../../sdk": {
"name": "@scrypted/sdk",
"version": "0.2.104",
"version": "0.3.5",
"dev": true,
"license": "ISC",
"dependencies": {
"@babel/preset-typescript": "^7.18.6",
"adm-zip": "^0.4.13",
"axios": "^0.21.4",
"axios": "^1.6.5",
"babel-loader": "^9.1.0",
"babel-plugin-const-enum": "^1.1.0",
"esbuild": "^0.15.9",
@@ -54,10 +72,32 @@
"typedoc": "^0.23.21"
}
},
"../common": {
"extraneous": true
},
"node_modules/@scrypted/common": {
"resolved": "../../common",
"link": true
},
"node_modules/@scrypted/sdk": {
"resolved": "../../sdk",
"link": true
},
"node_modules/@types/debug": {
"version": "4.1.12",
"resolved": "https://registry.npmjs.org/@types/debug/-/debug-4.1.12.tgz",
"integrity": "sha512-vIChWdVG3LG1SMxEvI/AK+FWJthlrqlTu7fbrlywTkkaONwk/UAGaULXRlf8vkzFBLVm0zkMdCquhL5aOjhXPQ==",
"dev": true,
"dependencies": {
"@types/ms": "*"
}
},
"node_modules/@types/ms": {
"version": "0.7.34",
"resolved": "https://registry.npmjs.org/@types/ms/-/ms-0.7.34.tgz",
"integrity": "sha512-nG96G3Wp6acyAgJqGasjODb+acrI7KltPiRxzHPXnP3NgI28bpQDRv53olbqGXbfcgF5aiiHmO3xpwEpS5Ld9g==",
"dev": true
},
"node_modules/@types/node": {
"version": "18.14.2",
"resolved": "https://registry.npmjs.org/@types/node/-/node-18.14.2.tgz",
@@ -70,9 +110,9 @@
"integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q=="
},
"node_modules/axios": {
"version": "1.3.4",
"resolved": "https://registry.npmjs.org/axios/-/axios-1.3.4.tgz",
"integrity": "sha512-toYm+Bsyl6VC5wSkfkbbNB6ROv7KY93PEBBL6xyDczaIHasAiv4wPqQ/c4RjoQzipxRD2W5g21cOqQulZ7rHwQ==",
"version": "1.6.2",
"resolved": "https://registry.npmjs.org/axios/-/axios-1.6.2.tgz",
"integrity": "sha512-7i24Ri4pmDRfJTR7LDBhsOTtcm+9kjX5WiY1X3wIisx6G9So3pfMkEiU7emUBe46oceVImccTEM3k6C5dbVW8A==",
"dependencies": {
"follow-redirects": "^1.15.0",
"form-data": "^4.0.0",
@@ -99,9 +139,9 @@
}
},
"node_modules/follow-redirects": {
"version": "1.15.2",
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.2.tgz",
"integrity": "sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA==",
"version": "1.15.5",
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.5.tgz",
"integrity": "sha512-vSFWUON1B+yAw1VN4xMfxgn5fTUiaOzAJCKBwIIgT/+7CuGy9+r+5gITvP62j3RmaD5Ph65UaERdOSRGUzZtgw==",
"funding": [
{
"type": "individual",

View File

@@ -1,18 +1,19 @@
{
"name": "@scrypted/alexa",
"version": "0.2.8",
"version": "0.3.2",
"scripts": {
"scrypted-setup-project": "scrypted-setup-project",
"prescrypted-setup-project": "scrypted-package-json",
"build": "scrypted-webpack",
"prepublishOnly": "NODE_ENV=production scrypted-webpack",
"prepublishOnly": "scrypted-changelog && NODE_ENV=production scrypted-webpack",
"prescrypted-vscode-launch": "scrypted-webpack",
"scrypted-vscode-launch": "scrypted-deploy-debug",
"scrypted-deploy-debug": "scrypted-deploy-debug",
"scrypted-debug": "scrypted-debug",
"scrypted-deploy": "scrypted-deploy",
"scrypted-readme": "scrypted-readme",
"scrypted-package-json": "scrypted-package-json"
"scrypted-changelog": "scrypted-changelog",
"scrypted-package-json": "scrypted-package-json",
"scrypted-readme": "scrypted-readme"
},
"keywords": [
"scrypted",
@@ -38,7 +39,9 @@
"uuid": "^9.0.0"
},
"devDependencies": {
"@types/node": "^18.4.2",
"@scrypted/sdk": "../../sdk"
"@scrypted/common": "../../common",
"@scrypted/sdk": "../../sdk",
"@types/debug": "^4.1.12",
"@types/node": "^18.4.2"
}
}

View File

@@ -1,4 +1,4 @@
export declare type DisplayCategory = 'ACTIVITY_TRIGGER' | 'CAMERA' | 'CONTACT_SENSOR' | 'DOOR' | 'DOORBELL' | 'GARAGE_DOOR' | 'LIGHT' | 'MICROWAVE' | 'MOTION_SENSOR' | 'OTHER' | 'SCENE_TRIGGER' | 'SECURITY_PANEL' | 'SMARTLOCK' | 'SMARTPLUG' | 'SPEAKER' | 'SWITCH' | 'TEMPERATURE_SENSOR' | 'THERMOSTAT' | 'TV';
export declare type DisplayCategory = 'ACTIVITY_TRIGGER' | 'CAMERA' | 'CONTACT_SENSOR' | 'DOOR' | 'DOORBELL' | 'GARAGE_DOOR' | 'LIGHT' | 'MICROWAVE' | 'MOTION_SENSOR' | 'OTHER' | 'SCENE_TRIGGER' | 'SECURITY_PANEL' | 'SMARTLOCK' | 'SMARTPLUG' | 'SPEAKER' | 'SWITCH' | 'TEMPERATURE_SENSOR' | 'THERMOSTAT' | 'TV' | 'FAN';
/*
COMMON DIRECTIVES AND RESPONSES
@@ -116,7 +116,7 @@ export interface ErrorPayload {
message: string;
}
export interface ChangePayload {
export interface ChangePayload extends Payload {
change: {
cause: {
type: "APP_INTERACTION" | "PERIODIC_POLL" | "PHYSICAL_INTERACTION" | "VOICE_INTERACTION" | "RULE_TRIGGER";

View File

@@ -27,6 +27,7 @@ class AlexaPlugin extends ScryptedDeviceBase implements HttpRequestHandler, Mixi
json: true
},
syncedDevices: {
defaultValue: [],
multiple: true,
hide: true
},
@@ -47,7 +48,11 @@ class AlexaPlugin extends ScryptedDeviceBase implements HttpRequestHandler, Mixi
onPut(oldValue: boolean, newValue: boolean) {
DEBUG = newValue;
}
}
},
pairedUserId: {
title: "Pairing Key",
description: "The pairing key used to validate requests from Alexa. Clear this key or delete the plugin to allow pairing with a different Alexa login.",
},
});
accessToken: Promise<string>;
@@ -62,7 +67,10 @@ class AlexaPlugin extends ScryptedDeviceBase implements HttpRequestHandler, Mixi
alexaHandlers.set('Alexa.Authorization/AcceptGrant', this.onAlexaAuthorization);
alexaHandlers.set('Alexa.Discovery/Discover', this.onDiscoverEndpoints);
this.start();
this.start()
.catch(e => {
this.console.error('startup failed', e);
})
}
async start() {
@@ -79,7 +87,7 @@ class AlexaPlugin extends ScryptedDeviceBase implements HttpRequestHandler, Mixi
if (status === DeviceMixinStatus.Setup)
await this.syncEndpoints();
if (status === DeviceMixinStatus.Setup || status === DeviceMixinStatus.AlreadySetup) {
if (status === DeviceMixinStatus.Setup || status === DeviceMixinStatus.AlreadySetup) {
if (!this.devices.has(eventSource.id)) {
this.devices.set(eventSource.id, eventSource);
@@ -142,7 +150,7 @@ class AlexaPlugin extends ScryptedDeviceBase implements HttpRequestHandler, Mixi
await this.syncEndpoints();
}
async deviceListen(eventSource: ScryptedDevice | undefined, eventDetails: EventDetails, eventData: any) : Promise<void> {
async deviceListen(eventSource: ScryptedDevice | undefined, eventDetails: EventDetails, eventData: any): Promise<void> {
if (!eventSource)
return;
@@ -167,7 +175,7 @@ class AlexaPlugin extends ScryptedDeviceBase implements HttpRequestHandler, Mixi
}
if (!report) {
this.console.warn(`${eventDetails.eventInterface}.${eventDetails.property} not supported for device ${eventSource.type}`);
debug(`${eventDetails.eventInterface}.${eventDetails.property} not supported for device ${eventSource.type}`);
return;
}
@@ -194,14 +202,14 @@ class AlexaPlugin extends ScryptedDeviceBase implements HttpRequestHandler, Mixi
// nothing to report
if (data.context === undefined && data.event.payload === undefined)
return;
return;
data = await this.addAccessToken(data);
await this.postEvent(data);
}
private async addAccessToken(data: any) : Promise<any> {
private async addAccessToken(data: any): Promise<any> {
const accessToken = await this.getAccessToken();
if (data.event === undefined)
@@ -232,7 +240,7 @@ class AlexaPlugin extends ScryptedDeviceBase implements HttpRequestHandler, Mixi
'api.fe.amazonalexa.com'
];
async getAlexaEndpoint() : Promise<string> {
async getAlexaEndpoint(): Promise<string> {
if (this.storageSettings.values.apiEndpoint)
return this.storageSettings.values.apiEndpoint;
@@ -276,7 +284,7 @@ class AlexaPlugin extends ScryptedDeviceBase implements HttpRequestHandler, Mixi
});
}
async getEndpoints() : Promise<DiscoveryEndpoint[]> {
async getEndpoints(): Promise<DiscoveryEndpoint[]> {
const endpoints: DiscoveryEndpoint[] = [];
for (const id of Object.keys(systemManager.getSystemState())) {
@@ -284,7 +292,7 @@ class AlexaPlugin extends ScryptedDeviceBase implements HttpRequestHandler, Mixi
if (!device.mixins?.includes(this.id))
continue;
const endpoint = await this.getEndpointForDevice(device);
if (endpoint)
endpoints.push(endpoint);
@@ -319,7 +327,7 @@ class AlexaPlugin extends ScryptedDeviceBase implements HttpRequestHandler, Mixi
const endpoints = await this.getEndpoints();
if (!endpoints.length)
return [];
return [];
const accessToken = await this.getAccessToken();
const data = {
@@ -448,7 +456,7 @@ class AlexaPlugin extends ScryptedDeviceBase implements HttpRequestHandler, Mixi
self.console.warn(error?.response?.data);
self.log.a(error?.response?.data?.error_description);
break;
case 'expired_token':
self.console.warn(error?.response?.data);
self.log.a(error?.response?.data?.error_description);
@@ -480,9 +488,14 @@ class AlexaPlugin extends ScryptedDeviceBase implements HttpRequestHandler, Mixi
this.storageSettings.values.tokenInfo = grant;
this.storageSettings.values.apiEndpoint = undefined;
this.accessToken = undefined;
const self = this;
let accessToken = await this.getAccessToken().catch(reason => {
let accessToken: any;
try {
accessToken = await this.getAccessToken();
}
catch (reason) {
self.console.error(`Failed to handle the AcceptGrant directive because ${reason}`);
this.storageSettings.values.tokenInfo = undefined;
@@ -491,36 +504,23 @@ class AlexaPlugin extends ScryptedDeviceBase implements HttpRequestHandler, Mixi
response.send(authErrorResponse("ACCEPT_GRANT_FAILED", `Failed to handle the AcceptGrant directive because ${reason}`, directive));
return undefined;
});
if (accessToken !== undefined) {
this.log.clearAlerts();
try {
response.send({
"event": {
"header": {
"namespace": "Alexa.Authorization",
"name": "AcceptGrant.Response",
"messageId": createMessageId(),
"payloadVersion": "3"
},
"payload": {}
}
});
} catch (error) {
this.console.error(`AcceptGrant.Response failed because ${error}`);
this.storageSettings.values.tokenInfo = undefined;
this.storageSettings.values.apiEndpoint = undefined;
this.accessToken = undefined;
throw error;
return;
};
this.log.clearAlerts();
response.send({
"event": {
"header": {
"namespace": "Alexa.Authorization",
"name": "AcceptGrant.Response",
"messageId": createMessageId(),
"payloadVersion": "3"
},
"payload": {}
}
}
});
}
async getEndpointForDevice(device: ScryptedDevice) : Promise<DiscoveryEndpoint> {
async getEndpointForDevice(device: ScryptedDevice): Promise<DiscoveryEndpoint> {
if (!device)
return;
@@ -545,7 +545,7 @@ class AlexaPlugin extends ScryptedDeviceBase implements HttpRequestHandler, Mixi
};
let supportedEndpointHealths: any[] = [];
if (device.interfaces.includes(ScryptedInterface.Online)) {
supportedEndpointHealths.push({
"name": "connectivity"
@@ -607,11 +607,22 @@ class AlexaPlugin extends ScryptedDeviceBase implements HttpRequestHandler, Mixi
try {
debug("making authorization request to Scrypted");
await axios.get('https://home.scrypted.app/_punch/getcookie', {
const getcookieResponse = await axios.get('https://home.scrypted.app/_punch/getcookie', {
headers: {
'Authorization': authorization,
}
});
// new tokens will contain a lot of information, including the expiry and client id.
// validate this. old tokens will be grandfathered in.
if (getcookieResponse.data.expiry && getcookieResponse.data.clientId !== 'amazon')
throw new Error('client id mismatch');
if (!this.storageSettings.values.pairedUserId) {
this.storageSettings.values.pairedUserId = getcookieResponse.data.id;
}
else if (this.storageSettings.values.pairedUserId !== getcookieResponse.data.id) {
this.log.a('This plugin is already paired with a different account. Clear the existing key in the plugin settings to pair this plugin with a different account.');
throw new Error('user id mismatch');
}
this.validAuths.add(authorization);
}
catch (e) {
@@ -632,8 +643,10 @@ class AlexaPlugin extends ScryptedDeviceBase implements HttpRequestHandler, Mixi
debug("received directive from alexa", mapName, body);
const handler = alexaHandlers.get(mapName);
if (handler)
return handler.apply(this, [request, response, directive]);
if (handler) {
await handler.apply(this, [request, response, directive]);
return;
}
const deviceHandler = alexaDeviceHandlers.get(mapName);
@@ -644,7 +657,8 @@ class AlexaPlugin extends ScryptedDeviceBase implements HttpRequestHandler, Mixi
return;
}
return deviceHandler.apply(this, [request, response, directive, device]);
await deviceHandler.apply(this, [request, response, directive, device]);
return;
} else {
this.console.error(`no handler for: ${mapName}`);
}

View File

@@ -4,6 +4,7 @@ import { v4 as createMessageId } from 'uuid';
import { AlexaHttpResponse, sendDeviceResponse } from "../../common";
import { alexaDeviceHandlers } from "../../handlers";
import { Response, WebRTCAnswerGeneratedForSessionEvent, WebRTCSessionConnectedEvent, WebRTCSessionDisconnectedEvent } from '../../alexa'
import { Deferred } from '@scrypted/common/src/deferred';
export class AlexaSignalingSession implements RTCSignalingSession {
constructor(public response: AlexaHttpResponse, public directive: any) {
@@ -13,7 +14,8 @@ export class AlexaSignalingSession implements RTCSignalingSession {
__proxy_props: { options: RTCSignalingOptions; };
options: RTCSignalingOptions;
remoteDescription = new Deferred<void>();
async getOptions(): Promise<RTCSignalingOptions> {
return this.options;
}
@@ -39,11 +41,17 @@ export class AlexaSignalingSession implements RTCSignalingSession {
}
async createLocalDescription(type: "offer" | "answer", setup: RTCAVSignalingSetup, sendIceCandidate: RTCSignalingSendIceCandidate): Promise<RTCSessionDescriptionInit> {
if (type !== 'offer')
throw new Error('Alexa only supports RTC offer');
if (type !== 'offer') {
const e = new Error('Alexa only supports RTC offer');
this.remoteDescription.reject(e);
throw e;
}
if (sendIceCandidate)
throw new Error("Alexa does not support trickle ICE");
if (sendIceCandidate) {
const e = new Error("Alexa does not support trickle ICE");
this.remoteDescription.reject(e);
throw e;
}
return {
type: type,
@@ -67,15 +75,16 @@ export class AlexaSignalingSession implements RTCSignalingSession {
},
context: undefined
};
data.event.header.name = "AnswerGeneratedForSession";
data.event.header.messageId = createMessageId();
data.event.payload.answer = {
format: 'SDP',
value: description.sdp,
};
this.remoteDescription.resolve();
this.response.send(data);
}
}
@@ -85,13 +94,14 @@ const sessionCache = new Map<string, RTCSessionControl>();
alexaDeviceHandlers.set('Alexa.RTCSessionController/InitiateSessionWithOffer', async (request, response, directive: any, device: ScryptedDevice & RTCSignalingChannel) => {
const { header, endpoint, payload } = directive;
const { sessionId } = payload;
const session = new AlexaSignalingSession(response, directive);
const control = await device.startRTCSignalingSession(session);
control.setPlayback({
audio: true,
video: false,
})
});
await session.remoteDescription.promise;
sessionCache.set(sessionId, control);
});
@@ -115,13 +125,13 @@ alexaDeviceHandlers.set('Alexa.RTCSessionController/SessionConnected', async (re
alexaDeviceHandlers.set('Alexa.RTCSessionController/SessionDisconnected', async (request, response, directive: any, device: ScryptedDevice) => {
const { header, endpoint, payload } = directive;
const { sessionId } = payload;
const session = sessionCache.get(sessionId);
if (session) {
sessionCache.delete(sessionId);
await session.endSession();
}
const data: WebRTCSessionDisconnectedEvent = {
"event": {
header,
@@ -130,9 +140,9 @@ alexaDeviceHandlers.set('Alexa.RTCSessionController/SessionDisconnected', async
},
context: undefined
};
data.event.header.messageId = createMessageId();
response.send(data);
});
@@ -152,14 +162,14 @@ alexaDeviceHandlers.set('Alexa.SmartVision.ObjectDetectionSensor/SetObjectDetect
},
"context": {
"properties": [{
"namespace": "Alexa.SmartVision.ObjectDetectionSensor",
"name": "objectDetectionClasses",
"value": detectionTypes.classes.map(type => ({
"imageNetClass": type
})),
timeOfSample: new Date().toISOString(),
uncertaintyInMilliseconds: 0
}]
"namespace": "Alexa.SmartVision.ObjectDetectionSensor",
"name": "objectDetectionClasses",
"value": detectionTypes.classes.map(type => ({
"imageNetClass": type
})),
timeOfSample: new Date().toISOString(),
uncertaintyInMilliseconds: 0
}]
}
};

View File

@@ -0,0 +1,71 @@
import { OnOff, ScryptedDevice, ScryptedDeviceType, ScryptedInterface } from "@scrypted/sdk";
import { DiscoveryEndpoint, ChangeReport, Report, Property, ChangePayload, DiscoveryCapability } from "../alexa";
import { supportedTypes } from ".";
supportedTypes.set(ScryptedDeviceType.Fan, {
async discover(device: ScryptedDevice): Promise<Partial<DiscoveryEndpoint>> {
if (!device.interfaces.includes(ScryptedInterface.OnOff))
return;
const capabilities: DiscoveryCapability[] = [];
capabilities.push({
"type": "AlexaInterface",
"interface": "Alexa.PowerController",
"version": "3",
"properties": {
"supported": [
{
"name": "powerState"
}
],
"proactivelyReported": true,
"retrievable": true
}
});
return {
displayCategories: ['FAN'],
capabilities
}
},
async sendReport(eventSource: ScryptedDevice & OnOff): Promise<Partial<Report>> {
return {
context: {
"properties": [
{
"namespace": "Alexa.PowerController",
"name": "powerState",
"value": eventSource.on ? "ON" : "OFF",
"timeOfSample": new Date().toISOString(),
"uncertaintyInMilliseconds": 0
} as Property
]
}
};
},
async sendEvent(eventSource: ScryptedDevice & OnOff, eventDetails, eventData): Promise<Partial<Report>> {
if (eventDetails.eventInterface !== ScryptedInterface.OnOff)
return undefined;
return {
event: {
payload: {
change: {
cause: {
type: "PHYSICAL_INTERACTION"
},
properties: [
{
"namespace": "Alexa.PowerController",
"name": "powerState",
"value": eventData ? "ON" : "OFF",
"timeOfSample": new Date().toISOString(),
"uncertaintyInMilliseconds": 0
} as Property
]
}
} as ChangePayload,
}
} as Partial<ChangeReport>;
}
});

View File

@@ -13,8 +13,12 @@ export const supportedTypes = new Map<ScryptedDeviceType, SupportedType>();
import '../handlers';
import './camera';
import './camera/handlers';
import './light';
import './light/handlers'
import './fan';
import './doorbell';
import './garagedoor';
import './outlet';
import './switch';
import './switch/handlers';
import './sensor';

View File

@@ -0,0 +1,225 @@
import { Brightness, ColorSettingHsv, ColorSettingTemperature, OnOff, ScryptedDevice, ScryptedDeviceType, ScryptedInterface } from "@scrypted/sdk";
import { DiscoveryEndpoint, ChangeReport, Report, Property, ChangePayload, DiscoveryCapability, StateReport } from "../alexa";
import { supportedTypes } from ".";
supportedTypes.set(ScryptedDeviceType.Light, {
async discover(device: ScryptedDevice): Promise<Partial<DiscoveryEndpoint>> {
if (!device.interfaces.includes(ScryptedInterface.OnOff))
return;
const capabilities: DiscoveryCapability[] = [];
if (device.interfaces.includes(ScryptedInterface.OnOff)) {
capabilities.push({
"type": "AlexaInterface",
"interface": "Alexa.PowerController",
"version": "3",
"properties": {
"supported": [{
"name": "powerState"
}],
"proactivelyReported": true,
"retrievable": true
}
});
}
if (device.interfaces.includes(ScryptedInterface.Brightness)) {
capabilities.push({
"type": "AlexaInterface",
"interface": "Alexa.BrightnessController",
"version": "3",
"properties": {
"supported": [{
"name": "brightness"
}],
"proactivelyReported": true,
"retrievable": true
}
});
}
if (device.interfaces.includes(ScryptedInterface.ColorSettingTemperature)) {
capabilities.push({
"type": "AlexaInterface",
"interface": "Alexa.ColorTemperatureController",
"version": "3",
"properties": {
"supported": [{
"name": "colorTemperatureInKelvin"
}],
"proactivelyReported": true,
"retrievable": true
}
});
}
if (device.interfaces.includes(ScryptedInterface.ColorSettingHsv)) {
capabilities.push({
"type": "AlexaInterface",
"interface": "Alexa.ColorController",
"version": "3",
"properties": {
"supported": [{
"name": "color"
}],
"proactivelyReported": true,
"retrievable": true
}
});
}
return {
displayCategories: ['LIGHT'],
capabilities
}
},
async sendReport(eventSource: ScryptedDevice & OnOff & Brightness & ColorSettingHsv & ColorSettingTemperature): Promise<Partial<Report>> {
let data = {
context: {
properties: []
}
} as Partial<StateReport>;
if (eventSource.interfaces.includes(ScryptedInterface.OnOff)) {
data.context.properties.push({
"namespace": "Alexa.PowerController",
"name": "powerState",
"value": eventSource.on ? "ON" : "OFF",
"timeOfSample": new Date().toISOString(),
"uncertaintyInMilliseconds": 0
});
}
if (eventSource.interfaces.includes(ScryptedInterface.Brightness)) {
data.context.properties.push({
"namespace": "Alexa.BrightnessController",
"name": "brightness",
"value": eventSource.brightness,
"timeOfSample": new Date().toISOString(),
"uncertaintyInMilliseconds": 0
});
}
if (eventSource.interfaces.includes(ScryptedInterface.ColorSettingHsv) && eventSource.hsv) {
data.context.properties.push({
"namespace": "Alexa.ColorController",
"name": "color",
"value": {
"hue": eventSource.hsv.h,
"saturation": eventSource.hsv.s,
"brightness": eventSource.hsv.v
},
"timeOfSample": new Date().toISOString(),
"uncertaintyInMilliseconds": 0
});
}
if (eventSource.interfaces.includes(ScryptedInterface.ColorSettingTemperature) && eventSource.colorTemperature) {
data.context.properties.push({
"namespace": "Alexa.ColorTemperatureController",
"name": "colorTemperatureInKelvin",
"value": eventSource.colorTemperature,
"timeOfSample": new Date().toISOString(),
"uncertaintyInMilliseconds": 0
});
}
return data;
},
async sendEvent(eventSource: ScryptedDevice & OnOff & Brightness & ColorSettingHsv & ColorSettingTemperature, eventDetails, eventData): Promise<Partial<Report>> {
if (eventDetails.eventInterface == ScryptedInterface.OnOff)
return {
event: {
payload: {
change: {
cause: {
type: "PHYSICAL_INTERACTION"
},
properties: [
{
"namespace": "Alexa.PowerController",
"name": "powerState",
"value": eventData ? "ON" : "OFF",
"timeOfSample": new Date(eventDetails.eventTime).toISOString(),
"uncertaintyInMilliseconds": 0
} as Property
]
}
} as ChangePayload,
}
} as Partial<ChangeReport>;
if (eventDetails.eventInterface == ScryptedInterface.Brightness && eventSource.brightness)
return {
event: {
payload: {
change: {
cause: {
type: "PHYSICAL_INTERACTION"
},
properties: [
{
"namespace": "Alexa.BrightnessController",
"name": "brightness",
"value": eventSource.brightness,
"timeOfSample": new Date(eventDetails.eventTime).toISOString(),
"uncertaintyInMilliseconds": 0
} as Property
]
}
} as ChangePayload,
}
} as Partial<ChangeReport>;
if (eventDetails.eventInterface == ScryptedInterface.ColorSettingHsv && eventSource.hsv)
return {
event: {
payload: {
change: {
cause: {
type: "PHYSICAL_INTERACTION"
},
properties: [
{
"namespace": "Alexa.ColorController",
"name": "color",
"value": {
"hue": eventSource.hsv.h,
"saturation": eventSource.hsv.s,
"brightness": eventSource.hsv.v
},
"timeOfSample": new Date(eventDetails.eventTime).toISOString(),
"uncertaintyInMilliseconds": 0
} as Property
]
}
} as ChangePayload,
}
} as Partial<ChangeReport>;
if (eventDetails.eventInterface == ScryptedInterface.ColorSettingTemperature && eventSource.colorTemperature)
return {
event: {
payload: {
change: {
cause: {
type: "PHYSICAL_INTERACTION"
},
properties: [
{
"namespace": "Alexa.ColorTemperatureController",
"name": "colorTemperatureInKelvin",
"value": eventSource.colorTemperature,
"timeOfSample": new Date(eventDetails.eventTime).toISOString(),
"uncertaintyInMilliseconds": 0
} as Property
]
}
} as ChangePayload,
}
} as Partial<ChangeReport>;
return undefined;
}
});

View File

@@ -0,0 +1,166 @@
import { Brightness, ColorHsv, ColorSettingHsv, ColorSettingTemperature, ScryptedDevice, ScryptedInterface } from "@scrypted/sdk";
import { supportedTypes } from "..";
import { deviceErrorResponse, sendDeviceResponse } from "../../common";
import { v4 as createMessageId } from 'uuid';
import { alexaDeviceHandlers } from "../../handlers";
import { Directive, Response } from "../../alexa";
import { error } from "console";
function commonBrightnessResponse(header, endpoint, payload, response, device: ScryptedDevice & Brightness) {
const data : Response = {
"event": {
header,
endpoint,
payload
},
"context": {
"properties": [
{
"namespace": "Alexa.PowerController",
"name": "brightness",
"value": device.brightness,
"timeOfSample": new Date().toISOString(),
"uncertaintyInMilliseconds": 500
}
]
}
};
data.event.header.namespace = "Alexa";
data.event.header.name = "Response";
data.event.header.messageId = createMessageId();
sendDeviceResponse(data, response, device);
}
alexaDeviceHandlers.set('Alexa.BrightnessController/SetBrightness', async (request, response, directive: Directive, device: ScryptedDevice & Brightness) => {
const supportedType = supportedTypes.get(device.type);
if (!supportedType)
return;
const { header, endpoint, payload } = directive;
await device.setBrightness((payload as any).brightness)
commonBrightnessResponse(header, endpoint, payload, response, device);
});
alexaDeviceHandlers.set('Alexa.BrightnessController/AdjustBrightness', async (request, response, directive: Directive, device: ScryptedDevice & Brightness) => {
const supportedType = supportedTypes.get(device.type);
if (!supportedType)
return;
const { header, endpoint, payload } = directive;
await device.setBrightness(device.brightness + (payload as any).brightnessDelta)
commonBrightnessResponse(header, endpoint, payload, response, device);
});
alexaDeviceHandlers.set('Alexa.ColorController/SetColor', async (request, response, directive: Directive, device: ScryptedDevice & ColorSettingHsv) => {
const supportedType = supportedTypes.get(device.type);
if (!supportedType)
return;
const { header, endpoint, payload } = directive;
let hsv : ColorHsv = {
h: (payload as any).color.hue,
s: (payload as any).color.saturation,
v: (payload as any).color.brightness
};
if (!device.interfaces.includes(ScryptedInterface.ColorSettingHsv))
return deviceErrorResponse("INVALID_REQUEST_EXCEPTION", "Device does not support setting color by HSV.", directive);
await device.setHsv(hsv.h, hsv.s, hsv.v);
hsv = device.hsv;
const data : Response = {
"event": {
"header": {
"namespace": "Alexa",
"name": "Response",
"messageId": createMessageId(),
"correlationToken": header.correlationToken,
"payloadVersion": header.payloadVersion
},
endpoint,
payload
},
"context": {
"properties": [
{
"namespace": "Alexa.ColorController",
"name": "color",
"value": {
"hue": hsv.h,
"saturation": hsv.s,
"brightness": hsv.v
},
"timeOfSample": new Date().toISOString(),
"uncertaintyInMilliseconds": 500
}
]
}
};
sendDeviceResponse(data, response, device);
});
function commonColorTemperatureResponse(header, endpoint, payload, response, device: ScryptedDevice & ColorSettingTemperature) {
const data : Response = {
"event": {
header,
endpoint,
payload
},
"context": {
"properties": [
{
"namespace": "Alexa.ColorTemperatureController",
"name": "colorTemperatureInKelvin",
"value": device.colorTemperature,
"timeOfSample": new Date().toISOString(),
"uncertaintyInMilliseconds": 500
}
]
}
};
data.event.header.namespace = "Alexa";
data.event.header.name = "Response";
data.event.header.messageId = createMessageId();
sendDeviceResponse(data, response, device);
}
alexaDeviceHandlers.set('Alexa.ColorTemperatureController/SetColorTemperature', async (request, response, directive: Directive, device: ScryptedDevice & ColorSettingTemperature) => {
const supportedType = supportedTypes.get(device.type);
if (!supportedType)
return;
const { header, endpoint, payload } = directive;
await device.setColorTemperature((payload as any).colorTemperatureInKelvin)
commonColorTemperatureResponse(header, endpoint, payload, response, device);
});
alexaDeviceHandlers.set('Alexa.ColorTemperatureController/IncreaseColorTemperature', async (request, response, directive: Directive, device: ScryptedDevice & ColorSettingTemperature) => {
const supportedType = supportedTypes.get(device.type);
if (!supportedType)
return;
const { header, endpoint, payload } = directive;
await device.setColorTemperature(device.colorTemperature + 500);
commonColorTemperatureResponse(header, endpoint, payload, response, device);
});
alexaDeviceHandlers.set('Alexa.ColorTemperatureController/DecreaseColorTemperature', async (request, response, directive: Directive, device: ScryptedDevice & ColorSettingTemperature) => {
const supportedType = supportedTypes.get(device.type);
if (!supportedType)
return;
const { header, endpoint, payload } = directive;
await device.setColorTemperature(device.colorTemperature - 500);
commonColorTemperatureResponse(header, endpoint, payload, response, device);
});

View File

@@ -0,0 +1,71 @@
import { OnOff, ScryptedDevice, ScryptedDeviceType, ScryptedInterface } from "@scrypted/sdk";
import { DiscoveryEndpoint, ChangeReport, Report, Property, ChangePayload, DiscoveryCapability } from "../alexa";
import { supportedTypes } from ".";
supportedTypes.set(ScryptedDeviceType.Outlet, {
async discover(device: ScryptedDevice): Promise<Partial<DiscoveryEndpoint>> {
if (!device.interfaces.includes(ScryptedInterface.OnOff))
return;
const capabilities: DiscoveryCapability[] = [];
capabilities.push({
"type": "AlexaInterface",
"interface": "Alexa.PowerController",
"version": "3",
"properties": {
"supported": [
{
"name": "powerState"
}
],
"proactivelyReported": true,
"retrievable": true
}
});
return {
displayCategories: ['SMARTPLUG'],
capabilities
}
},
async sendReport(eventSource: ScryptedDevice & OnOff): Promise<Partial<Report>> {
return {
context: {
"properties": [
{
"namespace": "Alexa.PowerController",
"name": "powerState",
"value": eventSource.on ? "ON" : "OFF",
"timeOfSample": new Date().toISOString(),
"uncertaintyInMilliseconds": 0
} as Property
]
}
};
},
async sendEvent(eventSource: ScryptedDevice & OnOff, eventDetails, eventData): Promise<Partial<Report>> {
if (eventDetails.eventInterface !== ScryptedInterface.OnOff)
return undefined;
return {
event: {
payload: {
change: {
cause: {
type: "PHYSICAL_INTERACTION"
},
properties: [
{
"namespace": "Alexa.PowerController",
"name": "powerState",
"value": eventData ? "ON" : "OFF",
"timeOfSample": new Date().toISOString(),
"uncertaintyInMilliseconds": 0
} as Property
]
}
} as ChangePayload,
}
} as Partial<ChangeReport>;
}
});

View File

@@ -10,7 +10,7 @@
"port": 10081,
"request": "attach",
"skipFiles": [
"**/plugin-remote-worker.*",
"**/plugin-console.*",
"<node_internals>/**"
],
"preLaunchTask": "scrypted: deploy+debug",

View File

@@ -39,6 +39,8 @@ Each 'Channel' or (camera) Device attached to the NVR must be configured as sepa
* `Snapshot URL Override` camera's IP address (preferred) or specific port number of NVR for that camera (may work). That is: `http://<camera IP address>/cgi-bin/snapshot.cgi` or `http://<NVR IP address>:<NVR port # for camera>/cgi-bin/snapshot.cgi`
* `Channel Number Override` camera's channel number as known to DVR
## Dahua Lock/Unlock
Dahua DTO video intercoms have built-in access control for locks/doors. If you have set the Amcrest plugin up with `Doorbell Type` set to `Dahua Doorbell`, you can enable support for remotely locking/unlocking by enabling/toggle the option `Enable Dahua Lock`.
# Troubleshooting
## General

View File

@@ -1,45 +1,46 @@
{
"name": "@scrypted/amcrest",
"version": "0.0.127",
"version": "0.0.151",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "@scrypted/amcrest",
"version": "0.0.127",
"version": "0.0.151",
"license": "Apache",
"dependencies": {
"@koush/axios-digest-auth": "^0.8.5",
"@scrypted/common": "file:../../common",
"@scrypted/sdk": "file:../../sdk",
"@types/multiparty": "^0.0.33",
"multiparty": "^4.2.3"
"content-type": "^1.0.5"
},
"devDependencies": {
"@types/node": "^18.16.18"
"@types/content-type": "^1.1.8",
"@types/node": "^20.11.30"
}
},
"../../common": {
"name": "@scrypted/common",
"version": "1.0.1",
"license": "ISC",
"dependencies": {
"@scrypted/sdk": "file:../sdk",
"@scrypted/server": "file:../server",
"http-auth-utils": "^3.0.2",
"node-fetch-commonjs": "^3.1.1",
"typescript": "^4.4.3"
"http-auth-utils": "^5.0.1",
"typescript": "^5.3.3"
},
"devDependencies": {
"@types/node": "^16.9.0"
"@types/node": "^20.11.0",
"ts-node": "^10.9.2"
}
},
"../../sdk": {
"version": "0.2.103",
"name": "@scrypted/sdk",
"version": "0.3.29",
"license": "ISC",
"dependencies": {
"@babel/preset-typescript": "^7.18.6",
"adm-zip": "^0.4.13",
"axios": "^0.21.4",
"axios": "^1.6.5",
"babel-loader": "^9.1.0",
"babel-plugin-const-enum": "^1.1.0",
"esbuild": "^0.15.9",
@@ -69,15 +70,6 @@
"typedoc": "^0.23.21"
}
},
"node_modules/@koush/axios-digest-auth": {
"version": "0.8.5",
"resolved": "https://registry.npmjs.org/@koush/axios-digest-auth/-/axios-digest-auth-0.8.5.tgz",
"integrity": "sha512-EZMM0gMJ3hMUD4EuUqSwP6UGt5Vmw2TZtY7Ypec55AnxkExSXM0ySgPtqkAcnL43g1R27yAg/dQL7dRTLMqO3Q==",
"dependencies": {
"auth-header": "^1.0.0",
"axios": "^0.21.4"
}
},
"node_modules/@scrypted/common": {
"resolved": "../../common",
"link": true
@@ -86,150 +78,34 @@
"resolved": "../../sdk",
"link": true
},
"node_modules/@types/multiparty": {
"version": "0.0.33",
"resolved": "https://registry.npmjs.org/@types/multiparty/-/multiparty-0.0.33.tgz",
"integrity": "sha512-Il6cJUpSqgojT7NxbVJUvXkCblm50/yEJYtblISDsNIeNYf4yMAhdizzidUk6h8pJ8yhwK/3Fkb+3Dwcgtwl8w==",
"dependencies": {
"@types/node": "*"
}
"node_modules/@types/content-type": {
"version": "1.1.8",
"resolved": "https://registry.npmjs.org/@types/content-type/-/content-type-1.1.8.tgz",
"integrity": "sha512-1tBhmVUeso3+ahfyaKluXe38p+94lovUZdoVfQ3OnJo9uJC42JT7CBoN3k9HYhAae+GwiBYmHu+N9FZhOG+2Pg==",
"dev": true
},
"node_modules/@types/node": {
"version": "18.16.18",
"resolved": "https://registry.npmjs.org/@types/node/-/node-18.16.18.tgz",
"integrity": "sha512-/aNaQZD0+iSBAGnvvN2Cx92HqE5sZCPZtx2TsK+4nvV23fFe09jVDvpArXr2j9DnYlzuU9WuoykDDc6wqvpNcw=="
},
"node_modules/auth-header": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/auth-header/-/auth-header-1.0.0.tgz",
"integrity": "sha512-CPPazq09YVDUNNVWo4oSPTQmtwIzHusZhQmahCKvIsk0/xH6U3QsMAv3sM+7+Q0B1K2KJ/Q38OND317uXs4NHA=="
},
"node_modules/axios": {
"version": "0.21.4",
"resolved": "https://registry.npmjs.org/axios/-/axios-0.21.4.tgz",
"integrity": "sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg==",
"version": "20.11.30",
"resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.30.tgz",
"integrity": "sha512-dHM6ZxwlmuZaRmUPfv1p+KrdD1Dci04FbdEm/9wEMouFqxYoFl5aMkt0VMAUtYRQDyYvD41WJLukhq/ha3YuTw==",
"dev": true,
"dependencies": {
"follow-redirects": "^1.14.0"
"undici-types": "~5.26.4"
}
},
"node_modules/depd": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz",
"integrity": "sha512-7emPTl6Dpo6JRXOXjLRxck+FlLRX5847cLKEn00PLAgc3g2hTZZgr+e4c2v6QpSmLeFP3n5yUo7ft6avBK/5jQ==",
"node_modules/content-type": {
"version": "1.0.5",
"resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz",
"integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==",
"engines": {
"node": ">= 0.6"
}
},
"node_modules/follow-redirects": {
"version": "1.15.2",
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.2.tgz",
"integrity": "sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA==",
"funding": [
{
"type": "individual",
"url": "https://github.com/sponsors/RubenVerborgh"
}
],
"engines": {
"node": ">=4.0"
},
"peerDependenciesMeta": {
"debug": {
"optional": true
}
}
},
"node_modules/http-errors": {
"version": "1.8.1",
"resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.8.1.tgz",
"integrity": "sha512-Kpk9Sm7NmI+RHhnj6OIWDI1d6fIoFAtFt9RLaTMRlg/8w49juAStsrBgp0Dp4OdxdVbRIeKhtCUvoi/RuAhO4g==",
"dependencies": {
"depd": "~1.1.2",
"inherits": "2.0.4",
"setprototypeof": "1.2.0",
"statuses": ">= 1.5.0 < 2",
"toidentifier": "1.0.1"
},
"engines": {
"node": ">= 0.6"
}
},
"node_modules/inherits": {
"version": "2.0.4",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
"integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ=="
},
"node_modules/multiparty": {
"version": "4.2.3",
"resolved": "https://registry.npmjs.org/multiparty/-/multiparty-4.2.3.tgz",
"integrity": "sha512-Ak6EUJZuhGS8hJ3c2fY6UW5MbkGUPMBEGd13djUzoY/BHqV/gTuFWtC6IuVA7A2+v3yjBS6c4or50xhzTQZImQ==",
"dependencies": {
"http-errors": "~1.8.1",
"safe-buffer": "5.2.1",
"uid-safe": "2.1.5"
},
"engines": {
"node": ">= 0.10"
}
},
"node_modules/random-bytes": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/random-bytes/-/random-bytes-1.0.0.tgz",
"integrity": "sha512-iv7LhNVO047HzYR3InF6pUcUsPQiHTM1Qal51DcGSuZFBil1aBBWG5eHPNek7bvILMaYJ/8RU1e8w1AMdHmLQQ==",
"engines": {
"node": ">= 0.8"
}
},
"node_modules/safe-buffer": {
"version": "5.2.1",
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz",
"integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==",
"funding": [
{
"type": "github",
"url": "https://github.com/sponsors/feross"
},
{
"type": "patreon",
"url": "https://www.patreon.com/feross"
},
{
"type": "consulting",
"url": "https://feross.org/support"
}
]
},
"node_modules/setprototypeof": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz",
"integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw=="
},
"node_modules/statuses": {
"version": "1.5.0",
"resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz",
"integrity": "sha512-OpZ3zP+jT1PI7I8nemJX4AKmAX070ZkYPVWV/AaKTJl+tXCTGyVdC1a4SL8RUQYEwk/f34ZX8UTykN68FwrqAA==",
"engines": {
"node": ">= 0.6"
}
},
"node_modules/toidentifier": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz",
"integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==",
"engines": {
"node": ">=0.6"
}
},
"node_modules/uid-safe": {
"version": "2.1.5",
"resolved": "https://registry.npmjs.org/uid-safe/-/uid-safe-2.1.5.tgz",
"integrity": "sha512-KPHm4VL5dDXKz01UuEd88Df+KzynaohSL9fBh096KWAxSKZQDI2uBrVqtvRM4rwrIrRRKsdLNML/lnaaVSRioA==",
"dependencies": {
"random-bytes": "~1.0.0"
},
"engines": {
"node": ">= 0.8"
}
"node_modules/undici-types": {
"version": "5.26.5",
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz",
"integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==",
"dev": true
}
}
}

View File

@@ -1,6 +1,6 @@
{
"name": "@scrypted/amcrest",
"version": "0.0.127",
"version": "0.0.151",
"description": "Amcrest Plugin for Scrypted",
"author": "Scrypted",
"license": "Apache",
@@ -35,13 +35,12 @@
]
},
"dependencies": {
"@koush/axios-digest-auth": "^0.8.5",
"@scrypted/common": "file:../../common",
"@scrypted/sdk": "file:../../sdk",
"@types/multiparty": "^0.0.33",
"multiparty": "^4.2.3"
"content-type": "^1.0.5"
},
"devDependencies": {
"@types/node": "^18.16.18"
"@types/content-type": "^1.1.8",
"@types/node": "^20.11.30"
}
}

View File

@@ -1,12 +1,140 @@
import AxiosDigestAuth from '@koush/axios-digest-auth';
import { Readable } from 'stream';
import https from 'https';
import { AuthFetchCredentialState, HttpFetchOptions, authHttpFetch } from '@scrypted/common/src/http-auth-fetch';
import { readLine } from '@scrypted/common/src/read-stream';
import { parseHeaders, readBody } from '@scrypted/common/src/rtsp-server';
import contentType from 'content-type';
import { IncomingMessage } from 'http';
import { amcrestHttpsAgent, getDeviceInfo } from './probe';
import { EventEmitter, Readable } from 'stream';
import { Destroyable } from '../../rtsp/src/rtsp';
import { getDeviceInfo } from './probe';
import { Point } from '@scrypted/sdk';
// Human
// {
// "Action" : "Cross",
// "Class" : "Normal",
// "CountInGroup" : 1,
// "DetectRegion" : [
// [ 455, 260 ],
// [ 3586, 260 ],
// [ 3768, 7580 ],
// [ 382, 7451 ]
// ],
// "Direction" : "Enter",
// "EventID" : 10181,
// "GroupID" : 0,
// "Name" : "Rule1",
// "Object" : {
// "Action" : "Appear",
// "BoundingBox" : [ 2856, 1280, 3880, 4880 ],
// "Center" : [ 3368, 3080 ],
// "Confidence" : 0,
// "LowerBodyColor" : [ 0, 0, 0, 0 ],
// "MainColor" : [ 0, 0, 0, 0 ],
// "ObjectID" : 863,
// "ObjectType" : "Human",
// "RelativeID" : 0,
// "Speed" : 0
// },
// "PTS" : 43380319830.0,
// "RuleID" : 2,
// "Track" : [],
// "UTC" : 1711446999,
// "UTCMS" : 701
// }
// Face
// {
// "CfgRuleId" : 1,
// "Class" : "FaceDetection",
// "CountInGroup" : 2,
// "DetectRegion" : null,
// "EventID" : 10360,
// "EventSeq" : 6,
// "Faces" : [
// {
// "BoundingBox" : [ 1504, 2336, 1728, 2704 ],
// "Center" : [ 1616, 2520 ],
// "ObjectID" : 94,
// "ObjectType" : "HumanFace",
// "RelativeID" : 0
// }
// ],
// "FrameSequence" : 8251212,
// "GroupID" : 6,
// "Mark" : 0,
// "Name" : "FaceDetection",
// "Object" : {
// "Action" : "Appear",
// "BoundingBox" : [ 1504, 2336, 1728, 2704 ],
// "Center" : [ 1616, 2520 ],
// "Confidence" : 19,
// "FrameSequence" : 8251212,
// "ObjectID" : 94,
// "ObjectType" : "HumanFace",
// "RelativeID" : 0,
// "SerialUUID" : "",
// "Source" : 0.0,
// "Speed" : 0,
// "SpeedTypeInternal" : 0
// },
// "Objects" : [
// {
// "Action" : "Appear",
// "BoundingBox" : [ 1504, 2336, 1728, 2704 ],
// "Center" : [ 1616, 2520 ],
// "Confidence" : 19,
// "FrameSequence" : 8251212,
// "ObjectID" : 94,
// "ObjectType" : "HumanFace",
// "RelativeID" : 0,
// "SerialUUID" : "",
// "Source" : 0.0,
// "Speed" : 0,
// "SpeedTypeInternal" : 0
// }
// ],
// "PTS" : 43774941350.0,
// "Priority" : 0,
// "RuleID" : 1,
// "RuleId" : 1,
// "Source" : -1280470024.0,
// "UTC" : 947510337,
// "UTCMS" : 0
// }
export interface AmcrestObjectDetails {
Action: string;
BoundingBox: Point;
Center: Point;
Confidence: number;
LowerBodyColor: [number, number, number, number];
MainColor: [number, number, number, number];
ObjectID: number;
ObjectType: string;
RelativeID: number;
Speed: number;
}
export interface AmcrestEventData {
Action: string;
Class: string;
CountInGroup: number;
DetectRegion: Point[];
Direction: string;
EventID: number;
GroupID: number;
Name: string;
Object: AmcrestObjectDetails;
PTS: number;
RuleID: number;
Track: any[];
UTC: number;
UTCMS: number;
}
export enum AmcrestEvent {
MotionStart = "Code=VideoMotion;action=Start",
MotionStop = "Code=VideoMotion;action=Stop",
MotionInfo = "Code=VideoMotionInfo;action=State",
AudioStart = "Code=AudioMutation;action=Start",
AudioStop = "Code=AudioMutation;action=Stop",
TalkInvite = "Code=_DoTalkAction_;action=Invite",
@@ -20,37 +148,69 @@ export enum AmcrestEvent {
DahuaTalkHangup = "Code=PassiveHungup;action=Start",
DahuaCallDeny = "Code=HungupPhone;action=Pulse",
DahuaTalkPulse = "Code=_CallNoAnswer_;action=Pulse",
FaceDetection = "Code=FaceDetection;action=Start",
SmartMotionHuman = "Code=SmartMotionHuman;action=Start",
SmartMotionVehicle = "Code=Vehicle;action=Start",
CrossLineDetection = "Code=CrossLineDetection;action=Start",
CrossRegionDetection = "Code=CrossRegionDetection;action=Start",
}
async function readAmcrestMessage(client: Readable): Promise<string[]> {
let currentHeaders: string[] = [];
while (true) {
const originalLine = await readLine(client);
const line = originalLine.trim();
if (!line)
return currentHeaders;
// dahua bugs out and sends message without a newline separating the body:
// Content-Length:39
// Code=AudioMutation;action=Start;index=0
if (!line.includes(':')) {
client.unshift(Buffer.from(originalLine + '\n'));
return currentHeaders;
}
currentHeaders.push(line);
}
}
export class AmcrestCameraClient {
digestAuth: AxiosDigestAuth;
credential: AuthFetchCredentialState;
constructor(public ip: string, username: string, password: string, public console?: Console) {
this.digestAuth = new AxiosDigestAuth({
this.credential = {
username,
password,
};
}
async request(urlOrOptions: string | URL | HttpFetchOptions<Readable>, body?: Readable) {
const response = await authHttpFetch({
...typeof urlOrOptions !== 'string' && !(urlOrOptions instanceof URL) ? urlOrOptions : {
url: urlOrOptions,
},
rejectUnauthorized: false,
credential: this.credential,
body,
});
return response;
}
async reboot() {
const response = await this.digestAuth.request({
httpsAgent: amcrestHttpsAgent,
method: "GET",
responseType: 'text',
const response = await this.request({
url: `http://${this.ip}/cgi-bin/magicBox.cgi?action=reboot`,
responseType: 'text',
});
return response.data as string;
return response.body;
}
async checkTwoWayAudio() {
const response = await this.digestAuth.request({
httpsAgent: amcrestHttpsAgent,
method: "GET",
responseType: 'text',
const response = await this.request({
url: `http://${this.ip}/cgi-bin/devAudioOutput.cgi?action=getCollect`,
responseType: 'text',
});
return (response.data as string).includes('result=1');
return response.body.includes('result=1');
}
// appAutoStart=true
@@ -61,69 +221,167 @@ export class AmcrestCameraClient {
// updateSerial=IPC-AW46WN-S2
// updateSerialCloudUpgrade=IPC-AW46WN-.....
async getDeviceInfo() {
return getDeviceInfo(this.digestAuth, this.ip);
return getDeviceInfo(this.credential, this.ip);
}
async jpegSnapshot(): Promise<Buffer> {
const response = await this.digestAuth.request({
httpsAgent: amcrestHttpsAgent,
method: "GET",
responseType: 'arraybuffer',
async jpegSnapshot(timeout = 10000): Promise<Buffer> {
const response = await this.request({
url: `http://${this.ip}/cgi-bin/snapshot.cgi`,
timeout: 60000,
timeout,
});
return Buffer.from(response.data);
return response.body;
}
async listenEvents() {
async listenEvents(): Promise<Destroyable> {
const events = new EventEmitter();
const url = `http://${this.ip}/cgi-bin/eventManager.cgi?action=attach&codes=[All]`;
console.log('preparing event listener', url);
const response = await this.digestAuth.request({
httpsAgent: amcrestHttpsAgent,
method: "GET",
responseType: 'stream',
const response = await this.request({
url,
responseType: 'readable',
});
const stream: IncomingMessage = response.body;
(events as any).destroy = () => {
stream.destroy();
events.removeAllListeners();
};
stream.on('close', () => {
events.emit('close');
});
stream.on('end', () => {
events.emit('end');
});
stream.on('error', e => {
events.emit('error', e);
});
const stream = response.data as IncomingMessage;
stream.socket.setKeepAlive(true);
stream.on('data', (buffer: Buffer) => {
const data = buffer.toString();
const parts = data.split(';');
let index: string;
try {
for (const part of parts) {
if (part.startsWith('index')) {
index = part.split('=')[1]?.trim();
const ct = stream.headers['content-type'];
// make content type parsable as content disposition filename
const cd = contentType.parse(ct);
let { boundary } = cd.parameters;
// amcrest may send "--myboundary" or "-- myboundary" (with a space)
const altBoundary = `-- ${boundary}`;
boundary = `--${boundary}`;
const boundaryEnd = `${boundary}--`;
(async () => {
while (true) {
let ignore = await readLine(stream);
ignore = ignore.trim();
if (!ignore)
continue;
if (ignore === boundaryEnd)
continue;
// dahua bugs out and sends this.
if (ignore === 'HTTP/1.1 200 OK') {
const message = await readAmcrestMessage(stream);
this.console.log('ignoring dahua http message', message);
message.unshift('');
const headers = parseHeaders(message);
const body = await readBody(stream, headers);
if (body)
this.console.log('ignoring dahua http body', body);
continue;
}
if (ignore !== boundary && ignore !== altBoundary) {
this.console.error('expected boundary but found', ignore);
this.console.error(response.headers);
throw new Error('expected boundary');
}
const message = await readAmcrestMessage(stream);
events.emit('data', message);
message.unshift('');
const headers = parseHeaders(message);
const body = await readBody(stream, headers);
const data = body.toString();
events.emit('data', data);
const parts = data.split(';');
let index: string;
try {
for (const part of parts) {
if (part.startsWith('index')) {
index = part.split('=')[1]?.trim();
}
}
}
catch (e) {
this.console.error('error parsing index', data);
}
let jsonData: any;
try {
for (const part of parts) {
if (part.startsWith('data')) {
jsonData = JSON.parse(part.split('=')[1]?.trim());
}
}
}
catch (e) {
this.console.error('error parsing data', data);
}
for (const event of Object.values(AmcrestEvent)) {
if (data.indexOf(event) !== -1) {
events.emit('event', event, index, data);
if (event === AmcrestEvent.SmartMotionHuman) {
events.emit('smart', 'person', jsonData);
}
else if (event === AmcrestEvent.SmartMotionVehicle) {
events.emit('smart', 'car', jsonData);
}
else if (event === AmcrestEvent.FaceDetection) {
events.emit('smart', 'face', jsonData);
}
else if (event === AmcrestEvent.CrossLineDetection || event === AmcrestEvent.CrossRegionDetection) {
const eventData: AmcrestEventData = jsonData;
if (eventData?.Object?.ObjectType === 'Human') {
events.emit('smart', 'person', eventData);
}
else if (eventData?.Object?.ObjectType === 'Vehicle') {
events.emit('smart', 'car', eventData);
}
}
}
}
}
catch (e) {
this.console.error('error parsing index', data);
}
// this.console?.log('event', data);
for (const event of Object.values(AmcrestEvent)) {
if (data.indexOf(event) !== -1) {
stream.emit('event', event, index, data);
}
}
});
return stream;
})()
.catch(() => stream.destroy());
return events as any as Destroyable;
}
async enableContinousRecording(channel: number) {
for (let i = 0; i < 7; i++) {
const url = `http://${this.ip}/cgi-bin/configManager.cgi?action=setConfig&Record[${channel - 1}].TimeSection[${i}][0]=1 00:00:00-23:59:59`;
const response = await this.digestAuth.request({
httpsAgent: amcrestHttpsAgent,
method: "POST",
const response = await this.request({
url,
});
this.console.log(response.data);
method: 'POST',
responseType: 'text',
},);
this.console.log(response.body);
}
}
async unlock(): Promise<boolean> {
const response = await this.request({
url: `http://${this.ip}/cgi-bin/accessControl.cgi?action=openDoor&channel=1&UserID=101&Type=Remote`,
responseType: 'text',
});
return response.body.includes('OK');
}
async lock(): Promise<boolean> {
const response = await this.request({
url: `http://${this.ip}/cgi-bin/accessControl.cgi?action=closeDoor&channel=1&UserID=101&Type=Remote`,
responseType: 'text',
});
return response.body.includes('OK');
}
}

View File

@@ -1,12 +1,11 @@
import { ffmpegLogInitialOutput } from '@scrypted/common/src/media-helpers';
import { readLength } from "@scrypted/common/src/read-stream";
import sdk, { Camera, DeviceCreatorSettings, DeviceInformation, FFmpegInput, Intercom, MediaObject, MediaStreamOptions, PictureOptions, Reboot, RequestRecordingStreamOptions, ResponseMediaStreamOptions, ScryptedDeviceType, ScryptedInterface, ScryptedMimeTypes, Setting, VideoCameraConfiguration, VideoRecorder } from "@scrypted/sdk";
import sdk, { Camera, DeviceCreatorSettings, DeviceInformation, FFmpegInput, Intercom, Lock, MediaObject, MediaStreamOptions, ObjectDetectionTypes, ObjectDetector, ObjectsDetected, Reboot, RequestPictureOptions, RequestRecordingStreamOptions, ResponseMediaStreamOptions, ScryptedDeviceType, ScryptedInterface, ScryptedMimeTypes, Setting, VideoCameraConfiguration, VideoRecorder } from "@scrypted/sdk";
import child_process, { ChildProcess } from 'child_process';
import { PassThrough, Readable, Stream } from "stream";
import { OnvifIntercom } from "../../onvif/src/onvif-intercom";
import { RtspProvider, RtspSmartCamera, UrlMediaStreamOptions } from "../../rtsp/src/rtsp";
import { AmcrestCameraClient, AmcrestEvent } from "./amcrest-api";
import { amcrestHttpsAgent } from './probe';
import { AmcrestCameraClient, AmcrestEvent, AmcrestEventData } from "./amcrest-api";
const { mediaManager } = sdk;
@@ -23,12 +22,13 @@ function findValue(blob: string, prefix: string, key: string) {
return parts[1];
}
class AmcrestCamera extends RtspSmartCamera implements VideoCameraConfiguration, Camera, Intercom, VideoRecorder, Reboot {
class AmcrestCamera extends RtspSmartCamera implements VideoCameraConfiguration, Camera, Intercom, Lock, VideoRecorder, Reboot, ObjectDetector {
eventStream: Stream;
cp: ChildProcess;
client: AmcrestCameraClient;
videoStreamOptions: Promise<UrlMediaStreamOptions[]>;
onvifIntercom = new OnvifIntercom(this);
hasSmartDetection: boolean;
constructor(nativeId: string, provider: RtspProvider) {
super(nativeId, provider);
@@ -37,6 +37,7 @@ class AmcrestCamera extends RtspSmartCamera implements VideoCameraConfiguration,
this.storage.removeItem('amcrestDoorbell');
}
this.hasSmartDetection = this.storage.getItem('hasSmartDetection') === 'true';
this.updateDevice();
this.updateDeviceInfo();
}
@@ -94,12 +95,11 @@ class AmcrestCamera extends RtspSmartCamera implements VideoCameraConfiguration,
for (const element of deviceParameters) {
try {
const response = await this.getClient().digestAuth.request({
httpsAgent: amcrestHttpsAgent,
url: `http://${this.getHttpAddress()}/cgi-bin/magicBox.cgi?action=${element.action}`
const response = await this.getClient().request({
url: `http://${this.getHttpAddress()}/cgi-bin/magicBox.cgi?action=${element.action}`,
responseType: 'text',
});
const result = String(response.data).replace(element.replace, "").trim();
const result = String(response.body).replace(element.replace, "").trim();
deviceInfo[element.parameter] = result;
}
catch (e) {
@@ -147,11 +147,11 @@ class AmcrestCamera extends RtspSmartCamera implements VideoCameraConfiguration,
if (![...params.keys()].length)
return;
const response = await this.getClient().digestAuth.request({
httpsAgent: amcrestHttpsAgent,
url: `http://${this.getHttpAddress()}/cgi-bin/configManager.cgi?action=setConfig&${params}`
const response = await this.getClient().request({
url: `http://${this.getHttpAddress()}/cgi-bin/configManager.cgi?action=setConfig&${params}`,
responseType: 'text',
});
this.console.log('reconfigure result', response.data);
this.console.log('reconfigure result', response.body);
}
getClient() {
@@ -161,6 +161,16 @@ class AmcrestCamera extends RtspSmartCamera implements VideoCameraConfiguration,
}
async listenEvents() {
let motionTimeout: NodeJS.Timeout;
const motionTimeoutDuration = 20000;
const resetMotionTimeout = () => {
clearTimeout(motionTimeout);
motionTimeout = setTimeout(() => {
this.motionDetected = false;
}, motionTimeoutDuration);
}
const client = new AmcrestCameraClient(this.getHttpAddress(), this.getUsername(), this.getPassword(), this.console);
const events = await client.listenEvents();
const doorbellType = this.storage.getItem('doorbellType');
@@ -176,11 +186,21 @@ class AmcrestCamera extends RtspSmartCamera implements VideoCameraConfiguration,
if (idx.toString() !== channelNumber)
return;
}
if (event === AmcrestEvent.MotionStart) {
if (event === AmcrestEvent.MotionStart
|| event === AmcrestEvent.SmartMotionHuman
|| event === AmcrestEvent.SmartMotionVehicle
|| event === AmcrestEvent.CrossLineDetection
|| event === AmcrestEvent.CrossRegionDetection) {
this.motionDetected = true;
resetMotionTimeout();
}
else if (event === AmcrestEvent.MotionInfo) {
// this seems to be a motion pulse
if (this.motionDetected)
resetMotionTimeout();
}
else if (event === AmcrestEvent.MotionStop) {
this.motionDetected = false;
// use resetMotionTimeout
}
else if (event === AmcrestEvent.AudioStart) {
this.audioDetected = true;
@@ -222,9 +242,43 @@ class AmcrestCamera extends RtspSmartCamera implements VideoCameraConfiguration,
}
});
events.on('smart', (className: string, data: AmcrestEventData) => {
if (!this.hasSmartDetection) {
this.hasSmartDetection = true;
this.storage.setItem('hasSmartDetection', 'true');
this.updateDevice();
}
const detected: ObjectsDetected = {
timestamp: Date.now(),
detections: [
{
score: 1,
className,
}
],
};
this.onDeviceEvent(ScryptedInterface.ObjectDetector, detected);
});
return events;
}
async getDetectionInput(detectionId: string, eventId?: any): Promise<MediaObject> {
return;
}
async getObjectTypes(): Promise<ObjectDetectionTypes> {
return {
classes: [
'person',
'face',
'car',
],
}
}
async getOtherSettings(): Promise<Setting[]> {
const ret = await super.getOtherSettings();
ret.push(
@@ -261,6 +315,16 @@ class AmcrestCamera extends RtspSmartCamera implements VideoCameraConfiguration,
if (doorbellType == DAHUA_DOORBELL_TYPE) {
ret.push(
{
title: 'Enable Dahua Lock',
key: 'enableDahuaLock',
description: 'Some Dahua Doorbells have a built in lock/door access control.',
type: 'boolean',
value: (this.storage.getItem('enableDahuaLock') === 'true').toString(),
}
);
ret.push(
{
title: 'Multiple Call Buttons',
@@ -309,11 +373,8 @@ class AmcrestCamera extends RtspSmartCamera implements VideoCameraConfiguration,
}
async takeSmartCameraPicture(option?: PictureOptions): Promise<MediaObject> {
return this.createMediaObject(await this.getClient().jpegSnapshot(), 'image/jpeg');
async takeSmartCameraPicture(options?: RequestPictureOptions): Promise<MediaObject> {
return this.createMediaObject(await this.getClient().jpegSnapshot(options?.timeout), 'image/jpeg');
}
async getUrlSettings() {
@@ -334,7 +395,6 @@ class AmcrestCamera extends RtspSmartCamera implements VideoCameraConfiguration,
return this.storage.getItem('rtspChannel');
}
createRtspMediaStreamOptions(url: string, index: number) {
const ret = super.createRtspMediaStreamOptions(url, index);
ret.tool = 'scrypted';
@@ -348,12 +408,11 @@ class AmcrestCamera extends RtspSmartCamera implements VideoCameraConfiguration,
this.videoStreamOptions = (async () => {
let mas: string;
try {
const response = await client.digestAuth.request({
const response = await client.request({
url: `http://${this.getHttpAddress()}/cgi-bin/magicBox.cgi?action=getProductDefinition&name=MaxExtraStream`,
responseType: 'text',
httpsAgent: amcrestHttpsAgent,
})
mas = response.data.split('=')[1].trim();
mas = response.body.split('=')[1].trim();
this.storage.setItem('maxExtraStreams', mas.toString());
}
catch (e) {
@@ -366,18 +425,16 @@ class AmcrestCamera extends RtspSmartCamera implements VideoCameraConfiguration,
const vsos = [...Array(maxExtraStreams + 1).keys()].map(subtype => this.createRtspMediaStreamOptions(`rtsp://${this.getRtspAddress()}/cam/realmonitor?channel=${channel}&subtype=${subtype}`, subtype));
try {
const capResponse = await client.digestAuth.request({
const capResponse = await client.request({
url: `http://${this.getHttpAddress()}/cgi-bin/encode.cgi?action=getConfigCaps&channel=0`,
responseType: 'text',
httpsAgent: amcrestHttpsAgent,
});
this.console.log(capResponse.data);
const encodeResponse = await client.digestAuth.request({
this.console.log(capResponse.body);
const encodeResponse = await client.request({
url: `http://${this.getHttpAddress()}/cgi-bin/configManager.cgi?action=getConfig&name=Encode`,
responseType: 'text',
httpsAgent: amcrestHttpsAgent,
});
this.console.log(encodeResponse.data);
this.console.log(encodeResponse.body);
for (let i = 0; i < vsos.length; i++) {
const vso = vsos[i];
@@ -392,16 +449,16 @@ class AmcrestCamera extends RtspSmartCamera implements VideoCameraConfiguration,
encName = `table.Encode[${channel - 1}].ExtraFormat[${i - 1}]`;
}
const videoCodec = findValue(encodeResponse.data, encName, 'Video.Compression')
const videoCodec = findValue(encodeResponse.body, encName, 'Video.Compression')
?.replace('.', '')?.toLowerCase()?.trim();
let audioCodec = findValue(encodeResponse.data, encName, 'Audio.Compression')
let audioCodec = findValue(encodeResponse.body, encName, 'Audio.Compression')
?.replace('.', '')?.toLowerCase()?.trim();
if (audioCodec?.includes('aac'))
audioCodec = 'aac';
else if (audioCodec?.includes('g711a'))
audioCodec = 'pcm_alaw';
else if (audioCodec?.includes('g711u'))
audioCodec = 'pcm_ulaw';
audioCodec = 'pcm_mulaw';
else if (audioCodec?.includes('g711'))
audioCodec = 'pcm';
@@ -409,18 +466,18 @@ class AmcrestCamera extends RtspSmartCamera implements VideoCameraConfiguration,
vso.audio.codec = audioCodec;
vso.video.codec = videoCodec;
const width = findValue(encodeResponse.data, encName, 'Video.Width');
const height = findValue(encodeResponse.data, encName, 'Video.Height');
const width = findValue(encodeResponse.body, encName, 'Video.Width');
const height = findValue(encodeResponse.body, encName, 'Video.Height');
if (width && height) {
vso.video.width = parseInt(width);
vso.video.height = parseInt(height);
}
const bitrateOptions = findValue(capResponse.data, capName, 'Video.BitRateOptions');
const bitrateOptions = findValue(capResponse.body, capName, 'Video.BitRateOptions');
if (!bitrateOptions)
continue;
const encodeOptions = findValue(encodeResponse.data, encName, 'Video.BitRate');
const encodeOptions = findValue(encodeResponse.body, encName, 'Video.BitRate');
if (!encodeOptions)
continue;
@@ -460,9 +517,19 @@ class AmcrestCamera extends RtspSmartCamera implements VideoCameraConfiguration,
if (isDoorbell || twoWayAudio) {
interfaces.push(ScryptedInterface.Intercom);
}
const enableDahuaLock = this.storage.getItem('enableDahuaLock') === 'true';
if (isDoorbell && doorbellType === DAHUA_DOORBELL_TYPE && enableDahuaLock) {
interfaces.push(ScryptedInterface.Lock);
}
const continuousRecording = this.storage.getItem('continuousRecording') === 'true';
if (continuousRecording)
interfaces.push(ScryptedInterface.VideoRecorder);
if (this.hasSmartDetection)
interfaces.push(ScryptedInterface.ObjectDetector);
this.provider.updateDevice(this.nativeId, this.name, interfaces, type);
}
@@ -504,6 +571,8 @@ class AmcrestCamera extends RtspSmartCamera implements VideoCameraConfiguration,
return this.onvifIntercom.startIntercom(media);
}
const doorbellType = this.storage.getItem('doorbellType');
// not sure if this all works, since i don't actually have a doorbell.
// good luck!
const channel = this.getRtspChannel() || '1';
@@ -514,12 +583,39 @@ class AmcrestCamera extends RtspSmartCamera implements VideoCameraConfiguration,
const args = ffmpegInput.inputArguments.slice();
args.unshift('-hide_banner');
args.push(
"-vn",
'-acodec', 'aac',
'-f', 'adts',
'pipe:3',
);
let contentType: string;
if (doorbellType == DAHUA_DOORBELL_TYPE) {
args.push(
"-vn",
'-acodec', 'pcm_alaw',
'-ac', '1',
'-ar', '8000',
'-sample_fmt', 's16',
'-f', 'alaw',
'pipe:3',
);
contentType = 'Audio/G.711A';
}
else {
args.push(
"-vn",
'-acodec', 'aac',
'-f', 'adts',
'pipe:3',
);
contentType = 'Audio/AAC';
// args.push(
// "-vn",
// '-acodec', 'pcm_mulaw',
// '-ac', '1',
// '-ar', '8000',
// '-sample_fmt', 's16',
// '-f', 'mulaw',
// 'pipe:3',
// );
// contentType = 'Audio/G.711A';
}
this.console.log('ffmpeg intercom', args);
@@ -538,16 +634,19 @@ class AmcrestCamera extends RtspSmartCamera implements VideoCameraConfiguration,
// seems the dahua doorbells preferred 1024 chunks. should investigate adts
// parsing and sending multipart chunks instead.
const passthrough = new PassThrough();
this.getClient().digestAuth.request({
method: 'POST',
const abortController = new AbortController();
this.getClient().request({
url,
method: 'POST',
headers: {
'Content-Type': 'Audio/AAC',
'Content-Length': '9999999'
'Content-Type': contentType,
'Content-Length': '9999999',
},
httpsAgent: amcrestHttpsAgent,
data: passthrough,
});
signal: abortController.signal,
responseType: 'readable',
}, passthrough)
.catch(() => { })
.finally(() => this.console.log('request finished'))
try {
while (true) {
@@ -559,7 +658,8 @@ class AmcrestCamera extends RtspSmartCamera implements VideoCameraConfiguration,
}
finally {
this.console.log('audio finished');
passthrough.end();
passthrough.destroy();
abortController.abort();
}
this.stopIntercom();
@@ -578,6 +678,18 @@ class AmcrestCamera extends RtspSmartCamera implements VideoCameraConfiguration,
showRtspUrlOverride() {
return false;
}
async lock(): Promise<void> {
if (!this.client.lock()) {
this.console.error("Could not lock");
}
}
async unlock(): Promise<void> {
if (!this.client.unlock()) {
this.console.error("Could not unlock");
}
}
}
class AmcrestProvider extends RtspProvider {
@@ -598,7 +710,7 @@ class AmcrestProvider extends RtspProvider {
const username = settings.username?.toString();
const password = settings.password?.toString();
const skipValidate = settings.skipValidate === 'true';
const skipValidate = settings.skipValidate?.toString() === 'true';
let twoWayAudio: string;
if (!skipValidate) {
const api = new AmcrestCameraClient(httpAddress, username, password, this.console);

View File

@@ -1,8 +1,4 @@
import https from 'https';
export const amcrestHttpsAgent = new https.Agent({
rejectUnauthorized: false,
});
import { AuthFetchCredentialState, authHttpFetch } from '@scrypted/common/src/http-auth-fetch';
// appAutoStart=true
// deviceType=IP4M-1041B
@@ -11,17 +7,16 @@ export const amcrestHttpsAgent = new https.Agent({
// serialNumber=12345
// updateSerial=IPC-AW46WN-S2
import AxiosDigestAuth from "@koush/axios-digest-auth";
// updateSerialCloudUpgrade=IPC-AW46WN-.....
export async function getDeviceInfo(digestAuth: AxiosDigestAuth, address: string) {
const response = await digestAuth.request({
httpsAgent: amcrestHttpsAgent,
method: "GET",
responseType: 'text',
export async function getDeviceInfo(credential: AuthFetchCredentialState, address: string) {
const response = await authHttpFetch({
credential,
url: `http://${address}/cgi-bin/magicBox.cgi?action=getSystemInfo`,
rejectUnauthorized: false,
responseType: 'text',
});
const lines = (response.data as string).split('\n');
const lines = response.body.split('\n');
const vals: {
[key: string]: string,
} = {};
@@ -34,9 +29,14 @@ export async function getDeviceInfo(digestAuth: AxiosDigestAuth, address: string
vals[k] = v.trim();
}
return {
const ret = {
deviceType: vals.deviceType,
hardwareVersion: vals.hardwareVersion,
serialNumber: vals.serialNumber,
}
};
if (!ret.deviceType && !ret.hardwareVersion && !ret.serialNumber)
throw new Error('not amcrest');
return ret;
}

View File

@@ -1,5 +0,0 @@
.DS_Store
out/
node_modules/
dist/
.venv

View File

@@ -1,27 +0,0 @@
{
// specify the following paths on the target scrypted server:
// 1) where @scrypted/server node module resides: this may either be a checkout or a install.
// 2) where the scrypted "volume" data is located on the server. ie, the docker volume.
// the following default examples are provided for local and docker installations,
// only modifying the debugHost should be necessary:
// local installation
// "scrypted.debugHost": "192.168.2.119",
// "scrypted.serverRoot": "/home/pi/.scrypted/node_modules/@scrypted/server",
// "scrypted.volumeRoot": "/home/pi/.scrypted/volume",
// docker installation
// "scrypted.debugHost": "192.168.2.109",
"scrypted.serverRoot": "/server/node_modules/@scrypted/server",
"scrypted.volumeRoot": "/server/volume",
// local checkout
"scrypted.debugHost": "127.0.0.1",
//"scrypted.serverRoot": "/Volumes/Dev/scrypted/server",
//"scrypted.volumeRoot": "${config:scrypted.serverRoot}/volume",
"python.analysis.extraPaths": [
"./node_modules/@scrypted/sdk/types/scrypted_python"
]
}

View File

@@ -1,43 +0,0 @@
# Arlo Plugin for Scrypted
The Arlo Plugin connects Scrypted to Arlo Cloud, allowing you to access all of your Arlo cameras in Scrypted.
It is highly recommended to create a dedicated Arlo account for use with this plugin and share your cameras from your main account, as Arlo only permits one active login to their servers per account. Using a separate account allows you to use the Arlo app or website simultaneously with this plugin, otherwise logging in from one place will log you out from all other devices.
The account you use for this plugin must have either SMS or email set as the default 2FA option. Once you enter your username and password on the plugin settings page, you should receive a 2FA code through your default 2FA option. Enter that code into the provided box, and your cameras will appear in Scrypted. Or, see below for configuring IMAP to auto-login with 2FA.
If you experience any trouble logging in, clear the username and password boxes, reload the plugin, and try again.
If you are unable to see shared cameras in your separate Arlo account, ensure that both your primary and secondary accounts are upgraded according to this [forum post](https://web.archive.org/web/20230710141914/https://community.arlo.com/t5/Arlo-Secure/Invited-friend-cannot-see-devices-on-their-dashboard-Arlo-Pro-2/m-p/1889396#M1813). Verify the sharing worked by logging in via the Arlo web dashboard.
**If you add or remove cameras from your main Arlo account, or share/un-share/re-share cameras with the Arlo account used with this plugin, ensure that you reload this plugin to get the updated camera state from Arlo Cloud.**
## General Setup Notes
* Ensure that your Arlo account's default 2FA option is set to either SMS or email.
* Motion events notifications should be turned on in the Arlo app. If you are receiving motion push notifications, Scrypted will also receive motion events.
* Disable smart detection and any cloud/local recording in the Arlo app. Arlo Cloud only permits one active stream per camera, so any smart detection or recording features may prevent downstream plugins (e.g. Homekit) from successfully pulling the video feed after a motion event.
* It is highly recommended to enable the Rebroadcast plugin to allow multiple downstream plugins to pull the video feed within Scrypted.
* If there is no audio on your camera, switch to the `FFmpeg (TCP)` parser under the `Cloud RTSP` settings.
* Prebuffering should only be enabled if the camera is wired to a persistent power source, such as a wall outlet. Prebuffering will only work if your camera does not have a battery or `Plugged In to External Power` is selected.
* The plugin supports pulling RTSP or DASH streams from Arlo Cloud. It is recommended to use RTSP for the lowest latency streams. DASH is inconsistent in reliability, and may return finicky codecs that require additional FFmpeg output arguments, e.g. `-vcodec h264`. *Note that both RTSP and DASH will ultimately pull the same video stream feed from your camera, and they cannot both be used at the same time due to the single stream limitation.*
Note that streaming cameras uses extra Internet bandwidth, since video and audio packets will need to travel from the camera through your network, out to Arlo Cloud, and then back to your network and into Scrypted.
## IMAP 2FA
The Arlo Plugin supports using the IMAP protocol to check an email mailbox for Arlo 2FA codes. This requires you to specify an email 2FA option as the default in your Arlo account settings.
The plugin should work with any mailbox that supports IMAP, but so far has been tested with Gmail. To configure a Gmail mailbox, see [here](https://support.google.com/mail/answer/7126229?hl=en) to see the Gmail IMAP settings, and [here](https://support.google.com/accounts/answer/185833?hl=en) to create an App Password. Enter the App Password in place of your normal Gmail password.
The plugin searches for emails sent by Arlo's `do_not_reply@arlo.com` address when looking for 2FA codes. If you are using a service to forward emails to the mailbox registered with this plugin (e.g. a service like iCloud's Hide My Email), it is possible that Arlo's email sender address has been overwritten by the mail forwarder. Check the email registered with this plugin to see what address the mail forwarder uses to replace Arlo's sender address, and update that in the IMAP 2FA settings.
## Virtual Security System for Arlo Sirens
In external integrations like Homekit, sirens are exposed as simple on-off switches. This makes it easy to accidentally hit the switch when using the Home app. The Arlo Plugin creates a "virtual" security system device per siren to allow Scrypted to arm or disarm the siren switch to protect against accidental triggers. This fake security system device will be synced into Homekit as a separate accessory from the camera, with the siren itself merged into the security system accessory.
Note that the virtual security system is NOT tied to your Arlo account at all, and will not make any changes such as switching your device's motion alert armed/disarmed modes. For more information, please see the README on the virtual security system device in Scrypted.
## Video Clips
The Arlo Plugin will show video clips available in Arlo Cloud for cameras with cloud recording enabled. These clips are not downloaded onto your Scrypted server, but rather streamed on-demand. Deleting clips is not available in Scrypted and should be done through the Arlo app or the Arlo web dashboard.

View File

@@ -1 +0,0 @@
from .provider import ArloProvider

View File

@@ -1 +0,0 @@
from .arlo_async import Arlo

File diff suppressed because it is too large Load Diff

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