GRAFANA_IMAGE=grafana/grafana:{{ grafana_image_tag }}
{% if grafana_server_root_url is defined and grafana_server_root_url|length %}
GF_SERVER_ROOT_URL={{ grafana_server_root_url }}
{% endif %}
GF_SERVER_ENABLE_GZIP=true
{% if grafana_enable_ssl %}
GF_SERVER_CERT_FILE=/etc/ssl/grafana.cert
GF_SERVER_CERT_KEY=/etc/ssl/grafana.key
GF_SERVER_PROTOCOL=https
{% endif %}
# Initial admin password. Must be changed afterwards
GF_SECURITY_ADMIN_PASSWORD={{ grafana_security_admin_password }}
GF_USERS_ALLOW_SIGN_UP={{ grafana_users_allow_sign_up }}


{% if grafana_users_login_hint is defined and  grafana_users_login_hint|length %}
GF_USERS_LOGIN_HINT={{ grafana_users_login_hint  }}
{% endif %}
{% if grafana_users_password_hint is defined and  grafana_users_password_hint|length %}
GF_USERS_PASSWORD_HINT={{ grafana_users_password_hint }}
{% endif %}

{% if grafana_db_url is defined and grafana_db_url|length %}
GF_DATABASE_URL={{ grafana_db_url }}
{% endif %}
{% if grafana_db_type is defined and grafana_db_type|length %}
GF_DATABASE_TYPE={{ grafana_db_type }}
{% endif %}
{% if grafana_db_host is defined and grafana_db_host|length %}
GF_DATABASE_HOST={{ grafana_db_host }}
{% endif %}
{% if grafana_db_name is defined and grafana_db_name|length %}
GF_DATABASE_NAME={{ grafana_db_name }}
{% endif %}
{% if grafana_db_user is defined and grafana_db_user|length %}
GF_DATABASE_USER={{ grafana_db_user }}
{% if grafana_db_password is defined and grafana_db_password|length %}
GF_DATABASE_PASSWORD={{ grafana_db_password }}
{% endif %}
{% endif %}
{% if grafana_db_ssl_mode is defined and grafana_db_user|length %}
GF_DATABASE_SSL_MODE={{ grafana_db_ssl_mode }}
{% endif %}

{% if grafana_auth_github_enable is defined and grafana_auth_github_enable %}
GF_AUTH_GITHUB_ENABLED=true
GF_AUTH_GITHUB_ALLOW_SIGN_UP=true
GF_AUTH_GITHUB_CLIENT_ID={{ grafana_auth_github_client_id }}
GF_AUTH_GITHUB_CLIENT_SECRET={{ grafana_auth_github_client_secret }}
GF_AUTH_GITHUB_SCOPES=user:email,read:org
GF_AUTH_GITHUB_AUTH_URL=https://github.com/login/oauth/authorize
GF_AUTH_GITHUB_TOKEN_URL=https://github.com/login/oauth/access_token
GF_AUTH_GITHUB_API_URL=https://api.github.com/user
{% if grafana_auth_github_allowed_orgs %}
GF_AUTH_GITHUB_ALLOWED_ORGANIZATIONS={{ grafana_auth_github_allowed_orgs }}
{% endif %}
{% endif %}

{% if grafana_smtp_enable is defined and grafana_smtp_enable %}
GF_SMTP_ENABLED=true
GF_SMTP_HOST={{ grafana_smtp_host }}
{% if grafana_smtp_from_address is defined and grafana_smtp_from_address|length %}
GF_SMTP_FROM_ADDRESS={{ grafana_smtp_from_address }}
{% endif %}
{% if grafana_smtp_from_name is defined and grafana_smtp_from_name|length %}
GF_SMTP_FROM_NAME={{ grafana_smtp_from_name }}
{% endif %}
{% endif %}

{% if grafana_auth_ldap_enable is defined and grafana_auth_ldap_enable %}
GF_AUTH_LDAP_ENABLED=true
GF_AUTH_LDAP_ALLOW_SIGN_UP=true
GF_AUTH_LDAP_CONFIG_FILE=/etc/grafana/ldap/ldap.toml
{% endif %}

GF_RENDERING_SERVER_URL=http://{{ grafana_renderer_host }}:8081/render
GF_RENDERING_CALLBACK_URL=http://{{ grafana_grafana_host }}:3000/
GF_LOG_FILTERS=rendering:debug
