Open paulplac opened 2 years 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:
- ./folder-near-docker-compose/dispatcher.py:/opt/frigate/frigate/comms/dispatcher.py
- ./folder-near-docker-compose/http.py:/opt/frigate/frigate/http.py
P.S. You can also develop or fix some part of code on-the fly using the same flow
A slightly less intrusive but limited method would be to block calls to specific API endpoints on a firewall level. Based on quick testing in DevTools, it appears the UI works fine even if requests to /api/reviews
are blocked. If access to reviews is something you want to share, only blockPOST
requests. Similarly it seems possible to prevent saving settings. Leaking settings/passwords could not easily be done this way as all the settings are fetched right after logging in and the cameras won't load without it.
Preventing leaking camera passwors can however be avoided by proxying the cameras from a separately installed Go2RTC (or MediaMTX instance).
Edit: Or simpler yet, use a different URL for sharing and do the above in the HTTP proxy level as suggested here.
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.