Skip to content

Commit

Permalink
add other session providers (#5963)
Browse files Browse the repository at this point in the history
  • Loading branch information
techknowlogick committed Feb 5, 2019
1 parent bf4bada commit 9de871a
Show file tree
Hide file tree
Showing 160 changed files with 37,644 additions and 66 deletions.
111 changes: 109 additions & 2 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/content/doc/advanced/config-cheat-sheet.en-us.md
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ Values containing `#` or `;` must be quoted using `` ` `` or `"""`.

## Session (`session`)

- `PROVIDER`: **memory**: Session engine provider \[memory, file, redis, mysql\].
- `PROVIDER`: **memory**: Session engine provider \[memory, file, redis, mysql, couchbase, memcache, nodb, postgres\].
- `PROVIDER_CONFIG`: **data/sessions**: For file, the root path; for others, the connection string.
- `COOKIE_SECURE`: **false**: Enable this to force using HTTPS for all session access.
- `COOKIE_NAME`: **i\_like\_gitea**: The name of the cookie used for the session ID.
Expand Down
9 changes: 7 additions & 2 deletions modules/setting/setting.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,12 @@ import (
_ "github.com/go-macaron/cache/memcache" // memcache plugin for cache
_ "github.com/go-macaron/cache/redis"
"github.com/go-macaron/session"
_ "github.com/go-macaron/session/redis" // redis plugin for store session
_ "github.com/go-macaron/session/couchbase" // couchbase plugin for session store
_ "github.com/go-macaron/session/memcache" // memcache plugin for session store
_ "github.com/go-macaron/session/mysql" // mysql plugin for session store
_ "github.com/go-macaron/session/nodb" // nodb plugin for session store
_ "github.com/go-macaron/session/postgres" // postgres plugin for session store
_ "github.com/go-macaron/session/redis" // redis plugin for store session
"github.com/go-xorm/core"
shellquote "github.com/kballard/go-shellquote"
version "github.com/mcuadros/go-version"
Expand Down Expand Up @@ -1506,7 +1511,7 @@ func newCacheService() {

func newSessionService() {
SessionConfig.Provider = Cfg.Section("session").Key("PROVIDER").In("memory",
[]string{"memory", "file", "redis", "mysql"})
[]string{"memory", "file", "redis", "mysql", "postgres", "couchbase", "memcache", "nodb"})
SessionConfig.ProviderConfig = strings.Trim(Cfg.Section("session").Key("PROVIDER_CONFIG").MustString(path.Join(AppDataPath, "sessions")), "\" ")
if SessionConfig.Provider == "file" && !filepath.IsAbs(SessionConfig.ProviderConfig) {
SessionConfig.ProviderConfig = path.Join(AppWorkPath, SessionConfig.ProviderConfig)
Expand Down
21 changes: 21 additions & 0 deletions vendor/github.com/BurntSushi/toml/COPYING

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 21 additions & 0 deletions vendor/github.com/BurntSushi/toml/cmd/toml-test-decoder/COPYING

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 21 additions & 0 deletions vendor/github.com/BurntSushi/toml/cmd/toml-test-encoder/COPYING

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 21 additions & 0 deletions vendor/github.com/BurntSushi/toml/cmd/tomlv/COPYING

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 9de871a

Please sign in to comment.