Skip to content

Commit

Permalink
config: add ALLOW_PURE_SSH option
Browse files Browse the repository at this point in the history
  • Loading branch information
ConcurrentCrab committed Sep 17, 2024
1 parent f3c77c2 commit b837c33
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions cmd/serv.go
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,9 @@ func runServ(c *cli.Context) error {
if !setting.LFS.StartServer {
return fail(ctx, "Unknown git command", "LFS authentication request over SSH denied, LFS support is disabled")
}
if verb == verbLfsTransfer && !setting.LFS.AllowPureSSH {
return fail(ctx, "Unknown git command", "LFS SSH transfer connection denied, pure SSH protocol is disabled")
}
if len(words) > 2 {
lfsVerb = words[2]
}
Expand Down
1 change: 1 addition & 0 deletions modules/setting/lfs.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (
// LFS represents the configuration for Git LFS
var LFS = struct {
StartServer bool `ini:"LFS_START_SERVER"`
AllowPureSSH bool `ini:"LFS_ALLOW_PURE_SSH"`
JWTSecretBytes []byte `ini:"-"`
HTTPAuthExpiry time.Duration `ini:"LFS_HTTP_AUTH_EXPIRY"`
MaxFileSize int64 `ini:"LFS_MAX_FILE_SIZE"`
Expand Down

0 comments on commit b837c33

Please sign in to comment.