Skip to content

Commit b837c33

Browse files
config: add ALLOW_PURE_SSH option
1 parent f3c77c2 commit b837c33

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

cmd/serv.go

+3
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,9 @@ func runServ(c *cli.Context) error {
287287
if !setting.LFS.StartServer {
288288
return fail(ctx, "Unknown git command", "LFS authentication request over SSH denied, LFS support is disabled")
289289
}
290+
if verb == verbLfsTransfer && !setting.LFS.AllowPureSSH {
291+
return fail(ctx, "Unknown git command", "LFS SSH transfer connection denied, pure SSH protocol is disabled")
292+
}
290293
if len(words) > 2 {
291294
lfsVerb = words[2]
292295
}

modules/setting/lfs.go

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import (
1313
// LFS represents the configuration for Git LFS
1414
var LFS = struct {
1515
StartServer bool `ini:"LFS_START_SERVER"`
16+
AllowPureSSH bool `ini:"LFS_ALLOW_PURE_SSH"`
1617
JWTSecretBytes []byte `ini:"-"`
1718
HTTPAuthExpiry time.Duration `ini:"LFS_HTTP_AUTH_EXPIRY"`
1819
MaxFileSize int64 `ini:"LFS_MAX_FILE_SIZE"`

0 commit comments

Comments
 (0)