forked from tangled.org/core
this repo has no description

keyfetch: flag for log path

authored by anirudh.fi and committed by oppi.li 7d5263c7 688619ea

Changed files
+5 -4
cmd
keyfetch
+3 -3
cmd/keyfetch/format.go
··· 4 "fmt" 5 ) 6 7 - func formatKeyData(repoguardPath string, gitDir string, data []map[string]interface{}) string { 8 var result string 9 for _, entry := range data { 10 result += fmt.Sprintf( 11 - `command="%s -base-dir %s -user %s -log-path /home/git/log ",no-port-forwarding,no-X11-forwarding,no-agent-forwarding,no-pty %s`+"\n", 12 - repoguardPath, gitDir, entry["did"], entry["key"]) 13 } 14 return result 15 }
··· 4 "fmt" 5 ) 6 7 + func formatKeyData(repoguardPath, gitDir, logPath string, data []map[string]interface{}) string { 8 var result string 9 for _, entry := range data { 10 result += fmt.Sprintf( 11 + `command="%s -base-dir %s -user %s -log-path %s",no-port-forwarding,no-X11-forwarding,no-agent-forwarding,no-pty %s`+"\n", 12 + repoguardPath, gitDir, entry["did"], logPath, entry["key"]) 13 } 14 return result 15 }
+2 -1
cmd/keyfetch/main.go
··· 22 endpoint := flag.String("internal-api", "http://localhost:5444", "Internal API endpoint") 23 repoguardPath := flag.String("repoguard-path", "/home/git/repoguard", "Path to the repoguard binary") 24 gitDir := flag.String("git-dir", "/home/git", "Path to the git directory") 25 flag.Parse() 26 27 resp, err := http.Get(*endpoint + "/keys") ··· 41 log.Fatalf("error unmarshalling response body: %v", err) 42 } 43 44 - fmt.Print(formatKeyData(*repoguardPath, *gitDir, data)) 45 }
··· 22 endpoint := flag.String("internal-api", "http://localhost:5444", "Internal API endpoint") 23 repoguardPath := flag.String("repoguard-path", "/home/git/repoguard", "Path to the repoguard binary") 24 gitDir := flag.String("git-dir", "/home/git", "Path to the git directory") 25 + logPath := flag.String("log-path", "/home/git/log", "Path to log file") 26 flag.Parse() 27 28 resp, err := http.Get(*endpoint + "/keys") ··· 42 log.Fatalf("error unmarshalling response body: %v", err) 43 } 44 45 + fmt.Print(formatKeyData(*repoguardPath, *gitDir, *logPath, data)) 46 }