-
Notifications
You must be signed in to change notification settings - Fork 108
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added support for multiple directories to deploy OOD extensions/customizations #3991
base: master
Are you sure you want to change the base?
Conversation
:novnc_default_quality => '2' | ||
:novnc_default_compression => '6', | ||
:novnc_default_quality => '2', | ||
:plugins_directory => '/var/www/ood/apps/plugins' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should probably be /etc/ood/config/plugins
. Stuff in /var/www/ood
will be overwritten on updates.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
config.paths["config/initializers"] << installed_plugin.join("initializers").to_s | ||
config.autoload_paths << installed_plugin.join("lib").to_s | ||
config.paths["app/views"].unshift installed_plugin.join("views").to_s |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should likely have additional checks here for root owned files in production. I just want to be extra doubly sure that what we load in production is indeed given by an administrator.
init_dir = installed_plugin.join("initializers")
safe_load = init_dir.children.all? { |f| File.stat(f.to_s).uid.zero? }
config.paths["config/initializers"] << init_dir if safe_load
@treydock any additional thoughts here on loading trusted files?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand the need to make sure that the configuration is given by an admin, but why is this different from the ones we use for load_external_config?
, ::Configuration.config_root
(/etc/ood/config/apps/dashboard)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should patch those too, we just haven't.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I made a change to verify that the plugin folders are owned by root when in production
Experimental feature to add support for a folder based OOD extensions structure.
The idea being that administrators can deploy OOD extensions by copying a folder to the new plugins directory.
More infor about the idea in #3916
To test:
Create the plugins folder:
/var/www/ood/apps/plugins
Download the attached zip file. It contains a folder with an OOD extension.
Add the folder,
session_metrics
, into the plugins directory.The attached zip file is an OOD extension to add Job metrics to the session card.
It requires a Slurm job scheduler to work.
session_metrics.zip
Fixes #3916