Lurker News
I needed a security camera inside my house, one that would send motion notifications to my smartphone and would allow me to livestream remotely. However, I could not find one that I could trust due to privacy concerns. Many of them upload the plaintext of videos to their servers and none is fully open-source as far as I know. Therefore, I decided to use my spare time to build one from scratch. Called Privastead (as in Private Homestead), it uses OpenMLS for end-to-end encryption (between the camera local hub and the smartphone) and is mostly implemented in Rust (except for part of the Android app that is implemented in Kotlin). The system is functional now and I've been using it in my own house for the past couple of weeks.

Based on some of the discussions I've seen online, it seems like there are other users who are also concerned with the privacy implications of home security cameras. Therefore, I decided to open source my solution for everyone to use. If you need a privacy-preserving home security camera, please give it a try and provide feedback. Note that trying out the system requires you to have a supported IP camera, a local machine connected to the IP camera, a server, and an Android smartphone. I have put together detailed instructions on setting up the system, which I hope makes it easier for others to get the system up and running.
In addition, consider contributing to the project. The prototype currently has a lot of limitations: mainly that it has only been tested with one IP camera, only allows the use of one camera, and only supports Android. I'll continue to improve the prototype as time permits, but progress will be much faster if there are other contributors as well.

Comments (165) 36 threads

Earlier comments
hereme888#
Dude good job. Thanks for this.
0points2 replies#
Certainly interesting project, but I do encourage people to do more thorough research before starting a new project and claiming they needed to fill a void.

> However, I could not find one that I could trust due to privacy concerns.
> Many of them upload the plaintext of videos to their servers and none is fully open-source as far as I know.
There's Frigate [1] which is off-cloud, opensource and self-hosted and it does person detection using GPU or Google Coral. It relays camera streams over WebRTC using ssl and works well with Home Assistant [2], which is your self-hosted off-cloud smart home solution.
Then there's moonfire-nvr [3] which is written in rust and less feature complete than frigate.
And then there's sentryshot [4], another option written in rust.
Interestingly, your project got more stars since you posted it on HN than sentryshot has in total, and they have had a product out since 2021 while yours only support a single camera model and has no object detection.
I suppose this reflects how unknown these option are, which is kind of unexpected since googling "rust nvr" lists them all in the first page.
1: https://frigate.video/
2: https://www.home-assistant.io/
3: https://github.com/scottlamb/moonfire-nvr
4: https://github.com/SentryShot/sentryshot
> The prototype currently has a lot of limitations: mainly that it has only been tested with one IP camera
Since you use rust, you should maybe have a look at retina:
https://github.com/scottlamb/retina
Personally, I use frigate with Home Assistant linked to HomeKit, so I get snapshots & video from frigate straight into my iPhone lock screen as soon as it detects moving people or cars outside my house.

acidburnNSA1 reply#
I've got frigate running at 3 sites and use wireguard to log into them and then monitor/review through the browser. Truly awesome technology. Self-hosting object detection and getting alerts is very effective and satisfying.
thelittleone2 replies#
I'm looking at a similar setup. Mind sharing which cameras you went with?
0points#
I use Reolink fwiw. Cheap china cameras which stream in https & rtsp in h264 and h265.
acidburnNSA1 reply#
I have a bunch of Amcrest brand cams, indoor and outdoor, plus one Reolink combination floodlight/camera.

I like these PoE outdoor ones best: IP5M-T1179EW
Indoor PTZ ones: IP4M-1041W
Old wifi outdoor one: IP4M-1026E
I got some with the plastic dome around them but they do not work well at night, especially in weather.
I also have a ridiculous industrial PTZ camera that I put on my roof to watch birds, planes, and boats, and this thing is an absolute beast. I love it. https://www.alibaba.com/product-detail/4k-action-ptz-camera-...

Continue this thread — 1 reply

arrdalan#
Thanks for the pointers. Frigate, Home Assistant, and HomeKit were mentioned in other comments and we had some discussions there. They're certainly good setups.

A key design decision for me was using a strong end-to-end encryption scheme between the camera/hub and the app. MLS fit this need perfectly and therefore I came up with the design that is now Privastead.
I was also less concerned with supporting many cameras since all I needed was one camera inside my house. Rather, I wanted a lean solution that I could fully understand and reason about. I will however look more carefully into the NVRs you listed to see if I can borrow some ideas to support more cameras more easily in Privastead.

VTimofeenko2 replies#
I've been a happy user of frigate (https://frigate.video) with fully local isolated setup: multiple poe cameras on a dedicated network, coral to supplement on-camera recognition, HA+Prometheus for alerts and smarts.

Excited to see another project, especially in Rust(not for the memes; python env management has bit me a few times when hacking).
One major gripe with frigate that I have is the way it treats detection events as pointers to video files. This makes replicating events off site a major pain.

stevenpetryk2 replies#
Have you found cameras you’re happy with? That’s the main thing holding me back is not knowing a good PoE camera to use.
hughesjj3 replies#
Hikvision and reolink are highly rated onvif ones that support poe, but as long as the camera support ONVIF from there just compare as normal
hunter2_#
Search for "Hikvision compromised" though. The results are damning. I suppose there's not much of a concern if using a proper firewall on a managed network, however.
hipitihop1 reply#
I can second Frigate and welcome any work in this space, so nice work OP will have a look. For others asking, I have found so far Hikvision POE PTZ domes like DS-2DE2A404IW-DE3 have been reliable, depends on your budget. I have cams themselves fully locked down from internet and on a separate subnet on the local net. OPNSense is also a friend here. I would love some OSS firmware for these cams. For remote, I find ZeroTier to Frigate & Home Assistant machines is all I need. I get why others WireGuard too. YMMV

Continue this thread — 1 reply

nonrandomstring2 replies#
Aren't HikVision the ones banned by many governments because they have dodgy "call home to China" firmware?

Persoanlly I go with the Eyeball Entities Omnicam with an Omniscient Systems Xcam-REAM control centre [0].
[0] https://cybershow.uk/media/ads/cctv-ads.mp3

Continue this thread — 2 replies

VTimofeenko#
Reolink have not disappointed me so far. I am using a duo 2 cam watching over the front of the property and a collection of their bullet cams. There's a lot of recommendations on frigate github discussions. Some models indeed have quirks.

On top of decent cameras they also have pretty well-documented API.

arrdalan4 replies#
A fully isolated setup on a dedicated network can certainly provide good privacy. A key benefit of Privastead is that it can send the videos to your smartphone remotely using a strong (MLS-based) end-to-end encryption.

And I share your excitement about Rust. :-)

VTimofeenko1 reply#
The remote access part can be solved by wireguard or tailscale for less hands-on approach. Ntfy.sh/telegram/whatever cool kids use these days for notifications.

This and my previous comment probably amount to a full Dropbox comment now :)
Can you elaborate on the sending video part -- do you transfer the whole file or a link to the file on the server? Curious about the replication piece I mentioned

arrdalan2 replies#
Privastead uses end-to-end encryption between the hub and the app. The hub encrypts the whole video file and sends it (through an untrusted server) to the app. The app will have a local copy of the video. The hub deletes the video upon delivery to the app. The server never has access to the unecrypted video.

Continue this thread — 2 replies

windexh8er1 reply#
I've been using locally hosted NVRs going on two decades now and so I definitely appreciate another local NVR option. But given the current lack of common requirements (e.g. more than 1 camera), curious if you're seeing any usage outside of your own? As others have mentioned Frigate is filling a nice gap for many, currently. I can only connect to it via a VPN I control and I can easily get notifications via Home Assistant.

I feel as though I have protection of getting the feeds to my phone securely, already. And while I'd love to be able to trust exposing Frigate and making it more accessible, I really don't have a need nor would I as the barrier to entry is already low enough to not impose much friction.
My intent isn't to dissuade you (obviously you wrote it for yourself) but I'd be curious if implementing a more secure transport in an existing OSS NVR that has traction was something you considered?

arrdalan1 reply#
Your local setup plus VPN/wireguard is a good design. For me, port forwarding on my router was a no-go due to the increased attack surface. Therefore, I wanted to use the cloud to route the videos and hence I decided to use a strong end-to-end encryption scheme (MLS).

Regarding the limitation you mentioned: I plan to address them. The next task on my plate is to support multiple cameras. :-)

Continue this thread — 1 reply

hamandcheese1 reply#
FWIW, e2ee is a feature that mostly matters to me when I don't own the infrastructure, and my bytes are flowing over someone else's platform.

If I do own all the infra, it seems like a lot of extra effort and complexity in the application which could be farmed out to other solutions (I.e. wireguard).

arrdalan#
That's right. My assumption is that the server is untrusted and that's why I use end-to-end encryption. This allows me to use any server, possibly even one operated by a third-party service in the future.
goodpoint2 replies#
How is video streamed to the apps? Push notification services are not meant for real time video streaming.
discordance#
RTSP
arrdalan#
Push notifications are for notifying the apps of events (e.g., motion). The actual encrypted video (either motion-triggered video or livestreams) are transferred through the server.
StayTrue2 replies#
My DIY setup uses cameras on an isolated VLAN that prohibits outbound internet access, RTSP data collected by Frigate[0] with Coral TPU recognition, and alerts via Pushover[1] notifications. My push notifications include an unencrypted thumbnail with a link to Frigate that only works via VPN connection.

Seems like this project offers a lot of what I had to cobble together. Nice work. I like that it offers encrypted notifications although I don’t use Android so not ready for me yet. I don’t like the Google dependency.
[0] https://frigate.video/
[1] https://pushover.net/

arrdalan#
A fully isolated setup can certainly provide good privacy. A key benefit of Privastead is that it can send the videos to your smartphone remotely using a strong (MLS-based) end-to-end encryption.

Privastead does not currently send thumbnails as part of the notifications. Performing proper end-to-end encryption on data in push notifications is a bit tricky and I haven't solved that yet. I do have some ideas on how to make that happen though. Once I do, I plan to add thumbnails to push notifications as well.
And thanks for the pointer on Pushover. I'll check it out to see if it can be a replacement for Google FCM.

bobbob1921#
Excellent set up, and in fact exactly what I’m using / how I’m set up. In addition for a few IOT type sensors and things like thermostats around my house, I have another vlan as well as a dedicated SSID tagged for that vlan, that only allows Internet access and everything else is dropped for that vlan. (Ie a firewall rule on the forward chain that drops anything in on that IOT vlan, that has a destination address of the private ip ranges: ie dst= 10.x or 192.168.x or 172…. anything locally that needs to access those sensors does so through the cloud/Internet, and for the one or two device devices that need to access them locally I have a fw rule allowing just that devices IP

Load more comments