mirror of
https://github.com/bitwarden/server.git
synced 2025-04-23 05:55:13 -05:00
set proper port bindings for alternate port setup
This commit is contained in:
parent
7f250a4e74
commit
6f708a8198
@ -21,15 +21,19 @@ namespace Bit.Setup
|
|||||||
|
|
||||||
public bool MssqlDataDockerVolume { get; private set; }
|
public bool MssqlDataDockerVolume { get; private set; }
|
||||||
public int HttpPort { get; private set; } = 80;
|
public int HttpPort { get; private set; } = 80;
|
||||||
public int HttpsPort { get; private set; } = 443;
|
public int HttpsPort { get; private set; }
|
||||||
public string CoreVersion { get; private set; } = "latest";
|
public string CoreVersion { get; private set; } = "latest";
|
||||||
public string WebVersion { get; private set; } = "latest";
|
public string WebVersion { get; private set; } = "latest";
|
||||||
|
|
||||||
public void BuildForInstaller(int httpPort, int httpsPort)
|
public void BuildForInstaller(int httpPort, int httpsPort)
|
||||||
{
|
{
|
||||||
if(httpPort != default(int) && httpsPort != default(int))
|
if(httpPort != default(int))
|
||||||
{
|
{
|
||||||
HttpPort = httpPort;
|
HttpPort = httpPort;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(httpsPort != default(int))
|
||||||
|
{
|
||||||
HttpsPort = httpsPort;
|
HttpsPort = httpsPort;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -179,8 +183,15 @@ services:
|
|||||||
container_name: bitwarden-nginx
|
container_name: bitwarden-nginx
|
||||||
restart: always
|
restart: always
|
||||||
ports:
|
ports:
|
||||||
- '{HttpPort}:8080'
|
- '{HttpPort}:8080'");
|
||||||
- '{HttpsPort}:8081'
|
|
||||||
|
if(HttpsPort != default(int))
|
||||||
|
{
|
||||||
|
sw.Write($@"
|
||||||
|
- '{HttpsPort}:8081'");
|
||||||
|
}
|
||||||
|
|
||||||
|
sw.Write($@"
|
||||||
volumes:
|
volumes:
|
||||||
- ../nginx:/etc/bitwarden/nginx
|
- ../nginx:/etc/bitwarden/nginx
|
||||||
- ../letsencrypt:/etc/letsencrypt
|
- ../letsencrypt:/etc/letsencrypt
|
||||||
|
@ -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): ");
|
Console.Write("(!) Do you want to use the default ports for HTTP (80) and HTTPS (443)? (y/n): ");
|
||||||
var defaultPorts = Console.ReadLine().ToLowerInvariant() == "y";
|
var defaultPorts = Console.ReadLine().ToLowerInvariant() == "y";
|
||||||
int httpPort = default(int), httpsPort = default(int);
|
int httpPort = default(int), httpsPort = default(int);
|
||||||
if(!defaultPorts)
|
if(defaultPorts)
|
||||||
|
{
|
||||||
|
httpPort = 80;
|
||||||
|
httpsPort = 443;
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
Console.Write("(!) HTTP port: ");
|
Console.Write("(!) HTTP port: ");
|
||||||
if(int.TryParse(Console.ReadLine().ToLowerInvariant().Trim(), out httpPort))
|
if(int.TryParse(Console.ReadLine().ToLowerInvariant().Trim(), out httpPort))
|
||||||
@ -108,8 +113,9 @@ namespace Bit.Setup
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Console.WriteLine("Invalid HTTPS port.");
|
Console.WriteLine("Invalid HTTPS port. Using defaults.");
|
||||||
httpPort = httpsPort = default(int);
|
httpPort = 80;
|
||||||
|
httpsPort = 443;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(httpPort != 80)
|
else if(httpPort != 80)
|
||||||
@ -119,7 +125,8 @@ namespace Bit.Setup
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Console.WriteLine("Invalid HTTP port.");
|
Console.WriteLine("Invalid HTTP port. Using default.")
|
||||||
|
httpPort = 80;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user