File tree 3 files changed +11
-9
lines changed
3 files changed +11
-9
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 (time . Duration ( setting .LFS .HTTPAuthExpiryMinutes ) * 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,8 +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 minutes , pushes taking longer than this may fail.
193
- LFS_HTTP_AUTH_EXPIRY_MINUTES = 20
192
+ ; LFS authentication validity period ( in time.Duration) , pushes taking longer than this may fail.
193
+ LFS_HTTP_AUTH_EXPIRY = 20m
194
194
195
195
; Define allowed algorithms and their minimum key length (use -1 to disable a type)
196
196
[ssh.minimum_key_sizes]
Original file line number Diff line number Diff line change @@ -136,11 +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:"-"`
143
- HTTPAuthExpiryMinutes int `ini:"LFS_HTTP_AUTH_EXPIRY_MINUTES "`
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 "`
144
144
}
145
145
146
146
// Security settings
@@ -828,7 +828,9 @@ func NewContext() {
828
828
if ! filepath .IsAbs (LFS .ContentPath ) {
829
829
LFS .ContentPath = filepath .Join (AppWorkPath , LFS .ContentPath )
830
830
}
831
- LFS .HTTPAuthExpiryMinutes = sec .Key ("LFS_HTTP_AUTH_EXPIRY_MINUTES" ).MustInt (5 )
831
+
832
+ sec = Cfg .Section ("LFS" )
833
+ LFS .HTTPAuthExpiry = sec .Key ("LFS_HTTP_AUTH_EXPIRY" ).MustDuration (20 * time .Minute )
832
834
833
835
if LFS .StartServer {
834
836
You can’t perform that action at this time.
0 commit comments