summaryrefslogtreecommitdiffstats
path: root/modules/setting/setting.go
diff options
context:
space:
mode:
authorInon S <InonS@users.noreply.github.com>2018-05-29 11:07:16 +0300
committerLunny Xiao <xiaolunwen@gmail.com>2018-05-29 16:07:16 +0800
commit15f6ec96327d69d19fcce937811214e113341f58 (patch)
tree36fa8e3ca63a7018ccd9c7b0ab167e5612a28274 /modules/setting/setting.go
parent832ca509d36ede26780ccb76528515fe318dca8d (diff)
downloadgitea-15f6ec96327d69d19fcce937811214e113341f58.tar.gz
gitea-15f6ec96327d69d19fcce937811214e113341f58.zip
LFS: make HTTP auth period configurable (#4035)
* LFS: make HTTP auth period configurable * Formatting: Removed semicolon Due to automated fmt-check failure (drone.gitea.io) * applying code reviews * Applied code review comment: Change HTTPAuthExpiry to time.Duration * Updated config cheat sheet
Diffstat (limited to 'modules/setting/setting.go')
-rw-r--r--modules/setting/setting.go12
1 files changed, 8 insertions, 4 deletions
diff --git a/modules/setting/setting.go b/modules/setting/setting.go
index b23a68e3ac..c8add5fd31 100644
--- a/modules/setting/setting.go
+++ b/modules/setting/setting.go
@@ -136,10 +136,11 @@ var (
}
LFS struct {
- StartServer bool `ini:"LFS_START_SERVER"`
- ContentPath string `ini:"LFS_CONTENT_PATH"`
- JWTSecretBase64 string `ini:"LFS_JWT_SECRET"`
- JWTSecretBytes []byte `ini:"-"`
+ StartServer bool `ini:"LFS_START_SERVER"`
+ ContentPath string `ini:"LFS_CONTENT_PATH"`
+ JWTSecretBase64 string `ini:"LFS_JWT_SECRET"`
+ JWTSecretBytes []byte `ini:"-"`
+ HTTPAuthExpiry time.Duration `ini:"LFS_HTTP_AUTH_EXPIRY"`
}
// Security settings
@@ -828,6 +829,9 @@ func NewContext() {
LFS.ContentPath = filepath.Join(AppWorkPath, LFS.ContentPath)
}
+ sec = Cfg.Section("LFS")
+ LFS.HTTPAuthExpiry = sec.Key("LFS_HTTP_AUTH_EXPIRY").MustDuration(20 * time.Minute)
+
if LFS.StartServer {
if err := os.MkdirAll(LFS.ContentPath, 0700); err != nil {