mirror of
https://github.com/quexten/goldwarden.git
synced 2024-09-11 19:17:33 +03:00
Fix socket path in daemonize
This commit is contained in:
parent
ac9251d0f4
commit
ab431835d4
@ -309,22 +309,6 @@ type AgentState struct {
|
||||
func StartUnixAgent(path string, runtimeConfig config.RuntimeConfig) error {
|
||||
ctx := context.Background()
|
||||
|
||||
home, _ := os.UserHomeDir()
|
||||
_, err := os.Stat("/.flatpak-info")
|
||||
isFlatpak := err == nil
|
||||
if runtimeConfig.GoldwardenSocketPath == "" {
|
||||
runtimeConfig.GoldwardenSocketPath = home + "/.goldwarden.sock"
|
||||
if isFlatpak {
|
||||
runtimeConfig.GoldwardenSocketPath = home + "/.var/app/com.quexten.Goldwarden/data/goldwarden.sock"
|
||||
}
|
||||
}
|
||||
if runtimeConfig.SSHAgentSocketPath == "" {
|
||||
runtimeConfig.SSHAgentSocketPath = home + "/.ssh-agent-socket"
|
||||
if isFlatpak {
|
||||
runtimeConfig.SSHAgentSocketPath = home + "/.var/app/com.quexten.Goldwarden/data/ssh-auth-sock"
|
||||
}
|
||||
}
|
||||
|
||||
var keyring crypto.Keyring
|
||||
if runtimeConfig.UseMemguard {
|
||||
keyring = crypto.NewMemguardKeyring(nil)
|
||||
|
@ -2,6 +2,7 @@ package cmd
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"syscall"
|
||||
|
||||
"github.com/awnumar/memguard"
|
||||
@ -42,7 +43,23 @@ var daemonizeCmd = &cobra.Command{
|
||||
memguard.SafeExit(0)
|
||||
}
|
||||
|
||||
err := agent.StartUnixAgent(runtimeConfig.GoldwardenSocketPath, runtimeConfig)
|
||||
home, _ := os.UserHomeDir()
|
||||
_, err := os.Stat("/.flatpak-info")
|
||||
isFlatpak := err == nil
|
||||
if runtimeConfig.GoldwardenSocketPath == "" {
|
||||
runtimeConfig.GoldwardenSocketPath = home + "/.goldwarden.sock"
|
||||
if isFlatpak {
|
||||
runtimeConfig.GoldwardenSocketPath = home + "/.var/app/com.quexten.Goldwarden/data/goldwarden.sock"
|
||||
}
|
||||
}
|
||||
if runtimeConfig.SSHAgentSocketPath == "" {
|
||||
runtimeConfig.SSHAgentSocketPath = home + "/.ssh-agent-socket"
|
||||
if isFlatpak {
|
||||
runtimeConfig.SSHAgentSocketPath = home + "/.var/app/com.quexten.Goldwarden/data/ssh-auth-sock"
|
||||
}
|
||||
}
|
||||
|
||||
err = agent.StartUnixAgent(runtimeConfig.GoldwardenSocketPath, runtimeConfig)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user