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

Auth enables itself out of nowhere and randomly goes away after reboot. #813

Open
bwinkers opened this issue Sep 23, 2024 · 7 comments
Open

Comments

@bwinkers
Copy link

Everything else rocks, broken auth makes it all useless.

@bwinkers
Copy link
Author

Adding the below to the config provides a one-time opportunity to register a username and password at the onboarding url.

webserver:
port: 8888
auth:

If someone can provide some background on the expected behavior of this, I'd be glad to create a PR.

A. Should having no webserver section in the config work? It seems to eventually apply it.

B. Can more than one user be added? The /#/onboarding url redirects to /#/login after a single user is added.

C. Are there other valid auth params?

D. Is my "fix" above correct? Should it remain working?

I could spend days debugging to answer those myself, but I'm not sure if I'd understand the intent, just the current state. I'd like a little background on the expected behavior and functionality of the auth flow, so I'm not documenting or fixing them in incompatible ways.

I'll have a fair amount of time to hack on this software, we're adopting it where I work. I'd much prefer working on the code to move it the direction you want vs. creating a fork with different capabilities.

@roflcoopter
Copy link
Owner

Auth enabling on its own should not be possible, could you provide more information on how to reproduce?
The only way i can image it happen is if you first enable auth and restart Viseron so it saves the config as a "last known valid config".
If you then disable auth while also breaking the config YAML format, Viseron will enable safe mode and revert back to the last known valid config.
The safe mode should also be documented (saw your other issue regarding the auth docs being non-existent)

A. Should having no webserver section in the config work? It seems to eventually apply it.

The webserver is part of the default components and as such are always loaded:

DEFAULT_COMPONENTS = {"webserver", "storage"}

B. Can more than one user be added? The /#/onboarding url redirects to /#/login after a single user is added.

Atm no, only the first user can be added. There is no reason for that other than me having limited time.

C. Are there other valid auth params?

Could you elaborate a bit more on what you mean here?

I'll have a fair amount of time to hack on this software, we're adopting it where I work. I'd much prefer working on the code to move it the direction you want vs. creating a fork with different capabilities.

Awesome! Would love some contributions, I am pretty much the solo developer on this project.
User management is done here: https://github.com/roflcoopter/viseron/blob/dev/viseron/components/webserver/auth.py
As you can see the groundwork for multiple users is already there, with support for groups (admin, read, write)

The API supports creating users already:

"path_pattern": r"/auth/create",

So basically all that has to be done to support multiple users is the UI portion.
And in the long run stuff like deleting users/changing passwords etc.

@superkekko
Copy link

superkekko commented Nov 6, 2024

Hi, I've just found this project and I love it. Is simple but complete and in couple of hours I've managed to run on my Synology.

The only thing is missing is the user part to put on a public domain so I join this discussion!

@roflcoopter
Copy link
Owner

Great to hear you are enjoying Viseron!
Just to be clear, you can enable auth already but it's only possible to have a single user atm.

I intend to circle back to this at some point but can't promise when, have been busy with #716

@superkekko
Copy link

Great to hear you are enjoying Viseron!
Just to be clear, you can enable auth already but it's only possible to have a single user atm.

Good for me, how I enable that? I don't remember to ser that in the documentation.

@roflcoopter
Copy link
Owner

You enable it by adding auth: for the webserver component:

webserver:
  auth:

And then the next time you restart Viseron and open the interface you will be redirected to an onboarding page where you can create your first user.

@superkekko
Copy link

You enable it by adding auth: for the webserver component:

webserver:
  auth:

And then the next time you restart Viseron and open the interface you will be redirected to an onboarding page where you can create your first user.

Done...awesome!!!

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

No branches or pull requests

3 participants