Git backed by object storage because you can't stop me
git object-storage kefka
10

Configure Feed

Select the types of activity you want to include in your feed.

feat(ssh): wire the SSH listener into the server lifecycle

Signed-off-by: Xe Iaso <me@xeiaso.net>

Xe Iaso (May 28, 2026, 11:27 PM EDT) cbe152be 29bde0a7

+25 -2
+25 -2
cmd/objgitd/main.go
··· 14 14 "time" 15 15 16 16 "github.com/facebookgo/flagenv" 17 + "github.com/gliderlabs/ssh" 17 18 "github.com/go-git/go-git/v6/plumbing/transport" 18 19 "github.com/tigrisdata/storage-go" 19 20 "golang.org/x/sync/errgroup" ··· 27 28 var ( 28 29 gitBind = flag.String("git-bind", ":9418", "TCP address to listen on for the git:// protocol; empty disables it") 29 30 httpBind = flag.String("http-bind", ":8080", "TCP address to listen on for the git smart-HTTP protocol; empty disables it") 31 + sshBind = flag.String("ssh-bind", "", "TCP address to listen on for the git-over-SSH protocol; empty disables it") 30 32 bucket = flag.String("bucket", "", "Tigris bucket that holds the git repositories") 31 33 allowPush = flag.Bool("allow-push", false, "allow unauthenticated git-receive-pack (push) requests") 32 34 slogLevel = flag.String("slog-level", "INFO", "log level (DEBUG, INFO, WARN, ERROR)") ··· 51 53 os.Exit(1) 52 54 } 53 55 54 - if *gitBind == "" && *httpBind == "" { 55 - slog.Error("at least one of -git-bind or -http-bind must be set") 56 + if *gitBind == "" && *httpBind == "" && *sshBind == "" { 57 + slog.Error("at least one of -git-bind, -http-bind, or -ssh-bind must be set") 56 58 os.Exit(1) 57 59 } 58 60 ··· 82 84 slog.Info("objgitd listening", 83 85 "git_bind", *gitBind, 84 86 "http_bind", *httpBind, 87 + "ssh_bind", *sshBind, 85 88 "bucket", *bucket, 86 89 "allow_push", *allowPush, 87 90 "allow_hooks", *allowHooks, ··· 107 110 srv := &http.Server{Handler: d} 108 111 g.Go(func() error { 109 112 if err := srv.Serve(ln); err != nil && !errors.Is(err, http.ErrServerClosed) { 113 + return err 114 + } 115 + return nil 116 + }) 117 + g.Go(func() error { 118 + <-gCtx.Done() 119 + shutdownCtx, cancel := context.WithTimeout(context.Background(), 10*time.Second) 120 + defer cancel() 121 + return srv.Shutdown(shutdownCtx) 122 + }) 123 + } 124 + 125 + if *sshBind != "" { 126 + srv, err := newSSHServer(d, *sshBind) 127 + if err != nil { 128 + slog.Error("can't create ssh server", "ssh_bind", *sshBind, "err", err) 129 + os.Exit(1) 130 + } 131 + g.Go(func() error { 132 + if err := srv.ListenAndServe(); err != nil && !errors.Is(err, ssh.ErrServerClosed) { 110 133 return err 111 134 } 112 135 return nil