mirror of
https://codeberg.org/hyperreal/go-transmission-stats
synced 2024-11-25 12:13:42 +01:00
Use env vars for RPC
This commit is contained in:
parent
4ea4f4c8c8
commit
a3578c5767
@ -81,7 +81,7 @@ type TorrentStatsPageData struct {
|
||||
}
|
||||
|
||||
func main() {
|
||||
transmissionbt, err := transmissionrpc.New("127.0.0.1", "", "", nil)
|
||||
transmissionbt, err := transmissionrpc.New(os.Getenv("TRANSMISSION_RPC_URL"), os.Getenv("TRANSMISSION_RPC_USER"), os.Getenv("TRANSMISSION_RPC_PASSWORD"), nil)
|
||||
if err != nil {
|
||||
log.Fatalln(err)
|
||||
}
|
||||
|
2
main.go
2
main.go
@ -83,7 +83,7 @@ func main() {
|
||||
fmt.Println("20 text/gemini\r")
|
||||
fmt.Println("```")
|
||||
|
||||
transmissionbt, err := transmissionrpc.New("", "", "", nil)
|
||||
transmissionbt, err := transmissionrpc.New(os.Getenv("TRANSMISSION_RPC_URL"), os.Getenv("TRANSMISSION_RPC_USER"), os.Getenv("TRANSMISSION_RPC_PASSWORD"), nil)
|
||||
if err != nil {
|
||||
log.Fatalln(err)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user