Skip to content
Snippets Groups Projects
Unverified Commit 9704c501 authored by ysde's avatar ysde Committed by GitHub
Browse files

Merge pull request #46 from dbaumann/master

add GRAFANA_HEADERS environment variable
parents 5bb8535f 0733dc98
No related branches found
No related tags found
No related merge requests found
......@@ -20,6 +20,7 @@ You need to add the following to your `.bashrc` or execute once before using the
# do not use a trailing slash!
export GRAFANA_URL=http://some.host.org:3000
export GRAFANA_TOKEN=eyJrIjoidUhaU2ZQQndrWFN3RRVkUnVfrT56a1JoaG9KWFFObEgiLCJuIjoiYWRtaW4iLCJpZCI6MX0=
export GRAFANA_HEADERS=Host:some.host.org
```
There is [official documentation](http://docs.grafana.org/http_api/auth/) how to obtain the `TOKEN` for your installation.
......@@ -38,7 +39,7 @@ _OUTPUT_/
## Docker
Replace variables below to use docker version of this tool
* `{YOUR_GRAFANA_TOKEN}`: Your grafana site token.
* `{YOUR_GRAFANA_TOKEN}`: Your grafana site token.
* `{YOUR_GRAFANA_URL}`: Your grafana site url.
* `{YOUR_BACKUP_FOLDER_ON_THE_HOST}`: The backup folder on the host machine.
......
......@@ -2,8 +2,9 @@ import os
GRAFANA_URL = os.getenv('GRAFANA_URL', 'http://localhost:3000')
TOKEN = os.getenv('GRAFANA_TOKEN', 'eyJrIjoiSkQ5NkdvWllHdnVNdlVhWUV3Tm5LSGc4NG53UFdSTjQiLCJuIjoiYWRtaW4iLCJpZCI6MX0=')
HTTP_GET_HEADERS = {'Authorization': 'Bearer ' + TOKEN}
HTTP_POST_HEADERS = {'Authorization': 'Bearer ' + TOKEN, 'Content-Type': 'application/json'}
EXTRA_HEADERS = dict(h.split(':') for h in os.getenv('GRAFANA_HEADERS').split(',') if 'GRAFANA_HEADERS' in os.environ)
HTTP_GET_HEADERS = {'Authorization': 'Bearer ' + TOKEN, **EXTRA_HEADERS}
HTTP_POST_HEADERS = {'Authorization': 'Bearer ' + TOKEN, 'Content-Type': 'application/json', **EXTRA_HEADERS}
SEARCH_API_LIMIT = 5000
DEBUG = True
VERIFY_SSL = False
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment