blakeblackshear / frigate

NVR with realtime local object detection for IP cameras
https://frigate.video
MIT License
16.07k stars 1.51k forks source link

"View Only" Web UI feature request #3539

Open paulplac opened 1 year ago

paulplac commented 1 year ago

Describe what you are trying to accomplish and why in non technical terms I would love a "view only" WEB UI that I could allow my family to access without being able to delete events, turn off detection's or expose camera passwords.

Describe the solution you'd like An option to disable/hide the following: -Delete button on events page -Toggle buttons on camera page -Debug page (at least hide "config" section so that camera passwords are not exposed)

Describe alternatives you've considered I love the Web UI. I don't run HA, but did try it out as an alternate solution. HA does not offer the same simplicity and features as the UI (slow to load cameras and viewing events for all cameras is clunky compared to the Web UI events page).

Additional context Either an option to toggle the "view only" Web UI in the config file or an ability to log in with different permissions would be fantastic. Currently I have openhab send push notification to my phone which link back to the Web UI via reverse proxy.

kzkvv commented 7 months ago

Hi! I have the same problem and I found a dirty workaround. It disables all visible delete/modify actions on backend side.

Disclaimer: I know that what I will write next is a kind of crime against the open-source community. It will be better to contribute and add this feature instead of writing this comment. But I think this workaround will help for some people for whom is really important to have read-only access to Frigate UI right now.

Backend part of Frigate is written in python, which is an interpreted programming language. It means that you can modify source code on the fly, restart Frigate and your changes will be applied immediatly.

This workaround works with docker-compose deploy and Frigate 0.12.1:

  1. Specify the image version explicitly in docker-compose
  2. Pull Frigate sources
  3. Checkout master branch, reset local commit history to release tag
  4. Modify source files. You can check changes in my branch disables toggles, restart, events deletion and any config changes from UI in 0.12.1: https://github.com/blakeblackshear/frigate/compare/master...kzkvv:frigate:read-only-example
  5. Copy modified files from source code to the folder-near-docker-compose
  6. Bind all files using "volumes" section
      - ./folder-near-docker-compose/dispatcher.py:/opt/frigate/frigate/comms/dispatcher.py
      - ./folder-near-docker-compose/http.py:/opt/frigate/frigate/http.py
  7. Restart container with Frigate

P.S. You can also develop or fix some part of code on-the fly using the same flow