Project

General

Profile

Actions

Patch #24007

open

Change plugins directory through the configuration.yml file

Added by Helder Manuel Torres Vieira over 7 years ago. Updated almost 7 years ago.

Status:
Reopened
Priority:
Normal
Assignee:
-
Category:
Plugin API
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:

Description

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)


Files

config_plugins_path.diff (3.85 KB) config_plugins_path.diff Helder Manuel Torres Vieira, 2016-10-05 20:17

Related issues

Related to Redmine - Patch #13927: Reduce coupling between plugins and the "plugins/" directoryNewJean-Baptiste Barth

Actions
Blocked by Redmine - Patch #26139: Follow Gemfile's plugin loader as #24007ReopenedJean-Philippe Lang

Actions
Actions #1

Updated by Jean-Philippe Lang over 7 years ago

  • Status changed from New to Needs feedback

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.

Actions #2

Updated by Andrey Lobanov (RedSoft) over 7 years ago

I agree. Why plugins directory should have write permissions?

Actions #3

Updated by Jean-Philippe Lang over 7 years ago

  • Category set to Plugin API
  • Status changed from Needs feedback to New
  • Assignee set to Jean-Philippe Lang
  • Target version set to 3.4.0
Actions #4

Updated by Helder Manuel Torres Vieira over 7 years ago

Hello,

Sorry, it was a mistake, i was talking about read permissions (not write).

Thanks

Actions #5

Updated by Jean-Philippe Lang over 7 years ago

  • Status changed from New to Closed

Patch committed, thanks.

Actions #6

Updated by Go MAEDA almost 7 years ago

  • Status changed from Closed to Reopened

config/routes.rb must be aware of plugins_path setting.

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
Actions #7

Updated by Anonymous almost 7 years ago

I wish that functionality, would be very great for multitenancy environments.

Actions #8

Updated by Jean-Philippe Lang almost 7 years ago

  • Status changed from Reopened to Closed

Fix committed, thanks.

Actions #9

Updated by Go MAEDA almost 7 years ago

  • Blocked by Patch #26139: Follow Gemfile's plugin loader as #24007 added
Actions #10

Updated by Go MAEDA almost 7 years ago

  • Status changed from Closed to Reopened

Reopening this issue because a fix for this feature has been submitted as #26139.

Actions #11

Updated by Sho HASHIMOTO almost 7 years ago

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}/*"

Actions #12

Updated by Jean-Philippe Lang almost 7 years ago

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.

Actions #13

Updated by Jean-Philippe Lang almost 7 years ago

  • Assignee deleted (Jean-Philippe Lang)
  • Target version deleted (3.4.0)

The current implementation does not support loading plugin gemfiles (#26139), I've removed the option in the configuration file for 3.4.0

Actions #14

Updated by Mischa The Evil over 6 years ago

  • Related to Patch #13927: Reduce coupling between plugins and the "plugins/" directory added
Actions

Also available in: Atom PDF