-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow gem to work with MongoDB on Heroku #51
Comments
Hi, // EDIT: I forgot that MongoDB gem don't use ActiveRecord - so, at this moment, this gem won't work with MongoDB on Heroku (patches are welcome) |
If you outline how and where to look and make this work and what kind of tests to write for this I would gladly write a PR. (If you don't have time for that it will just take me longer to do so :P) |
Code for challenge is placed in Challenge Model: https://github.com/lgromanowski/letsencrypt-plugin/blob/master/app/models/letsencrypt_plugin/challenge.rb: module LetsencryptPlugin
# if the project doesn't use ActiveRecord, we assume the challenge will
# be stored in the filesystem
if LetsencryptPlugin.config.challenge_dir_name.blank? && defined?(ActiveRecord::Base) == 'constant' && ActiveRecord::Base.class == Class
class Challenge < ActiveRecord::Base
end
else
class Challenge
attr_accessor :response
def initialize
full_challenge_dir = File.join(Rails.root, LetsencryptPlugin.config.challenge_dir_name, 'challenge')
@response = IO.read(full_challenge_dir)
end
end
end
end Place which should be changed is Challenge::initialize() method in "else" branch - at this moment that code tries to read challenge from a file. |
Cool, thanks! |
I'm under the impression that this gem won't work with MongoDB on Heroku: #39 because Heroku is a read-only file system and this either requires the challenge directory or ActiveRecord?
Related because I can't create files on Heroku - (or unrelated, I'm not sure?) I can't figure out how to make the private key available on Heroku without checking it into the source code. I don't think checking it into the source code is the right way to go, but we're an open source app, so...
The text was updated successfully, but these errors were encountered: