Skip to content
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

Support rails relative_root_url #26

Open
cmacduff opened this issue Aug 21, 2020 · 4 comments
Open

Support rails relative_root_url #26

cmacduff opened this issue Aug 21, 2020 · 4 comments

Comments

@cmacduff
Copy link

Doesn't seem like this gem supports this configuration:
https://guides.rubyonrails.org/configuring.html#deploy-to-a-subdirectory-relative-url-root
it always assumes the engine can be mounted at /.well_known

@elct9620
Copy link
Owner

This gem is based on Rails Engine, but I am not sure the Rails is supported relative_url_root in this case or not.

There have a rails/rails#31476 discuss it, but the PR seems not active and didn't be merged.
Maybe you can try mount LetsEncrypt::Engine => '/myroot/.well-known', I have no idea how to detect the relative_url_root in the Rails Engine for now.

@cmacduff
Copy link
Author

@elct9620 I dug into this one a bit more, I don't think it's possible. The ACME challenge requires this to be at the root of the domain:
https://github.com/unixcharles/acme-client/blob/38f4e17bc9e4ec21c3a417a085d843d1fb7f8b4d/lib/acme/client/resources/challenges/http01.rb#L16
which is how the spec is written for an HTTP-01 challenge:
https://letsencrypt.org/docs/challenge-types/

There could be support for a DNS-01 challenge, which the ACME client does support:
https://github.com/unixcharles/acme-client#preparing-for-dns-challenge
This gem would have to support different DNS services.

If I put together something to support multiple DNS services with a setup for Route53, would you be open to a PR for that?

@elct9620
Copy link
Owner

This gem depends on the Rails Engine, it didn't directly use acme-client to serve the /.well-known endpoint, according to the issue I point out in my previous comment, the Rails didn't support apply relative_root_url to the mounted engine.

The DNS support is required the plugin support for this gem and changes the current flow.

For example, we may want to add Route53, CloudFlare support, but it adds a lot of dependency for others didn't need it.
Therefore, we need to add the plugin gem rails-letsencrypt-router53 or rails-letsencrypt-cloudflare to extend the features to support it, I think we are not ready for it.

@elct9620
Copy link
Owner

I create an issue (#27) for DNS-challenge feature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants