diff options
author | ᴜɴᴋɴᴡᴏɴ <u@gogs.io> | 2020-02-29 00:26:03 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-29 00:26:03 +0800 |
commit | d59b0f6ff7ee24d94eaa5ad68173405faea6a81c (patch) | |
tree | aac389356946b2f6b0f5281843d1dde3ed23f121 /conf/app.ini | |
parent | 1898201b8b4e555b6dfabd58c5d1136051f35b93 (diff) |
conf: overhaul sessions settings (#5952)
Diffstat (limited to 'conf/app.ini')
-rw-r--r-- | conf/app.ini | 41 |
1 files changed, 19 insertions, 22 deletions
diff --git a/conf/app.ini b/conf/app.ini index 36b829f1..49f15402 100644 --- a/conf/app.ini +++ b/conf/app.ini @@ -225,6 +225,25 @@ REVERSE_PROXY_AUTHENTICATION_HEADER = X-WEBAUTH-USER ; Whether to enable email notifications for users. ENABLE_EMAIL_NOTIFICATION = false +[session] +; The session provider, either "memory", "file", or "redis". +PROVIDER = memory +; The configuration for respective provider: +; - memory: does not need any config yet +; - file: session file path, e.g. `data/sessions` +; - redis: network=tcp,addr=:6379,password=macaron,db=0,pool_size=100,idle_timeout=180 +PROVIDER_CONFIG = data/sessions +; The cookie name to store the session identifier. +COOKIE_NAME = i_like_gogs +; Whether to set cookie in HTTPS only. +COOKIE_SECURE = false +; The GC interval in seconds for session data. +GC_INTERVAL = 3600 +; The maximum life time in seconds for a session. +MAX_LIFE_TIME = 86400 +; The cookie name for CSRF token. +CSRF_COOKIE_NAME = _csrf + ; Attachment settings for releases [release.attachment] ; Whether attachments are enabled. Defaults to `true` @@ -285,28 +304,6 @@ INTERVAL = 60 ; memcache: `127.0.0.1:11211` HOST = -[session] -; Either "memory", "file", or "redis", default is "memory" -PROVIDER = memory -; Provider config options -; memory: not have any config yet -; file: session file path, e.g. `data/sessions` -; redis: network=tcp,addr=:6379,password=macaron,db=0,pool_size=100,idle_timeout=180 -; mysql: go-sql-driver/mysql dsn config string, e.g. `root:password@/session_table` -PROVIDER_CONFIG = data/sessions -; Session cookie name -COOKIE_NAME = i_like_gogs -; If you use session in https only, default is false -COOKIE_SECURE = false -; Enable set cookie, default is true -ENABLE_SET_COOKIE = true -; Session GC time interval, default is 3600 -GC_INTERVAL_TIME = 3600 -; Session life time, default is 86400 -SESSION_LIFE_TIME = 86400 -; Cookie name for CSRF -CSRF_COOKIE_NAME = _csrf - [picture] ; Path to store user uploaded avatars AVATAR_UPLOAD_PATH = data/avatars |