File tree 4 files changed +12
-5
lines changed
docs/content/doc/advanced
4 files changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -268,7 +268,7 @@ func runServ(c *cli.Context) error {
268
268
claims := jwt.MapClaims {
269
269
"repo" : repo .ID ,
270
270
"op" : lfsVerb ,
271
- "exp" : now .Add (5 * time . Minute ).Unix (),
271
+ "exp" : now .Add (setting . LFS . HTTPAuthExpiry ).Unix (),
272
272
"nbf" : now .Unix (),
273
273
}
274
274
if user != nil {
Original file line number Diff line number Diff line change @@ -189,6 +189,8 @@ LFS_START_SERVER = false
189
189
LFS_CONTENT_PATH = data/lfs
190
190
; LFS authentication secret, change this yourself
191
191
LFS_JWT_SECRET =
192
+ ; LFS authentication validity period (in time.Duration), pushes taking longer than this may fail.
193
+ LFS_HTTP_AUTH_EXPIRY = 20m
192
194
193
195
; Define allowed algorithms and their minimum key length (use -1 to disable a type)
194
196
[ssh.minimum_key_sizes]
Original file line number Diff line number Diff line change @@ -115,6 +115,7 @@ Values containing `#` or `;` must be quoted using `` ` `` or `"""`.
115
115
- ` LFS_START_SERVER ` : ** false** : Enables git-lfs support.
116
116
- ` LFS_CONTENT_PATH ` : ** ./data/lfs** : Where to store LFS files.
117
117
- ` LFS_JWT_SECRET ` : ** \< empty\> ** : LFS authentication secret, change this a unique string.
118
+ - ` LFS_HTTP_AUTH_EXPIRY ` : ** 20m** : LFS authentication validity period in time.Duration, pushes taking longer than this may fail.
118
119
- ` REDIRECT_OTHER_PORT ` : ** false** : If true and ` PROTOCOL ` is https, redirects http requests
119
120
on another (https) port.
120
121
- ` PORT_TO_REDIRECT ` : ** 80** : Port used when ` REDIRECT_OTHER_PORT ` is true.
Original file line number Diff line number Diff line change @@ -136,10 +136,11 @@ var (
136
136
}
137
137
138
138
LFS struct {
139
- StartServer bool `ini:"LFS_START_SERVER"`
140
- ContentPath string `ini:"LFS_CONTENT_PATH"`
141
- JWTSecretBase64 string `ini:"LFS_JWT_SECRET"`
142
- JWTSecretBytes []byte `ini:"-"`
139
+ StartServer bool `ini:"LFS_START_SERVER"`
140
+ ContentPath string `ini:"LFS_CONTENT_PATH"`
141
+ JWTSecretBase64 string `ini:"LFS_JWT_SECRET"`
142
+ JWTSecretBytes []byte `ini:"-"`
143
+ HTTPAuthExpiry time.Duration `ini:"LFS_HTTP_AUTH_EXPIRY"`
143
144
}
144
145
145
146
// Security settings
@@ -828,6 +829,9 @@ func NewContext() {
828
829
LFS .ContentPath = filepath .Join (AppWorkPath , LFS .ContentPath )
829
830
}
830
831
832
+ sec = Cfg .Section ("LFS" )
833
+ LFS .HTTPAuthExpiry = sec .Key ("LFS_HTTP_AUTH_EXPIRY" ).MustDuration (20 * time .Minute )
834
+
831
835
if LFS .StartServer {
832
836
833
837
if err := os .MkdirAll (LFS .ContentPath , 0700 ); err != nil {
You can’t perform that action at this time.
0 commit comments