Skip to content

Commit

Permalink
Actually implement BasicAuth for transmission
Browse files Browse the repository at this point in the history
  • Loading branch information
metalmatze committed Dec 14, 2016
1 parent 6ee6b25 commit 0428d9e
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion cmd/transmission-exporter/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,15 @@ func main() {

arg.MustParse(&c)

client := transmission.New(c.TransmissionAddr, nil)
var user *transmission.User
if c.TransmissionUsername != "" && c.TransmissionPassword != "" {
user = &transmission.User{
Username: c.TransmissionUsername,
Password: c.TransmissionPassword,
}
}

client := transmission.New(c.TransmissionAddr, user)

prometheus.MustRegister(NewTorrentCollector(client))

Expand Down

0 comments on commit 0428d9e

Please sign in to comment.