Skip to content

Commit

Permalink
Merge branch 'release/0.1.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
metalmatze committed Dec 15, 2016
2 parents 66c79f0 + 0428d9e commit dcb45d4
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 2 deletions.
17 changes: 17 additions & 0 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,20 @@ pipeline:
when:
event: [ push ]
branch: [ master ]

docker:
image: plugins/docker
repo: metalmatze/transmission-exporter
tags:
- develop
when:
event: [ push ]
branch: [ develop ]

docker:
image: plugins/docker
repo: metalmatze/transmission-exporter
tags: [ '${TAG}' ]
when:
event: [ tag ]
branch: [ refs/tags/* ]
2 changes: 1 addition & 1 deletion .drone.yml.sig
Original file line number Diff line number Diff line change
@@ -1 +1 @@
eyJhbGciOiJIUzI1NiJ9.d29ya3NwYWNlOgogIGJhc2U6IC9nbwogIHBhdGg6IHNyYy9naXRodWIuY29tL21ldGFsbWF0emUvdHJhbnNtaXNzaW9uLWV4cG9ydGVyCgpwaXBlbGluZToKICBidWlsZDoKICAgIGltYWdlOiBnb2xhbmc6YWxwaW5lCiAgICBjb21tYW5kczoKICAgICAgLSBhcGsgYWRkIC1VIGdpdCBtYWtlCiAgICAgIC0gbWFrZSBmbXQKICAgICAgLSBtYWtlIHZldAogICAgICAtIG1ha2UgbGludAogICAgICAtIG1ha2UgYnVpbGQKCiAgZG9ja2VyOgogICAgaW1hZ2U6IHBsdWdpbnMvZG9ja2VyCiAgICByZXBvOiBtZXRhbG1hdHplL3RyYW5zbWlzc2lvbi1leHBvcnRlcgogICAgdGFnczoKICAgICAgLSBsYXRlc3QKICAgIHdoZW46CiAgICAgIGV2ZW50OiBbIHB1c2ggXQogICAgICBicmFuY2g6IFsgbWFzdGVyIF0K.EvjQhswEji2LJOlEuV5uxgF39PI0jftrgYc7MpJp4F8
eyJhbGciOiJIUzI1NiJ9.d29ya3NwYWNlOgogIGJhc2U6IC9nbwogIHBhdGg6IHNyYy9naXRodWIuY29tL21ldGFsbWF0emUvdHJhbnNtaXNzaW9uLWV4cG9ydGVyCgpwaXBlbGluZToKICBidWlsZDoKICAgIGltYWdlOiBnb2xhbmc6YWxwaW5lCiAgICBjb21tYW5kczoKICAgICAgLSBhcGsgYWRkIC1VIGdpdCBtYWtlCiAgICAgIC0gbWFrZSBmbXQKICAgICAgLSBtYWtlIHZldAogICAgICAtIG1ha2UgbGludAogICAgICAtIG1ha2UgYnVpbGQKCiAgZG9ja2VyOgogICAgaW1hZ2U6IHBsdWdpbnMvZG9ja2VyCiAgICByZXBvOiBtZXRhbG1hdHplL3RyYW5zbWlzc2lvbi1leHBvcnRlcgogICAgdGFnczoKICAgICAgLSBsYXRlc3QKICAgIHdoZW46CiAgICAgIGV2ZW50OiBbIHB1c2ggXQogICAgICBicmFuY2g6IFsgbWFzdGVyIF0KCiAgZG9ja2VyOgogICAgaW1hZ2U6IHBsdWdpbnMvZG9ja2VyCiAgICByZXBvOiBtZXRhbG1hdHplL3RyYW5zbWlzc2lvbi1leHBvcnRlcgogICAgdGFnczoKICAgICAgLSBkZXZlbG9wCiAgICB3aGVuOgogICAgICBldmVudDogWyBwdXNoIF0KICAgICAgYnJhbmNoOiBbIGRldmVsb3AgXQoKICBkb2NrZXI6CiAgICBpbWFnZTogcGx1Z2lucy9kb2NrZXIKICAgIHJlcG86IG1ldGFsbWF0emUvdHJhbnNtaXNzaW9uLWV4cG9ydGVyCiAgICB0YWdzOiBbICcke1RBR30nIF0KICAgIHdoZW46CiAgICAgIGV2ZW50OiBbIHRhZyBdCiAgICAgIGJyYW5jaDogWyByZWZzL3RhZ3MvKiBdCg.RcpjcT3Ky5llmu2eagvPekXH95FLGquudasY3Qr-un0
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 dcb45d4

Please sign in to comment.