diff --git a/CHANGELOG.md b/CHANGELOG.md index 4bd9cb917d7..34d3c82916e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,6 @@ # 5.3.0 (unreleased) +* **OAuth**: Gitlab OAuth with support for filter by groups [#5623](https://github.com/grafana/grafana/issues/5623), thx [@BenoitKnecht](https://github.com/BenoitKnecht) * **Dataproxy**: Pass configured/auth headers to a Datasource [#10971](https://github.com/grafana/grafana/issues/10971), thx [@mrsiano](https://github.com/mrsiano) * **Cleanup**: Make temp file time to live configurable [#11607](https://github.com/grafana/grafana/issues/11607), thx [@xapon](https://github.com/xapon) * **LDAP**: Define Grafana Admin permission in ldap group mappings [#2469](https://github.com/grafana/grafana/issues/2496), PR [#12622](https://github.com/grafana/grafana/issues/12622) diff --git a/docs/sources/features/datasources/cloudwatch.md b/docs/sources/features/datasources/cloudwatch.md index d178c176602..7adc6ebe4fb 100644 --- a/docs/sources/features/datasources/cloudwatch.md +++ b/docs/sources/features/datasources/cloudwatch.md @@ -115,6 +115,8 @@ and `dimension keys/values`. In place of `region` you can specify `default` to use the default region configured in the datasource for the query, e.g. `metrics(AWS/DynamoDB, default)` or `dimension_values(default, ..., ..., ...)`. +Read more about the available dimensions in the [CloudWatch Metrics and Dimensions Reference](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CW_Support_For_AWS.html). + Name | Description ------- | -------- *regions()* | Returns a list of regions AWS provides their service. diff --git a/docs/sources/http_api/alerting.md b/docs/sources/http_api/alerting.md index e4fe0dad3ff..80b6e283be3 100644 --- a/docs/sources/http_api/alerting.md +++ b/docs/sources/http_api/alerting.md @@ -59,7 +59,6 @@ Content-Type: application/json "panelId": 1, "name": "fire place sensor", "state": "alerting", - "message": "Someone is trying to break in through the fire place", "newStateDate": "2018-05-14T05:55:20+02:00", "evalDate": "0001-01-01T00:00:00Z", "evalData": null, diff --git a/docs/sources/http_api/dashboard.md b/docs/sources/http_api/dashboard.md index ea1bd7f2ef7..3df36894901 100644 --- a/docs/sources/http_api/dashboard.md +++ b/docs/sources/http_api/dashboard.md @@ -85,7 +85,7 @@ Status Codes: - **403** – Access denied - **412** – Precondition failed -The **412** status code is used for explaing that you cannot create the dashboard and why. +The **412** status code is used for explaining that you cannot create the dashboard and why. There can be different reasons for this: - The dashboard has been changed by someone else, `status=version-mismatch` diff --git a/docs/sources/http_api/folder.md b/docs/sources/http_api/folder.md index fb318ecf58e..e8845c3b125 100644 --- a/docs/sources/http_api/folder.md +++ b/docs/sources/http_api/folder.md @@ -223,7 +223,7 @@ Status Codes: - **404** – Folder not found - **412** – Precondition failed -The **412** status code is used for explaing that you cannot update the folder and why. +The **412** status code is used for explaining that you cannot update the folder and why. There can be different reasons for this: - The folder has been changed by someone else, `status=version-mismatch` diff --git a/docs/sources/installation/docker.md b/docs/sources/installation/docker.md index 1f755625699..6bf25ad8232 100644 --- a/docs/sources/installation/docker.md +++ b/docs/sources/installation/docker.md @@ -38,6 +38,8 @@ The back-end web server has a number of configuration options. Go to the [Configuration]({{< relref "configuration.md" >}}) page for details on all those options. +> For any changes to `conf/grafana.ini` (or corresponding environment variables) to take effect you need to restart Grafana by restarting the Docker container. + ## Running a Specific Version of Grafana ```bash @@ -49,10 +51,13 @@ $ docker run \ grafana/grafana:5.1.0 ``` -## Running of the master branch +## Running the master branch -For every successful commit we publish a Grafana container to [`grafana/grafana`](https://hub.docker.com/r/grafana/grafana/tags/) and [`grafana/grafana-dev`](https://hub.docker.com/r/grafana/grafana-dev/tags/). In `grafana/grafana` container we will always overwrite the `master` tag with the latest version. In `grafana/grafana-dev` we will include -the git commit in the tag. If you run Grafana master in production we **strongly** recommend that you use the later since different machines might run different version of grafana if they pull the master tag at different times. +For every successful build of the master branch we update the `grafana/grafana:master` tag and create a new tag `grafana/grafana-dev:master-` with the hash of the git commit that was built. This means you can always get the latest version of Grafana. + +When running Grafana master in production we **strongly** recommend that you use the `grafana/grafana-dev:master-` tag as that will guarantee that you use a specific version of Grafana instead of whatever was the most recent commit at the time. + +For a list of available tags, check out [grafana/grafana](https://hub.docker.com/r/grafana/grafana/tags/) and [grafana/grafana-dev](https://hub.docker.com/r/grafana/grafana-dev/tags/). ## Installing Plugins for Grafana diff --git a/packaging/docker/push_to_docker_hub.sh b/packaging/docker/push_to_docker_hub.sh index 3cf97d580ca..526c216f8fa 100755 --- a/packaging/docker/push_to_docker_hub.sh +++ b/packaging/docker/push_to_docker_hub.sh @@ -15,10 +15,10 @@ fi echo "pushing ${_docker_repo}:${_grafana_version}" docker push "${_docker_repo}:${_grafana_version}" -if echo "$_grafana_tag" | grep -q "^v"; then +if echo "$_grafana_tag" | grep -q "^v" && echo "$_grafana_tag" | grep -vq "beta"; then echo "pushing ${_docker_repo}:latest" docker push "${_docker_repo}:latest" -else +elif echo "$_grafana_tag" | grep -q "master"; then echo "pushing grafana/grafana:master" docker push grafana/grafana:master fi diff --git a/pkg/api/pluginproxy/ds_proxy.go b/pkg/api/pluginproxy/ds_proxy.go index b420398f9a9..c8056040d24 100644 --- a/pkg/api/pluginproxy/ds_proxy.go +++ b/pkg/api/pluginproxy/ds_proxy.go @@ -203,6 +203,7 @@ func (proxy *DataSourceProxy) getDirector() func(req *http.Request) { req.Header.Del("X-Forwarded-Host") req.Header.Del("X-Forwarded-Port") req.Header.Del("X-Forwarded-Proto") + req.Header.Set("User-Agent", fmt.Sprintf("Grafana/%s", setting.BuildVersion)) // set X-Forwarded-For header if req.RemoteAddr != "" { diff --git a/pkg/api/pluginproxy/ds_proxy_test.go b/pkg/api/pluginproxy/ds_proxy_test.go index bb553b4d075..ad331113f46 100644 --- a/pkg/api/pluginproxy/ds_proxy_test.go +++ b/pkg/api/pluginproxy/ds_proxy_test.go @@ -212,20 +212,21 @@ func TestDSRouteRule(t *testing.T) { }) Convey("When proxying graphite", func() { + setting.BuildVersion = "5.3.0" plugin := &plugins.DataSourcePlugin{} ds := &m.DataSource{Url: "htttp://graphite:8080", Type: m.DS_GRAPHITE} ctx := &m.ReqContext{} proxy := NewDataSourceProxy(ds, plugin, ctx, "/render") + req, err := http.NewRequest(http.MethodGet, "http://grafana.com/sub", nil) + So(err, ShouldBeNil) - requestURL, _ := url.Parse("http://grafana.com/sub") - req := http.Request{URL: requestURL} - - proxy.getDirector()(&req) + proxy.getDirector()(req) Convey("Can translate request url and path", func() { So(req.URL.Host, ShouldEqual, "graphite:8080") So(req.URL.Path, ShouldEqual, "/render") + So(req.Header.Get("User-Agent"), ShouldEqual, "Grafana/5.3.0") }) }) @@ -243,10 +244,10 @@ func TestDSRouteRule(t *testing.T) { ctx := &m.ReqContext{} proxy := NewDataSourceProxy(ds, plugin, ctx, "") - requestURL, _ := url.Parse("http://grafana.com/sub") - req := http.Request{URL: requestURL} + req, err := http.NewRequest(http.MethodGet, "http://grafana.com/sub", nil) + So(err, ShouldBeNil) - proxy.getDirector()(&req) + proxy.getDirector()(req) Convey("Should add db to url", func() { So(req.URL.Path, ShouldEqual, "/db/site/") diff --git a/scripts/docker/run.sh b/scripts/docker/run.sh deleted file mode 100755 index df64ce3adf4..00000000000 --- a/scripts/docker/run.sh +++ /dev/null @@ -1,67 +0,0 @@ -#!/bin/bash -e - -PERMISSIONS_OK=0 - -if [ ! -r "$GF_PATHS_CONFIG" ]; then - echo "GF_PATHS_CONFIG='$GF_PATHS_CONFIG' is not readable." - PERMISSIONS_OK=1 -fi - -if [ ! -w "$GF_PATHS_DATA" ]; then - echo "GF_PATHS_DATA='$GF_PATHS_DATA' is not writable." - PERMISSIONS_OK=1 -fi - -if [ ! -r "$GF_PATHS_HOME" ]; then - echo "GF_PATHS_HOME='$GF_PATHS_HOME' is not readable." - PERMISSIONS_OK=1 -fi - -if [ $PERMISSIONS_OK -eq 1 ]; then - echo "You may have issues with file permissions, more information here: http://docs.grafana.org/installation/docker/#migration-from-a-previous-version-of-the-docker-container-to-5-1-or-later" -fi - -if [ ! -d "$GF_PATHS_PLUGINS" ]; then - mkdir "$GF_PATHS_PLUGINS" -fi - - -if [ ! -z ${GF_AWS_PROFILES+x} ]; then - > "$GF_PATHS_HOME/.aws/credentials" - - for profile in ${GF_AWS_PROFILES}; do - access_key_varname="GF_AWS_${profile}_ACCESS_KEY_ID" - secret_key_varname="GF_AWS_${profile}_SECRET_ACCESS_KEY" - region_varname="GF_AWS_${profile}_REGION" - - if [ ! -z "${!access_key_varname}" -a ! -z "${!secret_key_varname}" ]; then - echo "[${profile}]" >> "$GF_PATHS_HOME/.aws/credentials" - echo "aws_access_key_id = ${!access_key_varname}" >> "$GF_PATHS_HOME/.aws/credentials" - echo "aws_secret_access_key = ${!secret_key_varname}" >> "$GF_PATHS_HOME/.aws/credentials" - if [ ! -z "${!region_varname}" ]; then - echo "region = ${!region_varname}" >> "$GF_PATHS_HOME/.aws/credentials" - fi - fi - done - - chmod 600 "$GF_PATHS_HOME/.aws/credentials" -fi - -if [ ! -z "${GF_INSTALL_PLUGINS}" ]; then - OLDIFS=$IFS - IFS=',' - for plugin in ${GF_INSTALL_PLUGINS}; do - IFS=$OLDIFS - grafana-cli --pluginsDir "${GF_PATHS_PLUGINS}" plugins install ${plugin} - done -fi - -exec grafana-server \ - --homepath="$GF_PATHS_HOME" \ - --config="$GF_PATHS_CONFIG" \ - "$@" \ - cfg:default.log.mode="console" \ - cfg:default.paths.data="$GF_PATHS_DATA" \ - cfg:default.paths.logs="$GF_PATHS_LOGS" \ - cfg:default.paths.plugins="$GF_PATHS_PLUGINS" \ - cfg:default.paths.provisioning="$GF_PATHS_PROVISIONING" \ No newline at end of file