Skip to content

Commit 54f399c

Browse files
authored
Increase default LFS auth timeout from 20m to 24h (#24628)
According to the discussion with DanielGibson, the default "20m" seems too short. It would make LFS fail if the file is large / network is slow. I think relaxing this timeout doesn't have side affect. So change the default value to 24h, IMO that should be long enough. ## ⚠️ BREAKING If admins want the previous timeout, they should set the setting `[server].LFS_HTTP_AUTH_EXPIRY`.
1 parent 89eebfa commit 54f399c

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

custom/conf/app.example.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ RUN_MODE = ; prod
303303
LFS_JWT_SECRET =
304304
;;
305305
;; LFS authentication validity period (in time.Duration), pushes taking longer than this may fail.
306-
;LFS_HTTP_AUTH_EXPIRY = 20m
306+
;LFS_HTTP_AUTH_EXPIRY = 24h
307307
;;
308308
;; Maximum allowed LFS file size in bytes (Set to 0 for no limit).
309309
;LFS_MAX_FILE_SIZE = 0

docs/content/doc/administration/config-cheat-sheet.en-us.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,7 @@ The following configuration set `Content-Type: application/vnd.android.package-a
364364
- `LFS_START_SERVER`: **false**: Enables Git LFS support.
365365
- `LFS_CONTENT_PATH`: **%(APP_DATA_PATH)s/lfs**: Default LFS content path. (if it is on local storage.) **DEPRECATED** use settings in `[lfs]`.
366366
- `LFS_JWT_SECRET`: **\<empty\>**: LFS authentication secret, change this a unique string.
367-
- `LFS_HTTP_AUTH_EXPIRY`: **20m**: LFS authentication validity period in time.Duration, pushes taking longer than this may fail.
367+
- `LFS_HTTP_AUTH_EXPIRY`: **24h**: LFS authentication validity period in time.Duration, pushes taking longer than this may fail.
368368
- `LFS_MAX_FILE_SIZE`: **0**: Maximum allowed LFS file size in bytes (Set to 0 for no limit).
369369
- `LFS_LOCKS_PAGING_NUM`: **50**: Maximum number of LFS Locks returned per page.
370370

modules/setting/lfs.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ func loadLFSFrom(rootCfg ConfigProvider) {
4545
LFS.LocksPagingNum = 50
4646
}
4747

48-
LFS.HTTPAuthExpiry = sec.Key("LFS_HTTP_AUTH_EXPIRY").MustDuration(20 * time.Minute)
48+
LFS.HTTPAuthExpiry = sec.Key("LFS_HTTP_AUTH_EXPIRY").MustDuration(24 * time.Hour)
4949

5050
if LFS.StartServer {
5151
LFS.JWTSecretBytes = make([]byte, 32)

0 commit comments

Comments
 (0)