diff --git a/build.go b/build.go index 202caa1837b..a457a49a2c8 100644 --- a/build.go +++ b/build.go @@ -5,6 +5,7 @@ package main import ( "bytes" "crypto/md5" + "crypto/sha1" "encoding/json" "flag" "fmt" @@ -85,17 +86,21 @@ func main() { case "package": grunt(gruntBuildArg("release")...) createLinuxPackages() + sha1FilesInDist() case "pkg-rpm": grunt(gruntBuildArg("release")...) createRpmPackages() + sha1FilesInDist() case "pkg-deb": grunt(gruntBuildArg("release")...) createDebPackages() + sha1FilesInDist() case "latest": makeLatestDistCopies() + sha1FilesInDist() case "clean": clean() @@ -501,3 +506,38 @@ func md5File(file string) error { return out.Close() } + +func sha1FilesInDist() { + filepath.Walk("./dist", func(path string, f os.FileInfo, err error) error { + if strings.Contains(path, ".sha1") == false { + sha1File(path) + } + return nil + }) +} + +func sha1File(file string) error { + fd, err := os.Open(file) + if err != nil { + return err + } + defer fd.Close() + + h := sha1.New() + _, err = io.Copy(h, fd) + if err != nil { + return err + } + + out, err := os.Create(file + ".sha1") + if err != nil { + return err + } + + _, err = fmt.Fprintf(out, "%x\n", h.Sum(nil)) + if err != nil { + return err + } + + return out.Close() +} diff --git a/conf/defaults.ini b/conf/defaults.ini index 39e10280645..d47cefd6bf6 100644 --- a/conf/defaults.ini +++ b/conf/defaults.ini @@ -267,6 +267,7 @@ auto_sign_up = true [auth.ldap] enabled = false config_file = /etc/grafana/ldap.toml +allow_sign_up = true #################################### SMTP / Emailing ##################### [smtp] @@ -292,6 +293,9 @@ mode = console, file # Either "debug", "info", "warn", "error", "critical", default is "info" level = info +# optional settings to set different levels for specific loggers. Ex filters = sqlstore:debug +filters = + # For "console" mode only [log.console] level = @@ -421,7 +425,7 @@ url = https://grafana.net #################################### External Image Storage ############## [external_image_storage] # You can choose between (s3, webdav) -provider = s3 +provider = [external_image_storage.s3] bucket_url = diff --git a/conf/sample.ini b/conf/sample.ini index bb575a596b0..dee40c6f2e9 100644 --- a/conf/sample.ini +++ b/conf/sample.ini @@ -252,6 +252,7 @@ [auth.ldap] ;enabled = false ;config_file = /etc/grafana/ldap.toml +;allow_sign_up = true #################################### SMTP / Emailing ########################## [smtp] @@ -276,6 +277,10 @@ # Either "trace", "debug", "info", "warn", "error", "critical", default is "info" ;level = info +# optional settings to set different levels for specific loggers. Ex filters = sqlstore:debug +;filters = + + # For "console" mode only [log.console] ;level = @@ -375,8 +380,8 @@ #################################### External image storage ########################## [external_image_storage] # Used for uploading images to public servers so they can be included in slack/email messages. -# you can choose between (s3, webdav or internal) -;provider = s3 +# you can choose between (s3, webdav) +;provider = [external_image_storage.s3] ;bucket_url = diff --git a/docs/sources/installation/configuration.md b/docs/sources/installation/configuration.md index 9a7a480f482..e3e435d1194 100644 --- a/docs/sources/installation/configuration.md +++ b/docs/sources/installation/configuration.md @@ -30,6 +30,9 @@ using environment variables using the syntax: Where the section name is the text within the brackets. Everything should be upper case, `.` should be replaced by `_`. For example, given these configuration settings: + # default section + instance_name = ${HOSTNAME} + [security] admin_user = admin @@ -39,6 +42,7 @@ should be upper case, `.` should be replaced by `_`. For example, given these co Then you can override them using: + export GF_DEFAULT_INSTANCE_NAME=my-instance export GF_SECURITY_ADMIN_USER=true export GF_AUTH_GOOGLE_CLIENT_SECRET=newS3cretKey @@ -528,7 +532,7 @@ Use space to separate multiple modes, e.g. "console file" ### level Either "debug", "info", "warn", "error", "critical", default is "info" -### filter +### filters optional settings to set different levels for specific loggers. Ex `filters = sqlstore:debug` diff --git a/pkg/components/imguploader/imguploader.go b/pkg/components/imguploader/imguploader.go index 1de46e7fd1d..1cbe55c8572 100644 --- a/pkg/components/imguploader/imguploader.go +++ b/pkg/components/imguploader/imguploader.go @@ -10,6 +10,13 @@ type ImageUploader interface { Upload(path string) (string, error) } +type NopImageUploader struct { +} + +func (NopImageUploader) Upload(path string) (string, error) { + return "", nil +} + func NewImageUploader() (ImageUploader, error) { switch setting.ImageUploadProvider { @@ -53,5 +60,5 @@ func NewImageUploader() (ImageUploader, error) { return NewWebdavImageUploader(url, username, password) } - return nil, fmt.Errorf("could not find specified provider") + return NopImageUploader{}, nil } diff --git a/pkg/login/ldap.go b/pkg/login/ldap.go index d8c916bb765..cee7096dc45 100644 --- a/pkg/login/ldap.go +++ b/pkg/login/ldap.go @@ -13,6 +13,7 @@ import ( "github.com/grafana/grafana/pkg/bus" "github.com/grafana/grafana/pkg/log" m "github.com/grafana/grafana/pkg/models" + "github.com/grafana/grafana/pkg/setting" ) type ldapAuther struct { @@ -132,8 +133,10 @@ func (a *ldapAuther) getGrafanaUserFor(ldapUser *ldapUserInfo) (*m.User, error) // get user from grafana db userQuery := m.GetUserByLoginQuery{LoginOrEmail: ldapUser.Username} if err := bus.Dispatch(&userQuery); err != nil { - if err == m.ErrUserNotFound { + if err == m.ErrUserNotFound && setting.LdapAllowSignup { return a.createGrafanaUser(ldapUser) + } else if err == m.ErrUserNotFound { + return nil, ErrInvalidCredentials } else { return nil, err } diff --git a/pkg/setting/setting.go b/pkg/setting/setting.go index 46f70215c1f..3086e7b9239 100644 --- a/pkg/setting/setting.go +++ b/pkg/setting/setting.go @@ -134,8 +134,9 @@ var ( GoogleTagManagerId string // LDAP - LdapEnabled bool - LdapConfigFile string + LdapEnabled bool + LdapConfigFile string + LdapAllowSignup bool = true // SMTP email settings Smtp SmtpSettings @@ -551,6 +552,7 @@ func NewConfigContext(args *CommandLineArgs) error { ldapSec := Cfg.Section("auth.ldap") LdapEnabled = ldapSec.Key("enabled").MustBool(false) LdapConfigFile = ldapSec.Key("config_file").String() + LdapAllowSignup = ldapSec.Key("allow_sign_up").MustBool(true) alerting := Cfg.Section("alerting") AlertingEnabled = alerting.Key("enabled").MustBool(false) diff --git a/pkg/tsdb/testdata/scenarios.go b/pkg/tsdb/testdata/scenarios.go index 29a0b5a2ada..73963fc9844 100644 --- a/pkg/tsdb/testdata/scenarios.go +++ b/pkg/tsdb/testdata/scenarios.go @@ -90,10 +90,13 @@ func init() { queryRes := tsdb.NewQueryResult() stringInput := query.Model.Get("stringInput").MustString() - values := []float64{} + values := []null.Float{} for _, strVal := range strings.Split(stringInput, ",") { + if strVal == "null" { + values = append(values, null.FloatFromPtr(nil)) + } if val, err := strconv.ParseFloat(strVal, 64); err == nil { - values = append(values, val) + values = append(values, null.FloatFrom(val)) } } @@ -107,7 +110,7 @@ func init() { step := (endTime - startTime) / int64(len(values)-1) for _, val := range values { - series.Points = append(series.Points, tsdb.NewTimePoint(null.FloatFrom(val), float64(startTime))) + series.Points = append(series.Points, tsdb.TimePoint{val, null.FloatFrom(float64(startTime))}) startTime += step } diff --git a/public/app/core/directives/metric_segment.js b/public/app/core/directives/metric_segment.js index cc662aa67ca..2001073ed80 100644 --- a/public/app/core/directives/metric_segment.js +++ b/public/app/core/directives/metric_segment.js @@ -186,25 +186,27 @@ function (_, $, coreModule) { $scope.getOptionsInternal = function() { if ($scope.options) { - var optionSegments = _.map($scope.options, function(option) { + cachedOptions = _.map($scope.options, function(option) { return uiSegmentSrv.newSegment({value: option.text}); }); - return $q.when(optionSegments); + return $q.when(cachedOptions); } else { return $scope.getOptions().then(function(options) { - cachedOptions = options; - return _.map(options, function(option) { + cachedOptions =_.map(options, function(option) { + if (option.html) { + return option; + } return uiSegmentSrv.newSegment({value: option.text}); }); + return cachedOptions; }); } }; $scope.onSegmentChange = function() { - var options = $scope.options || cachedOptions; - if (options) { - var option = _.find(options, {text: $scope.segment.value}); + if (cachedOptions) { + var option = _.find(cachedOptions, {value: $scope.segment.value}); if (option && option.value !== $scope.property) { $scope.property = option.value; } else if (attrs.custom !== 'false') { diff --git a/public/app/plugins/app/testdata/dashboards/graph_last_1h.json b/public/app/plugins/app/testdata/dashboards/graph_last_1h.json index 757dd48e50f..c64ab84f338 100644 --- a/public/app/plugins/app/testdata/dashboards/graph_last_1h.json +++ b/public/app/plugins/app/testdata/dashboards/graph_last_1h.json @@ -1,5 +1,5 @@ { - "revision": 4, + "revision": 5, "title": "TestData - Graph Panel Last 1h", "tags": [ "grafana-test" @@ -320,124 +320,376 @@ ] }, { - "title": "", - "error": false, - "span": 4, - "editable": true, - "type": "text", - "isNew": true, - "id": 6, - "mode": "markdown", "content": "Just verify that the tooltip time has millisecond resolution ", - "links": [] + "editable": true, + "error": false, + "id": 6, + "isNew": true, + "links": [], + "mode": "markdown", + "span": 4, + "title": "", + "type": "text" } ], "title": "New row" }, { - "title": "New row", - "height": 336, - "editable": true, "collapse": false, + "editable": true, + "height": 336, "panels": [ { - "title": "2 yaxis and axis lables", - "error": false, - "span": 7.99561403508772, - "editable": true, - "type": "graph", - "isNew": true, - "id": 5, - "targets": [ - { - "target": "", - "refId": "A", - "scenarioId": "csv_metric_values", - "stringInput": "1,20,90,30,5,0" - }, - { - "target": "", - "refId": "B", - "scenarioId": "csv_metric_values", - "stringInput": "2000,3000,4000,1000,3000,10000" - } - ], + "aliasColors": {}, + "bars": false, "datasource": "Grafana TestData", - "renderer": "flot", - "yaxes": [ - { - "label": "Perecent", - "show": true, - "logBase": 1, - "min": null, - "max": null, - "format": "percent" - }, - { - "label": "Pressure", - "show": true, - "logBase": 1, - "min": null, - "max": null, - "format": "short" - } - ], - "xaxis": { + "editable": true, + "error": false, + "fill": 1, + "id": 5, + "isNew": true, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, "show": true, - "mode": "time", - "name": null, - "values": [] + "total": false, + "values": false }, "lines": true, - "fill": 1, "linewidth": 2, - "points": false, - "pointradius": 5, - "bars": false, - "stack": false, - "percentage": false, - "legend": { - "show": true, - "values": false, - "min": false, - "max": false, - "current": false, - "total": false, - "avg": false - }, + "links": [], "nullPointMode": "connected", - "steppedLine": false, - "tooltip": { - "value_type": "cumulative", - "shared": true, - "sort": 0, - "msResolution": false - }, - "timeFrom": null, - "timeShift": null, - "aliasColors": {}, + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", "seriesOverrides": [ { "alias": "B-series", "yaxis": 2 } ], + "span": 7.99561403508772, + "stack": false, + "steppedLine": false, + "targets": [ + { + "refId": "A", + "scenarioId": "csv_metric_values", + "stringInput": "1,20,90,30,5,0", + "target": "" + }, + { + "refId": "B", + "scenarioId": "csv_metric_values", + "stringInput": "2000,3000,4000,1000,3000,10000", + "target": "" + } + ], "thresholds": [], - "links": [] + "timeFrom": null, + "timeShift": null, + "title": "2 yaxis and axis lables", + "tooltip": { + "msResolution": false, + "shared": true, + "sort": 0, + "value_type": "cumulative" + }, + "type": "graph", + "xaxis": { + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "percent", + "label": "Perecent", + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": "Pressure", + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ] }, { - "title": "", - "error": false, - "span": 4.00438596491228, - "editable": true, - "type": "text", - "isNew": true, - "id": 7, - "mode": "markdown", "content": "Verify that axis labels look ok", - "links": [] + "editable": true, + "error": false, + "id": 7, + "isNew": true, + "links": [], + "mode": "markdown", + "span": 4.00438596491228, + "title": "", + "type": "text" } - ] + ], + "title": "New row" + }, + { + "collapse": false, + "editable": true, + "height": "250px", + "panels": [ + { + "aliasColors": {}, + "bars": false, + "datasource": "Grafana TestData", + "editable": true, + "error": false, + "fill": 1, + "id": 8, + "isNew": true, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 2, + "links": [], + "nullPointMode": "connected", + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "span": 4, + "stack": false, + "steppedLine": false, + "targets": [ + { + "refId": "B", + "scenarioId": "csv_metric_values", + "stringInput": "1,20,null,null,null,null,null,null,100,10,10,20,30,40,10", + "target": "" + } + ], + "thresholds": [], + "timeFrom": null, + "timeShift": null, + "title": "null value connected", + "tooltip": { + "msResolution": false, + "shared": true, + "sort": 0, + "value_type": "cumulative" + }, + "type": "graph", + "xaxis": { + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ] + }, + { + "aliasColors": {}, + "bars": false, + "datasource": "Grafana TestData", + "editable": true, + "error": false, + "fill": 1, + "id": 10, + "isNew": true, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 2, + "links": [], + "nullPointMode": "null as zero", + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "span": 3, + "stack": false, + "steppedLine": false, + "targets": [ + { + "refId": "B", + "scenarioId": "csv_metric_values", + "stringInput": "1,20,null,null,null,null,null,null,100,10,10,20,30,40,10", + "target": "" + } + ], + "thresholds": [], + "timeFrom": null, + "timeShift": null, + "title": "null value null as zero", + "tooltip": { + "msResolution": false, + "shared": true, + "sort": 0, + "value_type": "cumulative" + }, + "type": "graph", + "xaxis": { + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ] + }, + { + "aliasColors": {}, + "bars": false, + "datasource": "Grafana TestData", + "editable": true, + "error": false, + "fill": 1, + "id": 9, + "isNew": true, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 2, + "links": [], + "nullPointMode": "null", + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [ + { + "alias": "B-series", + "zindex": -3 + } + ], + "span": 5, + "stack": true, + "steppedLine": false, + "targets": [ + { + "hide": false, + "refId": "B", + "scenarioId": "csv_metric_values", + "stringInput": "1,20,null,null,null,null,null,null,100,10,10,20,30,40,10", + "target": "" + }, + { + "alias": "", + "hide": false, + "refId": "A", + "scenarioId": "csv_metric_values", + "stringInput": "1,20,90,30,5,10,20,30,40,40,40,100,10,20,20", + "target": "" + }, + { + "alias": "", + "hide": false, + "refId": "C", + "scenarioId": "csv_metric_values", + "stringInput": "1,20,90,30,5,10,20,30,40,40,40,100,10,20,20", + "target": "" + } + ], + "thresholds": [], + "timeFrom": null, + "timeShift": null, + "title": "Stacking value ontop of nulls", + "tooltip": { + "msResolution": false, + "shared": true, + "sort": 0, + "value_type": "cumulative" + }, + "type": "graph", + "xaxis": { + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ] + } + ], + "title": "New row" } ], "time": { @@ -477,7 +729,7 @@ }, "refresh": false, "schemaVersion": 13, - "version": 3, + "version": 13, "links": [], "gnetId": null } diff --git a/public/app/plugins/app/testdata/plugin.json b/public/app/plugins/app/testdata/plugin.json index 6742ad04ecb..63f88df8140 100644 --- a/public/app/plugins/app/testdata/plugin.json +++ b/public/app/plugins/app/testdata/plugin.json @@ -9,7 +9,7 @@ "name": "Grafana Project", "url": "http://grafana.org" }, - "version": "1.0.13", + "version": "1.0.14", "updated": "2016-09-26" }, diff --git a/public/app/plugins/datasource/cloudwatch/img/amazon-web-services.png b/public/app/plugins/datasource/cloudwatch/img/amazon-web-services.png index f11f4034751..7f9687e839c 100644 Binary files a/public/app/plugins/datasource/cloudwatch/img/amazon-web-services.png and b/public/app/plugins/datasource/cloudwatch/img/amazon-web-services.png differ diff --git a/public/app/plugins/datasource/elasticsearch/img/logo_large.png b/public/app/plugins/datasource/elasticsearch/img/logo_large.png index b76d01e5d74..5ded1d8f438 100644 Binary files a/public/app/plugins/datasource/elasticsearch/img/logo_large.png and b/public/app/plugins/datasource/elasticsearch/img/logo_large.png differ diff --git a/public/app/plugins/datasource/graphite/img/graphite_logo.png b/public/app/plugins/datasource/graphite/img/graphite_logo.png index e70b40720c4..7b6b85d2eb5 100644 Binary files a/public/app/plugins/datasource/graphite/img/graphite_logo.png and b/public/app/plugins/datasource/graphite/img/graphite_logo.png differ diff --git a/public/app/plugins/datasource/opentsdb/datasource.js b/public/app/plugins/datasource/opentsdb/datasource.js index 54605a4f7e2..93a1158b6e0 100644 --- a/public/app/plugins/datasource/opentsdb/datasource.js +++ b/public/app/plugins/datasource/opentsdb/datasource.js @@ -419,7 +419,7 @@ function (angular, _, dateMath) { return target.metric === metricData.metric; } else { return target.metric === metricData.metric && - _.all(target.tags, function(tagV, tagK) { + _.every(target.tags, function(tagV, tagK) { interpolatedTagValue = templateSrv.replace(tagV, options.scopedVars, 'pipe'); return metricData.tags[tagK] === interpolatedTagValue || interpolatedTagValue === "*"; }); diff --git a/public/app/plugins/datasource/opentsdb/img/opentsdb_logo.png b/public/app/plugins/datasource/opentsdb/img/opentsdb_logo.png index 519d56a476c..081459abe0c 100644 Binary files a/public/app/plugins/datasource/opentsdb/img/opentsdb_logo.png and b/public/app/plugins/datasource/opentsdb/img/opentsdb_logo.png differ diff --git a/public/app/plugins/panel/graph/tab_display.html b/public/app/plugins/panel/graph/tab_display.html index 14c8c4cf6fc..6845181b8b2 100644 --- a/public/app/plugins/panel/graph/tab_display.html +++ b/public/app/plugins/panel/graph/tab_display.html @@ -71,13 +71,9 @@