After installing Vaultwarden I could not create an account because there was no secure connection. So I am trying to get this working with Rocket. I know a reverse proxy is recommended, but I am not planning on exposing anything to the internet so I want to use Rocket. Unfortunately I get an error:
[INFO] No .env file found.
Logger failed to initialize: attempted to set a logger after the logging system was already initialized
[2021-12-26 20:03:34.859][rocket::config::error][ERROR] environment variable ROCKET_TLS={certs="/ssl/vaultwarden.mydomain.local.pem,key="/ssl/vaultwarden.mydomain.local.key"} could not be parsed
When I remove the ROCKET_TLS line, the container deploys and I can open vaultwarden, but I do have the first error (No .env file found.)
So it must be somewhere in that ROCKET_TLS line, but I have no idea what I am doing wrong. The certificate and key both are in PEM format. I read something about symlinks, but I have no idea how to check for that.
Oh yeah, I’ve created the cert and key with easyrsa.
And now I get the same error as I remember I had in the beginning:
[INFO] No .env file found.
Logger failed to initialize: attempted to set a logger after the logging system was already initialized
[2021-12-30 08:37:17.628][rocket::config::error][ERROR] I/O error while setting tls.certs:
I solved it. When I entered my docker container via console I saw that the ssl/keys folder was empty, while the pem files where present on my host. Also the data folder was filled in the container, but it was empty on my host. So it came clear to me that the volume mapping wasn’t right.
After some investigation I saw that it had to do with the fact that I used VS Code to create the folders, and I needed to add “sftpSudo”: true to my settings.json file. After doing that it worked.
I do have a issue now that Chrome doesn’t want to open the page, even if I add the certificate to my browser. But I will look at that later, in Firefox it works after ignoring the warning.