45Drives / cockpit-file-sharing

A Cockpit plugin to easily manage samba and NFS file sharing.
GNU General Public License v3.0
598 stars 32 forks source link

[Feature Request] Any User to Create Shares #40

Closed Hutch-45D closed 2 years ago

Hutch-45D commented 2 years ago

I've ran into the issue a few times now where someone wants to create a new SMB share using the module but it only works if you are logged into root and most times you don't want everyone knowing the root password and in some instances, there is no root password for security reasons

it would be great if any user could log in, elevate themselves as an admin (like they already can) and then just allow them to make shares.

i believe the issue now is that for clusters there needs to be passwordless ssh between systems and that user needs to be able to make systems services

currently, there is no way around this besides making shares in the cli which defeats the purpose of this module

joshuaboud commented 2 years ago

Hey Hutch, this issue will be gone soon once we do the next big release of components. I may just go ahead and patch this anyway in the meantime, since it'll be as simple as adding the { superuser: 'try' } option to every instance of cockpit.spawn() for running commands. I believe default behaviour of cockpit.spawn() is just attempting to run the command as the logged in user with no attempt to escalate privilege.