dietpi-letsencrypt with qbittorrent for ongoing https access Topic is solved

Have some feedback, questions, suggestions, or just fancy a chat? Pop it in here.
Post Reply
chucklesmcgee
Posts: 19
Joined: Tue Jun 02, 2020 7:19 pm

dietpi-letsencrypt with qbittorrent for ongoing https access

Post by chucklesmcgee »

I have a dynamic domain name set up. dietpi-letsencrypt generated the SSL certificates just fine so HTTPS was working well

I copied and pasted the certs into qbittorrent's Web UI and that worked well.

Now it appears the certificates renewed and continue to work well on the dynamic domain itself, but not on port 1340- port 1340 shows the certificate has expired. My letsencrypt folder has 2 certificates, one which I presume was the renewed version.

How do I renew the certificate for port 1340 automatically so I don't need to copy and paste this every few months?
User avatar
MichaIng
Site Admin
Posts: 2324
Joined: Sat Nov 18, 2017 6:21 pm

Re: dietpi-letsencrypt with qbittorrent for ongoing https access

Post by MichaIng »

There is /etc/letsencrypt/live which contains symlinks to the current active certificate + key files. In the other directories I think its the ones with the highest integer, otherwise the last modification date should tell you which ones were created last ;). Inside /etc/letsencrypt there is as well a renewal-hook directory where you can place scripts inside that are executed on certificate renewal and can be used to copy the new files from /etc/letsencrypt/live to your qBittorrent location.
chucklesmcgee
Posts: 19
Joined: Tue Jun 02, 2020 7:19 pm

Re: dietpi-letsencrypt with qbittorrent for ongoing https access

Post by chucklesmcgee »

MichaIng wrote: Tue Sep 01, 2020 4:37 pm There is /etc/letsencrypt/live which contains symlinks to the current active certificate + key files. In the other directories I think its the ones with the highest integer, otherwise the last modification date should tell you which ones were created last ;). Inside /etc/letsencrypt there is as well a renewal-hook directory where you can place scripts inside that are executed on certificate renewal and can be used to copy the new files from /etc/letsencrypt/live to your qBittorrent location.
Very helpful!

I followed the instructions here:

https://www.npmjs.com/package/update-qbittorrent-cert

Switched into the cloned directory, installed, then edited "/etc/letsencrypt/renewal-hooks/deploy/update-qbittorrent-cert.js" to match the path to the folder named after my domain in "/etc/letsencrypt/live". Changed the destination to
const qbtConfigPath = '/home/qbittorrent/.config/qBittorrent/qBittorrent.conf';

Think that worked!
User avatar
Joulinar
Posts: 2287
Joined: Sat Nov 16, 2019 12:49 am

Re: dietpi-letsencrypt with qbittorrent for ongoing https access

Post by Joulinar »

Hi,

Another approach would be to setup a reverse proxy. As I understood you are already running a http web server, correct? Than it should be quite simple to add qbittorrent and to configure web server that way, that qbittorrent will be reachable via standard ports 80/443. This way you could remove qbittorrent ports from port-forwarding on your router. As well, no need to copy or link files because SSL termination will be done at the reverse proxy side. There is a config example available at qBittorrent Wiki for Nginx web server.

https://github.com/qbittorrent/qBittorr ... for-Web-UI
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
Post Reply