Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow invalid config to be updated via UI #17157

Draft
wants to merge 3 commits into
base: dev
Choose a base branch
from

Conversation

codecrunchers
Copy link

Proposed Change

This PR introduces a new feature that, instead of simply failing when encountering bad YAML or an invalid configuration, launches a restricted UI. In this mode, a warning is displayed , authentication is enforced , and navigation restricted so that users can only access the configuration editor. This approach helps guide users to fix configuration issues without completely blocking access to the system.

Type of Change

  • Dependency upgrade
  • New feature
  • Bug fix
  • Documentation Update
  • Other (please describe):

Additional Information

  • When an invalid config is detected (for example, due to bad YAML), the application will now launch a restricted UI rather than halting entirely.
  • In this restricted mode, the UI displays a clear warning and enforces authentication.
  • Once authenticated, users are only able to access the configuration editor (i.e. the /config route) so that they can make the necessary updates.
    Screenshot From 2025-03-13 21-37-36

I welcome any feedback or suggestions. I’ve tested this locally and ensured that everything works as expected.

Checklist

  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass.
  • There is no commented out code in this PR.
  • The code has been formatted using Ruff (ruff format frigate).

Copy link

netlify bot commented Mar 14, 2025

Deploy Preview for frigate-docs ready!

Name Link
🔨 Latest commit 7ea864d
🔍 Latest deploy log https://app.netlify.com/sites/frigate-docs/deploys/67d4ae749590420008df5e66
😎 Deploy Preview https://deploy-preview-17157--frigate-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@NickM-27
Copy link
Collaborator

NickM-27 commented Mar 14, 2025

I see it is marked as draft, but wanted to leave some feedback as I have put some time into ways of doing this.

As far as I understand, you are sending the minimal_config which means auth will not be enforced as it is now because the users auth config won't be given to fastapi. Instead of creating a basic config with a basic FrigateApp, here is what I was planning on doing:

  1. If the config is invalid, create a basic config that only copies the auth config portion and the rest (like cameras) is set to default values ({})
  2. try to create a Frigate app with that config, if that fails then frigate should still stop because without a valid auth config we can not expose any UI

This accomplishes the following:

  • simplifies the need for separate fastapi handlers as it will just use the same one as before
  • everything still starts up the same, just that there are no cameras and everything else is disabled so only minimal processes are created

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants