dec0dOS/zero-ui

feat: Multiple users in addition to the admin account?

wewlad-dev opened this issue · 9 comments

Is is possible to have a multi-user signup page in addition to the admin account that included in the docker file?
Just like the zerotier central where you can signup for a user and create some networks, but you can create another with different networks, is that possible or planned to be added?

Thanks.

This is a much needed feature if this app should be used for larger networks. @dec0dOS please keep this issue pinned as a high-priority topic.

9p4 commented

As for the header-based login, we can check an HTTP variable for the username and automatically log the user in with that username (such as REMOTE_USER)

well done. I need it.

9p4 commented

FYI for anyone here who is saying "I need it" or "When is this being added":

Those comments contribute nothing to the discussion. dec0deOS and the other contributes are developing and maintaining this program out of the goodness of their hearts. Adding comments like that add undue stress and will make devs frustrated.

Better than saying "I want this now", try laying out the groundwork for what should be changed. Contribute to the project instead of being entitled and demanding someone else put more time and effort into something that they are getting no compensation for.

Open source isn't a one-way street.

I would be interested to start looking at implementing this. I'm still working to get familiar with the project and ZeroTier. I have spent a few hours reading about it already. What would be the expectations for this feature? A few questions I would have right now for which getting a few answers could help drive the direction of this feature:

  • Should the current db.json file be used to store the user accounts?
  • What should normal users be allowed to change vs what an admin user should be able to change?
  • What information about the users should be kept? The minimum is username and password but then, should more be configurable such as user description, comment field, access to what exactly, etc.?
  • What would be changeable on the screen where users are managed? I assume, for now, not the username, and yes for the password.
  • I assume usernames should be unique so we need to have checks to check the full username list to ensure this.

I guess I started looking at this issue first because I noticed it is a high priority above everything else (seems to be the only issue with the priority-high label) but I haven't contributed to any project on GitHub so far so if there are other features that are similarly important but much smaller in terms of work, I could start with the smaller features first to get more familiar with the code base before I move on with this feature. I also checked the current branches of the project and I wouldn't be able to know if anyone else is working on this already. I would hate to work on something that someone else is about to complete if it could be the case, so please chime in, as needed.

Thank you!

Hello, @davidlag0!

I really appreciate your interest in the ZeroUI project! Currently, I don't have enough bandwidth for developing the new features for ZeroUI, but I'm going to support you in any way that I'm able to if you would like to contribute. Please don’t hesitate to ask questions in the discussion section.

For a more general project overview, I would suggest you check all the issues and discuss the section first of all. Especially the following comment.

Should the current db.json file be used to store the user accounts?

Yes, it should. Current db.json structure supports multiple account creation.

What should normal users be allowed to change vs what an admin user should be able to change?

That should be defined in the permissions section

What information about the users should be kept? The minimum is username and password but then, should more be configurable such as user description, comment field, access to what exactly, etc.?
What would be changeable on the screen where users are managed? I assume, for now, not the username, and yes for the password
I assume usernames should be unique so we need to have checks to check the full username list to ensure this.

That is really an implementation questions. You could check the example below.

There is an backend rewrite of the ZeroUI with the multiple users support, you could use it as an implementation example.

I don't recommned it use styliteag/zero-ui-userportal instead of the original ZeroUI implementation, as it seems its not going to be supported in any way, and any new original ZeroUI features are not going to be implemented there.

Correct user implementation is also a question about the #119 and #39.
It should be kept in mind.

You could also check what ZeroUI forks have been created and what features are partly ready there. https://github.com/dec0dOS/zero-ui/network

If you would like to understand the project better and contribute to it, It would be awesome if you could help with the MUI v5/React 18 migration and ES6 modules migration. That is the main bottleneck for new feature development.

The current progress of the MUI v5 migration: some things after migration are broken, and need to fix them.

Hi @dec0dOS,

Working on the migration to MUI v5/React 18 and to ES6 modules works for me! I also believe I couldn't find any tests for the code. Is this something you believe would be helpful for the development experience? I usually build tests and cover as much code as possible with them. Doing so helps avoid making changes that could break something that works already.

I can start checking out the dev branch and help you complete that migration first! Have you already documented somewhere the things you noticed have broke through this migration? If not, no worries, I can look around and fix what I believe seems broken!

I just read your comment about tests on my Discussion question. I can definitely help create automated tests. I'm somewhat familiar with Jest, Cypress and React Testing Library. Any concerns to use these tools for now for automated testing?

Thank you!

@davidlag0, I have no prior experience with writing tests on React applications, so the decision of choosing the best testing library for the project is yours.

Thank you!