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

Access Solr admin over HTTPS in DDEV by default #27

Closed
1 task done
gitressa opened this issue Nov 29, 2023 · 18 comments
Closed
1 task done

Access Solr admin over HTTPS in DDEV by default #27

gitressa opened this issue Nov 29, 2023 · 18 comments
Labels
enhancement New feature or request

Comments

@gitressa
Copy link
Contributor

Is there an existing issue for this?

  • I have searched the existing issues

Is your feature request related to a problem?

In Firefox, you need to disable HTTPS-Only Mode in Firefox to access Solr, since it's using HTTP, which is not ideal.

Describe your solution

It would be great with Solr access over HTTPS as the default, if it's possible.

Describe alternatives

No response

Additional context

Kevin Quillen's blog post Access Apache Solr admin over HTTPS in DDEV.

@gitressa gitressa added the enhancement New feature or request label Nov 29, 2023
@rfay
Copy link
Member

rfay commented Nov 29, 2023

My experience is that it all goes bad with HTTPS enabled, but the right place fof this issue is ddev/ddev-solr, so I'll move it there.

@rfay rfay transferred this issue from ddev/ddev Nov 29, 2023
@mkalkbrenner
Copy link
Collaborator

environment:
      # This defines the host name the service should be accessible from. This
      # will be solr.sitename.ddev.site.
      - VIRTUAL_HOST=solr.$DDEV_HOSTNAME
      # HTTP_EXPOSE exposes http traffic from the container port 8983
      # to the host port 8983 vid ddev-router reverse proxy.
      - HTTP_EXPOSE=8983:8983
      - HTTPS_EXPOSE=443:8983

OK, this isn't true HTTPS between the router and Solr. But it makes sense as simple workaround for Firefox and also your app uses CSP headers to redirect to HTTPS.

@mkalkbrenner
Copy link
Collaborator

I'll add this after the Solr 9 support is committed.

@rfay
Copy link
Member

rfay commented May 1, 2024

The HTTPS_EXPOSE has been problematic in the past because the Solr admin did an odd redirect on some/many browsers. Hopefully that's fixed. But that's why it was removed in previous revisions.

@mkalkbrenner
Copy link
Collaborator

mkalkbrenner commented May 2, 2024

Using port 443 might cause conflicts with the application if it serves /solr as well.

@mkalkbrenner
Copy link
Collaborator

mkalkbrenner commented May 2, 2024

If I add HTTPS_EXPOSE=8943:8983, ddev status gives me https://dummy.ddev.site:8943.
This gets redirected to http://dummy.ddev.site:8943/solr, which doesn't work (http instead of https).
If I enter https://dummy.ddev.site:8943/solr manually, it works.

@rfay is there any way to append /solr to the URL shown by ddev status?

@rfay
Copy link
Member

rfay commented May 2, 2024

Great troubleshooting.

DDEV doesn't have a way to know what the default URI should be (it auto-discovers the port). But you might consider a solr custom command added by the add-on. Then people could do ddev solr, or ddev solradmin. Just a knock-off on all the many other custom commands that do a launch, like ddev phpmyadmin. https://github.com/ddev/ddev-phpmyadmin/blob/main/commands/host/phpmyadmin

Related:

@rfay
Copy link
Member

rfay commented Jun 2, 2024

@kevinquillen article on a solution, https://kevinquillen.com/access-apache-solr-admin-over-https-ddev

@kevinquillen if this can be done reliably, how about a PR?

@mkalkbrenner
Copy link
Collaborator

mkalkbrenner commented Jun 4, 2024

@rfay as mentioned above in #27 (comment) the suggestion by @kevinquillen works, but the link in ddev status breaks.

@kevinquillen
Copy link

@mkalkbrenner @rfay that would be fixed with this change in a future release, right? The output will reflect the host and port overrides. I haven't quite had an issue with https redirect otherwise.

ddev/ddev#6136

@stasadev
Copy link
Member

stasadev commented Jun 4, 2024

I got to the root of the problem:

@stasadev
Copy link
Member

stasadev commented Jun 4, 2024

@mkalkbrenner
This won't work 0398b27
HTTPS support is only for the UI, meaning you still need to access it via HTTP inside the container.

@stasadev
Copy link
Member

stasadev commented Jun 4, 2024

I forgot about the tests, but you still can test HTTPS here:

if curl --output /dev/null --silent --head --fail http://${PROJNAME}.ddev.site:8983/solr/techproducts/select?q=*:*; then

See:

@rfay
Copy link
Member

rfay commented Jun 4, 2024

@kevinquillen does this make your article obsolete?

@kevinquillen
Copy link

kevinquillen commented Jun 4, 2024

I think so. This fixes the https redirect, the other shows customization. The PR I made last month will make the ddev describe reflect all cases correctly.

@rfay
Copy link
Member

rfay commented Jun 4, 2024

@gitressa
Copy link
Contributor Author

gitressa commented Jun 5, 2024

Thanks everyone! It's so great to be able to access Solr over HTTPS.

@gitressa
Copy link
Contributor Author

gitressa commented Jun 5, 2024

I created a follow-up issue #41.

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

No branches or pull requests

5 participants