There are a couple places in the webui that allow users to start an ssh terminal. File explorer, Active interactive sessions, dashboard’s cluster shell, I think that is all of them. What like to do is disable them all.
The Dashboard’s navbar can be overridden by defining apps you want to allow
/etc/ood/config/apps/dashboard/initializers/ood.rb
NavConfig.categories=[“Files”, “Jobs”, “Interactive Apps”]
NavConfig.categories_whitelist=true
Other 2 there does not appear to be a configuration option to control behaviour. What about commenting out in html/cgi. Can you point me to where in the code they are and or make them a configurable option to enable/disable?
As far as the other locations, I’m not sure that there is a way without doing what you are planning to do. However, if you do comment out the code, you would need to reapply that comment each time you update ondemand.
If this functionality does exist and I’m unaware, I will let you know. If it does not exist, I will create a project ticket to add this as a feature. Ability to globally disable the terminal app.
The preferred method in OnDemand to disable an app is to block the user(s) from having access using POSIX permissions. So to make it so only root can access the shell app (used for Terminal access):
If a user can’t access the app on the filesystem, their PUN (Per-User-NGINX) will not be able to access the app so it won’t show up in OnDemand.
Be aware that at this time, OnDemand updates will overwrite permission changes on apps that are shipped with OnDemand packages. I would recommend integrating the permission changes into some kind of automation.
Thank you for the quick suggestion. Changing directory perm to 700 does disables the functionality, not hide the buttons from the webui. If user clicks on it they get application error 500.
Gerald,
I did go through pages and commented out in the code where button and or anchor tags are generated. This does give does hide buttons from webui and would be preferred. If they have button, they will click it and if it errors, thats a ticket. I’ll do both changing perms and little code edits.
I removed the cluster menu item with:
/etc/ood/config/apps/dashboard/initializers/ood.rb
NavConfig.categories=[“Files”, “Jobs”, “Interactive Apps”]
NavConfig.categories_whitelist=true
Curious, why not use a global class and extend for individual modules as needed?
in the individual modules/apps class appConfiguration < ConfigurationSingleton
This could me global setting, with local overrides as needed or vice versa
Setting terminal functionality in files app
def files_enable_shell_button
to_bool(config.fetch(:files_enable_shell_button, true))
end
Looking at the diff patch for index.html it’s not clear where the code removed is coming from. For example in 2.0 branch I see no mention of OODClusters.any in the dashboard views.