mirror of
https://github.com/bitwarden/server.git
synced 2025-06-30 15:42:48 -05:00
Enable key connector selfhost (#1707)
* initial commit * Add code for Key Connector feature * Add help URL to config * Fix folders for key-connector service * Fix paths for key-connector * fixing the env file builder when disabling the key connector * swapping a variable name Co-authored-by: Vince Grassia <593223+vgrassia@users.noreply.github.com>
This commit is contained in:
@ -97,5 +97,19 @@ namespace Bit.Setup
|
||||
Helpers.ShowBanner(_context, "WARNING", message, ConsoleColor.Yellow);
|
||||
}
|
||||
}
|
||||
|
||||
public void BuildForUpdater()
|
||||
{
|
||||
if (_context.Config.EnableKeyConnector && !File.Exists("/bitwarden/key-connector/bwkc.pfx"))
|
||||
{
|
||||
Directory.CreateDirectory("/bitwarden/key-connector/");
|
||||
var keyConnectorCertPassword = Helpers.GetValueFromEnvFile("key-connector",
|
||||
"keyConnectorSettings__certificate__filesystemPassword");
|
||||
Helpers.Exec("openssl req -x509 -newkey rsa:4096 -sha256 -nodes -keyout bwkc.key " +
|
||||
"-out bwkc.crt -subj \"/CN=Bitwarden Key Connector\" -days 36500");
|
||||
Helpers.Exec("openssl pkcs12 -export -out /bitwarden/key-connector/bwkc.pfx -inkey bwkc.key " +
|
||||
$"-in bwkc.crt -passout pass:{keyConnectorCertPassword}");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user