1
0
mirror of https://github.com/bitwarden/server synced 2026-03-01 10:51:26 +00:00

set proper port bindings for alternate port setup

This commit is contained in:
Kyle Spearrin
2018-03-28 11:03:20 -04:00
parent 7f250a4e74
commit 6f708a8198
2 changed files with 26 additions and 8 deletions

View File

@@ -91,7 +91,12 @@ namespace Bit.Setup
Console.Write("(!) Do you want to use the default ports for HTTP (80) and HTTPS (443)? (y/n): ");
var defaultPorts = Console.ReadLine().ToLowerInvariant() == "y";
int httpPort = default(int), httpsPort = default(int);
if(!defaultPorts)
if(defaultPorts)
{
httpPort = 80;
httpsPort = 443;
}
else
{
Console.Write("(!) HTTP port: ");
if(int.TryParse(Console.ReadLine().ToLowerInvariant().Trim(), out httpPort))
@@ -108,8 +113,9 @@ namespace Bit.Setup
}
else
{
Console.WriteLine("Invalid HTTPS port.");
httpPort = httpsPort = default(int);
Console.WriteLine("Invalid HTTPS port. Using defaults.");
httpPort = 80;
httpsPort = 443;
}
}
else if(httpPort != 80)
@@ -119,7 +125,8 @@ namespace Bit.Setup
}
else
{
Console.WriteLine("Invalid HTTP port.");
Console.WriteLine("Invalid HTTP port. Using default.")
httpPort = 80;
}
}