Redmine

Using Amazon S3 for storage

I'm trying to find some documentation about adding S3 support to Redmine be it by hacking the codebase or via a plugin. My current install is hosted on Heroku (which has a read only filesystem) hence the need for file uploads to be handled somewhere else in the cloud.

Has anyone been confronted with this issue before? Is there plugin in the works that I might be able to contribute to?If not, do any of the devs know of any pitfalls that might be encountered before developing such a plugin? (ie, in principle should it simply be a matter of overloading the Attachment model?).

I've been taking a look at paperclip for Redmine myself. I have one Redmine on Heroku (demo.redmine.org) but I'd like to be able to put my main Redmine's files on S3 to have more flexibility in hosting. I think the easiest path would be to create a Redmine plugin that overrode the core's Attachment model and saved to S3. That would make it easy to keep it compatible with the core Redmine until it's ready to be merged. If you could post it to Github, I might be able to help out once I finish up a few other projects.

+1 for getting file uploads to work with S3. I too am hosted on heroku and would love to see this working. Christopher let me know how it's going, and if you need a hand. I'm no expert but will do what I can.

I decided not implement paperclip in the end since it meant changing a whole bunch of the Attachment code.Haven't had time yet far to tidy it up, add tests and sort out all of the plugin pages but it basically works.

That plugin looks great! I wasn't reading its code yet or testing it, I have question before I try - Is it designed to work with one S3 configuration per redmine instance or project? Also is it possible to configure S3 access data trough redmine administration options or it needs file manipulations?

You will need to start Redmine locally and add your Redmine plugin's assets to git (public/plugin_assets). When Rails Engines starts, it copies those files but Heroku has a read-only filesystem so it will fail.

If you add SCM repositories, your database will grow really fast. I had demo.redmine.org up to about a 500MB database, well over Heroku's free plan.

Let me know if you need any help, I've deployed a few Redmine to Heroku and am planning to deploy a lot more of them there.

You will need to start Redmine locally and add your Redmine plugin's assets to git (public/plugin_assets). When Rails Engines starts, it copies those files but Heroku has a read-only filesystem so it will fail.

Could you please elaborate on this? I setup rm to run locally, but how "add your Redmine plugin's assets to git (public/plugin_assets)"?

I was wondering if I could get some help though :) So, I would like to host my redmine on Heroku. I have the redmine_s3 plugin installed and running on my localhost just fine. It writes to the correct s3 bucket and all from the localhost instance. However, when I deploy to Heroku and try to upload files, it fails. Here is a snippet from the heroku logs for the app.

Thanks for the prompt reply. Your advice led me down the right path because once I push /files into heroku...I realized that the heroku install was still trying to write to the file system rather than s3. So I went to reconfiguring the gem bundle and got it working. Its now working just as designed.

I'm trying to install S3 plugin to work with Redmine 9.2 and getting following error:

/var/spool/redmine/rm_0196/vendor/plugins/redmine_s3/lib/S3.rb:251:in `make_request': undefined method `empty?' for nil:NilClass (NoMethodError) from /var/spool/redmine/rm_0196/vendor/plugins/redmine_s3/lib/S3.rb:157:in `create_bucket' from /var/spool/redmine/rm_0196/vendor/plugins/redmine_s3/lib/redmine_s3/connection.rb:43:in `create_bucket' from /var/spool/redmine/rm_0196/vendor/plugins/redmine_s3/rails/../init.rb:17 from /var/spool/redmine/rm_0196/vendor/rails/activesupport/lib/active_support/callbacks.rb:182:in `call' from /var/spool/redmine/rm_0196/vendor/rails/activesupport/lib/active_support/callbacks.rb:182:in `evaluate_method' from /var/spool/redmine/rm_0196/vendor/rails/activesupport/lib/active_support/callbacks.rb:166:in `call' from /var/spool/redmine/rm_0196/vendor/rails/activesupport/lib/active_support/callbacks.rb:90:in `run' from /var/spool/redmine/rm_0196/vendor/rails/activesupport/lib/active_support/callbacks.rb:90:in `each' from /var/spool/redmine/rm_0196/vendor/rails/activesupport/lib/active_support/callbacks.rb:90:in `send' from /var/spool/redmine/rm_0196/vendor/rails/activesupport/lib/active_support/callbacks.rb:90:in `run' from /var/spool/redmine/rm_0196/vendor/rails/activesupport/lib/active_support/callbacks.rb:276:in `run_callbacks' from /var/spool/redmine/rm_0196/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:51:in `send' from /var/spool/redmine/rm_0196/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:51:in `run_prepare_callbacks' from /var/spool/redmine/rm_0196/config/../vendor/rails/railties/lib/initializer.rb:631:in `prepare_dispatcher' from /var/spool/redmine/rm_0196/config/../vendor/rails/railties/lib/initializer.rb:185:in `process' from /var/spool/redmine/rm_0196/config/../vendor/rails/railties/lib/initializer.rb:113:in `send' from /var/spool/redmine/rm_0196/config/../vendor/rails/railties/lib/initializer.rb:113:in `run' from /var/spool/redmine/rm_0196/config/environment.rb:23 from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require' from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require' from /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/rails.rb:147:in `rails' from /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails:113:in `cloaker_' from /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/configurator.rb:149:in `call' from /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/configurator.rb:149:in `listener' from /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails:99:in `cloaker_' from /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/configurator.rb:50:in `call' from /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/configurator.rb:50:in `initialize' from /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails:84:in `new' from /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails:84:in `run' from /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/command.rb:212:in `run' from /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails:281 from /usr/local/bin/mongrel_rails:19:in `load' from /usr/local/bin/mongrel_rails:19

Hi,Am trying to get the redmine_s3 plugin working on heroku. It appears to be working on local dev machine and appears in admin/settings/plugins listing. It does not appear in the plugins listing when I'm on heroku. Mike said that he "went to reconfiguring the gem bundle and got it working." I'm new to redmine and do not see the documentation on how to reconfigure the gem bundle for a plugin like this. Do I need an entry in heroku's required .gems? Do I need a config.gem "redmine_s3" in my environment.rb file?