alpha
Login
or
Join now
dunkirk.sh
/
core
forked from
tangled.org/core
Star
0
Fork
0
Atom
Configure Feed
Issues
Pull Requests
Commits
Tags
Feed URL
Select the types of activity you want to include in your feed.
This repository has no description
Star
0
Fork
0
Atom
Configure Feed
Issues
Pull Requests
Commits
Tags
Feed URL
Select the types of activity you want to include in your feed.
Overview
Issues
Pulls
Pipelines
keyfetch: make git dir configurable
author
Anirudh Oppiliappan
committer
Akshay
date
1 year ago
(Mar 5, 2025, 9:29 PM UTC)
commit
f621867a
f621867a91e999e3b840d5efbee644be3b0ef0fa
parent
06f3bf5c
06f3bf5c653a4333b16f6017af696ac96b1c39c9
+5
-4
2 changed files
Expand all
Collapse all
Unified
Split
cmd
keyfetch
format.go
main.go
+3
-3
cmd/keyfetch/format.go
Reviewed
···
4
4
"fmt"
5
5
)
6
6
7
7
-
func formatKeyData(repoguardPath string, data []map[string]interface{}) string {
7
7
+
func formatKeyData(repoguardPath string, gitDir string, data []map[string]interface{}) string {
8
8
var result string
9
9
for _, entry := range data {
10
10
result += fmt.Sprintf(
11
11
-
`command="%s -base-dir /home/git -user %s -log-path /home/git/log ",no-port-forwarding,no-X11-forwarding,no-agent-forwarding,no-pty %s`+"\n",
12
12
-
repoguardPath, entry["did"], entry["key"])
11
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
12
+
repoguardPath, gitDir, entry["did"], entry["key"])
13
13
}
14
14
return result
15
15
}
+2
-1
cmd/keyfetch/main.go
Reviewed
···
21
21
func main() {
22
22
endpoint := flag.String("internal-api", "http://localhost:5444", "Internal API endpoint")
23
23
repoguardPath := flag.String("repoguard-path", "/home/git/repoguard", "Path to the repoguard binary")
24
24
+
gitDir := flag.String("git-dir", "/home/git", "Path to the git directory")
24
25
flag.Parse()
25
26
26
27
resp, err := http.Get(*endpoint + "/keys")
···
40
41
log.Fatalf("error unmarshalling response body: %v", err)
41
42
}
42
43
43
43
-
fmt.Print(formatKeyData(*repoguardPath, data))
44
44
+
fmt.Print(formatKeyData(*repoguardPath, *gitDir, data))
44
45
}