Closed markusjura closed 8 years ago
Where do the "DEFAULT" envs get set? ConductR doesn't supply them...
default
is the default endpoint and therefore DEFAULT_BIND_IP
and DEFAULT_BIND_PORT
is available. If BundleKeys.endpoints
gets overridden then the user need to add specify a override http.port
and http.address
as well, e.g. by using BundleKeys.startCommand
.
Open for suggestions here, but I don't see any better solution after fighting with this for the past day.
The related change with the default
endpoint is made here https://github.com/typesafehub/sbt-conductr/pull/150.
LGTM - just rename DEFAULT
back to WEB
.
Changed it to WEB
.
For a Play project it is currently necessary to overwrite the
http.port
andhttp.address
envs with thestartCommand
option in thebuild.sbt
of the user project.Example
In
conductr-bundle-lib
the current approach to automate setting these envs is by adding configuration to the Play application loader: https://github.com/typesafehub/conductr-lib/blob/master/play25-conductr-bundle-lib/src/main/scala/com/typesafe/conductr/bundlelib/play/api/Env.scala#L19-L20Unfortunately, this approach doesn't work. Reason is that these envs are not used by Play when the netty server gets started. So Play will start itself inside of ConductR still on
0.0.0.0:9000
. Instead it is necessary to overrideplay.server.http.port
andplay.server.http.address
in theoverrides-referece.conf
.To keep things simple we override the port and address with the
default
endpoints (formerlyweb
) instead of using the project name as a key. Otherwise it would be hard to resolve the particular name of the project inside the configuration file.This PR has been tested with reactive-maps and chirper. I could see that the ip and port of the netty server is allocated properly. However, some other things were still not working (yet) with sbt-conductr 2.0.0. This PR is therefore still on
WIP
because I am not sure yet if this PR introduced this issues.