diff --git a/.gitignore b/.gitignore index dfc25e9..fb060cc 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,2 @@ -SOURCES/grafana-6.3.6.tar.gz -SOURCES/grafana_webpack-6.3.6.tar.gz +SOURCES/grafana-6.7.3.tar.gz +SOURCES/grafana_webpack-6.7.3.tar.gz diff --git a/.grafana.metadata b/.grafana.metadata index b0b0282..cbf7dbd 100644 --- a/.grafana.metadata +++ b/.grafana.metadata @@ -1,2 +1,2 @@ -59a2779eecc65a49339789ef27f5039e6cd1df00 SOURCES/grafana-6.3.6.tar.gz -58a07073b24fddba1973a0788118648ea8363ed9 SOURCES/grafana_webpack-6.3.6.tar.gz +cd15a32c97cad74170baf35fda5cdb63dda71189 SOURCES/grafana-6.7.3.tar.gz +497241edb4421d19f87bbfd048d45521fe055f01 SOURCES/grafana_webpack-6.7.3.tar.gz diff --git a/SOURCES/001-login-oauth-use-oauth2-exchange.patch b/SOURCES/001-login-oauth-use-oauth2-exchange.patch index ff59d44..f6dff49 100644 --- a/SOURCES/001-login-oauth-use-oauth2-exchange.patch +++ b/SOURCES/001-login-oauth-use-oauth2-exchange.patch @@ -1,8 +1,8 @@ diff --git a/pkg/api/login_oauth.go b/pkg/api/login_oauth.go -index a46c97238..76fc8480c 100644 +index c8c9f05b33..1b5a67aec2 100644 --- a/pkg/api/login_oauth.go +++ b/pkg/api/login_oauth.go -@@ -125,7 +125,7 @@ func (hs *HTTPServer) OAuthLogin(ctx *m.ReqContext) { +@@ -134,7 +134,7 @@ func (hs *HTTPServer) OAuthLogin(ctx *m.ReqContext) { oauthCtx := context.WithValue(context.Background(), oauth2.HTTPClient, oauthClient) // get token from provider diff --git a/SOURCES/002-remove-jaeger-tracing.patch b/SOURCES/002-remove-jaeger-tracing.patch index 0d20b5e..e6fae49 100644 --- a/SOURCES/002-remove-jaeger-tracing.patch +++ b/SOURCES/002-remove-jaeger-tracing.patch @@ -1,5 +1,5 @@ diff --git a/pkg/cmd/grafana-server/server.go b/pkg/cmd/grafana-server/server.go -index 85d6db43e..6de99b58b 100644 +index 0dace4ebab..f1a4bfde53 100644 --- a/pkg/cmd/grafana-server/server.go +++ b/pkg/cmd/grafana-server/server.go @@ -23,7 +23,6 @@ import ( @@ -12,10 +12,10 @@ index 85d6db43e..6de99b58b 100644 "github.com/grafana/grafana/pkg/login/social" diff --git a/pkg/infra/tracing/tracing.go b/pkg/infra/tracing/tracing.go deleted file mode 100644 -index d1511a533..000000000 +index 923459786b..0000000000 --- a/pkg/infra/tracing/tracing.go +++ /dev/null -@@ -1,148 +0,0 @@ +@@ -1,161 +0,0 @@ -package tracing - -import ( @@ -56,7 +56,7 @@ index d1511a533..000000000 - ts.parseSettings() - - if ts.enabled { -- ts.initGlobalTracer() +- return ts.initGlobalTracer() - } - - return nil @@ -80,7 +80,7 @@ index d1511a533..000000000 - ts.disableSharedZipkinSpans = section.Key("disable_shared_zipkin_spans").MustBool(false) -} - --func (ts *TracingService) initGlobalTracer() error { +-func (ts *TracingService) initJaegerCfg() (jaegercfg.Configuration, error) { - cfg := jaegercfg.Configuration{ - ServiceName: "grafana", - Disabled: !ts.enabled, @@ -94,6 +94,19 @@ index d1511a533..000000000 - }, - } - +- _, err := cfg.FromEnv() +- if err != nil { +- return cfg, err +- } +- return cfg, nil +-} +- +-func (ts *TracingService) initGlobalTracer() error { +- cfg, err := ts.initJaegerCfg() +- if err != nil { +- return err +- } +- - jLogger := &jaegerLogWrapper{logger: log.New("jaeger")} - - options := []jaegercfg.Option{} @@ -120,7 +133,7 @@ index d1511a533..000000000 - return err - } - -- opentracing.InitGlobalTracer(tracer) +- opentracing.SetGlobalTracer(tracer) - - ts.closer = closer - @@ -166,13 +179,18 @@ index d1511a533..000000000 -} diff --git a/pkg/infra/tracing/tracing_test.go b/pkg/infra/tracing/tracing_test.go deleted file mode 100644 -index 27e4de777..000000000 +index a6d71cf165..0000000000 --- a/pkg/infra/tracing/tracing_test.go +++ /dev/null -@@ -1,36 +0,0 @@ +@@ -1,94 +0,0 @@ -package tracing - --import "testing" +-import ( +- "github.com/stretchr/testify/assert" +- "github.com/stretchr/testify/require" +- "os" +- "testing" +-) - -func TestGroupSplit(t *testing.T) { - tests := []struct { @@ -200,9 +218,62 @@ index 27e4de777..000000000 - tags := splitTagSettings(test.input) - for k, v := range test.expected { - value, exists := tags[k] -- if !exists || value != v { -- t.Errorf("tags does not match %v ", test) -- } +- assert.Truef(t, exists, "Tag %q not found for input %q", k, test.input) +- assert.Equalf(t, v, value, "Tag %q has wrong value for input %q", k, test.input) - } - } -} +- +-func TestInitJaegerCfg_Default(t *testing.T) { +- ts := &TracingService{} +- cfg, err := ts.initJaegerCfg() +- require.NoError(t, err) +- +- assert.True(t, cfg.Disabled) +-} +- +-func TestInitJaegerCfg_Enabled(t *testing.T) { +- ts := &TracingService{enabled: true} +- cfg, err := ts.initJaegerCfg() +- require.NoError(t, err) +- +- assert.False(t, cfg.Disabled) +- assert.Equal(t, "localhost:6831", cfg.Reporter.LocalAgentHostPort) +-} +- +-func TestInitJaegerCfg_DisabledViaEnv(t *testing.T) { +- os.Setenv("JAEGER_DISABLED", "true") +- defer func() { +- os.Unsetenv("JAEGER_DISABLED") +- }() +- +- ts := &TracingService{enabled: true} +- cfg, err := ts.initJaegerCfg() +- require.NoError(t, err) +- +- assert.True(t, cfg.Disabled) +-} +- +-func TestInitJaegerCfg_EnabledViaEnv(t *testing.T) { +- os.Setenv("JAEGER_DISABLED", "false") +- defer func() { +- os.Unsetenv("JAEGER_DISABLED") +- }() +- +- ts := &TracingService{enabled: false} +- cfg, err := ts.initJaegerCfg() +- require.NoError(t, err) +- +- assert.False(t, cfg.Disabled) +-} +- +-func TestInitJaegerCfg_InvalidEnvVar(t *testing.T) { +- os.Setenv("JAEGER_DISABLED", "totallybogus") +- defer func() { +- os.Unsetenv("JAEGER_DISABLED") +- }() +- +- ts := &TracingService{} +- _, err := ts.initJaegerCfg() +- require.EqualError(t, err, "cannot parse env var JAEGER_DISABLED=totallybogus: strconv.ParseBool: parsing \"totallybogus\": invalid syntax") +-} diff --git a/SOURCES/003-manpages.patch b/SOURCES/003-manpages.patch new file mode 100644 index 0000000..d2b2f88 --- /dev/null +++ b/SOURCES/003-manpages.patch @@ -0,0 +1,219 @@ +diff --git a/docs/man/man1/grafana-cli.1 b/docs/man/man1/grafana-cli.1 +new file mode 100644 +index 0000000000..171748fcda +--- /dev/null ++++ b/docs/man/man1/grafana-cli.1 +@@ -0,0 +1,51 @@ ++.TH GRAFANA "1" "February 2019" "Grafana cli version 5.4.3" "User Commands" ++.SH NAME ++grafana-cli \- command line administration for the Grafana metrics dashboard and graph editor ++.SH DESCRIPTION ++.SS "NAME:" ++.IP ++grafana-cli ++.SS "USAGE:" ++.IP ++\fBgrafana\-cli\fP [\fIglobal options\fP] \fIcommand\fP [\fIcommand options\fP] [\fIarguments\fP...] ++.SS "COMMANDS:" ++.TP ++plugins ++Manage plugins for grafana ++.TP ++admin ++Grafana admin commands ++.TP ++help, h ++Shows a list of commands or help for one command ++.SS "GLOBAL OPTIONS:" ++.TP ++\fB\-\-pluginsDir\fR value ++path to the grafana plugin directory (default: "/var/lib/grafana/plugins") [$GF_PLUGIN_DIR] ++.TP ++\fB\-\-repo\fR value ++url to the plugin repository (default: "https://grafana.com/api/plugins") [$GF_PLUGIN_REPO] ++.TP ++\fB\-\-pluginUrl\fR value ++Full url to the plugin zip file instead of downloading the plugin from grafana.com/api [$GF_PLUGIN_URL] ++.TP ++\fB\-\-insecure\fR ++Skip TLS verification (insecure) ++.TP ++\fB\-\-debug\fR, \fB\-d\fR ++enable debug logging ++.TP ++\fB\-\-help\fR, \fB\-h\fR ++show help ++.TP ++\fB\-\-version\fR, \fB\-v\fR ++print the version ++.SH "SEE ALSO" ++Additional documentation for ++.B grafana-cli ++is available on-line at ++.BR http://docs.grafana.org/administration/cli/ . ++The full documentation for ++.B Grafana ++is available on-line at ++.BR http://docs.grafana.org/ . +diff --git a/docs/man/man1/grafana-server.1 b/docs/man/man1/grafana-server.1 +new file mode 100644 +index 0000000000..30b7c1306f +--- /dev/null ++++ b/docs/man/man1/grafana-server.1 +@@ -0,0 +1,156 @@ ++.TH VERSION "1" "February 2019" "Version 5.4.3" "User Commands" ++.SH NAME ++grafana-server \- back-end server for the Grafana metrics dashboard and graph editor ++.SH DESCRIPTION ++.B grafana-server ++is the back-end server for the Grafana metrics dashboard and graph editor. ++The ++.B grafana-server ++program should not normally be run from the command line, ++except when testing or for development purposes. ++Rather it should be managed by ++.BR systemd . ++After installing Grafana, the systemd service should be enabled and started as follows: ++.P ++.in 1i ++.B systemctl daemon-reload ++.br ++.B systemctl enable grafana-server.service ++.br ++.B systemctl start grafana-server.service ++.in ++.P ++.SH OPTIONS ++The ++.B gafana-server ++configuration is specified in ++.BR /etc/grafana/grafana.ini ++and is well documented with comments. ++The command-line options listed below override options of ++the same (or similar) name in the configuration file and also provide ++additional options for testing Grafana. ++.P ++.HP ++\fB\-config\fR string ++.IP ++path to config file ++.HP ++\fB\-homepath\fR string ++.IP ++path to grafana install/home path, defaults to working directory ++.HP ++\fB\-packaging\fR string ++.IP ++describes the way Grafana was installed (default "unknown") ++.HP ++\fB\-pidfile\fR string ++.IP ++path to pid file ++.HP ++\fB\-profile\fR ++.IP ++Turn on pprof profiling ++.HP ++\fB\-profile\-port\fR int ++.IP ++Define custom port for profiling (default 6060) ++.HP ++\fB\-test\fR.bench regexp ++.IP ++run only benchmarks matching regexp ++.HP ++\fB\-test\fR.benchmem ++.IP ++print memory allocations for benchmarks ++.HP ++\fB\-test\fR.benchtime d ++.IP ++run each benchmark for duration d (default 1s) ++.HP ++\fB\-test\fR.blockprofile file ++.IP ++write a goroutine blocking profile to file ++.HP ++\fB\-test\fR.blockprofilerate rate ++.IP ++set blocking profile rate (see runtime.SetBlockProfileRate) (default 1) ++.HP ++\fB\-test\fR.count n ++.IP ++run tests and benchmarks n times (default 1) ++.HP ++\fB\-test\fR.coverprofile file ++.IP ++write a coverage profile to file ++.HP ++\fB\-test\fR.cpu list ++.IP ++comma\-separated list of cpu counts to run each test with ++.HP ++\fB\-test\fR.cpuprofile file ++.IP ++write a cpu profile to file ++.HP ++\fB\-test\fR.failfast ++.IP ++do not start new tests after the first test failure ++.HP ++\fB\-test\fR.list regexp ++.IP ++list tests, examples, and benchmarks matching regexp then exit ++.HP ++\fB\-test\fR.memprofile file ++.IP ++write a memory profile to file ++.HP ++\fB\-test\fR.memprofilerate rate ++.IP ++set memory profiling rate (see runtime.MemProfileRate) ++.HP ++\fB\-test\fR.mutexprofile string ++.IP ++write a mutex contention profile to the named file after execution ++.HP ++\fB\-test\fR.mutexprofilefraction int ++.IP ++if >= 0, calls runtime.SetMutexProfileFraction() (default 1) ++.HP ++\fB\-test\fR.outputdir dir ++.IP ++write profiles to dir ++.HP ++\fB\-test\fR.parallel n ++.IP ++run at most n tests in parallel (default 8) ++.HP ++\fB\-test\fR.run regexp ++.IP ++run only tests and examples matching regexp ++.HP ++\fB\-test\fR.short ++.IP ++run smaller test suite to save time ++.HP ++\fB\-test\fR.testlogfile file ++.IP ++write test action log to file (for use only by cmd/go) ++.HP ++\fB\-test\fR.timeout d ++.IP ++panic test binary after duration d (default 0, timeout disabled) ++.HP ++\fB\-test\fR.trace file ++.IP ++write an execution trace to file ++.HP ++\fB\-test\fR.v ++.IP ++verbose: print additional output ++.TP ++\fB\-v\fR ++prints current version and exits ++.SH "SEE ALSO" ++The full documentation for ++.B Grafana ++is available on-line at ++.BR http://docs.grafana.org/ . diff --git a/SOURCES/003-new-files.patch b/SOURCES/003-new-files.patch deleted file mode 100644 index 2cac75d..0000000 --- a/SOURCES/003-new-files.patch +++ /dev/null @@ -1,1762 +0,0 @@ -diff --git a/conf/distro-defaults.ini b/conf/distro-defaults.ini -new file mode 100644 -index 0000000000..e337ba0b57 ---- /dev/null -+++ b/conf/distro-defaults.ini -@@ -0,0 +1,685 @@ -+##################### Grafana Configuration Defaults for distros ##################### -+# -+# Do not modify this file in grafana installs -+# -+ -+# possible values : production, development -+app_mode = production -+ -+# instance name, defaults to HOSTNAME environment variable value or hostname if HOSTNAME var is empty -+instance_name = ${HOSTNAME} -+ -+#################################### Paths ############################### -+[paths] -+# Path to where grafana can store temp files, sessions, and the sqlite3 db (if that is used) -+data = /var/lib/grafana -+ -+# Temporary files in `data` directory older than given duration will be removed -+temp_data_lifetime = 24h -+ -+# Directory where grafana can store logs -+logs = /var/log/grafana -+ -+# Directory where grafana will automatically scan and look for plugins -+plugins = /var/lib/grafana/plugins -+ -+# folder that contains provisioning config files that grafana will apply on startup and while running. -+provisioning = conf/provisioning -+ -+#################################### Server ############################## -+[server] -+# Protocol (http, https, socket) -+protocol = http -+ -+# The ip address to bind to, empty will bind to all interfaces -+http_addr = -+ -+# The http port to use -+http_port = 3000 -+ -+# The public facing domain name used to access grafana from a browser -+domain = localhost -+ -+# Redirect to correct domain if host header does not match domain -+# Prevents DNS rebinding attacks -+enforce_domain = false -+ -+# The full public facing url -+root_url = %(protocol)s://%(domain)s:%(http_port)s/ -+ -+# Serve Grafana from subpath specified in `root_url` setting. By default it is set to `false` for compatibility reasons. -+serve_from_sub_path = false -+ -+# Log web requests -+router_logging = false -+ -+# the path relative working path -+static_root_path = public -+ -+# enable gzip -+enable_gzip = false -+ -+# https certs & key file -+cert_file = -+cert_key = -+ -+# Unix socket path -+socket = /tmp/grafana.sock -+ -+#################################### Database ############################ -+[database] -+# You can configure the database connection by specifying type, host, name, user and password -+# as separate properties or as on string using the url property. -+ -+# Either "mysql", "postgres" or "sqlite3", it's your choice -+type = sqlite3 -+host = 127.0.0.1:3306 -+name = grafana -+user = root -+# If the password contains # or ; you have to wrap it with triple quotes. Ex """#password;""" -+password = -+# Use either URL or the previous fields to configure the database -+# Example: mysql://user:secret@host:port/database -+url = -+ -+# Max idle conn setting default is 2 -+max_idle_conn = 2 -+ -+# Max conn setting default is 0 (mean not set) -+max_open_conn = -+ -+# Connection Max Lifetime default is 14400 (means 14400 seconds or 4 hours) -+conn_max_lifetime = 14400 -+ -+# Set to true to log the sql calls and execution times. -+log_queries = -+ -+# For "postgres", use either "disable", "require" or "verify-full" -+# For "mysql", use either "true", "false", or "skip-verify". -+ssl_mode = disable -+ -+ca_cert_path = -+client_key_path = -+client_cert_path = -+server_cert_name = -+ -+# For "sqlite3" only, path relative to data_path setting -+path = grafana.db -+ -+# For "sqlite3" only. cache mode setting used for connecting to the database -+cache_mode = private -+ -+#################################### Cache server ############################# -+[remote_cache] -+# Either "redis", "memcached" or "database" default is "database" -+type = database -+ -+# cache connectionstring options -+# database: will use Grafana primary database. -+# redis: config like redis server e.g. `addr=127.0.0.1:6379,pool_size=100,db=0`. Only addr is required. -+# memcache: 127.0.0.1:11211 -+connstr = -+ -+#################################### Data proxy ########################### -+[dataproxy] -+ -+# This enables data proxy logging, default is false -+logging = false -+ -+# How long the data proxy should wait before timing out default is 30 (seconds) -+timeout = 30 -+ -+# If enabled and user is not anonymous, data proxy will add X-Grafana-User header with username into the request, default is false. -+send_user_header = false -+ -+#################################### Analytics ########################### -+[analytics] -+# Server reporting, sends usage counters to stats.grafana.org every 24 hours. -+# No ip addresses are being tracked, only simple counters to track -+# running instances, dashboard and error counts. It is very helpful to us. -+# Change this option to false to disable reporting. -+reporting_enabled = false -+ -+# Set to false to disable all checks to https://grafana.com -+# for new versions (grafana itself and plugins), check is used -+# in some UI views to notify that grafana or plugin update exists -+# This option does not cause any auto updates, nor send any information -+# only a GET request to https://grafana.com to get latest versions -+check_for_updates = false -+ -+# Google Analytics universal tracking code, only enabled if you specify an id here -+google_analytics_ua_id = -+ -+# Google Tag Manager ID, only enabled if you specify an id here -+google_tag_manager_id = -+ -+#################################### Security ############################ -+[security] -+# default admin user, created on startup -+admin_user = admin -+ -+# default admin password, can be changed before first start of grafana, or in profile settings -+admin_password = admin -+ -+# used for signing -+secret_key = SW2YcwTIb9zpOOhoPsMm -+ -+# disable gravatar profile images -+disable_gravatar = false -+ -+# data source proxy whitelist (ip_or_domain:port separated by spaces) -+data_source_proxy_whitelist = -+ -+# disable protection against brute force login attempts -+disable_brute_force_login_protection = false -+ -+# set to true if you host Grafana behind HTTPS. default is false. -+cookie_secure = false -+ -+# set cookie SameSite attribute. defaults to `lax`. can be set to "lax", "strict" and "none" -+cookie_samesite = lax -+ -+# set to true if you want to allow browsers to render Grafana in a ,