Setting up HTTPS for Bitwarden_RS using Letsencrypt Topic is solved

Have some feedback, questions, suggestions, or just fancy a chat? Pop it in here.
gasto
Posts: 44
Joined: Fri Dec 04, 2020 2:24 am

Re: Setting up HTTPS for Bitwarden_RS using Letsencrypt

Post by gasto »

Thank you Joulinar, I have deleted the files then. Now, to perform the copy, while positioned myself on the bitwarden_rs directory, I use this command to copy:

sudo cp -rp /etc/letsencrypt/live/domain.duckdns.org/fullchain.pem /mnt/dietpi_userdata/bitwarden_rs
sudo cp -rp /etc/letsencrypt/live/domain.duckdns.org/privkey.pem /mnt/dietpi_userdata/bitwarden_rs

After that, I perform this:

chown bitwarden_rs:bitwarden_rs /mnt/dietpi_userdata/bitwarden_rs/fullchain.pem
chown bitwarden_rs:bitwarden_rs /mnt/dietpi_userdata/bitwarden_rs/privkey.pem


Is that correct?
User avatar
Joulinar
Posts: 4170
Joined: Sat Nov 16, 2019 12:49 am

Re: Setting up HTTPS for Bitwarden_RS using Letsencrypt

Post by Joulinar »

which user you are login to your system? can you try root user? This way you don't need to use sudo
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
gasto
Posts: 44
Joined: Fri Dec 04, 2020 2:24 am

Re: Setting up HTTPS for Bitwarden_RS using Letsencrypt

Post by gasto »

Ah yes, I´m using root, don´t know why I included sudo.
User avatar
Joulinar
Posts: 4170
Joined: Sat Nov 16, 2019 12:49 am

Re: Setting up HTTPS for Bitwarden_RS using Letsencrypt

Post by Joulinar »

a normal cp should be enough as you are going to change permissions on the files anyway.
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
gasto
Posts: 44
Joined: Fri Dec 04, 2020 2:24 am

Re: Setting up HTTPS for Bitwarden_RS using Letsencrypt

Post by gasto »

Thank you Joulinar.

I successfully copied the 2 .pem files on bitwarden_rs directory, and they show up under bitwarden_rs ownership.

Code: Select all

root@orangedietpi:/mnt/dietpi_userdata/bitwarden_rs# ls -al
total 256
drwxr-xr-x 4 bitwarden_rs bitwarden_rs   4096 Dec 22 09:19 .
drwxrwxr-x 8 dietpi       dietpi         4096 Dec 22 02:49 ..
-rw-r--r-- 1 bitwarden_rs bitwarden_rs  12146 Dec 22 09:00 bitwarden_rs.env
-rw-r--r-- 1 bitwarden_rs bitwarden_rs   1765 Dec 22 02:49 cert.pem
-rw-r--r-- 1 bitwarden_rs bitwarden_rs 208896 Dec 22 09:19 db.sqlite3
-rw-r--r-- 1 bitwarden_rs bitwarden_rs   3790 Dec 22 08:56 fullchain.pem
drwxr-xr-x 2 bitwarden_rs bitwarden_rs   4096 Dec 22 09:09 icon_cache
-rw-r--r-- 1 bitwarden_rs bitwarden_rs   3272 Dec 22 08:56 privkey.pem
-rw------- 1 bitwarden_rs bitwarden_rs   1192 Dec 22 02:59 rsa_key.der
-rw------- 1 bitwarden_rs bitwarden_rs   1679 Dec 22 02:59 rsa_key.pem
-rw-r--r-- 1 bitwarden_rs bitwarden_rs    270 Dec 22 02:59 rsa_key.pub.der
drwxr-xr-x 8 bitwarden_rs bitwarden_rs   4096 Dec  8 12:01 web-vault
And the .conf file for Bitwarden looks like this:

Code: Select all

## Rocket specific settings, check Rocket documentation to learn more
# ROCKET_ENV=staging
# ROCKET_ADDRESS=0.0.0.0 # Enable this to test mobile app
ROCKET_PORT=8001
ROCKET_TLS={certs="./fullchain.pem",key="./privkey.pem"}
I have also forwarded port 8001 to 443 for my local diet pi IP.


However, if I want to access via Internet my domain.duckdns.org:8001 I get this:

domain.duckdns.org didn´t send any data.
ERR_EMPTY_RESPONSE

Am I missing any steps?
User avatar
Joulinar
Posts: 4170
Joined: Sat Nov 16, 2019 12:49 am

Re: Setting up HTTPS for Bitwarden_RS using Letsencrypt

Post by Joulinar »

did you forward port 8001 on your internet router? I have seen on a google search that this issue happen with Chrome browser. Do you use Chrome?
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
gasto
Posts: 44
Joined: Fri Dec 04, 2020 2:24 am

Re: Setting up HTTPS for Bitwarden_RS using Letsencrypt

Post by gasto »

Yep, this is how I have my router configured:

Image

There´s also this setting on the bitwarden conf file that I haven´t changed, but I don´t know if it´s related to this:

Code: Select all

## Domain settings
## The domain must match the address from where you access the server
## It's recommended to configure this value, otherwise certain functionality might not work,
## like attachment downloads, email links and U2F.
## For U2F to work, the server must use HTTPS, you can use Let's Encrypt for free certs
# DOMAIN=https://bw.domain.tld:8443
And just in case, if I try to access https://domain.duckdns.org I get a "403 Forbidden".
Thanks again.
User avatar
Joulinar
Posts: 4170
Joined: Sat Nov 16, 2019 12:49 am

Re: Setting up HTTPS for Bitwarden_RS using Letsencrypt

Post by Joulinar »

do you forward 8001 to 443? I don't think it will work this way. You need to forward 8001 to 8001 and access you side https://domain.duckdns.org:8001
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
gasto
Posts: 44
Joined: Fri Dec 04, 2020 2:24 am

Re: Setting up HTTPS for Bitwarden_RS using Letsencrypt

Post by gasto »

Oh you´re right, that did it. Thanks, and sorry for all the questions.
User avatar
Joulinar
Posts: 4170
Joined: Sat Nov 16, 2019 12:49 am

Re: Setting up HTTPS for Bitwarden_RS using Letsencrypt

Post by Joulinar »

no problem, you're welcome.
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
Post Reply