-
Notifications
You must be signed in to change notification settings - Fork 71
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 manually specified approot. #133
base: master
Are you sure you want to change the base?
Conversation
I still don't understand why you're not just implementing this in your app directly. |
Because yesod approot settings are overridden by keter's APPROOT environment variable. |
That's not true, you can control that behavior, as I was trying to tell you On Tue, Jan 12, 2016 at 12:09 PM, ygale [email protected] wrote:
|
Anyway, hard-coding the approot in the yesod application and/or settings is not the right approach. We deploy each app build in many environments. The hostname for the current environment - and various other related settings - is defined in keter (or other deployment automation technologies we will be using). Why should we have to track that in parallel in the app settings, when there is already a mechanism to get it from the deployment framework? And besides - keter's approot feature really does need improvement. Are you opposed to this PR for some reason? |
I'm not maintaining Keter at this point, so it's Christopher's call, and I If you really, really think that updating the keter.yaml file in your I really don't have any objection in principle. It's just that the approach On Tue, Jan 12, 2016 at 12:52 PM, ygale [email protected] wrote:
|
Just a note: for yesod apps we can say whatever we want, it needs a small change in |
For web apps, keter sets the
APPROOT
environment variable to inform the app, which sits behind keter's reverse proxying, of the correct approot as seen from the outside.However, keter's algorithm to determine the approot is currently rather simplistic.
For example, keter always uses the first entry from the
hosts
list in the app bundle's keter.yaml, even if this particular request came in on a different hostname.For the URL method - HTTP or HTTPS - keter inserts the method of the request as received. That is not always correct; for example, when SSL processing is delegated to an upstream router.
See also this yesodweb thread.
This PR provides a quick-and-dirty workaround for these problems. It allows you to override keter's approot algorithm completely by hard-coding the approot in the app bundle's keter.yaml file. A new parameter
approot
is now supported in webapp stanzas.In the future, it would nice to expand this feature to give fine-grained control over the approot algorithm - to specify each of method, domain, and port separately as either a hard-coded value or taken from the request. That is compatible with this PR - specify
approot
as an object with fields instead of a single string value.It also would be a good idea to improve keter's default approot algorithm. That is outside the scope of this PR.