GUI bugulance? - using the user add GUI interface

stuartbh

Active Member
Dec 2, 2019
120
11
38
59
Developers, users, et alia:

Let us presume that my domain for my local network (when an IP address is DHCP'ed) is "test-net"; thus if I had a workstation or server would DHCP it's networking configuration it would be something "host1@test-net".

Whence I attempt to effectuate the creation of a PAM user via the GUI and enter an email address for the user "joetest@host1.test-net" the blue OK button goes dark (greyed out so to speak, though it does not turn the color grey) and cannot be clicked. However, if I change the entry to "joetest@host1.test" it allows me to click okay. Now it has always been my understanding that any TLD (notwithstanding if it is registered or just a local TLD) can indeed have dashes in it and not violate any RFCs. So, why then does ProxMox's GUI take issue with such a condition? I presume this is bugulance in the GUI?

By the way, I was able to fix this using a form of the pveum command and the "--email" parameter to force something like "joetest@host1.test-lan".

Thanks in advance.

Stay safe from the thugs and healthy from the China Virus.

Stuart
 
Last edited:
Hi,

yeah I took a look at the code behind this check and I think it's this [1]:

JavaScript:
proxmoxMail: function(v) {
    return (/^(\w+)([-+.][\w]+)*@(\w[-\w]*\.){1,5}([A-Za-z]){2,63}$/).test(v);
},

As you can see hyphens aren't allowed. While I am not sure about the relevant RFCs, it is famously hard to find an efficient regex that actually validates everything that could be a valid address [2,3,4]. I'll see what can be done to improve the situation though.

[1]: https://git.proxmox.com/?p=proxmox-...47d1b049eb3c8eb11f4619ad17db3b80;hb=HEAD#l135
[2]: https://stackoverflow.com/a/201378
[3]: https://emailregex.com/
[4]: https://www.regular-expressions.info/email.html
 
Last edited:
  • Like
Reactions: stuartbh
Stefan,

In fairness, this is of course not a critical bug (for me at least). However, it seemed rather odd. The rules that apply to TLDs also apply to subdomains. Thus, so long as domains like uni-corn.com or baskin-robbins.com exist and function so can the TLD have a dash as well.

I appreciate your attention to this concern and hope that it can be addressed. Whilst I do not pay for support per se, that does not stop bugs found by unsupported users from impacting users that do pay for support! :)
I also realize that such a bug likely does not compare to something like a bug that causes a security risk too.

One additional note, it would be nice if when creating a PAM user if there was a tick box to say "oh yes, please go and create this user in Linux also", and maybe offer a few options as to that as well.

Thanks in advance and do stay safe and healthy!


Stuart, N3GWG
 
Last edited:
Hi Stuart,

well this is a fairly easy fix and I send a patch to the mailing list already [1].

One additional note, it would be nice if when creating a PAM user if there was a tick box to say "oh yes, please go and create this user in Linux also", and maybe offer a few options as to that as well
That is a different issue that would be more complex to implement. It's also unclear how useful that would be, as we'd need to restrict creating users to users that could already log in and create them this way. You might be better of using the "pve" realm to create new users.

[1]: https://lists.proxmox.com/pipermail/pve-devel/2022-September/053859.html
 
Thank you.

Any idea when the next release of ProxMox will be forthcoming?

Will this patch make it into the unofficial free patches anytime soon?

Stuart, N3GWG
 
Last edited:
Any idea when the next release of ProxMox will be forthcoming?
Sorry but I can't tell you an exact date when that will happen, but usually new packages get pushed onto the pve-no-subscription repository fairly regularly.
Will this patch make it into the unofficial free patches anytime soon?
Not sure what you mean by "unofficial free patches". If you mean the pve-no-subscription repository, it should be released there a couple of days to maybe a few weeks after having been accepted. Since the patch wasn't yet accept, this might still take a while. If you feel confident enough, you could apply the changes from the patch I linked to your system though.
 
Sorry but I can't tell you an exact date when that will happen, but usually new packages get pushed onto the pve-no-subscription repository fairly regularly.

No problem, I was just curious. I was able to work around the issue by modifying my user configuration from the command line.

Not sure what you mean by "unofficial free patches". If you mean the pve-no-subscription repository, it should be released there a couple of days to maybe a few weeks after having been accepted. Since the patch wasn't yet accept, this might still take a while. If you feel confident enough, you could apply the changes from the patch I linked to your system though.

Yes, I did mean the pve-no-subscription repository and I am sorry to have been so inarticulate in referencing it.
It is not so much a lack of confidence, just was curious what the turn around was as generally I apply patches as they come out and am not looking for any fixes per se, this is a unique occasion for me. That said, it was more of a curiosity thing than a requirement for a fix thing.

Thanks again!

Stuart, N3GWG
 
Yes, I did mean the pve-no-subscription repository and I am sorry to have been so inarticulate in referencing it.
No worries, I just wanted to make sure that it is clear that the pve-no-subscription repository is still an official repository.

Generally patches get released to the testing, no-subscription and enterprise one after another. The intend is that only stable updates make it into the enterprise repository and faulty ones get caught when they get released to either the testing or no-subscription repositories. So all three more less offer the same packages just at different stages of maturity.

I hope that clears that up!
 
Stefan,

In that case I am happy to perform testing on the no-subscription repos. For now ProxMox is just for home lab use and its criticality is not that high.

I am curious, if I am going to upgrade an SSD in one of my NUCs running ProxMox, what is the easiest way to migrate (as the migrate function does not seem to work to do it) a VM (not a container) stored on local storage with some snapshots currently taken? Is there a backup I can take that would store the snapshot data too?

By the way, the VMs are currently shutdown and so a live migration is not needed at all.

The future answer is that I am going to use either NFS or CEPH. I like CEPH but it might need too many resources for these NUCs (one is 32GB RAM/i5 the other is a 32GB/i7) systems to use it.

Thanks again!

Stuart, N3GWG
 
Last edited:

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!