amidaware / tacticalrmm

A remote monitoring & management tool, built with Django, Vue and Go.
https://docs.tacticalrmm.com
Other
2.92k stars 422 forks source link

Allow Usernames With Spaces #1820

Closed LPJon closed 3 months ago

LPJon commented 3 months ago

Is your feature request related to a problem? Please describe. The latest update which syncs meshcentral does not support usernames that are not email addresses.

Describe the solution you'd like Support for both email address usernames and non email address usernames. Such as "John Doe" and "Jon.Doe@corporate.com"

Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.

Additional context We do not always use email addresses as usernames because a compromised email address could be used to attempt access to the UI with guessing known email addresses.

LPJon commented 3 months ago

It looks Like it just doesn't support spaces. Could support for just that be added?

wh1te909 commented 3 months ago

just pushed a fix for this, please run the following 2 commands to test it out and then toggle the sync off/on from global settings > meshcentral in the web UI, and it should work:

wget -O /rmm/api/tacticalrmm/accounts/models.py https://raw.githubusercontent.com/amidaware/tacticalrmm/develop/api/tacticalrmm/accounts/models.py

sudo systemctl restart rmm celery celerybeat
LPJon commented 2 months ago

@wh1te909 Sorry this took so long to get back to. The issue still exists as pictured below. I also reboot the TacticalRMM server just to be sure all necessary services restarted on top of your instructions above.

Untitled

Just so I know I was clear. The username area I need is under Settings->User Administrator->->Username Field The picture shows what I want to be able to do and it also shows the error I'm getting in the UI at the top.

wh1te909 commented 2 months ago

Ah I see, yea usernames with spaces are not allowed, that the policy of the web framework we use (Django) you can see the code for that here. If Django doesn't allow it there must be a good reason and I trust them on that.

LPJon commented 2 months ago

@wh1te909 Here is one that is strange for ya. Your install script uses manage.py to setup the first user on installation with line 568: python manage.py createsuperuser --username ${djangousername} --email ${letsemail}. When setting up the user here, you are allowed to use names with spaces just as requested above. That method works, so is there a command line option which I could change or setup a user name with?