soxfor / qbittorrent-natmap

The objective of this container is to run a script that requests a port forward (via NAT-PMP) from the VPN provider and upon success changes the listening port of the qBittorrent client when running in Docker
133 stars 17 forks source link

Allow for qBittorrent WebGUI to run in HTTPS #17

Open IBNobody opened 10 months ago

IBNobody commented 10 months ago

The default setup was to query the qBittorrent WebGUI over HTTP.

This is fine normally, but in order to register qBittorrent WebGUI to handle magnet links, qBittorrent needs to run in HTTPS.

This causes problems with qbittorrent-natmap. Because qBittorrent WebGUI only operates out of one port, the HTTP/HTTPS setting in qBittorrent WebGUI means that it will only respond to one or another. If we set qBittorrent WebGUI to use HTTPS, qbittorrent-natmap will be unable to query the qBittorrent WebGUI.

The solution was twofold:

  1. I added an ENV variable QBITTORRENT_SERVER_HTTP_OR_HTTPS which should be set to "http" by default and can be set to "https".
  2. I changed curl to use the "-k" option to accept self-signed certs. This option is ignored by curl commands to http targets.

I have tested this container both with and without https, and it is working for me.