cctv-stack 0.3.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- cctv/__init__.py +19 -0
- cctv/atomic.py +184 -0
- cctv/cleanup.py +1014 -0
- cctv/clip.py +278 -0
- cctv/config.py +742 -0
- cctv/config_cli.py +217 -0
- cctv/db.py +1478 -0
- cctv/dispatch.py +270 -0
- cctv/ffprobe.py +246 -0
- cctv/frigate.py +411 -0
- cctv/health.py +413 -0
- cctv/logging.py +157 -0
- cctv/materialise.py +488 -0
- cctv/migrations/0001_init.sql +199 -0
- cctv/migrations/0002_finding_kinds.sql +35 -0
- cctv/mqtt.py +171 -0
- cctv/paths.py +290 -0
- cctv/reviews.py +279 -0
- cctv/storage.py +751 -0
- cctv/sweep.py +254 -0
- cctv/timeutil.py +154 -0
- cctv/uploader.py +1417 -0
- cctv/worker.py +385 -0
- cctv_stack-0.3.0.dist-info/METADATA +410 -0
- cctv_stack-0.3.0.dist-info/RECORD +28 -0
- cctv_stack-0.3.0.dist-info/WHEEL +4 -0
- cctv_stack-0.3.0.dist-info/entry_points.txt +5 -0
- cctv_stack-0.3.0.dist-info/licenses/LICENSE +201 -0
|
@@ -0,0 +1,410 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: cctv-stack
|
|
3
|
+
Version: 0.3.0
|
|
4
|
+
Summary: A packaging-first self-hosted CCTV stack built on Frigate.
|
|
5
|
+
Project-URL: Homepage, https://github.com/aravindmyd/cctv-stack
|
|
6
|
+
Project-URL: Repository, https://github.com/aravindmyd/cctv-stack
|
|
7
|
+
Project-URL: Issues, https://github.com/aravindmyd/cctv-stack/issues
|
|
8
|
+
Author: Jothika Raja
|
|
9
|
+
License: Apache License
|
|
10
|
+
Version 2.0, January 2004
|
|
11
|
+
http://www.apache.org/licenses/
|
|
12
|
+
|
|
13
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
14
|
+
|
|
15
|
+
1. Definitions.
|
|
16
|
+
|
|
17
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
18
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
19
|
+
|
|
20
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
21
|
+
the copyright owner that is granting the License.
|
|
22
|
+
|
|
23
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
24
|
+
other entities that control, are controlled by, or are under common
|
|
25
|
+
control with that entity. For the purposes of this definition,
|
|
26
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
27
|
+
direction or management of such entity, whether by contract or
|
|
28
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
29
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
30
|
+
|
|
31
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
32
|
+
exercising permissions granted by this License.
|
|
33
|
+
|
|
34
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
35
|
+
including but not limited to software source code, documentation
|
|
36
|
+
source, and configuration files.
|
|
37
|
+
|
|
38
|
+
"Object" form shall mean any form resulting from mechanical
|
|
39
|
+
transformation or translation of a Source form, including but
|
|
40
|
+
not limited to compiled object code, generated documentation,
|
|
41
|
+
and conversions to other media types.
|
|
42
|
+
|
|
43
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
44
|
+
Object form, made available under the License, as indicated by a
|
|
45
|
+
copyright notice that is included in or attached to the work
|
|
46
|
+
(an example is provided in the Appendix below).
|
|
47
|
+
|
|
48
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
49
|
+
form, that is based on (or derived from) the Work and for which the
|
|
50
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
51
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
52
|
+
of this License, Derivative Works shall not include works that remain
|
|
53
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
54
|
+
the Work and Derivative Works thereof.
|
|
55
|
+
|
|
56
|
+
"Contribution" shall mean any work of authorship, including
|
|
57
|
+
the original version of the Work and any modifications or additions
|
|
58
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
59
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
60
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
61
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
62
|
+
means any form of electronic, verbal, or written communication sent
|
|
63
|
+
to the Licensor or its representatives, including but not limited to
|
|
64
|
+
communication on electronic mailing lists, source code control systems,
|
|
65
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
66
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
67
|
+
excluding communication that is conspicuously marked or otherwise
|
|
68
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
69
|
+
|
|
70
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
71
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
72
|
+
subsequently incorporated within the Work.
|
|
73
|
+
|
|
74
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
78
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
79
|
+
Work and such Derivative Works in Source or Object form.
|
|
80
|
+
|
|
81
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
82
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
83
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
84
|
+
(except as stated in this section) patent license to make, have made,
|
|
85
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
86
|
+
where such license applies only to those patent claims licensable
|
|
87
|
+
by such Contributor that are necessarily infringed by their
|
|
88
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
89
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
90
|
+
institute patent litigation against any entity (including a
|
|
91
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
92
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
93
|
+
or contributory patent infringement, then any patent licenses
|
|
94
|
+
granted to You under this License for that Work shall terminate
|
|
95
|
+
as of the date such litigation is filed.
|
|
96
|
+
|
|
97
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
98
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
99
|
+
modifications, and in Source or Object form, provided that You
|
|
100
|
+
meet the following conditions:
|
|
101
|
+
|
|
102
|
+
(a) You must give any other recipients of the Work or
|
|
103
|
+
Derivative Works a copy of this License; and
|
|
104
|
+
|
|
105
|
+
(b) You must cause any modified files to carry prominent notices
|
|
106
|
+
stating that You changed the files; and
|
|
107
|
+
|
|
108
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
109
|
+
that You distribute, all copyright, patent, trademark, and
|
|
110
|
+
attribution notices from the Source form of the Work,
|
|
111
|
+
excluding those notices that do not pertain to any part of
|
|
112
|
+
the Derivative Works; and
|
|
113
|
+
|
|
114
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
115
|
+
distribution, then any Derivative Works that You distribute must
|
|
116
|
+
include a readable copy of the attribution notices contained
|
|
117
|
+
within such NOTICE file, excluding those notices that do not
|
|
118
|
+
pertain to any part of the Derivative Works, in at least one
|
|
119
|
+
of the following places: within a NOTICE text file distributed
|
|
120
|
+
as part of the Derivative Works; within the Source form or
|
|
121
|
+
documentation, if provided along with the Derivative Works; or,
|
|
122
|
+
within a display generated by the Derivative Works, if and
|
|
123
|
+
wherever such third-party notices normally appear. The contents
|
|
124
|
+
of the NOTICE file are for informational purposes only and
|
|
125
|
+
do not modify the License. You may add Your own attribution
|
|
126
|
+
notices within Derivative Works that You distribute, alongside
|
|
127
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
128
|
+
that such additional attribution notices cannot be construed
|
|
129
|
+
as modifying the License.
|
|
130
|
+
|
|
131
|
+
You may add Your own copyright statement to Your modifications and
|
|
132
|
+
may provide additional or different license terms and conditions
|
|
133
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
134
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
135
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
136
|
+
the conditions stated in this License.
|
|
137
|
+
|
|
138
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
139
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
140
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
141
|
+
this License, without any additional terms or conditions.
|
|
142
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
143
|
+
the terms of any separate license agreement you may have executed
|
|
144
|
+
with Licensor regarding such Contributions.
|
|
145
|
+
|
|
146
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
147
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
148
|
+
except as required for reasonable and customary use in describing the
|
|
149
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
150
|
+
|
|
151
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
152
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
153
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
154
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
155
|
+
implied, including, without limitation, any warranties or conditions
|
|
156
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
157
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
158
|
+
appropriateness of using or redistributing the Work and assume any
|
|
159
|
+
risks associated with Your exercise of permissions under this License.
|
|
160
|
+
|
|
161
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
162
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
163
|
+
unless required by applicable law (such as deliberate and grossly
|
|
164
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
165
|
+
liable to You for damages, including any direct, indirect, special,
|
|
166
|
+
incidental, or consequential damages of any character arising as a
|
|
167
|
+
result of this License or out of the use or inability to use the
|
|
168
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
169
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
170
|
+
other commercial damages or losses), even if such Contributor
|
|
171
|
+
has been advised of the possibility of such damages.
|
|
172
|
+
|
|
173
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
174
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
175
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
176
|
+
or other liability obligations and/or rights consistent with this
|
|
177
|
+
License. However, in accepting such obligations, You may act only
|
|
178
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
179
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
180
|
+
defend, and hold each Contributor harmless for any liability
|
|
181
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
182
|
+
of your accepting any such warranty or additional liability.
|
|
183
|
+
|
|
184
|
+
END OF TERMS AND CONDITIONS
|
|
185
|
+
|
|
186
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
187
|
+
|
|
188
|
+
To apply the Apache License to your work, attach the following
|
|
189
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
190
|
+
replaced with your own identifying information. (Don't include
|
|
191
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
192
|
+
comment syntax for the file format. We also recommend that a
|
|
193
|
+
file or class name and description of purpose be included on the
|
|
194
|
+
same "printed page" as the copyright notice for easier
|
|
195
|
+
identification within third-party archives.
|
|
196
|
+
|
|
197
|
+
Copyright 2026 Jothika Raja
|
|
198
|
+
|
|
199
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
200
|
+
you may not use this file except in compliance with the License.
|
|
201
|
+
You may obtain a copy of the License at
|
|
202
|
+
|
|
203
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
204
|
+
|
|
205
|
+
Unless required by applicable law or agreed to in writing, software
|
|
206
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
207
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
208
|
+
See the License for the specific language governing permissions and
|
|
209
|
+
limitations under the License.
|
|
210
|
+
License-File: LICENSE
|
|
211
|
+
Keywords: backblaze-b2,cctv,frigate,nvr,self-hosted,video-surveillance
|
|
212
|
+
Classifier: Development Status :: 3 - Alpha
|
|
213
|
+
Classifier: Intended Audience :: System Administrators
|
|
214
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
215
|
+
Classifier: Operating System :: POSIX :: Linux
|
|
216
|
+
Classifier: Programming Language :: Python :: 3
|
|
217
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
218
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
219
|
+
Classifier: Topic :: Multimedia :: Video
|
|
220
|
+
Classifier: Topic :: System :: Systems Administration
|
|
221
|
+
Requires-Python: >=3.12
|
|
222
|
+
Requires-Dist: pyyaml>=6.0
|
|
223
|
+
Requires-Dist: tzdata>=2024.1
|
|
224
|
+
Provides-Extra: dev
|
|
225
|
+
Requires-Dist: pytest>=8.0; extra == 'dev'
|
|
226
|
+
Requires-Dist: ruff>=0.6; extra == 'dev'
|
|
227
|
+
Provides-Extra: mqtt
|
|
228
|
+
Requires-Dist: paho-mqtt>=2.1; extra == 'mqtt'
|
|
229
|
+
Provides-Extra: storage
|
|
230
|
+
Requires-Dist: boto3>=1.34; extra == 'storage'
|
|
231
|
+
Description-Content-Type: text/markdown
|
|
232
|
+
|
|
233
|
+
# cctv-stack
|
|
234
|
+
|
|
235
|
+
[](https://github.com/aravindmyd/cctv-stack/actions/workflows/ci.yml)
|
|
236
|
+
[](https://github.com/aravindmyd/cctv-stack/actions/workflows/publish.yml)
|
|
237
|
+
|
|
238
|
+
Self-hosted CCTV built on **Frigate**, adding the four things Frigate deliberately leaves
|
|
239
|
+
to the operator:
|
|
240
|
+
|
|
241
|
+
1. **Canonical clips** — every review becomes one file at a deterministic path.
|
|
242
|
+
2. **Durable cloud backup** — clips are uploaded to Backblaze B2 exactly once.
|
|
243
|
+
3. **Independent retention** — local cleanup that never deletes an un-uploaded clip.
|
|
244
|
+
4. **Health surfaces** — each service reports whether it is actually working.
|
|
245
|
+
|
|
246
|
+
Every installation is independent: no central hub, no cross-site data, no inbound
|
|
247
|
+
connectivity requirement.
|
|
248
|
+
|
|
249
|
+
---
|
|
250
|
+
|
|
251
|
+
## Status
|
|
252
|
+
|
|
253
|
+
| Capability | State |
|
|
254
|
+
|---|---|
|
|
255
|
+
| Detect → canonical clip | ✅ |
|
|
256
|
+
| Upload to Backblaze B2, exactly once | ✅ |
|
|
257
|
+
| Local retention (upload-aware) | ✅ |
|
|
258
|
+
| Cloud retention and reconciliation | ⬜ |
|
|
259
|
+
| Aggregate status page and alerting | ⬜ |
|
|
260
|
+
| One-command client installer and signed bundle | ⬜ |
|
|
261
|
+
| Backup, restore, upgrade | ⬜ |
|
|
262
|
+
|
|
263
|
+
v0.3 is usable for a local-only installation or a B2-backed one. The deferred work, and
|
|
264
|
+
why it is deferred, is in [`docs/plans/backlog.md`](docs/plans/backlog.md). The client-site
|
|
265
|
+
delivery plan is [`docs/plans/packaging.md`](docs/plans/packaging.md).
|
|
266
|
+
|
|
267
|
+
## How it fits together
|
|
268
|
+
|
|
269
|
+
```text
|
|
270
|
+
cameras ──RTSP──> Frigate ──review──> clip-worker ──> data/clips/... ──> uploader ──> B2
|
|
271
|
+
│ │
|
|
272
|
+
└── recordings (recovery window) └── cleanup (only after upload)
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
Frigate does camera ingest, detection, recording and review segmentation. The
|
|
276
|
+
`clip-worker` cuts **one canonical clip per review item**. The uploader pushes it once,
|
|
277
|
+
and cleanup deletes a local clip only after its upload is terminal-success (INV-1).
|
|
278
|
+
|
|
279
|
+
MQTT is the low-latency path. The Frigate review sweep is the guarantee: if the broker or
|
|
280
|
+
the worker was down, the next sweep still materialises the clip. A review arriving twice
|
|
281
|
+
produces one clip, not two.
|
|
282
|
+
|
|
283
|
+
## Quick start
|
|
284
|
+
|
|
285
|
+
**Requirements:** `git`, Linux x86_64 or arm64 (macOS is supported for development),
|
|
286
|
+
Docker Engine with the Compose v2 plugin, and disk space for Frigate's recordings. The
|
|
287
|
+
first real run pulls the Frigate image and builds the CCTV image, so expect several
|
|
288
|
+
minutes.
|
|
289
|
+
|
|
290
|
+
```bash
|
|
291
|
+
git clone https://github.com/aravindmyd/cctv-stack.git
|
|
292
|
+
cd cctv-stack
|
|
293
|
+
./install.sh
|
|
294
|
+
```
|
|
295
|
+
|
|
296
|
+
The first run creates the two files that only you can fill in, then exits:
|
|
297
|
+
|
|
298
|
+
| File | Contains | Committed? |
|
|
299
|
+
|---|---|---|
|
|
300
|
+
| `.env` | Camera RTSP URLs, timezone, optional B2 credentials | **No** — gitignored |
|
|
301
|
+
| `config/cameras.yml` | Camera names, clip padding, retention policy | **No** — gitignored |
|
|
302
|
+
|
|
303
|
+
Edit both, then run `./install.sh` again. It validates the configuration, generates
|
|
304
|
+
Frigate's config, builds the image, starts the stack, and waits until Frigate answers.
|
|
305
|
+
|
|
306
|
+
Frigate's UI is HTTPS on `https://127.0.0.1:8971` (loopback only). The certificate is
|
|
307
|
+
self-signed, so the browser warns once. Port 5000 and MQTT are never published.
|
|
308
|
+
|
|
309
|
+
Clips land at:
|
|
310
|
+
|
|
311
|
+
```text
|
|
312
|
+
data/clips/<camera>/YYYY/MM/DD/HH-MM-SS.mp4
|
|
313
|
+
data/clips/<camera>/YYYY/MM/DD/HH-MM-SS.mp4.json
|
|
314
|
+
```
|
|
315
|
+
|
|
316
|
+
The sidecar records the review, event ids, requested boundaries, coverage, size and
|
|
317
|
+
SHA-256. The clips tree uses the **site timezone**; Frigate's own recordings tree uses
|
|
318
|
+
**UTC** — both are deliberate ([ADR-0017](docs/adr/0017-time-handling.md)).
|
|
319
|
+
|
|
320
|
+
A clip appears **after** the visit ends, not during it: Frigate keeps the review open
|
|
321
|
+
until the alert cutoff passes. There is no partial clip by design.
|
|
322
|
+
|
|
323
|
+
## What runs
|
|
324
|
+
|
|
325
|
+
| Service | Role |
|
|
326
|
+
|---|---|
|
|
327
|
+
| **Frigate** | Camera ingest, detection, recording and review segmentation |
|
|
328
|
+
| **clip-worker** | Materialises completed reviews at the canonical path, with a sidecar |
|
|
329
|
+
| **uploader** | Uploads to B2 through a storage adapter, with a persisted retry state machine. Reports `DISABLED` when no bucket is configured and exits `78` on a half-configuration |
|
|
330
|
+
| **cleanup** | Enforces local retention; refuses to delete a clip whose upload is not terminal-success |
|
|
331
|
+
| **config** | One-shot generator: `cameras.yml` → Frigate's config (INV-3) |
|
|
332
|
+
| **mosquitto** | MQTT broker, internal only |
|
|
333
|
+
| **status-collector** | ⬜ not built yet |
|
|
334
|
+
|
|
335
|
+
### Health surfaces
|
|
336
|
+
|
|
337
|
+
| Surface | Address | Notes |
|
|
338
|
+
|---|---|---|
|
|
339
|
+
| Frigate UI | `https://127.0.0.1:8971` | HTTPS, self-signed, loopback only |
|
|
340
|
+
| Uploader | `http://127.0.0.1:8082/health` | `DISABLED` without a B2 bucket |
|
|
341
|
+
| Cleanup | `http://127.0.0.1:8083/health` | Local retention state |
|
|
342
|
+
| Frigate API, MQTT | not published | Reachable only on the compose network |
|
|
343
|
+
|
|
344
|
+
## Configuration
|
|
345
|
+
|
|
346
|
+
The split is deliberate and load-bearing:
|
|
347
|
+
|
|
348
|
+
- **`config/cameras.yml`** is the single source of truth for cameras (INV-3). Frigate's
|
|
349
|
+
config is generated from it and must never be hand-edited.
|
|
350
|
+
- **`.env`** holds location values and secrets: RTSP URLs, B2 keys, ports, data path.
|
|
351
|
+
|
|
352
|
+
Both real files are gitignored. `.env.example` and `config/cameras.example.yml` are the
|
|
353
|
+
templates. Never commit the filled-in versions, and never paste an RTSP URL or B2 key into
|
|
354
|
+
an issue. If a credential is exposed, follow
|
|
355
|
+
[`docs/runbooks/rotate-credentials.md`](docs/runbooks/rotate-credentials.md).
|
|
356
|
+
|
|
357
|
+
Camera names are lowercase kebab-case because they become filesystem paths and cloud
|
|
358
|
+
object keys.
|
|
359
|
+
|
|
360
|
+
## Published artefacts
|
|
361
|
+
|
|
362
|
+
| Artefact | Where | Published when |
|
|
363
|
+
|---|---|---|
|
|
364
|
+
| Branch image | `ghcr.io/aravindmyd/cctv-stack:edge` | Every merge to `main`/`master` |
|
|
365
|
+
| Commit image | `ghcr.io/aravindmyd/cctv-stack:sha-<short>` | Every merge |
|
|
366
|
+
| Version image | `ghcr.io/aravindmyd/cctv-stack:<version>` | A `v*` tag |
|
|
367
|
+
| Python package | `pypi.org/project/cctv-stack` | A `v*` tag |
|
|
368
|
+
| Wheel and sdist | Workflow artefact, and GitHub Release on tags | Every merge / tag |
|
|
369
|
+
|
|
370
|
+
```bash
|
|
371
|
+
docker pull ghcr.io/aravindmyd/cctv-stack:edge
|
|
372
|
+
pip install cctv-stack
|
|
373
|
+
```
|
|
374
|
+
|
|
375
|
+
The image is the runtime. `pip install cctv-stack` installs the four CLI entry points
|
|
376
|
+
(`cctv-clip-worker`, `cctv-config`, `cctv-uploader`, `cctv-cleanup`) but **not** Frigate,
|
|
377
|
+
Compose, or site configuration. The complete client-site install is the signed release
|
|
378
|
+
bundle in [`docs/plans/packaging.md`](docs/plans/packaging.md).
|
|
379
|
+
|
|
380
|
+
## Development
|
|
381
|
+
|
|
382
|
+
```bash
|
|
383
|
+
uv sync
|
|
384
|
+
uv run pytest # unit suite; live tests skip without Docker/S3
|
|
385
|
+
uv run ruff check .
|
|
386
|
+
uv run ruff format --check .
|
|
387
|
+
|
|
388
|
+
./tests/integration/run.sh # live S3 suite against RustFS; needs Docker
|
|
389
|
+
./tests/e2e/run.sh # synthetic camera → real clip; needs Docker + Frigate
|
|
390
|
+
```
|
|
391
|
+
|
|
392
|
+
The unit suite is **717 passed, 19 skipped** without a configured S3 endpoint or a running
|
|
393
|
+
Docker daemon. CI runs pre-commit, unit tests on Python 3.12 and 3.13, the pip-install
|
|
394
|
+
fallback, live integration, and the synthetic e2e pipeline. The publish workflow builds
|
|
395
|
+
the multi-arch image and the Python distributions.
|
|
396
|
+
|
|
397
|
+
## Documentation
|
|
398
|
+
|
|
399
|
+
- [`docs/index.md`](docs/index.md) — documentation map and reading order
|
|
400
|
+
- [`docs/architecture/hld.md`](docs/architecture/hld.md) — how the system fits together
|
|
401
|
+
- [`docs/architecture/invariants.md`](docs/architecture/invariants.md) — rules that must never break
|
|
402
|
+
- [`docs/runbooks/install.md`](docs/runbooks/install.md) — the target operator runbook (M6; the current installer is the two-run flow above)
|
|
403
|
+
- [`docs/plans/roadmap.md`](docs/plans/roadmap.md) — what gets built, in what order
|
|
404
|
+
- [`docs/plans/backlog.md`](docs/plans/backlog.md) — deliberately deferred work
|
|
405
|
+
- [`docs/plans/packaging.md`](docs/plans/packaging.md) — client-site delivery and release artefacts
|
|
406
|
+
|
|
407
|
+
## License
|
|
408
|
+
|
|
409
|
+
Apache-2.0 — see [`LICENSE`](LICENSE). The reasoning is in
|
|
410
|
+
[`docs/plans/opensourcing.md`](docs/plans/opensourcing.md).
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
cctv/__init__.py,sha256=fhbxV7JvQX-7aLdD-1jEeHuMuLOeFruq2CUrV8kaLNE,638
|
|
2
|
+
cctv/atomic.py,sha256=wszatXB2gpkVkWTpLx1wdCBzomvyN1Bzo8gFjGfvfm0,6333
|
|
3
|
+
cctv/cleanup.py,sha256=6a4v4UyE2Sflavq0Dmg44OJA9Hb-qeaghkM1V8Oh684,38879
|
|
4
|
+
cctv/clip.py,sha256=3qgZdzk2dqDQUwgFoaGCDOBqNTYTktNFsgyeWWv20Jc,10898
|
|
5
|
+
cctv/config.py,sha256=xjMaNYWjaQ7AIC2EjO28P4EjcaGzoTO8vegm87n6TWo,27844
|
|
6
|
+
cctv/config_cli.py,sha256=qqcFkV0qt6n4E_RYAIlLgOR4OsMc45xredW8dFcGHO4,8581
|
|
7
|
+
cctv/db.py,sha256=oM6kf2vWwKfrt0y0qKhbV2rxCTDuYRS9KTzDgWDCRRw,56211
|
|
8
|
+
cctv/dispatch.py,sha256=fzev9_GynjXZgGmFJPAPlv-W93dMmUAHOEavxT6Baw0,9924
|
|
9
|
+
cctv/ffprobe.py,sha256=qc-a_4Wb1VhdOintI3MKV-xoYg5yJfXGiY7Tr1hJ_18,8960
|
|
10
|
+
cctv/frigate.py,sha256=uGRVypAQqBlenq4NRwDbFFzuGrUhMYQIajFT_LyKSoI,16289
|
|
11
|
+
cctv/health.py,sha256=N78tgb_Gs3yUWvUQdKWF8T-YLezlhpQLO-Ey0RXKb8E,14837
|
|
12
|
+
cctv/logging.py,sha256=yOiJDgBnV-ayYSvJWCMIfgxIDZV-3Kpx9O7dOQyTmVc,6361
|
|
13
|
+
cctv/materialise.py,sha256=QuUchkWDtvbf27ao9NuFnlz_QvisP5XQeE1d86DCI1A,18137
|
|
14
|
+
cctv/mqtt.py,sha256=nnOjS8p63GOr3SLmMOatO-cqboHfa3AH7-tfgtVNSMA,7145
|
|
15
|
+
cctv/paths.py,sha256=zXD1gy9sRtOXgVKLgzPe8vopAMVlKgmcc5U1bbZxDNI,11521
|
|
16
|
+
cctv/reviews.py,sha256=c6OTmn-BWNy-0I6TnoL10bxW5iwFdti8v7HeqemAt0s,10736
|
|
17
|
+
cctv/storage.py,sha256=tNgtah_rd49uAaK9SFJqcXoSPAi2MQigd05MsGGYUog,29552
|
|
18
|
+
cctv/sweep.py,sha256=gZUc1ffRsN4o4oRB8KqjX4uxRUfBXeqy9Te3oXSri8U,9954
|
|
19
|
+
cctv/timeutil.py,sha256=60TZtfr2wU08hoQlTXP5sB1Q5YXIRWPsgFKpoNZVwtM,6214
|
|
20
|
+
cctv/uploader.py,sha256=iHl90gyJVnv3cedHcwdrJ60u3Iwu4MIDlwfQRN7BvTk,52128
|
|
21
|
+
cctv/worker.py,sha256=cjBbKPMS-9hOO45VzprROLb4LKTghm9YelO4HwPra3g,15053
|
|
22
|
+
cctv/migrations/0001_init.sql,sha256=t-41_Aay484xBOsyXNATYOZLLit0dVGkBowIhUHTIK0,7930
|
|
23
|
+
cctv/migrations/0002_finding_kinds.sql,sha256=29isjov7-fn8qnvdeJVFef-s-VS0BL6lYDQ89OmCvYI,1712
|
|
24
|
+
cctv_stack-0.3.0.dist-info/METADATA,sha256=oc2BFxrf-uLOMCqt73t7Xf8MBzkUHPxgU90omBSJCwU,22143
|
|
25
|
+
cctv_stack-0.3.0.dist-info/WHEEL,sha256=W3fkpkm7-wf9vBI5Z-7s0eWkeM-spu78I8Neb98DeEg,87
|
|
26
|
+
cctv_stack-0.3.0.dist-info/entry_points.txt,sha256=DP8WRpt3zZe14dw0idhdGcPFtBqACWyiFHWSOlfUsTY,157
|
|
27
|
+
cctv_stack-0.3.0.dist-info/licenses/LICENSE,sha256=Juby-z1z2gOJo8yffr84db-0tM7jS4L5bN2QqUGm1yE,11342
|
|
28
|
+
cctv_stack-0.3.0.dist-info/RECORD,,
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright 2026 Jothika Raja
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|