Vote #77873
未完了Change plugins directory through the configuration.yml file
0%
説明
This patch adds the possibility to change the directory "plugins" of the application through the file configuration.yml.
The patch has been tested with the last Trunk version (15839)
journals
In the comments, you say that Redmine needs to have write permission on the plugins directory. Why is that? I think it should have read permission only.
--------------------------------------------------------------------------------
I agree. Why plugins directory should have write permissions?
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
Hello,
Sorry, it was a mistake, i was talking about read permissions (not write).
Thanks
--------------------------------------------------------------------------------
Patch committed, thanks.
--------------------------------------------------------------------------------
@config/routes.rb@ must be aware of @plugins_path@ setting.
<pre><code class="diff">
Index: config/routes.rb
===================================================================
--- config/routes.rb (revision 16528)
+++ config/routes.rb (working copy)
@@ -374,7 +374,7 @@
get 'robots.txt', :to => 'welcome#robots'
- Dir.glob File.expand_path("plugins/*", Rails.root) do |plugin_dir|
+ Dir.glob File.expand_path("#{Redmine::Plugin.directory}/*", Rails.root) do |plugin_dir|
file = File.join(plugin_dir, "config/routes.rb")
if File.exists?(file)
begin
</code></pre>
--------------------------------------------------------------------------------
I wish that functionality, would be very great for multitenancy environments.
--------------------------------------------------------------------------------
Fix committed, thanks.
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
Reopening this issue because a fix for this feature has been submitted as #26139.
--------------------------------------------------------------------------------
Is r16654 correct?
config_plugins_path.diff defines Redmine::Plugin.directory as "Absolute path to the directory where plugins are stored.".
File.expand_path("#{Redmine::Plugin.directory}/*", Rails.root) maybe returns "#{Rails.root}/#{Redmine::Plugin.directory}/*"
--------------------------------------------------------------------------------
Sho HASHIMOTO wrote:
> Is r16654 correct?
> config_plugins_path.diff defines Redmine::Plugin.directory as "Absolute path to the directory where plugins are stored.".
> File.expand_path("#{Redmine::Plugin.directory}/*", Rails.root) maybe returns "#{Rails.root}/#{Redmine::Plugin.directory}/*"
No it does not returns that because the first argument is an absolute path. But for clarity, I've removed the second arg that is not used. Thanks for pointing this out.
--------------------------------------------------------------------------------
The current implementation does not support loading plugin gemfiles (#26139), I've removed the option in the configuration file for 3.4.0
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
related_issues
relates,New,13927,Reduce coupling between plugins and the "plugins/" directory
blocks,Reopened,26139,Follow Gemfile's plugin loader as #24007