Browse Source

Use config for overriding port numbers

pull/346/head
Marcel Hilgersom 7 years ago
parent
commit
2672bc81c2
  1. 4
      src/Squidex/Config/Orleans/OrleansServices.cs
  2. 8
      src/Squidex/appsettings.json

4
src/Squidex/Config/Orleans/OrleansServices.cs

@ -58,8 +58,8 @@ namespace Squidex.Config.Orleans
{
["MongoDB"] = () =>
{
var siloPort = int.Parse(Environment.GetEnvironmentVariable("Orleans.SiloPort") ?? "11111");
var gatewayPort = int.Parse(Environment.GetEnvironmentVariable("Orleans.GatewayPort") ?? "40000");
int siloPort = int.TryParse(config.GetRequiredValue("orleans:siloPort"), out siloPort) ? siloPort : 11111;
int gatewayPort = int.TryParse(config.GetRequiredValue("orleans:gatewayPort"), out gatewayPort) ? gatewayPort : 40000;
hostBuilder.ConfigureEndpoints(Dns.GetHostName(), siloPort, gatewayPort, listenOnAnyHostAddress: true);

8
src/Squidex/appsettings.json

@ -177,7 +177,13 @@
*
* Supported: MongoDB, Development
*/
"clustering": "MongoDb"
"clustering": "MongoDb",
/*
* The ports used to host the Orleans silo and the Gateway to connect to it
* optional: defaults to 11111 (silo) and 40000 (gateway) when not provided
*/
"siloPort": "11111",
"gatewayPort": "40000"
},
"eventStore": {

Loading…
Cancel
Save