Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
ed169147
Commit
ed169147
authored
Dec 08, 2015
by
Daniel Low
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add memcache as session provider
parent
d7ee7cb8
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
7 additions
and
3 deletions
+7
-3
conf/defaults.ini
+3
-1
docs/sources/installation/configuration.md
+2
-1
pkg/middleware/session.go
+1
-0
pkg/setting/setting.go
+1
-1
No files found.
conf/defaults.ini
View file @
ed169147
...
@@ -67,7 +67,7 @@ path = grafana.db
...
@@ -67,7 +67,7 @@ path = grafana.db
#################################### Session ####################################
#################################### Session ####################################
[session]
[session]
# Either "memory", "file", "redis", "mysql", "postgres", default is "file"
# Either "memory", "file", "redis", "mysql", "postgres",
"memcache",
default is "file"
provider
=
file
provider
=
file
# Provider config options
# Provider config options
...
@@ -76,6 +76,8 @@ provider = file
...
@@ -76,6 +76,8 @@ provider = file
# redis: config like redis server e.g. `addr=127.0.0.1:6379,pool_size=100,db=grafana`
# redis: config like redis server e.g. `addr=127.0.0.1:6379,pool_size=100,db=grafana`
# postgres: user=a password=b host=localhost port=5432 dbname=c sslmode=disable
# postgres: user=a password=b host=localhost port=5432 dbname=c sslmode=disable
# mysql: go-sql-driver/mysql dsn config string, e.g. `user:password@tcp(127.0.0.1:3306)/database_name`
# mysql: go-sql-driver/mysql dsn config string, e.g. `user:password@tcp(127.0.0.1:3306)/database_name`
# memcache: 127.0.0.1:11211
provider_config
=
sessions
provider_config
=
sessions
...
...
docs/sources/installation/configuration.md
View file @
ed169147
...
@@ -355,7 +355,7 @@ Set to `true` to enable auto sign up of users who do not exist in Grafana DB. De
...
@@ -355,7 +355,7 @@ Set to `true` to enable auto sign up of users who do not exist in Grafana DB. De
### provider
### provider
Valid values are
`memory`
,
`file`
,
`mysql`
,
`postgres`
. Default is
`file`
.
Valid values are
`memory`
,
`file`
,
`mysql`
,
`postgres`
,
`memcache`
. Default is
`file`
.
### provider_config
### provider_config
...
@@ -365,6 +365,7 @@ session provider you have configured.
...
@@ -365,6 +365,7 @@ session provider you have configured.
-
**file:**
session file path, e.g.
`data/sessions`
-
**file:**
session file path, e.g.
`data/sessions`
-
**mysql:**
go-sql-driver/mysql dsn config string, e.g.
`user:password@tcp(127.0.0.1:3306)/database_name`
-
**mysql:**
go-sql-driver/mysql dsn config string, e.g.
`user:password@tcp(127.0.0.1:3306)/database_name`
-
**postgres:**
ex: user=a password=b host=localhost port=5432 dbname=c sslmode=disable
-
**postgres:**
ex: user=a password=b host=localhost port=5432 dbname=c sslmode=disable
-
**memcache:**
ex: 127.0.0.1:11211
If you use MySQL or Postgres as the session store you need to create the
If you use MySQL or Postgres as the session store you need to create the
session table manually.
session table manually.
...
...
pkg/middleware/session.go
View file @
ed169147
...
@@ -8,6 +8,7 @@ import (
...
@@ -8,6 +8,7 @@ import (
_
"github.com/macaron-contrib/session/mysql"
_
"github.com/macaron-contrib/session/mysql"
_
"github.com/macaron-contrib/session/postgres"
_
"github.com/macaron-contrib/session/postgres"
_
"github.com/macaron-contrib/session/redis"
_
"github.com/macaron-contrib/session/redis"
_
"github.com/macaron-contrib/session/memcache"
)
)
const
(
const
(
...
...
pkg/setting/setting.go
View file @
ed169147
...
@@ -473,7 +473,7 @@ func NewConfigContext(args *CommandLineArgs) error {
...
@@ -473,7 +473,7 @@ func NewConfigContext(args *CommandLineArgs) error {
func
readSessionConfig
()
{
func
readSessionConfig
()
{
sec
:=
Cfg
.
Section
(
"session"
)
sec
:=
Cfg
.
Section
(
"session"
)
SessionOptions
=
session
.
Options
{}
SessionOptions
=
session
.
Options
{}
SessionOptions
.
Provider
=
sec
.
Key
(
"provider"
)
.
In
(
"memory"
,
[]
string
{
"memory"
,
"file"
,
"redis"
,
"mysql"
,
"postgres"
})
SessionOptions
.
Provider
=
sec
.
Key
(
"provider"
)
.
In
(
"memory"
,
[]
string
{
"memory"
,
"file"
,
"redis"
,
"mysql"
,
"postgres"
,
"memcache"
})
SessionOptions
.
ProviderConfig
=
strings
.
Trim
(
sec
.
Key
(
"provider_config"
)
.
String
(),
"
\"
"
)
SessionOptions
.
ProviderConfig
=
strings
.
Trim
(
sec
.
Key
(
"provider_config"
)
.
String
(),
"
\"
"
)
SessionOptions
.
CookieName
=
sec
.
Key
(
"cookie_name"
)
.
MustString
(
"grafana_sess"
)
SessionOptions
.
CookieName
=
sec
.
Key
(
"cookie_name"
)
.
MustString
(
"grafana_sess"
)
SessionOptions
.
CookiePath
=
AppSubUrl
SessionOptions
.
CookiePath
=
AppSubUrl
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment