Fix additional build errors

This commit is contained in:
Bernd Schoolmann 2023-09-12 03:26:05 +02:00
parent 257b911e00
commit 032da6cdf1
No known key found for this signature in database
4 changed files with 32 additions and 6 deletions

View File

@ -9,7 +9,7 @@ import (
func CheckBiometrics(approvalType Approval) bool { func CheckBiometrics(approvalType Approval) bool {
ok, err := touchid.Authenticate(approvalType.String()) ok, err := touchid.Authenticate(approvalType.String())
if err != nil { if err != nil {
log.Error(err) log.Error(err.Error())
} }
if ok { if ok {

View File

@ -0,0 +1,19 @@
//go:build linux
package setup
import (
"fmt"
"github.com/quexten/goldwarden/agent/config"
"github.com/quexten/goldwarden/cmd"
)
func VerifySetup(runtimeConfig config.RuntimeConfig) bool {
if !cmd.IsPolkitSetup() && !runtimeConfig.DisableAuth {
fmt.Println("Polkit is not setup. Run 'goldwarden setup polkit' to set it up.")
return false
}
return true
}

View File

@ -0,0 +1,9 @@
//go:build !linux
package setup
import "github.com/quexten/goldwarden/agent/config"
func VerifySetup(runtimeConfig config.RuntimeConfig) bool {
return true
}

View File

@ -1,13 +1,12 @@
package main package main
import ( import (
"fmt"
"os" "os"
"strings" "strings"
"time"
"github.com/quexten/goldwarden/agent/config" "github.com/quexten/goldwarden/agent/config"
"github.com/quexten/goldwarden/browserbiometrics" "github.com/quexten/goldwarden/browserbiometrics"
"github.com/quexten/goldwarden/client/setup"
"github.com/quexten/goldwarden/cmd" "github.com/quexten/goldwarden/cmd"
) )
@ -57,9 +56,8 @@ func main() {
os.Setenv("GOLDWARDEN_SYSTEM_AUTH_DISABLED", "true") os.Setenv("GOLDWARDEN_SYSTEM_AUTH_DISABLED", "true")
} }
if !cmd.IsPolkitSetup() && !runtimeConfig.DisableAuth { if !setup.VerifySetup(runtimeConfig) {
fmt.Println("Polkit is not setup. Run 'goldwarden setup polkit' to set it up.") return
time.Sleep(3 * time.Second)
} }
cmd.Execute(runtimeConfig) cmd.Execute(runtimeConfig)