feat(qbit): refactor url parse and add basic auth support (#245)

* feat(qbit): add basic auth and refactor url parse

* build: update dockerfile go base

* feat: only show port for legacy reasons
This commit is contained in:
Ludvig Lundgren 2022-05-20 17:17:00 +02:00 committed by GitHub
parent cf326a6c10
commit 62ada6de37
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 301 additions and 8 deletions

View file

@ -50,6 +50,13 @@ func (s *service) testQbittorrentConnection(client domain.DownloadClient) error
TLSSkipVerify: client.TLSSkipVerify,
}
// only set basic auth if enabled
if client.Settings.Basic.Auth {
qbtSettings.BasicAuth = client.Settings.Basic.Auth
qbtSettings.Basic.Username = client.Settings.Basic.Username
qbtSettings.Basic.Password = client.Settings.Basic.Password
}
qbt := qbittorrent.NewClient(qbtSettings)
err := qbt.Login()
if err != nil {