Sign inSign up

stellarhub/vaultwarden

By stellarhub

Updated over 2 years ago

Image
0

478

stellarhub/vaultwarden repository overview

To create a multi-architecture image :

docker pull --platform arm64 vaultwarden/server:1.30.5
docker tag 9b2355 stellarhub/vaultwarden:1.30.5-arm64

docker pull --platform amd64 vaultwarden/server:1.30.5
docker tag 739990 stellarhub/vaultwarden:1.30.5-amd64

docker push stellarhub/vaultwarden:1.30.5-arm64
docker push stellarhub/vaultwarden:1.30.5-amd64
docker buildx imagetools create --tag stellarhub/vaultwarden:1.30.5 stellarhub/vaultwarden:1.30.5-arm64 stellarhub/vaultwarden:1.30.5-amd64

To create a self-signed cert for 127.0.0.1 and localhost

To include multiple names (e.g., 127.0.0.1 and localhost) in the certificate, you need to use the Subject Alternative Name (SAN) extension. The Common Name (CN) field can only contain one name, but SAN can hold multiple names.

Here's how to do it:

  1. Create a configuration file for OpenSSL to specify the SAN. Create a file called openssl.cnf (or any name you prefer) and include the following content:

    [ req ]
    default_bits       = 2048
    distinguished_name = req_distinguished_name
    req_extensions     = req_ext
    x509_extensions    = v3_ca # The extentions to add to the self signed cert
    
    [ req_distinguished_name ]
    countryName                 = Country Name (2 letter code)
    countryName_default         = US
    stateOrProvinceName         = State or Province Name (full name)
    stateOrProvinceName_default = California
    localityName                = Locality Name (eg, city)
    localityName_default        = San Francisco
    organizationName            = Organization Name (eg, company)
    organizationName_default    = My Company
    commonName                  = Common Name (eg, YOUR name)
    commonName_default          = localhost
    
    [ req_ext ]
    subjectAltName = @alt_names
    
    [ v3_ca ]
    subjectAltName = @alt_names
    
    [ alt_names ]
    DNS.1   = localhost
    IP.1    = 127.0.0.1
    
  2. Generate the private key:

    openssl genpkey -algorithm RSA -out key.pem -aes256 -pass pass:yourpassword
    
  3. Create the certificate signing request (CSR):

    openssl req -new -key key.pem -out cert.csr -config openssl.cnf
    
  4. Remove the passphrase from the key (optional but recommended for server use):

    openssl rsa -in key.pem -out key.pem
    
  5. Generate the self-signed certificate (cert.pem) with SAN:

    openssl x509 -req -days 365 -in cert.csr -signkey key.pem -out cert.pem -extensions req_ext -extfile openssl.cnf
    

By following these steps, you will create a self-signed certificate with multiple names in the SAN field. You can then use cert.pem and key.pem in your Vaultwarden configuration.

To run the container

docker run -d --name testwarden -e ROCKET_TLS='{certs="/ssl/certs.pem",key="/ssl/key.pem"}' -v bitwardenvol:/data/ -v ./:/ssl/  -p 8888:80 stellarhub/vaultwarden:1.30.5

Tag summary

Content type

Image

Digest

Size

75.4 MB

Last updated

almost 5 years ago

docker pull stellarhub/vaultwarden