Browse Source

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.

## :warning: BREAKING

If admins want the previous timeout, they should set the setting
`[server].LFS_HTTP_AUTH_EXPIRY`.
tags/v1.20.0-rc0
wxiaoguang 1 year ago
parent
commit
54f399c4df
No account linked to committer's email address

+ 1
- 1
custom/conf/app.example.ini View File

@@ -303,7 +303,7 @@ RUN_MODE = ; prod
LFS_JWT_SECRET =
;;
;; LFS authentication validity period (in time.Duration), pushes taking longer than this may fail.
;LFS_HTTP_AUTH_EXPIRY = 20m
;LFS_HTTP_AUTH_EXPIRY = 24h
;;
;; Maximum allowed LFS file size in bytes (Set to 0 for no limit).
;LFS_MAX_FILE_SIZE = 0

+ 1
- 1
docs/content/doc/administration/config-cheat-sheet.en-us.md View File

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


+ 1
- 1
modules/setting/lfs.go View File

@@ -45,7 +45,7 @@ func loadLFSFrom(rootCfg ConfigProvider) {
LFS.LocksPagingNum = 50
}

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

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

Loading…
Cancel
Save