mirror of
https://github.com/bitwarden/server.git
synced 2026-01-31 06:03:12 +08:00
Make development easier (#3504)
* Remove Certificate Steps from Setup * Add Helpers to VSCode Tasks * Force Ephermal Key in Integration Tests * Add Property to Interface
This commit is contained in:
2
dev/.gitignore
vendored
2
dev/.gitignore
vendored
@@ -15,5 +15,7 @@ data_protection_dev.crt
|
||||
data_protection_dev.key
|
||||
data_protection_dev.pfx
|
||||
|
||||
signingkey.jwk
|
||||
|
||||
# Reverse Proxy Conifg
|
||||
reverse-proxy.conf
|
||||
|
||||
@@ -4,9 +4,6 @@
|
||||
IDENTITY_SERVER_KEY=identity_server_dev.key
|
||||
IDENTITY_SERVER_CERT=identity_server_dev.crt
|
||||
IDENTITY_SERVER_CN="Bitwarden Identity Server Dev"
|
||||
DATA_PROTECTION_KEY=data_protection_dev.key
|
||||
DATA_PROTECTION_CERT=data_protection_dev.crt
|
||||
DATA_PROTECTION_CN="Bitwarden Data Protection Dev"
|
||||
|
||||
# Detect management command to trust generated certificates.
|
||||
if [ -x "$(command -v update-ca-certificates)" ]; then
|
||||
@@ -30,19 +27,10 @@ openssl req -x509 -newkey rsa:4096 -sha256 -nodes -days 3650 \
|
||||
|
||||
sudo cp $IDENTITY_SERVER_CERT $CA_CERT_DIR
|
||||
|
||||
openssl req -x509 -newkey rsa:4096 -sha256 -nodes -days 3650 \
|
||||
-keyout $DATA_PROTECTION_KEY \
|
||||
-out $DATA_PROTECTION_CERT \
|
||||
-subj "/CN=$DATA_PROTECTION_CN"
|
||||
|
||||
sudo cp $DATA_PROTECTION_CERT $CA_CERT_DIR
|
||||
|
||||
sudo $UPDATE_CA_CMD
|
||||
|
||||
identity=($(openssl x509 -in $IDENTITY_SERVER_CERT -outform der | sha1sum | tr a-z A-Z))
|
||||
data=($(openssl x509 -in $DATA_PROTECTION_CERT -outform der | sha1sum | tr a-z A-Z))
|
||||
|
||||
echo "Certificate fingerprints:"
|
||||
|
||||
echo "Identity Server Dev: ${identity}"
|
||||
echo "Data Protection Dev: ${data}"
|
||||
|
||||
@@ -7,17 +7,8 @@ openssl pkcs12 -export -legacy -out identity_server_dev.pfx -inkey identity_serv
|
||||
|
||||
security import ./identity_server_dev.pfx -k ~/Library/Keychains/Login.keychain
|
||||
|
||||
openssl req -x509 -newkey rsa:4096 -sha256 -nodes -keyout data_protection_dev.key -out data_protection_dev.crt \
|
||||
-subj "/CN=Bitwarden Data Protection Dev" -days 3650
|
||||
openssl pkcs12 -export -legacy -out data_protection_dev.pfx -inkey data_protection_dev.key -in data_protection_dev.crt \
|
||||
-certfile data_protection_dev.crt
|
||||
|
||||
security import ./data_protection_dev.pfx -k ~/Library/Keychains/Login.keychain
|
||||
|
||||
identity=($(openssl x509 -in identity_server_dev.crt -outform der | shasum -a 1 | tr a-z A-Z));
|
||||
data=($(openssl x509 -in data_protection_dev.crt -outform der | shasum -a 1 | tr a-z A-Z));
|
||||
|
||||
echo "Certificate fingerprints:"
|
||||
|
||||
echo "Identity Server Dev: ${identity}"
|
||||
echo "Data Protection Dev: ${data}"
|
||||
|
||||
@@ -9,6 +9,3 @@ $params = @{
|
||||
|
||||
$params['Subject'] = 'CN=Bitwarden Identity Server Dev';
|
||||
New-SelfSignedCertificate @params;
|
||||
|
||||
$params['Subject'] = 'CN=Bitwarden Data Protection Dev';
|
||||
New-SelfSignedCertificate @params;
|
||||
|
||||
Reference in New Issue
Block a user