add ability to specify postgresql and mysql based sessions
This commit is contained in:
parent
72c889639c
commit
a3e50f563e
1 changed files with 7 additions and 3 deletions
|
@ -83,16 +83,20 @@ provider = {{ server.session.engine }}
|
||||||
# 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
|
||||||
{%- if server.session.engine == 'redis' %}
|
{%- if server.session.engine == 'redis' %}
|
||||||
provider_config = addr={{ server.session.get('host', '127.0.0.1') }}:{{ server.session.get('port', 6379) }},db={{ server.session.get('db', 'grafana') }}
|
provider_config = addr={{ server.session.get('host', '127.0.0.1') }}:{{ server.session.get('port', 6379) }},db={{ server.session.get('db', 'grafana') }}
|
||||||
|
{%- elif server.session.engine == 'postgres' %}
|
||||||
|
provider_config = user={{ server.session.get('user') }} password={{ server.session.get('password') }} host={{ server.session.get('host', '127.0.0.1') }} port={{ server.session.get('port', 5432) }} dbname={{ server.session.get('db', 'grafana') }} sslmode={{ server.session.get('sslmode', 'disable') }}
|
||||||
|
{%- elif server.session.engine == 'mysql' %}
|
||||||
|
provider_config = {{ server.session.get('user') }}:{{ server.session.get('password') }}@tcp({{ server.session.get('host', '127.0.0.1') }}:{{ server.session.get('port', '3306') }})/{{ server.session.get('db', 'grafana') }}
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
|
|
||||||
# Session cookie name
|
# Session cookie name
|
||||||
;cookie_name = grafana_sess
|
cookie_name = {{ server.session.get('cookie_name', 'grafana_sess') }}
|
||||||
|
|
||||||
# If you use session in https only, default is false
|
# If you use session in https only, default is false
|
||||||
;cookie_secure = false
|
cookie_secure = {{ server.session.get('cookie_https_only', 'false') }}
|
||||||
|
|
||||||
# Session life time, default is 86400
|
# Session life time, default is 86400
|
||||||
;session_life_time = 86400
|
session_life_time = {{ server.session.get('ttl', 86400) }}
|
||||||
|
|
||||||
#################################### Analytics ####################################
|
#################################### Analytics ####################################
|
||||||
[analytics]
|
[analytics]
|
||||||
|
|
Loading…
Reference in a new issue