diff --git a/apps/dashboard/config/application.rb b/apps/dashboard/config/application.rb index 8587bb56c..a85f4d70d 100644 --- a/apps/dashboard/config/application.rb +++ b/apps/dashboard/config/application.rb @@ -46,5 +46,17 @@ class Application < Rails::Application config.autoload_paths << ::Configuration.config_root.join("lib").to_s config.paths["app/views"].unshift ::Configuration.config_root.join("views").to_s end + + # Enable installed plugins only if configured by administrator + plugins_dir = Pathname.new(::Configuration.plugins_directory) + if plugins_dir.directory? + plugins_dir.children.select(&:directory?).each do |installed_plugin| + next unless installed_plugin.readable? + + 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 + end + end end end diff --git a/apps/dashboard/config/configuration_singleton.rb b/apps/dashboard/config/configuration_singleton.rb index 9db8aa902..8a9afb1a4 100644 --- a/apps/dashboard/config/configuration_singleton.rb +++ b/apps/dashboard/config/configuration_singleton.rb @@ -74,8 +74,9 @@ def string_configs :rclone_extra_config => nil, :default_profile => nil, :project_size_timeout => '15', - :novnc_default_compression => '6', - :novnc_default_quality => '2' + :novnc_default_compression => '6', + :novnc_default_quality => '2', + :plugins_directory => '/var/www/ood/apps/plugins' }.freeze end