1
0
Fork 0
mirror of synced 2024-11-22 17:05:34 -05:00

Auth and session cache enhancements

This commit is contained in:
Filip Pytloun 2016-03-31 21:30:13 +02:00
parent 04d32bf507
commit 89f4c5b65b

View file

@ -69,7 +69,7 @@ password = {{ server.database.password }}
#################################### Session #################################### #################################### Session ####################################
[session] [session]
# Either "memory", "file", "redis", "mysql", "postgres", default is "file" # Either "memory", "file", "redis", "mysql", "postgres", default is "file"
;provider = file provider = {{ server.get('session', {}).get('engine', 'file') }}
# Provider config options # Provider config options
# memory: not have any config yet # memory: not have any config yet
@ -77,7 +77,9 @@ password = {{ server.database.password }}
# 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`
# 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: 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
;provider_config = sessions {%- if server.get('session', {}).get('engine', 'file') == 'redis' %}
provider_config = addr={{ server.session.get('host', '127.0.0.1') }}:{{ server.session.get('port', 6379) }},db={{ server.session.get('db', 'grafana') }}
{%- endif %}
# Session cookie name # Session cookie name
;cookie_name = grafana_sess ;cookie_name = grafana_sess
@ -177,7 +179,7 @@ password = {{ server.database.password }}
enabled = true enabled = true
header_name = {{ server.auth.get('header', 'X-REMOTE-USER') %} header_name = {{ server.auth.get('header', 'X-REMOTE-USER') %}
header_property = {{ server.auth.get('header_property', 'username') }} header_property = {{ server.auth.get('header_property', 'username') }}
;auto_sign_up = true auto_sign_up = true
{%- endif %} {%- endif %}
#################################### Basic Auth ########################## #################################### Basic Auth ##########################
@ -191,14 +193,22 @@ header_property = {{ server.auth.get('header_property', 'username') }}
#################################### SMTP / Emailing ########################## #################################### SMTP / Emailing ##########################
[smtp] [smtp]
;enabled = false {%- if server.get('mail', {}).get('enabled', False) %}
;host = localhost:25 enabled = true
;user = {%- if server.mail.host is defined %}
;password = host = {{ server.mail.host }}:{{ server.mail.get('port', 25) }}
{%- endif %}
{%- if server.mail.username is defined %}
user = {{ server.mail.username }}
password = {{ server.mail.password }}
{%- endif %}
;cert_file = ;cert_file =
;key_file = ;key_file =
;skip_verify = false ;skip_verify = false
;from_address = admin@grafana.localhost from_address = {{ server.mail.get('from', 'grafana@localhost') }}
{%- else %}
enabled = false
{%- endif %}
[emails] [emails]
;welcome_email_on_sign_up = false ;welcome_email_on_sign_up = false