Project

General

Profile

Actions

Patch #24007

open

Change plugins directory through the configuration.yml file

Patch #24007: Change plugins directory through the configuration.yml file

Added by Helder Manuel Torres Vieira about 10 years ago. Updated over 9 years ago.

Status:
Reopened
Priority:
Normal
Assignee:
-
Category:
Plugin API
Target version:
-

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 2 (2 open — 0 closed)

Related to Redmine - Patch #13927: Reduce coupling between plugins and the "plugins/" directoryNewJean-Baptiste BarthActions
Blocked by Redmine - Patch #26139: Follow Gemfile's plugin loader as #24007ReopenedJean-Philippe LangActions

Updated by Jean-Philippe Lang about 10 years ago Actions #1

  • 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.

Updated by Andrey Lobanov (RedSoft) about 10 years ago Actions #2

I agree. Why plugins directory should have write permissions?

Updated by Jean-Philippe Lang about 10 years ago Actions #3

  • 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

Updated by Helder Manuel Torres Vieira about 10 years ago Actions #4

Hello,

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

Thanks

Updated by Jean-Philippe Lang about 10 years ago Actions #5

  • Status changed from New to Closed

Patch committed, thanks.

Updated by Go MAEDA over 9 years ago Actions #6

  • 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

Updated by Anonymous over 9 years ago Actions #7

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

Updated by Jean-Philippe Lang over 9 years ago Actions #8

  • Status changed from Reopened to Closed

Fix committed, thanks.

Updated by Go MAEDA over 9 years ago Actions #9

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

Updated by Go MAEDA over 9 years ago Actions #10

  • Status changed from Closed to Reopened

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

Updated by Sho HASHIMOTO over 9 years ago Actions #11

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

Updated by Jean-Philippe Lang over 9 years ago Actions #12

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.

Updated by Jean-Philippe Lang over 9 years ago Actions #13

  • 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

Updated by Mischa The Evil over 9 years ago Actions #14

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

Also available in: PDF Atom