kontron / redmine_oauth

Redmine authentication through OAuth.
GNU General Public License v2.0
57 stars 27 forks source link

Redmine 5.0.4 support for current plugin version #29

Closed svenseeberg closed 5 months ago

svenseeberg commented 7 months ago

I think it would be very helpful if this plugin supports Redmine 5.0.4. This is the version shipped in the default Debian Bookworm repositories. The package there is maintained and very stable and I think there are probably a lot of Redmine servers using it.

col-panic commented 7 months ago

I'm currently evaluating this plugin in redmine 5.1 and it seems to work - where is the problem?

svenseeberg commented 7 months ago

After installing the plugin as described in the README, Redmine throws an error:

App 1577267 output: Error: The application encountered the following error: redmine_oauth plugin requires Redmine 5.1.0 or higher but current is 5.0.4.stable (Redmine::PluginRequirementError)
App 1577267 output:     /usr/share/redmine/lib/redmine/plugin.rb:225:in `block in requires_redmine'
App 1577267 output:     /usr/share/redmine/lib/redmine/plugin.rb:217:in `each'
App 1577267 output:     /usr/share/redmine/lib/redmine/plugin.rb:217:in `requires_redmine'
App 1577267 output:     /usr/share/redmine/plugins/redmine_oauth/init.rb:32:in `block in <top (required)>'
App 1577267 output:     /usr/share/redmine/lib/redmine/plugin.rb:96:in `instance_eval'
App 1577267 output:     /usr/share/redmine/lib/redmine/plugin.rb:96:in `register'
App 1577267 output:     /usr/share/redmine/plugins/redmine_oauth/init.rb:24:in `<top (required)>'
App 1577267 output:     /usr/share/redmine/lib/redmine/plugin_loader.rb:31:in `load'
App 1577267 output:     /usr/share/redmine/lib/redmine/plugin_loader.rb:31:in `run_initializer'
App 1577267 output:     /usr/share/redmine/lib/redmine/plugin_loader.rb:108:in `each'
App 1577267 output:     /usr/share/redmine/lib/redmine/plugin_loader.rb:108:in `block in load'
App 1577267 output:     /var/lib/gems/3.1.0/gems/activesupport-6.1.7.6/lib/active_support/callbacks.rb:427:in `instance_exec'
App 1577267 output:     /var/lib/gems/3.1.0/gems/activesupport-6.1.7.6/lib/active_support/callbacks.rb:427:in `block in make_lambda'
App 1577267 output:     /var/lib/gems/3.1.0/gems/activesupport-6.1.7.6/lib/active_support/callbacks.rb:198:in `block (2 levels) in halting'
App 1577267 output:     /var/lib/gems/3.1.0/gems/activesupport-6.1.7.6/lib/active_support/callbacks.rb:604:in `block (2 levels) in default_terminator'
App 1577267 output:     /var/lib/gems/3.1.0/gems/activesupport-6.1.7.6/lib/active_support/callbacks.rb:603:in `catch'
App 1577267 output:     /var/lib/gems/3.1.0/gems/activesupport-6.1.7.6/lib/active_support/callbacks.rb:603:in `block in default_terminator'
App 1577267 output:     /var/lib/gems/3.1.0/gems/activesupport-6.1.7.6/lib/active_support/callbacks.rb:199:in `block in halting'
App 1577267 output:     /var/lib/gems/3.1.0/gems/activesupport-6.1.7.6/lib/active_support/callbacks.rb:512:in `block in invoke_before'
App 1577267 output:     /var/lib/gems/3.1.0/gems/activesupport-6.1.7.6/lib/active_support/callbacks.rb:512:in `each'
App 1577267 output:     /var/lib/gems/3.1.0/gems/activesupport-6.1.7.6/lib/active_support/callbacks.rb:512:in `invoke_before'
App 1577267 output:     /var/lib/gems/3.1.0/gems/activesupport-6.1.7.6/lib/active_support/callbacks.rb:105:in `run_callbacks'
App 1577267 output:     /var/lib/gems/3.1.0/gems/activesupport-6.1.7.6/lib/active_support/reloader.rb:88:in `prepare!'
App 1577267 output:     /var/lib/gems/3.1.0/gems/railties-6.1.7.6/lib/rails/application/finisher.rb:124:in `block in <module:Finisher>'
App 1577267 output:     /var/lib/gems/3.1.0/gems/railties-6.1.7.6/lib/rails/initializable.rb:32:in `instance_exec'
App 1577267 output:     /var/lib/gems/3.1.0/gems/railties-6.1.7.6/lib/rails/initializable.rb:32:in `run'
App 1577267 output:     /var/lib/gems/3.1.0/gems/railties-6.1.7.6/lib/rails/initializable.rb:61:in `block in run_initializers'
App 1577267 output:     /usr/lib/ruby/3.1.0/tsort.rb:228:in `block in tsort_each'
App 1577267 output:     /usr/lib/ruby/3.1.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component'
App 1577267 output:     /usr/lib/ruby/3.1.0/tsort.rb:431:in `each_strongly_connected_component_from'
App 1577267 output:     /usr/lib/ruby/3.1.0/tsort.rb:349:in `block in each_strongly_connected_component'
App 1577267 output:     /usr/lib/ruby/3.1.0/tsort.rb:347:in `each'
App 1577267 output:     /usr/lib/ruby/3.1.0/tsort.rb:347:in `call'
App 1577267 output:     /usr/lib/ruby/3.1.0/tsort.rb:347:in `each_strongly_connected_component'
App 1577267 output:     /usr/lib/ruby/3.1.0/tsort.rb:226:in `tsort_each'
App 1577267 output:     /usr/lib/ruby/3.1.0/tsort.rb:205:in `tsort_each'
App 1577267 output:     /var/lib/gems/3.1.0/gems/railties-6.1.7.6/lib/rails/initializable.rb:60:in `run_initializers'
App 1577267 output:     /var/lib/gems/3.1.0/gems/railties-6.1.7.6/lib/rails/application.rb:391:in `initialize!'
App 1577267 output:     /usr/share/redmine/config/environment.rb:16:in `<top (required)>'
App 1577267 output:     config.ru:3:in `require'
App 1577267 output:     config.ru:3:in `block in <main>'
App 1577267 output:     /var/lib/gems/3.1.0/gems/rack-2.2.8/lib/rack/builder.rb:125:in `instance_eval'
App 1577267 output:     /var/lib/gems/3.1.0/gems/rack-2.2.8/lib/rack/builder.rb:125:in `initialize'
App 1577267 output:     config.ru:1:in `new'
App 1577267 output:     config.ru:1:in `<main>'
App 1577267 output:     /usr/share/passenger/helper-scripts/rack-preloader.rb:101:in `eval'
App 1577267 output:     /usr/share/passenger/helper-scripts/rack-preloader.rb:101:in `preload_app'
App 1577267 output:     /usr/share/passenger/helper-scripts/rack-preloader.rb:189:in `block in <module:App>'
App 1577267 output:     /usr/lib/ruby/vendor_ruby/phusion_passenger/loader_shared_helpers.rb:397:in `run_block_and_record_step_progress'
App 1577267 output:     /usr/share/passenger/helper-scripts/rack-preloader.rb:188:in `<module:App>'
App 1577267 output:     /usr/share/passenger/helper-scripts/rack-preloader.rb:30:in `<module:PhusionPassenger>'
App 1577267 output:     /usr/share/passenger/helper-scripts/rack-preloader.rb:29:in `<main>'
col-panic commented 7 months ago

I see - so it requires at least redmine 5.1 👍

svenseeberg commented 7 months ago

We are currently testing the plugin with a patch (https://github.com/verdigado/redmine_oauth/commit/cd1f31db8e95bd6156c41e275600abcbaaeaf683) with Redmine 5.0.4 and it seems to work fine.

picman commented 7 months ago

The problem is in the rake task lib/tasks/email.rake. It requires gem 'net-imap', '~> 0.3.1' while Redmine 5.0.4 Gemfile contains gem 'net-imap', '~> 0.2.2'. So the authentication works in general but receiving emails via this task won't work with net-imap from Redmine 5.0.4.

svenseeberg commented 7 months ago

@pic would you accept a pull request that provides full compatibility for Redmine 5.0.4 or would that be not in your interest?

picman commented 7 months ago

Yes, I would.