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

Add per bundle certificates for static files and redirects. #163

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

tolysz
Copy link
Contributor

@tolysz tolysz commented Mar 4, 2017

Allow extending
static files and redirect stansaz with a custom certificate.

Redirects were not obvious, but they would fail on https

@@ -255,6 +257,7 @@ instance ParseYamlFile StaticFilesConfig where
<*> o .:? "directory-listing" .!= False
<*> o .:? "middleware" .!= []
<*> o .:? "connection-time-bound"
<*> o .:? "ssl" .!= SSLFalse
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be nice to have an example, even if it's "commented out"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated, but it is exactly the same syntax as for webapp

-> IO a
withActions asc bconfig f =
loop (V.toList $ bconfigStanzas bconfig) [] [] Map.empty
where
-- todo: add loading from relative location
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what's missing to support this now?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a pointer for others, I am happy with an absolute path.
I.e. I am using letsencrypt via https://github.com/lukas2511/dehydrated to generate certs in a fixed location in the filesystem (and I have to regenerate them every couple of months), then have my bundles to point to that absolute folders.

@creichert
Copy link
Collaborator

I like this. It would be nice to have examples, if possible. I left a review but approved these changes.

  • Were redirects failing before this change?

  • It looks like part of this fixes a bug and part is a feature. Can you give me a super quick example so I can understand a little deeper what the change is?

Otherwise, looks great.

@tolysz
Copy link
Contributor Author

tolysz commented Mar 4, 2017

Redirects :)
Let's assume the main certificate supports only domainA.
Now if we would like to add a redirect from domainB and we have a certificate for that domain.

Previously, the redirect, if connected via https would try to use the main cert giving a mismatch error, now we can supply the additional certificate for the domain we redirect from - making it work happily.

The last stantza left is the reverse-proxy, It will require some code shifts, so the SSLConfig will be available to both V10 and Network.HTTP.ReverseProxy.Rewrite

@tolysz
Copy link
Contributor Author

tolysz commented Mar 4, 2017

I added the reverse-proxy, so now additional certificates can be provided for all stanzas (except background).

@creichert
Copy link
Collaborator

@tolysz I've reviewed this one a few times and the code looks good. I really like the feature.

The one thing I would still add is documentation about the absolute path considering the primary keter config can take a relative path.

@snoyberg you might still want to take a quick look at this one when you have time. I haven't worked much on Keter core so the code is very unfamiliar.

@creichert creichert requested a review from snoyberg July 11, 2017 19:56
tolysz and others added 4 commits December 31, 2017 17:27
@tolysz
Copy link
Contributor Author

tolysz commented Feb 19, 2019

All the changes are merged into: #195

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

Successfully merging this pull request may close these issues.

4 participants