* Fix showing review items that span over multiple days
* Simplify
* Fix tests
* Fix unchanged value
* Allow admin as default role and viewer as passed header for proxy auth
---------
Co-authored-by: Josh Hawkins <32435876+hawkeye217@users.noreply.github.com>
* improve spacing of face selection in mobile drawer
* fix spacing
* sort face names alphabetically
* Improve face selection dialog
* Use a state to track when face image loads
The naturalWidth and naturalHeight will always be 0 until the image loads. So we use onLoad and a state to track loading and then calculate the area after it has loaded
* Verify that a camera only tracks objects that are possible to track
* Fix test
* genai docs tweak
* Disable openvino model cache
* Clenaup
* Sanitize floats for estimated speed and angle
Users can configure speed zones in such a way that velocity estimates from Norfair cause a value of inf to be stored as an estimated speed. FastAPI doesn't serialize inf as a float, so trying to return this value would result in an API error. Sanitizing the value before storing should correct this.
---------
Co-authored-by: Nicolas Mowen <nickmowen213@gmail.com>
* add zoom time to movement predictions
* config migrator
* add space to face rename regex
* more debug
* only calculate zoom time of relative move
* fix test
* make migrated movement weight a zero
* check for str and bool for movestatus support
* Don't limit review summary query
The /review/summary endpoint was being restricted to the last 30 days, so unreviewed alerts and detections weren't showing in the calendar before that point. This change removes the WHERE clause so that the endpoint returns all results.
* fix
* remove unneeded test
we are now returning all results so we don't need to test for > month_ago
* fix
* db migration
* db model
* assign admin role on password reset
* add role to jwt and api responses
* don't restrict api access for admins yet
* use json response
* frontend auth context
* update auth form for profile endpoint
* add access denied page
* add protected routes
* auth hook
* dialogs
* user settings view
* restrict viewer access to settings
* restrict camera functions for viewer role
* add password dialog to account menu
* spacing tweak
* migrator default to admin
* escape quotes in migrator
* ui tweaks
* tweaks
* colors
* colors
* fix merge conflict
* fix icons
* add api layer enforcement
* ui tweaks
* fix error message
* debug
* clean up
* remove print
* guard apis for admin only
* fix tests
* fix review tests
* use correct error responses from api in toasts
* add role to account menu
* Started unit tests for the review controller
* Revert "Started unit tests for the review controller"
This reverts commit 7746eb146f.
* Started unit tests for GET /review/activity/motion Endpoint
* Started unit tests for GET /review/event/{event_id} Endpoint
* Continued unit tests for GET /review/event/{event_id} Endpoint
* Continued unit tests for GET /review/{event_id} Endpoint
* Continued unit tests for GET /review/{review_id} Endpoint
* Added unit tests for GET /review/{review_id}/viewed Endpoint
* Added unit tests for GET /stats Endpoint
* Added unit tests for GET /events Endpoint
* Updated unit tests for GET /events Endpoint
* Deleted unit tests for /events from test_http (updated tests are now in test_http_event.py)
* Removed duplicated test for GET /review/activity/motion Endpoint
* Organize api files
* Add more API definitions for events
* Add export select by ID
* Typing fixes
* Update openapi spec
* Change type
* Fix test
* Fix message
* Fix tests
* Started unit tests for the review controller
* Revert "Started unit tests for the review controller"
This reverts commit 7746eb146f.
* Started unit tests for the review controller
* FIrst test
* Added test for review endpoint (time filter - after + before)
* Assert expected event
* Added more tests for review endpoint
* Added test for review endpoint with all filters
* Added test for review endpoint with limit
* Comment
* Renamed tests to increase readability
* Fix access
* Reorganize tracked object for imports
* Separate out rockchip build
* Formatting
* Use original ffmpeg build
* Fix build
* Update default search type value
* POC: Added FastAPI with one endpoint (get /logs/service)
* POC: Revert error_log
* POC: Converted preview related endpoints to FastAPI
* POC: Converted two more endpoints to FastAPI
* POC: lint
* Convert all media endpoints to FastAPI. Added /media prefix (/media/camera && media/events && /media/preview)
* Convert all notifications API endpoints to FastAPI
* Convert first review API endpoints to FastAPI
* Convert remaining review API endpoints to FastAPI
* Convert export endpoints to FastAPI
* Fix path parameters
* Convert events endpoints to FastAPI
* Use body for multiple events endpoints
* Use body for multiple events endpoints (create and end event)
* Convert app endpoints to FastAPI
* Convert app endpoints to FastAPI
* Convert auth endpoints to FastAPI
* Removed flask app in favour of FastAPI app. Implemented FastAPI middleware to check CSRF, connect and disconnect from DB. Added middleware x-forwared-for headers
* Added starlette plugin to expose custom headers
* Use slowapi as the limiter
* Use query parameters for the frame latest endpoint
* Use query parameters for the media snapshot.jpg endpoint
* Use query parameters for the media MJPEG feed endpoint
* Revert initial nginx.conf change
* Added missing even_id for /events/search endpoint
* Removed left over comment
* Use FastAPI TestClient
* severity query parameter should be a string
* Use the same pattern for all tests
* Fix endpoint
* Revert media routers to old names. Order routes to make sure the dynamic ones from media.py are only used whenever there's no match on auth/etc
* Reverted paths for media on tsx files
* Deleted file
* Fix test_http to use TestClient
* Formatting
* Bind timeline to DB
* Fix http tests
* Replace filename with pathvalidate
* Fix latest.ext handling and disable uvicorn access logs
* Add cosntraints to api provided values
* Formatting
* Remove unused
* Remove unused
* Get rate limiter working
---------
Co-authored-by: Nicolas Mowen <nickmowen213@gmail.com>
* Moved FrigateApp.init_config() into FrigateConfig.load()
* Move frigate config loading into main
* Store PlusApi in FrigateConfig
* Register SIGTERM handler in main
* Ensure logging is setup during config parsing
* Removed pointless try
* Moved config initialization out of FrigateApp
* Made FrigateApp.shm_frame_count into a function
* Removed log calls from signal handlers
python's logging calls are not re-entrant, which caused at least one of
these to deadlock randomly.
* Reopen stdout/err on process fork
This helps avoid deadlocks (https://github.com/python/cpython/issues/91776).
* Make mypy happy
* Whoops. I might have forgotten to save.
Truly an amateur mistake.
* Always call FrigateApp.stop()
* Ignore entire __pycache__ folder instead of individual *.pyc files
* Ignore .mypy_cache in git
* Rework config YAML parsing to use only ruamel.yaml
PyYAML silently overrides keys when encountering duplicates, but ruamel
raises and exception by default. Since we're already using it elsewhere,
dropping PyYAML is an easy choice to make.
* Added EnvString in config to slim down runtime_config()
* Added gitlens to devcontainer
* Automatically call FrigateConfig.runtime_config()
runtime_config needed to be called manually before. Now, it's been
removed, but the same code is run by a pydantic validator.
* Fix handling of missing -segment_time
* Removed type annotation on FrigateConfig's parse
I'd like to keep them, but then mypy complains about some fundamental
errors with how the pydantic model is structured. I'd like to fix it,
but I'd rather work towards moving some of this config to the database.
* Ignore entire __pycache__ folder instead of individual *.pyc files
* Rewrite the yaml loader to match PyYAML
The old implementation would fail in weird ways with configs that were
incorrect in just the right way. The new implementation just does what
PyYAML would do, only diverging in case of duplicate keys.
* Clarify duplicate yaml key ValueError message
Co-authored-by: Nicolas Mowen <nickmowen213@gmail.com>
---------
Co-authored-by: Nicolas Mowen <nickmowen213@gmail.com>
* Refactor recordings config to be based off of review items
* Update object processing logic for when an event is created
* Migrate to deciding recording retention based on review items
* Refactor recording expiration to be based off of review items
* Remove remainder of recording events access
* Handle migration automatically
* Update version and cleanup
* Update docs
* Clarify docs
* Cleanup
* Target camera config
* Safely access all fields
* Handle zones and masks as relative coords
* Ensure that zone coords are saved as relative
* Get motion mask working with relative coordinates
* Rewrite object mask to use relative coordinates as well
* Formatting
* Fix always trying to convert
* fix mask logic
* Generate low res low fps previews for recordings viewer
* Make sure previews end on the hour
* Fix durations and decrase keyframe interval to ensure smooth scrubbing
* Ensure minimized resolution is compatible with yuv
* Add ability to configure preview quality
* Fix
* Clean up previews more efficiently
* Use iterator