wooey / Wooey

A Django app that creates automatic web UIs for Python scripts.
http://wooey.readthedocs.org
BSD 3-Clause "New" or "Revised" License
2.11k stars 182 forks source link

Support for the scripts to be run as the logged in user #333

Closed JasonFinestone closed 3 years ago

JasonFinestone commented 3 years ago

Feature Request For Linux installation.

I would like to be able to set the wooey scripts, or a selection of the scripts, to be run as the logged in user instead of as the app runner. The users will would be authenticated for the Linux host the app is running on at login.

Then the script get's run as that logged in user.

Chris7 commented 3 years ago

Could you go into your use case here a little more? I think it'd be quite hard to actually do this in the general sense. The users would need to have a profile that is linked to their system user, then we'd have to go from that user -> user id, and become that user for the spawned subprocess. And we'd have to do it in a way that doesn't break other OS's.

Scripts can be assigned to users already -- so only certain users can run them. Is this the type of functionality you are looking for?

JasonFinestone commented 3 years ago

Thanks for the reply. The reason I wanted the functionality was that the scripts I have use the users stored credentials to access a few API's and those credentials are stored read only to that user. I think it's a better idea for me to update the scripts to run as the app user instead and create new API credentials for the app user so the API's calls still work.

Thanks again for the reply.

Chris7 commented 3 years ago

Thanks. I think from the wooey side -- the only idea I have to really do this without too much platform specificity is passing the logged in username as an environment variable, which i don't really like as it puts some wooey specific logic in a place it doesn't belong (the script itself)