1
0
mirror of https://github.com/taigrr/wtf synced 2025-01-18 04:03:14 -08:00

Clean up the Gerrit module's API credentials loading

This commit is contained in:
Chris Cummer
2018-07-31 15:02:27 -07:00
parent ebad879e0a
commit 8fdaf52610
4 changed files with 17 additions and 14 deletions

View File

@@ -3,13 +3,14 @@ package gerrit
import (
"crypto/tls"
"fmt"
"net/http"
"os"
"regexp"
glb "github.com/andygrunwald/go-gerrit"
"github.com/gdamore/tcell"
"github.com/rivo/tview"
"github.com/senorprogrammer/wtf/wtf"
"net/http"
"os"
"regexp"
)
const HelpText = `
@@ -43,7 +44,12 @@ var (
func NewWidget(app *tview.Application, pages *tview.Pages) *Widget {
baseURL := wtf.Config.UString("wtf.mods.gerrit.domain")
username := wtf.Config.UString("wtf.mods.gerrit.username")
password := os.Getenv("WTF_GERRIT_PASSWORD")
password := wtf.Config.UString(
"wtf.mods.gerrit.password",
os.Getenv("WTF_GERRIT_PASSWORD"),
)
verifyServerCertificate := wtf.Config.UBool("wtf.mods.gerrit.verifyServerCertificate", true)
httpClient := &http.Client{Transport: &http.Transport{