Use env vars for RPC

This commit is contained in:
Jeffrey Serio 2023-07-19 11:00:47 -05:00
parent 4ea4f4c8c8
commit a3578c5767
2 changed files with 2 additions and 2 deletions

View File

@ -81,7 +81,7 @@ type TorrentStatsPageData struct {
} }
func main() { 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 { if err != nil {
log.Fatalln(err) log.Fatalln(err)
} }

View File

@ -83,7 +83,7 @@ func main() {
fmt.Println("20 text/gemini\r") fmt.Println("20 text/gemini\r")
fmt.Println("```") 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 { if err != nil {
log.Fatalln(err) log.Fatalln(err)
} }