From 2672bc81c214e33f21ebbe8056c981656807cce1 Mon Sep 17 00:00:00 2001 From: Marcel Hilgersom Date: Wed, 13 Feb 2019 17:11:13 +0100 Subject: [PATCH] Use config for overriding port numbers --- src/Squidex/Config/Orleans/OrleansServices.cs | 4 ++-- src/Squidex/appsettings.json | 8 +++++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/Squidex/Config/Orleans/OrleansServices.cs b/src/Squidex/Config/Orleans/OrleansServices.cs index c4e2ae7fc..7ef2269c6 100644 --- a/src/Squidex/Config/Orleans/OrleansServices.cs +++ b/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); diff --git a/src/Squidex/appsettings.json b/src/Squidex/appsettings.json index 14e289162..b38d719e9 100644 --- a/src/Squidex/appsettings.json +++ b/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": {