Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add ability to specify postgresql and mysql based sessions #37

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions grafana/files/grafana.ini
Original file line number Diff line number Diff line change
Expand Up @@ -83,16 +83,20 @@ provider = {{ server.session.engine }}
# postgres: user=a password=b host=localhost port=5432 dbname=c sslmode=disable
{%- 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') }}
{%- 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 %}

# 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
;cookie_secure = false
cookie_secure = {{ server.session.get('cookie_https_only', 'false') }}

# Session life time, default is 86400
;session_life_time = 86400
session_life_time = {{ server.session.get('ttl', 86400) }}

#################################### Analytics ####################################
[analytics]
Expand Down