redmine_maintenance_mode icon indicating copy to clipboard operation
redmine_maintenance_mode copied to clipboard

Support Redmine 5

Open jsabater opened this issue 3 years ago • 4 comments

Please, when you have the chance, please check the compatibility with Redmine 5 and make the necessary adaptations, if any is needed. Thanks in advance.

jsabater avatar May 24 '22 19:05 jsabater

@tofi86 any update plz

ashrafalzyoud avatar Aug 09 '22 19:08 ashrafalzyoud

@tofi86 I did a cleanup and adapted for redmine 5. I did not test back on older pre-redmine 5 setups since I do not care at all on our side. The major thing is that we decided to get completely rid of the deface dependency. Basically there is no need to use deface at all since redmine provides adequate hooks in order to do the job in this case.

As the changes are pretty big let me know if you desire to take them partly I can then maybe provide small PRs one by one. If you feel like to take over parts by yourself, just go on. I made the changes by myself on my spare time, I am the author and it is MIT licensed, so feel free to have a look and grasp what you consider being useful:

https://github.com/tools-aoeur/redmine_maintenance_mode

jdehaan avatar Oct 12 '22 21:10 jdehaan

Hello,

with this

About your application's environment
Rails version             6.1.7
Ruby version              ruby 3.0.2p107 (2021-07-07 revision 0db68f0233) [x86_64-linux-gnu]
RubyGems version          3.3.5
Rack version              2.2.4
Middleware                ActionDispatch::HostAuthorization, Rack::ContentLength, Rack::Sendfile, ActionDispatch::Static, ActionDispatch::Executor, ActiveSupport::Cache::Strategy::LocalCache::Middleware, Rack::Runtime, Rack::MethodOverride, ActionDispatch::RequestId, RequestStore::Middleware, ActionDispatch::RemoteIp, Rails::Rack::Logger, ActionDispatch::ShowExceptions, ActionDispatch::DebugExceptions, ActionDispatch::ActionableExceptions, ActionDispatch::Callbacks, ActionDispatch::Cookies, ActionDispatch::Session::CookieStore, ActionDispatch::Flash, ActionDispatch::ContentSecurityPolicy::Middleware, ActionDispatch::PermissionsPolicy::Middleware, Rack::Head, Rack::ConditionalGet, Rack::ETag, Rack::TempfileReaper
Application root          /opt/redmine-5.0.3
Environment               production
Database adapter          mysql2
Database schema version   20220224194639

I got error

** Invoke redmine:plugins:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
rake aborted!
LoadError: cannot load such file -- maintenance_mode_hooks
/var/lib/gems/3.0.0/gems/polyglot-0.3.5/lib/polyglot.rb:65:in `require'
/var/lib/gems/3.0.0/gems/polyglot-0.3.5/lib/polyglot.rb:65:in `require'
/var/lib/gems/3.0.0/gems/zeitwerk-2.6.6/lib/zeitwerk/kernel.rb:38:in `require'
/var/lib/gems/3.0.0/gems/activesupport-6.1.7/lib/active_support/dependencies/zeitwerk_integration.rb:51:in `require_dependency'
/opt/redmine-5.0.3/plugins/redmine_maintenance_mode/init.rb:1:in `<top (required)>'
/opt/redmine-5.0.3/lib/redmine/plugin_loader.rb:31:in `load'
/opt/redmine-5.0.3/lib/redmine/plugin_loader.rb:31:in `run_initializer'
/opt/redmine-5.0.3/lib/redmine/plugin_loader.rb:108:in `each'
/opt/redmine-5.0.3/lib/redmine/plugin_loader.rb:108:in `block in load'
/var/lib/gems/3.0.0/gems/activesupport-6.1.7/lib/active_support/callbacks.rb:427:in `instance_exec'
/var/lib/gems/3.0.0/gems/activesupport-6.1.7/lib/active_support/callbacks.rb:427:in `block in make_lambda'
/var/lib/gems/3.0.0/gems/activesupport-6.1.7/lib/active_support/callbacks.rb:198:in `block (2 levels) in halting'
/var/lib/gems/3.0.0/gems/activesupport-6.1.7/lib/active_support/callbacks.rb:604:in `block (2 levels) in default_terminator'
/var/lib/gems/3.0.0/gems/activesupport-6.1.7/lib/active_support/callbacks.rb:603:in `catch'
/var/lib/gems/3.0.0/gems/activesupport-6.1.7/lib/active_support/callbacks.rb:603:in `block in default_terminator'
/var/lib/gems/3.0.0/gems/activesupport-6.1.7/lib/active_support/callbacks.rb:199:in `block in halting'
/var/lib/gems/3.0.0/gems/activesupport-6.1.7/lib/active_support/callbacks.rb:512:in `block in invoke_before'
/var/lib/gems/3.0.0/gems/activesupport-6.1.7/lib/active_support/callbacks.rb:512:in `each'
/var/lib/gems/3.0.0/gems/activesupport-6.1.7/lib/active_support/callbacks.rb:512:in `invoke_before'
/var/lib/gems/3.0.0/gems/activesupport-6.1.7/lib/active_support/callbacks.rb:105:in `run_callbacks'
/var/lib/gems/3.0.0/gems/activesupport-6.1.7/lib/active_support/reloader.rb:88:in `prepare!'
/var/lib/gems/3.0.0/gems/railties-6.1.7/lib/rails/application/finisher.rb:124:in `block in <module:Finisher>'
/var/lib/gems/3.0.0/gems/railties-6.1.7/lib/rails/initializable.rb:32:in `instance_exec'
/var/lib/gems/3.0.0/gems/railties-6.1.7/lib/rails/initializable.rb:32:in `run'
/var/lib/gems/3.0.0/gems/railties-6.1.7/lib/rails/initializable.rb:61:in `block in run_initializers'
/usr/lib/ruby/3.0.0/tsort.rb:228:in `block in tsort_each'
/usr/lib/ruby/3.0.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component'
/usr/lib/ruby/3.0.0/tsort.rb:431:in `each_strongly_connected_component_from'
/usr/lib/ruby/3.0.0/tsort.rb:349:in `block in each_strongly_connected_component'
/usr/lib/ruby/3.0.0/tsort.rb:347:in `each'
/usr/lib/ruby/3.0.0/tsort.rb:347:in `call'
/usr/lib/ruby/3.0.0/tsort.rb:347:in `each_strongly_connected_component'
/usr/lib/ruby/3.0.0/tsort.rb:226:in `tsort_each'
/usr/lib/ruby/3.0.0/tsort.rb:205:in `tsort_each'
/var/lib/gems/3.0.0/gems/railties-6.1.7/lib/rails/initializable.rb:60:in `run_initializers'
/var/lib/gems/3.0.0/gems/railties-6.1.7/lib/rails/application.rb:391:in `initialize!'
/opt/redmine-5.0.3/config/environment.rb:16:in `<top (required)>'
/var/lib/gems/3.0.0/gems/polyglot-0.3.5/lib/polyglot.rb:65:in `require'
/var/lib/gems/3.0.0/gems/polyglot-0.3.5/lib/polyglot.rb:65:in `require'
/var/lib/gems/3.0.0/gems/zeitwerk-2.6.6/lib/zeitwerk/kernel.rb:38:in `require'
/var/lib/gems/3.0.0/gems/activesupport-6.1.7/lib/active_support/dependencies.rb:332:in `block in require'
/var/lib/gems/3.0.0/gems/activesupport-6.1.7/lib/active_support/dependencies.rb:299:in `load_dependency'
/var/lib/gems/3.0.0/gems/activesupport-6.1.7/lib/active_support/dependencies.rb:332:in `require'
/var/lib/gems/3.0.0/gems/railties-6.1.7/lib/rails/application.rb:367:in `require_environment!'
/var/lib/gems/3.0.0/gems/railties-6.1.7/lib/rails/application.rb:533:in `block in run_tasks_blocks'
/usr/share/rubygems-integration/all/gems/rake-13.0.6/lib/rake/task.rb:281:in `block in execute'
/usr/share/rubygems-integration/all/gems/rake-13.0.6/lib/rake/task.rb:281:in `each'
/usr/share/rubygems-integration/all/gems/rake-13.0.6/lib/rake/task.rb:281:in `execute'
/usr/share/rubygems-integration/all/gems/rake-13.0.6/lib/rake/task.rb:219:in `block in invoke_with_call_chain'
/usr/share/rubygems-integration/all/gems/rake-13.0.6/lib/rake/task.rb:199:in `synchronize'
/usr/share/rubygems-integration/all/gems/rake-13.0.6/lib/rake/task.rb:199:in `invoke_with_call_chain'
/usr/share/rubygems-integration/all/gems/rake-13.0.6/lib/rake/task.rb:243:in `block in invoke_prerequisites'
/usr/share/rubygems-integration/all/gems/rake-13.0.6/lib/rake/task.rb:241:in `each'
/usr/share/rubygems-integration/all/gems/rake-13.0.6/lib/rake/task.rb:241:in `invoke_prerequisites'
/usr/share/rubygems-integration/all/gems/rake-13.0.6/lib/rake/task.rb:218:in `block in invoke_with_call_chain'
/usr/share/rubygems-integration/all/gems/rake-13.0.6/lib/rake/task.rb:199:in `synchronize'
/usr/share/rubygems-integration/all/gems/rake-13.0.6/lib/rake/task.rb:199:in `invoke_with_call_chain'
/usr/share/rubygems-integration/all/gems/rake-13.0.6/lib/rake/task.rb:188:in `invoke'
/usr/share/rubygems-integration/all/gems/rake-13.0.6/lib/rake/application.rb:160:in `invoke_task'
/usr/share/rubygems-integration/all/gems/rake-13.0.6/lib/rake/application.rb:116:in `block (2 levels) in top_level'
/usr/share/rubygems-integration/all/gems/rake-13.0.6/lib/rake/application.rb:116:in `each'
/usr/share/rubygems-integration/all/gems/rake-13.0.6/lib/rake/application.rb:116:in `block in top_level'
/usr/share/rubygems-integration/all/gems/rake-13.0.6/lib/rake/application.rb:125:in `run_with_threads'
/usr/share/rubygems-integration/all/gems/rake-13.0.6/lib/rake/application.rb:110:in `top_level'
/usr/share/rubygems-integration/all/gems/rake-13.0.6/lib/rake/application.rb:83:in `block in run'
/usr/share/rubygems-integration/all/gems/rake-13.0.6/lib/rake/application.rb:186:in `standard_exception_handling'
/usr/share/rubygems-integration/all/gems/rake-13.0.6/lib/rake/application.rb:80:in `run'
/usr/share/rubygems-integration/all/gems/rake-13.0.6/exe/rake:27:in `<top (required)>'
/usr/bin/rake:25:in `load'
/usr/bin/rake:25:in `<main>'
Tasks: TOP => redmine:plugins:migrate => environment

Thanks

simonefratini avatar Nov 26 '22 16:11 simonefratini

@tofi86 I did a cleanup and adapted for redmine 5. I did not test back on older pre-redmine 5 setups since I do not care at all on our side. The major thing is that we decided to get completely rid of the deface dependency. Basically there is no need to use deface at all since redmine provides adequate hooks in order to do the job in this case.

As the changes are pretty big let me know if you desire to take them partly I can then maybe provide small PRs one by one. If you feel like to take over parts by yourself, just go on. I made the changes by myself on my spare time, I am the author and it is MIT licensed, so feel free to have a look and grasp what you consider being useful:

https://github.com/tools-aoeur/redmine_maintenance_mode

For me your version works! Thank you very much!

simonefratini avatar Nov 26 '22 16:11 simonefratini