Skip to content

Commit 5009913

Browse files
config: add ALLOW_PURE_SSH option
1 parent f819027 commit 5009913

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed

cmd/serv.go

Lines changed: 3 additions & 0 deletions
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
}

custom/conf/app.example.ini

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,8 @@ RUN_USER = ; git
306306
;; Enables git-lfs support. true or false, default is false.
307307
;LFS_START_SERVER = false
308308
;;
309+
;; Enables git-lfs SSH protocol support. true or false, default is false.
310+
;LFS_ALLOW_PURE_SSH = false
309311
;;
310312
;; LFS authentication secret, change this yourself
311313
;LFS_JWT_SECRET =

modules/setting/lfs.go

Lines changed: 1 addition & 0 deletions
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)