FIx freeze and remove some logging

This commit is contained in:
Bernd Schoolmann 2024-02-08 17:12:13 +01:00
parent cf6221c080
commit ca17380758
No known key found for this signature in database
4 changed files with 6 additions and 24 deletions

View File

@ -335,7 +335,6 @@ func StartUnixAgent(path string, runtimeConfig config.RuntimeConfig) error {
if err != nil {
fmt.Println("accept error", err.Error())
}
fmt.Println("Accepted connection")
go serveAgentSession(fd, vault, &cfg)
}

View File

@ -72,8 +72,8 @@ var listLoginsCmd = &cobra.Command{
return
}
fmt.Println("[")
for index, login := range logins {
var toPrintLogins []map[string]string
for _, login := range logins {
data := map[string]string{
"name": stringsx.Clean(login.Name),
"uuid": stringsx.Clean(login.UUID),
@ -82,19 +82,10 @@ var listLoginsCmd = &cobra.Command{
"totp": stringsx.Clean(login.TOTPSeed),
"uri": stringsx.Clean(login.URI),
}
jsonString, err := json.Marshal(data)
if err != nil {
handleSendToAgentError(err)
return
}
fmt.Print(string(jsonString))
if index != len(logins)-1 {
fmt.Println(",")
} else {
fmt.Println()
}
toPrintLogins = append(toPrintLogins, data)
}
fmt.Println("]")
toPrintJSON, _ := json.Marshal(toPrintLogins)
fmt.Println(string(toPrintJSON))
},
}

View File

@ -34,11 +34,9 @@ def send_authenticated_command(cmd):
print("No daemon connection running, please restart the application completely.")
return ""
print("sending command", cmd)
authenticated_connection.stdin.write(cmd + "\n")
authenticated_connection.stdin.flush()
result = authenticated_connection.stdout.readline()
print("result", result)
return result
def set_api_url(url):
@ -61,7 +59,6 @@ def get_environment():
try:
return json.loads(result)
except Exception as e:
print(e)
return None
def set_client_id(client_id):
@ -110,13 +107,10 @@ def get_vault_status():
try:
return json.loads(result)
except Exception as e:
print(e)
return None
def get_vault_logins():
result = send_authenticated_command(f"logins list")
if result.returncode != 0:
raise Exception("Failed to initialize repository, err", result.stderr)
try:
return json.loads(result)
except Exception as e:
@ -124,7 +118,6 @@ def get_vault_logins():
def get_runtime_config():
result = send_authenticated_command(f"config get-runtime-config")
print(result)
try:
return json.loads(result)
except Exception as e:

View File

@ -136,8 +136,7 @@ class MainWindow(Gtk.ApplicationWindow):
self.history_list.get_style_context().add_class("boxed-list")
self.box.append(self.history_list)
self.set_default_size(700, 700)
# self.set_title("Goldwarden")
self.set_title(token)
self.set_title("Goldwarden Quick Access")
app = MyApp(application_id="com.quexten.Goldwarden.autofill-menu")
app.run(sys.argv)