diff --git a/001-wrappers-grafana-cli.patch b/001-wrappers-grafana-cli.patch new file mode 100644 index 0000000000000000000000000000000000000000..722d61fd65664e7a9729ec56c93566ede9e60e0d --- /dev/null +++ b/001-wrappers-grafana-cli.patch @@ -0,0 +1,49 @@ +diff --git a/packaging/wrappers/grafana-cli b/packaging/wrappers/grafana-cli +index 9cad151c0d..a786edc596 100755 +--- a/packaging/wrappers/grafana-cli ++++ b/packaging/wrappers/grafana-cli +@@ -5,18 +5,19 @@ + # the system-wide Grafana configuration that was bundled with the package as we + # use the binary. + +-DEFAULT=/etc/default/grafana ++DEFAULT=/etc/sysconfig/grafana-server + + GRAFANA_HOME=/usr/share/grafana + CONF_DIR=/etc/grafana + DATA_DIR=/var/lib/grafana + PLUGINS_DIR=/var/lib/grafana/plugins + LOG_DIR=/var/log/grafana ++LIBEXEC_DIR=/usr/libexec/grafana + + CONF_FILE=$CONF_DIR/grafana.ini + PROVISIONING_CFG_DIR=$CONF_DIR/provisioning + +-EXECUTABLE=$GRAFANA_HOME/bin/grafana-cli ++EXECUTABLE=$LIBEXEC_DIR/grafana-cli + + if [ ! -x $EXECUTABLE ]; then + echo "Program not installed or not executable" +@@ -24,6 +25,7 @@ if [ ! -x $EXECUTABLE ]; then + fi + + # overwrite settings from default file ++#shellcheck disable=SC1090 + if [ -f "$DEFAULT" ]; then + . "$DEFAULT" + fi +@@ -36,4 +38,13 @@ OPTS="--homepath=${GRAFANA_HOME} \ + cfg:default.paths.logs=${LOG_DIR} \ + cfg:default.paths.plugins=${PLUGINS_DIR}'" + +-eval $EXECUTABLE "$OPTS" "$@" ++if [ "$(id -u)" -eq 0 ]; then ++ cd "${GRAFANA_HOME}" ++ exec runuser -u "${GRAFANA_USER}" -- "$EXECUTABLE" "$OPTS" "$@" ++elif [ "$(id -u -n)" = "${GRAFANA_USER}" ]; then ++ cd "${GRAFANA_HOME}" ++ exec "$EXECUTABLE" "$OPTS" "$@" ++else ++ echo "Please run this script as user \"${GRAFANA_USER}\" or root." ++ exit 5 ++fi diff --git a/002-manpages.patch b/002-manpages.patch new file mode 100644 index 0000000000000000000000000000000000000000..fa82dc4499fc7938e8c249bd08f9d9e447bace16 --- /dev/null +++ b/002-manpages.patch @@ -0,0 +1,156 @@ +diff --git a/docs/man/man1/grafana-cli.1 b/docs/man/man1/grafana-cli.1 +new file mode 100644 +index 0000000000..7ac2af882c +--- /dev/null ++++ b/docs/man/man1/grafana-cli.1 +@@ -0,0 +1,60 @@ ++.TH GRAFANA "1" "December 2020" "Grafana cli version 7.3.6" "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\-\-configOverrides\fR value ++Configuration options to override defaults as a string. e.g. cfg:default.paths.log=/dev/null ++.TP ++\fB\-\-homepath\fR value ++Path to Grafana install/home path, defaults to working directory ++.TP ++\fB\-\-config\fR value ++Path to config file ++.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..c616268b31 +--- /dev/null ++++ b/docs/man/man1/grafana-server.1 +@@ -0,0 +1,84 @@ ++.TH VERSION "1" "December 2020" "Version 7.3.6" "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. ++.P ++.HP ++\fB\-config\fR string ++.IP ++path to config file ++.HP ++\fB\-convey-json\fR ++.IP ++When true, emits results in JSON blocks. Default: 'false' ++.HP ++\fB\-convey-silent\fR ++.IP ++When true, all output from GoConvey is suppressed. ++.HP ++\fB\-convey-story\fR ++.IP ++When true, emits story output, otherwise emits dot output. When not provided, this flag mirrors the value of the '-test.v' flag ++.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 uint ++.IP ++Define custom port for profiling (default 6060) ++.HP ++\fB\-tracing\fR ++.IP ++Turn on tracing ++.HP ++\fB\-tracing\-file\fR string ++.IP ++Define tracing output file (default "trace.out") ++.TP ++\fB\-v\fR ++.IP ++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/003-remove-dashboard-abspath-test.patch b/003-remove-dashboard-abspath-test.patch new file mode 100644 index 0000000000000000000000000000000000000000..2076441eeb5c56a2d7d89c7af4e6a79ad0d85d34 --- /dev/null +++ b/003-remove-dashboard-abspath-test.patch @@ -0,0 +1,41 @@ +diff --git a/pkg/services/provisioning/dashboards/file_reader_linux_test.go b/pkg/services/provisioning/dashboards/file_reader_linux_test.go +index 3584bbc242..3d37f5e104 100644 +--- a/pkg/services/provisioning/dashboards/file_reader_linux_test.go ++++ b/pkg/services/provisioning/dashboards/file_reader_linux_test.go +@@ -33,6 +33,11 @@ func TestProvisionedSymlinkedFolder(t *testing.T) { + t.Errorf("expected err to be nil") + } + ++ want, err = filepath.EvalSymlinks(want) ++ if err != nil { ++ t.Errorf("expected err to be nil %v", err) ++ } ++ + resolvedPath := reader.resolvedPath() + if resolvedPath != want { + t.Errorf("got %s want %s", resolvedPath, want) +diff --git a/pkg/services/provisioning/dashboards/file_reader_test.go b/pkg/services/provisioning/dashboards/file_reader_test.go +index 33fe6a0a68..2c67ebb677 100644 +--- a/pkg/services/provisioning/dashboards/file_reader_test.go ++++ b/pkg/services/provisioning/dashboards/file_reader_test.go +@@ -340,20 +340,6 @@ func TestDashboardFileReader(t *testing.T) { + So(err, ShouldBeNil) + + So(len(fakeService.provisioned["Default"]), ShouldEqual, 1) +- So(fakeService.provisioned["Default"][0].ExternalId, ShouldEqual, absPath1) +- }) +- +- Convey("Missing dashboard should be deleted if DisableDeletion = false", func() { +- reader, err := NewDashboardFileReader(cfg, logger) +- So(err, ShouldBeNil) +- +- err = reader.startWalkingDisk() +- So(err, ShouldBeNil) +- +- So(len(fakeService.provisioned["Default"]), ShouldEqual, 1) +- So(fakeService.provisioned["Default"][0].ExternalId, ShouldEqual, absPath1) +- So(len(fakeService.inserted), ShouldEqual, 1) +- So(fakeService.inserted[0].Dashboard.Id, ShouldEqual, 1) + }) + }) + diff --git a/004-pin-yarn-version.patch b/004-pin-yarn-version.patch new file mode 100644 index 0000000000000000000000000000000000000000..a7dc34da54750a2b942e08d62eafde914bd4384d --- /dev/null +++ b/004-pin-yarn-version.patch @@ -0,0 +1,13 @@ +diff --git a/package.json b/package.json +index ce11ba6de8..a3210762ed 100644 +--- a/package.json ++++ b/package.json +@@ -314,6 +314,7 @@ + "node": ">=12 <13" + }, + "volta": { +- "node": "12.19.0" ++ "node": "12.19.0", ++ "yarn": "1.22.10" + } + } diff --git a/005-remove-saml-dependency.patch b/005-remove-saml-dependency.patch new file mode 100644 index 0000000000000000000000000000000000000000..d164b3342653646236b42693824d741824d4567e --- /dev/null +++ b/005-remove-saml-dependency.patch @@ -0,0 +1,39 @@ +diff --git a/go.mod b/go.mod +index bb073996ac..c1b6c3219c 100644 +--- a/go.mod ++++ b/go.mod +@@ -19,7 +19,6 @@ require ( + github.com/benbjohnson/clock v0.0.0-20161215174838-7dc76406b6d3 + github.com/bradfitz/gomemcache v0.0.0-20190913173617-a41fca850d0b + github.com/centrifugal/centrifuge v0.11.0 +- github.com/crewjam/saml v0.4.4-0.20201214083806-0dd2422c212e + github.com/davecgh/go-spew v1.1.1 + github.com/denisenkom/go-mssqldb v0.0.0-20200620013148-b91950f658ec + github.com/facebookgo/ensure v0.0.0-20160127193407-b4ab57deab51 // indirect +diff --git a/go.sum b/go.sum +index c79d983b88..f45fa68f41 100644 +--- a/go.sum ++++ b/go.sum +@@ -228,10 +228,6 @@ github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d h1:U+s90UTSY + github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= + github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= + github.com/crewjam/httperr v0.0.0-20190612203328-a946449404da/go.mod h1:+rmNIXRvYMqLQeR4DHyTvs6y0MEMymTz4vyFpFkKTPs= +-github.com/crewjam/saml v0.4.1 h1:ZNSRJvdbypQDY2uApMngeIHNcxS6UCRAgiw3S+pmgRU= +-github.com/crewjam/saml v0.4.1/go.mod h1:vHcshzXm2WkPOV1dcToZa99cCB1h3nPiKLtLYK+erBE= +-github.com/crewjam/saml v0.4.4-0.20201214083806-0dd2422c212e h1:CFIpybPh+vrxRD6R3t2BCV9hdtlOQudsj1vB1ECXOo4= +-github.com/crewjam/saml v0.4.4-0.20201214083806-0dd2422c212e/go.mod h1:qCJQpUtZte9R1ZjUBcW8qtCNlinbO363ooNl02S68bk= + github.com/cupcake/rdb v0.0.0-20161107195141-43ba34106c76/go.mod h1:vYwsqCOLxGiisLwp9rITslkFNpZD5rz43tf41QFkTWY= + github.com/cyberdelia/templates v0.0.0-20141128023046-ca7fffd4298c/go.mod h1:GyV+0YP4qX0UQ7r2MoYZ+AvYDp12OF5yg4q8rGnyNh4= + github.com/cznic/b v0.0.0-20180115125044-35e9bbe41f07/go.mod h1:URriBxXwVq5ijiJ12C7iIZqlA69nTlI+LgI6/pwftG8= +diff --git a/pkg/extensions/main.go b/pkg/extensions/main.go +index 337f6566f8..b15c3f907b 100644 +--- a/pkg/extensions/main.go ++++ b/pkg/extensions/main.go +@@ -5,7 +5,6 @@ import ( + // remove the cron (v1) dependency + + _ "github.com/beevik/etree" +- _ "github.com/crewjam/saml" + _ "github.com/gobwas/glob" + "github.com/grafana/grafana/pkg/registry" + "github.com/grafana/grafana/pkg/services/licensing" diff --git a/distro-defaults.ini b/distro-defaults.ini index b982480390a4748b19f2147e5ec6582a4a85765b..d925297f43aa432f20852e9fb9a9c741a9648814 100644 --- a/distro-defaults.ini +++ b/distro-defaults.ini @@ -1,4 +1,4 @@ -##################### Grafana Configuration Defaults for distros ##################### +##################### Grafana Configuration Defaults ##################### # # Do not modify this file in grafana installs # @@ -24,7 +24,7 @@ logs = /var/log/grafana plugins = /var/lib/grafana/plugins # folder that contains provisioning config files that grafana will apply on startup and while running. -provisioning = conf/provisioning +provisioning = /etc/grafana/provisioning #################################### Server ############################## [server] @@ -126,10 +126,29 @@ connstr = # This enables data proxy logging, default is false logging = false -# How long the data proxy should wait before timing out default is 30 (seconds) +# How long the data proxy waits before timing out, default is 30 seconds. +# This setting also applies to core backend HTTP data sources where query requests use an HTTP client with timeout set. 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. +# How many seconds the data proxy waits before sending a keepalive request. +keep_alive_seconds = 30 + +# How many seconds the data proxy waits for a successful TLS Handshake before timing out. +tls_handshake_timeout_seconds = 10 + +# How many seconds the data proxy will wait for a server's first response headers after +# fully writing the request headers if the request has an "Expect: 100-continue" +# header. A value of 0 will result in the body being sent immediately, without +# waiting for the server to approve. +expect_continue_timeout_seconds = 1 + +# The maximum number of idle connections that Grafana will keep alive. +max_idle_connections = 100 + +# How many seconds the data proxy keeps an idle connection open before timing out. +idle_conn_timeout_seconds = 90 + +# If enabled and user is not anonymous, data proxy will add X-Grafana-User header with username into the request. send_user_header = false #################################### Analytics ########################### @@ -188,7 +207,6 @@ allow_embedding = false # Set to true if you want to enable http strict transport security (HSTS) response header. # This is only sent when HTTPS is enabled in this configuration. # HSTS tells browsers that the site should only be accessed using HTTPS. -# The default will change to true in the next minor release, 6.3. strict_transport_security = false # Sets how long a browser should cache HSTS. Only applied if strict_transport_security is enabled. @@ -202,12 +220,12 @@ strict_transport_security_subdomains = false # Set to true to enable the X-Content-Type-Options response header. # The X-Content-Type-Options response HTTP header is a marker used by the server to indicate that the MIME types advertised -# in the Content-Type headers should not be changed and be followed. The default will change to true in the next minor release, 6.3. -x_content_type_options = false +# in the Content-Type headers should not be changed and be followed. +x_content_type_options = true # Set to true to enable the X-XSS-Protection header, which tells browsers to stop pages from loading -# when they detect reflected cross-site scripting (XSS) attacks. The default will change to true in the next minor release, 6.3. -x_xss_protection = false +# when they detect reflected cross-site scripting (XSS) attacks. +x_xss_protection = true #################################### Snapshots ########################### @@ -230,9 +248,12 @@ snapshot_remove_expired = true # Number dashboard versions to keep (per dashboard). Default: 20, Minimum: 1 versions_to_keep = 20 -# Minimum dashboard refresh interval. When set, this will restrict users to set the refresh interval of a dashboard lower than given interval. Per default this is not set/unrestricted. +# Minimum dashboard refresh interval. When set, this will restrict users to set the refresh interval of a dashboard lower than given interval. Per default this is 5 seconds. # The interval string is a possibly signed sequence of decimal numbers, followed by a unit suffix (ms, s, m, h, d), e.g. 30s or 1m. -min_refresh_interval = +min_refresh_interval = 1s + +# Path to the default home dashboard. If this value is empty, then Grafana uses StaticRootPath + "dashboards/home.json" +default_home_dashboard_path = #################################### Users ############################### [users] @@ -272,15 +293,18 @@ viewers_can_edit = false # Editors can administrate dashboard, folders and teams they create editors_can_admin = false +# The duration in time a user invitation remains valid before expiring. This setting should be expressed as a duration. Examples: 6h (hours), 2d (days), 1w (week). Default is 24h (24 hours). The minimum supported duration is 15m (15 minutes). +user_invite_max_lifetime_duration = 24h + [auth] # Login cookie name login_cookie_name = grafana_session -# The lifetime (days) an authenticated user can be inactive before being required to login at next visit. Default is 7 days. -login_maximum_inactive_lifetime_days = 7 +# The maximum lifetime (duration) an authenticated user can be inactive before being required to login at next visit. Default is 7 days (7d). This setting should be expressed as a duration, e.g. 5m (minutes), 6h (hours), 10d (days), 2w (weeks), 1M (month). The lifetime resets at each successful token rotation (token_rotation_interval_minutes). +login_maximum_inactive_lifetime_duration = -# The maximum lifetime (days) an authenticated user can be logged in since login time before being required to login. Default is 30 days. -login_maximum_lifetime_days = 30 +# The maximum lifetime (duration) an authenticated user can be logged in since login time before being required to login. Default is 30 days (30d). This setting should be expressed as a duration, e.g. 5m (minutes), 6h (hours), 10d (days), 2w (weeks), 1M (month). +login_maximum_lifetime_duration = # How often should auth tokens be rotated for authenticated users when being active. The default is each 10 minutes. token_rotation_interval_minutes = 10 @@ -298,9 +322,15 @@ signout_redirect_url = # This setting is ignored if multiple OAuth providers are configured. oauth_auto_login = false +# OAuth state max age cookie duration in seconds. Defaults to 600 seconds. +oauth_state_cookie_max_age = 600 + # limit of api_key seconds to live before expiration api_key_max_seconds_to_live = -1 +# Set to true to enable SigV4 authentication option for HTTP-based datasources +sigv4_auth_enabled = false + #################################### Anonymous Auth ###################### [auth.anonymous] # enable anonymous access @@ -312,12 +342,15 @@ org_name = Main Org. # specify role for unauthenticated users org_role = Viewer -#################################### Github Auth ######################### +# mask the Grafana version number for unauthenticated users +hide_version = false + +#################################### GitHub Auth ######################### [auth.github] enabled = false allow_sign_up = true client_id = some_id -client_secret = some_secret +client_secret = scopes = user:email,read:org auth_url = https://github.com/login/oauth/authorize token_url = https://github.com/login/oauth/access_token @@ -331,7 +364,7 @@ allowed_organizations = enabled = false allow_sign_up = true client_id = some_id -client_secret = some_secret +client_secret = scopes = api auth_url = https://gitlab.com/oauth/authorize token_url = https://gitlab.com/oauth/token @@ -344,7 +377,7 @@ allowed_groups = enabled = false allow_sign_up = true client_id = some_client_id -client_secret = some_client_secret +client_secret = scopes = https://www.googleapis.com/auth/userinfo.profile https://www.googleapis.com/auth/userinfo.email auth_url = https://accounts.google.com/o/oauth2/auth token_url = https://accounts.google.com/o/oauth2/token @@ -358,7 +391,7 @@ hosted_domain = enabled = false allow_sign_up = true client_id = some_id -client_secret = some_secret +client_secret = scopes = user:email allowed_organizations = @@ -366,7 +399,7 @@ allowed_organizations = enabled = false allow_sign_up = true client_id = some_id -client_secret = some_secret +client_secret = scopes = user:email allowed_organizations = @@ -376,24 +409,41 @@ name = Azure AD enabled = false allow_sign_up = true client_id = some_client_id -client_secret = some_client_secret +client_secret = scopes = openid email profile auth_url = https://login.microsoftonline.com//oauth2/v2.0/authorize token_url = https://login.microsoftonline.com//oauth2/v2.0/token allowed_domains = allowed_groups = +#################################### Okta OAuth ####################### +[auth.okta] +name = Okta +enabled = false +allow_sign_up = true +client_id = some_id +client_secret = +scopes = openid profile email groups +auth_url = https://.okta.com/oauth2/v1/authorize +token_url = https://.okta.com/oauth2/v1/token +api_url = https://.okta.com/oauth2/v1/userinfo +allowed_domains = +allowed_groups = +role_attribute_path = + #################################### Generic OAuth ####################### [auth.generic_oauth] name = OAuth enabled = false allow_sign_up = true client_id = some_id -client_secret = some_secret +client_secret = scopes = user:email email_attribute_name = email:primary email_attribute_path = +login_attribute_path = role_attribute_path = +id_token_attribute_name = auth_url = token_url = api_url = @@ -405,47 +455,6 @@ tls_client_cert = tls_client_key = tls_client_ca = -#################################### SAML Auth ########################### -[auth.saml] # Enterprise only -# Defaults to false. If true, the feature is enabled -enabled = false - -# Base64-encoded public X.509 certificate. Used to sign requests to the IdP -certificate = - -# Path to the public X.509 certificate. Used to sign requests to the IdP -certificate_path = - -# Base64-encoded private key. Used to decrypt assertions from the IdP -private_key = - -# Path to the private key. Used to decrypt assertions from the IdP -private_key_path = - -# Base64-encoded IdP SAML metadata XML. Used to verify and obtain binding locations from the IdP -idp_metadata = - -# Path to the SAML metadata XML. Used to verify and obtain binding locations from the IdP -idp_metadata_path = - -# URL to fetch SAML IdP metadata. Used to verify and obtain binding locations from the IdP -idp_metadata_url = - -# Duration, since the IdP issued a response and the SP is allowed to process it. Defaults to 90 seconds -max_issue_delay = 90s - -# Duration, for how long the SP's metadata should be valid. Defaults to 48 hours -metadata_valid_duration = 48h - -# Friendly name or name of the attribute within the SAML assertion to use as the user's name -assertion_attribute_name = displayName - -# Friendly name or name of the attribute within the SAML assertion to use as the user's login handle -assertion_attribute_login = mail - -# Friendly name or name of the attribute within the SAML assertion to use as the user's email -assertion_attribute_email = mail - #################################### Basic Auth ########################## [auth.basic] enabled = true @@ -472,7 +481,7 @@ allow_sign_up = true # LDAP backround sync (Enterprise only) # At 1 am every day sync_cron = "0 0 1 * * *" -active_sync_enabled = false +active_sync_enabled = true #################################### SMTP / Emailing ##################### [smtp] @@ -487,6 +496,7 @@ skip_verify = false from_address = admin@grafana.localhost from_name = Grafana ehlo_identity = +startTLS_policy = [emails] welcome_email_on_sign_up = false @@ -613,6 +623,36 @@ max_attempts = 3 # Makes it possible to enforce a minimal interval between evaluations, to reduce load on the backend min_interval_seconds = 1 +# Configures for how long alert annotations are stored. Default is 0, which keeps them forever. +# This setting should be expressed as an duration. Ex 6h (hours), 10d (days), 2w (weeks), 1M (month). +max_annotation_age = + +# Configures max number of alert annotations that Grafana stores. Default value is 0, which keeps all alert annotations. +max_annotations_to_keep = + +#################################### Annotations ######################### + +[annotations.dashboard] +# Dashboard annotations means that annotations are associated with the dashboard they are created on. + +# Configures how long dashboard annotations are stored. Default is 0, which keeps them forever. +# This setting should be expressed as a duration. Examples: 6h (hours), 10d (days), 2w (weeks), 1M (month). +max_age = + +# Configures max number of dashboard annotations that Grafana stores. Default value is 0, which keeps all dashboard annotations. +max_annotations_to_keep = + +[annotations.api] +# API annotations means that the annotations have been created using the API without any +# association with a dashboard. + +# Configures how long Grafana stores API annotations. Default is 0, which keeps them forever. +# This setting should be expressed as a duration. Examples: 6h (hours), 10d (days), 2w (weeks), 1M (month). +max_age = + +# Configures max number of API annotations that Grafana keeps. Default value is 0, which keeps all API annotations. +max_annotations_to_keep = + #################################### Explore ############################# [explore] # Enable the Explore section @@ -630,6 +670,12 @@ disable_total_stats = false basic_auth_username = basic_auth_password = +# Metrics environment info adds dimensions to the `grafana_environment_info` metric, which +# can expose more information about the Grafana instance. +[metrics.environment_info] +#exampleLabel1 = exampleValue1 +#exampleLabel2 = exampleValue2 + # Send internal Grafana metrics to graphite [metrics.graphite] # Enable by setting the address setting (ex localhost:2003) @@ -659,6 +705,8 @@ sampler_type = const # and indicates the initial sampling rate before the actual one # is received from the mothership sampler_param = 1 +# sampling_server_url is the URL of a sampling manager providing a sampling strategy. +sampling_server_url = # Whether or not to use Zipkin span propagation (x-b3- HTTP headers). zipkin_propagation = false # Setting this to true disables shared RPC spans. @@ -691,6 +739,8 @@ public_url = key_file = bucket = path = +enable_signed_urls = false +signed_url_expiration = [external_image_storage.azure_blob] account_name = @@ -706,6 +756,9 @@ container_name = server_url = # If the remote HTTP image renderer service runs on a different server than the Grafana server you may have to configure this to a URL where Grafana is reachable, e.g. http://grafana.domain/. callback_url = +# Concurrent render request limit affects when the /render HTTP endpoint is used. Rendering many images at the same time can overload the server, +# which this setting can help protect against by only allowing a certain amount of concurrent requests. +concurrent_render_request_limit = 30 [panels] # here for to support old env variables, can remove after a few months @@ -715,6 +768,69 @@ disable_sanitize_html = false [plugins] enable_alpha = false app_tls_skip_verify_insecure = false +# Enter a comma-separated list of plugin identifiers to identify plugins that are allowed to be loaded even if they lack a valid signature. +allow_loading_unsigned_plugins = pcp-redis-datasource +marketplace_url = https://grafana.com/grafana/plugins/ + +#################################### Grafana Image Renderer Plugin ########################## +[plugin.grafana-image-renderer] +# Instruct headless browser instance to use a default timezone when not provided by Grafana, e.g. when rendering panel image of alert. +# See ICU’s metaZones.txt (https://cs.chromium.org/chromium/src/third_party/icu/source/data/misc/metaZones.txt) for a list of supported +# timezone IDs. Fallbacks to TZ environment variable if not set. +rendering_timezone = + +# Instruct headless browser instance to use a default language when not provided by Grafana, e.g. when rendering panel image of alert. +# Please refer to the HTTP header Accept-Language to understand how to format this value, e.g. 'fr-CH, fr;q=0.9, en;q=0.8, de;q=0.7, *;q=0.5'. +rendering_language = + +# Instruct headless browser instance to use a default device scale factor when not provided by Grafana, e.g. when rendering panel image of alert. +# Default is 1. Using a higher value will produce more detailed images (higher DPI), but will require more disk space to store an image. +rendering_viewport_device_scale_factor = + +# Instruct headless browser instance whether to ignore HTTPS errors during navigation. Per default HTTPS errors are not ignored. Due to +# the security risk it's not recommended to ignore HTTPS errors. +rendering_ignore_https_errors = + +# Instruct headless browser instance whether to capture and log verbose information when rendering an image. Default is false and will +# only capture and log error messages. When enabled, debug messages are captured and logged as well. +# For the verbose information to be included in the Grafana server log you have to adjust the rendering log level to debug, configure +# [log].filter = rendering:debug. +rendering_verbose_logging = + +# Instruct headless browser instance whether to output its debug and error messages into running process of remote rendering service. +# Default is false. This can be useful to enable (true) when troubleshooting. +rendering_dumpio = + +# Additional arguments to pass to the headless browser instance. Default is --no-sandbox. The list of Chromium flags can be found +# here (https://peter.sh/experiments/chromium-command-line-switches/). Multiple arguments is separated with comma-character. +rendering_args = + +# You can configure the plugin to use a different browser binary instead of the pre-packaged version of Chromium. +# Please note that this is not recommended, since you may encounter problems if the installed version of Chrome/Chromium is not +# compatible with the plugin. +rendering_chrome_bin = + +# Instruct how headless browser instances are created. Default is 'default' and will create a new browser instance on each request. +# Mode 'clustered' will make sure that only a maximum of browsers/incognito pages can execute concurrently. +# Mode 'reusable' will have one browser instance and will create a new incognito page on each request. +rendering_mode = + +# When rendering_mode = clustered you can instruct how many browsers or incognito pages can execute concurrently. Default is 'browser' +# and will cluster using browser instances. +# Mode 'context' will cluster using incognito pages. +rendering_clustering_mode = +# When rendering_mode = clustered you can define maximum number of browser instances/incognito pages that can execute concurrently.. +rendering_clustering_max_concurrency = + +# Limit the maximum viewport width, height and device scale factor that can be requested. +rendering_viewport_max_width = +rendering_viewport_max_height = +rendering_viewport_max_device_scale_factor = + +# Change the listening host and port of the gRPC server. Default host is 127.0.0.1 and default port is 0 and will automatically assign +# a port not in use. +grpc_host = +grpc_port = [enterprise] license_path = @@ -722,3 +838,23 @@ license_path = [feature_toggles] # enable features, separated by spaces enable = + +[date_formats] +# For information on what formatting patterns that are supported https://momentjs.com/docs/#/displaying/ + +# Default system date format used in time range picker and other places where full time is displayed +full_date = YYYY-MM-DD HH:mm:ss + +# Used by graph and other places where we only show small intervals +interval_second = HH:mm:ss +interval_minute = HH:mm +interval_hour = MM/DD HH:mm +interval_day = MM/DD +interval_month = YYYY-MM +interval_year = YYYY + +# Experimental feature +use_browser_locale = false + +# Default timezone for user preferences. Options are 'browser' for the browser local timezone or a timezone name from IANA Time Zone database, e.g. 'UTC' or 'Europe/Amsterdam' etc. +default_timezone = browser diff --git a/grafana_webpack-6.7.4.tar.gz b/grafana-7.3.6.tar.gz similarity index 51% rename from grafana_webpack-6.7.4.tar.gz rename to grafana-7.3.6.tar.gz index 152f3457a9a89b2e90e180b57b08190ddcfc2736..8a5e5b02185d607ee620a9a36b8ed010f0ce3858 100644 Binary files a/grafana_webpack-6.7.4.tar.gz and b/grafana-7.3.6.tar.gz differ diff --git a/grafana-vendor-7.3.6.tar.xz b/grafana-vendor-7.3.6.tar.xz new file mode 100644 index 0000000000000000000000000000000000000000..2118f6b55f1c11d61117e6df3b986703c48a4eb1 Binary files /dev/null and b/grafana-vendor-7.3.6.tar.xz differ diff --git a/grafana-6.7.4.tar.gz b/grafana-webpack-7.3.6.tar.gz similarity index 61% rename from grafana-6.7.4.tar.gz rename to grafana-webpack-7.3.6.tar.gz index 917a299244c143be4d47f58249c2f0370de39299..b47c28a634194b8866692a35391b8f5b4010df0c 100644 Binary files a/grafana-6.7.4.tar.gz and b/grafana-webpack-7.3.6.tar.gz differ diff --git a/grafana.spec b/grafana.spec index 4b8cc8c54c742a6872b8bdcc8fac66f3383b13fa..af8d0647a7f3f5fd32166aea97743c8fa351fb93 100644 --- a/grafana.spec +++ b/grafana.spec @@ -1,48 +1,39 @@ -%global grafana_arches %{lua: go_arches = {} - for arch in rpm.expand("%{go_arches}"):gmatch("%S+") do - go_arches[arch] = 1 - end - for arch in rpm.expand("%{nodejs_arches}"):gmatch("%S+") do - if go_arches[arch] then - print(arch .. " ") - end -end} - -# Unbundle Grafana vendor sources and instead use BuildRequires -# on platforms that have enough golang devel support. +%if ! 0%{?gobuild:1} +%define gobuild(o:) GO111MODULE=off go build -buildmode pie -compiler gc -tags="rpm_crashtraceback ${BUILDTAGS:-}" -ldflags "${LDFLAGS:-} -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \\n') -extldflags '-Wl,-z,relro -Wl,-z,now -specs=/usr/lib/rpm/generic-hardened-ld '" -a -v -x %{?**}; +%endif +%if ! 0%{?gotest:1} +%define gotest() GO111MODULE=off go test -buildmode pie -compiler gc -ldflags "${LDFLAGS:-} -extldflags '-Wl,-z,relro -Wl,-z,now -specs=/usr/lib/rpm/generic-hardened-ld '" %{?**}; +%endif Name: grafana -Version: 6.7.4 -Release: 1%{?dist} +Version: 7.3.6 +Release: 1 Summary: Metrics dashboard and graph editor -License: ASL 2.0 +License: Apache 2.0 URL: https://grafana.org - # Source0 contains the tagged upstream sources Source0: https://github.com/grafana/grafana/archive/v%{version}/%{name}-%{version}.tar.gz - -# Source1 contains the front-end javascript modules bundled into a webpack -Source1: grafana_webpack-%{version}.tar.gz - -# Source2 contains Grafana configuration defaults for distributions -Source2: distro-defaults.ini - -# Source3 is the script to create the webpack from grafana sources -Source3: make_grafana_webpack.sh - -# Source4 is the script to generate the list of Go build dependencies: -Source4: list_go_buildrequires.sh - -# Source5 is the script to generate the list of bundled nodejs packages -Source5: list_bundled_nodejs_packages.py - -# Intersection of go_arches and nodejs_arches -ExclusiveArch: aarch64 x86_64 +# Source1 contains the bundled Go and Node.js dependencies +Source1: grafana-vendor-%{version}.tar.xz +# Source2 contains the precompiled frontend +Source2: grafana-webpack-%{version}.tar.gz +# Source3 contains Grafana configuration defaults for distributions +Source3: distro-defaults.ini + +# Patches +Patch1: 001-wrappers-grafana-cli.patch +Patch2: 002-manpages.patch +# remove failing assertions due to a symlink +# BUILD/src/github.com/grafana/grafana -> BUILD/grafana-X.Y.Z +Patch3: 003-remove-dashboard-abspath-test.patch +Patch4: 004-pin-yarn-version.patch +Patch5: 005-remove-saml-dependency.patch + +BuildRequires: git, systemd, golang # omit golang debugsource, see BZ995136 and related %global dwz_low_mem_die_limit 0 %global _debugsource_template %{nil} - %global GRAFANA_USER %{name} %global GRAFANA_GROUP %{name} %global GRAFANA_HOME %{_datadir}/%{name} @@ -51,241 +42,398 @@ ExclusiveArch: aarch64 x86_64 %{?systemd_requires} Requires(pre): shadow-utils -BuildRequires: git, systemd, golang - - -# Declare all nodejs modules bundled in the webpack - this is for security -# purposes so if nodejs-foo ever needs an update, affected packages can be -# easily identified. -# Note: generated with the list_bundled_nodejs_packages.sh script (see README.md) -Provides: bundled(nodejs-@braintree/sanitize-url) = 4.0.0 -Provides: bundled(nodejs-@grafana/slate-react) = 0.22.9-grafana -Provides: bundled(nodejs-@reduxjs/toolkit) = 1.2.1 -Provides: bundled(nodejs-@torkelo/react-select) = 3.0.8 -Provides: bundled(nodejs-@types/md5) = 2.1.33 -Provides: bundled(nodejs-@types/react-loadable) = 5.5.2 -Provides: bundled(nodejs-@types/react-virtualized-auto-sizer) = 1.0.0 -Provides: bundled(nodejs-@types/uuid) = 3.4.7 -Provides: bundled(nodejs-abortcontroller-polyfill) = 1.4.0 -Provides: bundled(nodejs-angular) = 1.6.9 -Provides: bundled(nodejs-angular-bindonce) = 0.3.1 -Provides: bundled(nodejs-angular-native-dragdrop) = 1.2.2 -Provides: bundled(nodejs-angular-route) = 1.6.6 -Provides: bundled(nodejs-angular-sanitize) = 1.6.6 -Provides: bundled(nodejs-baron) = 3.0.3 -Provides: bundled(nodejs-brace) = 0.10.0 -Provides: bundled(nodejs-calculate-size) = 1.1.1 -Provides: bundled(nodejs-classnames) = 2.2.6 -Provides: bundled(nodejs-clipboard) = 2.0.4 -Provides: bundled(nodejs-core-js) = 1.2.7 -Provides: bundled(nodejs-d3) = 5.15.0 -Provides: bundled(nodejs-d3-scale-chromatic) = 1.5.0 -Provides: bundled(nodejs-emotion) = 10.0.27 -Provides: bundled(nodejs-eventemitter3) = 2.0.3 -Provides: bundled(nodejs-fast-text-encoding) = 1.0.0 -Provides: bundled(nodejs-file-saver) = 1.3.8 -Provides: bundled(nodejs-hoist-non-react-statics) = 3.3.0 -Provides: bundled(nodejs-immutable) = 3.8.2 -Provides: bundled(nodejs-is-hotkey) = 0.1.4 -Provides: bundled(nodejs-jquery) = 3.4.1 -Provides: bundled(nodejs-lodash) = 3.10.1 -Provides: bundled(nodejs-lru-cache) = 4.1.5 -Provides: bundled(nodejs-marked) = 0.3.19 -Provides: bundled(nodejs-md5) = 2.2.1 -Provides: bundled(nodejs-memoize-one) = 4.1.0 -Provides: bundled(nodejs-moment) = 2.24.0 -Provides: bundled(nodejs-mousetrap) = 1.6.3 -Provides: bundled(nodejs-mousetrap-global-bind) = 1.1.0 -Provides: bundled(nodejs-nodemon) = 1.18.10 -Provides: bundled(nodejs-papaparse) = 4.6.3 -Provides: bundled(nodejs-prismjs) = 1.16.0 -Provides: bundled(nodejs-prop-types) = 15.7.2 -Provides: bundled(nodejs-rc-cascader) = 0.17.5 -Provides: bundled(nodejs-re-resizable) = 6.2.0 -Provides: bundled(nodejs-react) = 16.10.2 -Provides: bundled(nodejs-react-dom) = 16.10.2 -Provides: bundled(nodejs-react-grid-layout) = 0.17.1 -Provides: bundled(nodejs-react-highlight-words) = 0.11.0 -Provides: bundled(nodejs-react-loadable) = 5.5.0 -Provides: bundled(nodejs-react-popper) = 1.3.3 -Provides: bundled(nodejs-react-redux) = 7.1.1 -Provides: bundled(nodejs-react-sizeme) = 2.5.2 -Provides: bundled(nodejs-react-split-pane) = 0.1.89 -Provides: bundled(nodejs-react-transition-group) = 2.6.1 -Provides: bundled(nodejs-react-use) = 12.8.0 -Provides: bundled(nodejs-react-virtualized-auto-sizer) = 1.0.2 -Provides: bundled(nodejs-react-window) = 1.7.1 -Provides: bundled(nodejs-redux) = 3.7.2 -Provides: bundled(nodejs-redux-logger) = 3.0.6 -Provides: bundled(nodejs-redux-thunk) = 2.3.0 -Provides: bundled(nodejs-regenerator-runtime) = 0.11.1 -Provides: bundled(nodejs-reselect) = 4.0.0 -Provides: bundled(nodejs-rst2html) = 1.0.4 -Provides: bundled(nodejs-rxjs) = 5.5.12 -Provides: bundled(nodejs-search-query-parser) = 1.5.2 -Provides: bundled(nodejs-slate) = 0.47.8 -Provides: bundled(nodejs-slate-plain-serializer) = 0.7.10 -Provides: bundled(nodejs-tether) = 1.4.5 -Provides: bundled(nodejs-tether-drop) = 1.5.0 -Provides: bundled(nodejs-tinycolor2) = 1.4.1 -Provides: bundled(nodejs-tti-polyfill) = 0.2.2 -Provides: bundled(nodejs-uuid) = 3.3.3 -Provides: bundled(nodejs-whatwg-fetch) = 3.0.0 -Provides: bundled(nodejs-xss) = 1.0.3 - +Obsoletes: grafana-cloudwatch < 7.3.6-1 +Obsoletes: grafana-elasticsearch < 7.3.6-1 +Obsoletes: grafana-azure-monitor < 7.3.6-1 +Obsoletes: grafana-graphite < 7.3.6-1 +Obsoletes: grafana-influxdb < 7.3.6-1 +Obsoletes: grafana-loki < 7.3.6-1 +Obsoletes: grafana-mssql < 7.3.6-1 +Obsoletes: grafana-mysql < 7.3.6-1 +Obsoletes: grafana-opentsdb < 7.3.6-1 +Obsoletes: grafana-postgres < 7.3.6-1 +Obsoletes: grafana-prometheus < 7.3.6-1 +Obsoletes: grafana-stackdriver < 7.3.6-1 +Provides: grafana-cloudwatch = 7.3.6-1 +Provides: grafana-elasticsearch = 7.3.6-1 +Provides: grafana-azure-monitor = 7.3.6-1 +Provides: grafana-graphite = 7.3.6-1 +Provides: grafana-influxdb = 7.3.6-1 +Provides: grafana-loki = 7.3.6-1 +Provides: grafana-mssql = 7.3.6-1 +Provides: grafana-mysql = 7.3.6-1 +Provides: grafana-opentsdb = 7.3.6-1 +Provides: grafana-postgres = 7.3.6-1 +Provides: grafana-prometheus = 7.3.6-1 +Provides: grafana-stackdriver = 7.3.6-1 + +# vendored golang and node.js build dependencies +# this is for security purposes, if nodejs-foo ever needs an update, +# affected packages can be easily identified. +# Note: generated by the Makefile (see README.md) +Provides: bundled(golang(cloud.google.com/go/storage)) = 1.10.0 +Provides: bundled(golang(github.com/BurntSushi/toml)) = 0.3.1 +Provides: bundled(golang(github.com/VividCortex/mysqlerr)) = 0.0.0-20170204212430.6c6b55f8796f +Provides: bundled(golang(github.com/aws/aws-sdk-go)) = 1.33.12 +Provides: bundled(golang(github.com/beevik/etree)) = 1.1.0 +Provides: bundled(golang(github.com/benbjohnson/clock)) = 0.0.0-20161215174838.7dc76406b6d3 +Provides: bundled(golang(github.com/bradfitz/gomemcache)) = 0.0.0-20190913173617.a41fca850d0b +Provides: bundled(golang(github.com/centrifugal/centrifuge)) = 0.11.0 +Provides: bundled(golang(github.com/davecgh/go-spew)) = 1.1.1 +Provides: bundled(golang(github.com/denisenkom/go-mssqldb)) = 0.0.0-20200620013148.b91950f658ec +Provides: bundled(golang(github.com/facebookgo/inject)) = 0.0.0-20180706035515.f23751cae28b +Provides: bundled(golang(github.com/fatih/color)) = 1.9.0 +Provides: bundled(golang(github.com/gchaincl/sqlhooks)) = 1.3.0 +Provides: bundled(golang(github.com/go-macaron/binding)) = 0.0.0-20190806013118.0b4f37bab25b +Provides: bundled(golang(github.com/go-macaron/gzip)) = 0.0.0-20160222043647.cad1c6580a07 +Provides: bundled(golang(github.com/go-macaron/session)) = 0.0.0-20190805070824.1a3cdc6f5659 +Provides: bundled(golang(github.com/go-sql-driver/mysql)) = 1.5.0 +Provides: bundled(golang(github.com/go-stack/stack)) = 1.8.0 +Provides: bundled(golang(github.com/gobwas/glob)) = 0.2.3 +Provides: bundled(golang(github.com/golang/protobuf)) = 1.4.3 +Provides: bundled(golang(github.com/google/go-cmp)) = 0.5.2 +Provides: bundled(golang(github.com/gosimple/slug)) = 1.4.2 +Provides: bundled(golang(github.com/grafana/grafana-plugin-model)) = 0.0.0-20190930120109.1fc953a61fb4 +Provides: bundled(golang(github.com/grafana/grafana-plugin-sdk-go)) = 0.79.0 +Provides: bundled(golang(github.com/grafana/loki)) = 1.6.0 +Provides: bundled(golang(github.com/grpc-ecosystem/go-grpc-middleware)) = 1.2.1 +Provides: bundled(golang(github.com/hashicorp/go-hclog)) = 0.12.2 +Provides: bundled(golang(github.com/hashicorp/go-plugin)) = 1.2.2 +Provides: bundled(golang(github.com/hashicorp/go-version)) = 1.2.0 +Provides: bundled(golang(github.com/inconshreveable/log15)) = 0.0.0-20180818164646.67afb5ed74ec +Provides: bundled(golang(github.com/influxdata/influxdb-client-go/v2)) = 2.2.0 +Provides: bundled(golang(github.com/jmespath/go-jmespath)) = 0.3.0 +Provides: bundled(golang(github.com/jung-kurt/gofpdf)) = 1.10.1 +Provides: bundled(golang(github.com/lib/pq)) = 1.3.0 +Provides: bundled(golang(github.com/linkedin/goavro/v2)) = 2.9.7 +Provides: bundled(golang(github.com/magefile/mage)) = 1.9.0 +Provides: bundled(golang(github.com/mattn/go-isatty)) = 0.0.12 +Provides: bundled(golang(github.com/mattn/go-sqlite3)) = 1.11.0 +Provides: bundled(golang(github.com/opentracing/opentracing-go)) = 1.2.0 +Provides: bundled(golang(github.com/patrickmn/go-cache)) = 2.1.0+incompatible +Provides: bundled(golang(github.com/pkg/errors)) = 0.9.1 +Provides: bundled(golang(github.com/prometheus/client_golang)) = 1.8.0 +Provides: bundled(golang(github.com/prometheus/client_model)) = 0.2.0 +Provides: bundled(golang(github.com/prometheus/common)) = 0.14.0 +Provides: bundled(golang(github.com/robfig/cron)) = 0.0.0-20180505203441.b41be1df6967 +Provides: bundled(golang(github.com/robfig/cron/v3)) = 3.0.0 +Provides: bundled(golang(github.com/russellhaering/goxmldsig)) = 1.1.0 +Provides: bundled(golang(github.com/smartystreets/goconvey)) = 1.6.4 +Provides: bundled(golang(github.com/stretchr/testify)) = 1.6.1 +Provides: bundled(golang(github.com/teris-io/shortid)) = 0.0.0-20171029131806.771a37caa5cf +Provides: bundled(golang(github.com/timberio/go-datemath)) = 0.1.1-0.20200323150745.74ddef604fff +Provides: bundled(golang(github.com/ua-parser/uap-go)) = 0.0.0-20190826212731.daf92ba38329 +Provides: bundled(golang(github.com/uber/jaeger-client-go)) = 2.25.0+incompatible +Provides: bundled(golang(github.com/unknwon/com)) = 1.0.1 +Provides: bundled(golang(github.com/urfave/cli/v2)) = 2.1.1 +Provides: bundled(golang(github.com/weaveworks/common)) = 0.0.0-20201119133501.0619918236ec +Provides: bundled(golang(github.com/xorcare/pointer)) = 1.1.0 +Provides: bundled(golang(github.com/yudai/gojsondiff)) = 1.0.0 +Provides: bundled(golang(golang.org/x/crypto)) = 0.0.0-20201208171446.5f87f3452ae9 +Provides: bundled(golang(golang.org/x/net)) = 0.0.0-20201022231255.08b38378de70 +Provides: bundled(golang(golang.org/x/oauth2)) = 0.0.0-20200902213428.5d25da1a8d43 +Provides: bundled(golang(golang.org/x/sync)) = 0.0.0-20201020160332.67f06af15bc9 +Provides: bundled(golang(golang.org/x/time)) = 0.0.0-20200630173020.3af7569d3a1e +Provides: bundled(golang(google.golang.org/grpc)) = 1.33.1 +Provides: bundled(golang(gopkg.in/ini.v1)) = 1.51.0 +Provides: bundled(golang(gopkg.in/ldap.v3)) = 3.0.2 +Provides: bundled(golang(gopkg.in/macaron.v1)) = 1.3.9 +Provides: bundled(golang(gopkg.in/mail.v2)) = 2.3.1 +Provides: bundled(golang(gopkg.in/redis.v5)) = 5.2.9 +Provides: bundled(golang(gopkg.in/square/go-jose.v2)) = 2.4.1 +Provides: bundled(golang(gopkg.in/yaml.v2)) = 2.3.0 +Provides: bundled(golang(xorm.io/core)) = 0.7.3 +Provides: bundled(golang(xorm.io/xorm)) = 0.8.1 +Provides: bundled(npm(@babel/core)) = 7.6.2 +Provides: bundled(npm(@babel/plugin-proposal-nullish-coalescing-operator)) = 7.8.3 +Provides: bundled(npm(@babel/plugin-proposal-optional-chaining)) = 7.8.3 +Provides: bundled(npm(@babel/plugin-syntax-dynamic-import)) = 7.2.0 +Provides: bundled(npm(@babel/preset-env)) = 7.6.3 +Provides: bundled(npm(@babel/preset-react)) = 7.6.3 +Provides: bundled(npm(@babel/preset-typescript)) = 7.8.3 +Provides: bundled(npm(@emotion/core)) = 10.0.21 +Provides: bundled(npm(@grafana/api-documenter)) = 0.9.3 +Provides: bundled(npm(@grafana/api-extractor)) = 7.10.1 +Provides: bundled(npm(@grafana/eslint-config)) = 2.0.3 +Provides: bundled(npm(@grafana/slate-react)) = 0.22.9-grafana +Provides: bundled(npm(@reduxjs/toolkit)) = 1.3.4 +Provides: bundled(npm(@rtsao/plugin-proposal-class-properties)) = 7.0.1-patch.1 +Provides: bundled(npm(@testing-library/jest-dom)) = 5.11.3 +Provides: bundled(npm(@testing-library/react)) = 10.4.8 +Provides: bundled(npm(@testing-library/react-hooks)) = 3.2.1 +Provides: bundled(npm(@testing-library/user-event)) = 12.1.3 +Provides: bundled(npm(@torkelo/react-select)) = 3.0.8 +Provides: bundled(npm(@types/angular)) = 1.6.56 +Provides: bundled(npm(@types/angular-route)) = 1.7.0 +Provides: bundled(npm(@types/antlr4)) = 4.7.1 +Provides: bundled(npm(@types/braintree__sanitize-url)) = 4.0.0 +Provides: bundled(npm(@types/classnames)) = 2.2.7 +Provides: bundled(npm(@types/clipboard)) = 2.0.1 +Provides: bundled(npm(@types/common-tags)) = 1.8.0 +Provides: bundled(npm(@types/d3)) = 5.7.2 +Provides: bundled(npm(@types/d3-scale-chromatic)) = 1.3.1 +Provides: bundled(npm(@types/enzyme)) = 3.10.3 +Provides: bundled(npm(@types/enzyme-adapter-react-16)) = 1.0.6 +Provides: bundled(npm(@types/file-saver)) = 2.0.1 +Provides: bundled(npm(@types/hoist-non-react-statics)) = 3.3.1 +Provides: bundled(npm(@types/is-hotkey)) = 0.1.1 +Provides: bundled(npm(@types/jest)) = 23.3.14 +Provides: bundled(npm(@types/jquery)) = 3.3.38 +Provides: bundled(npm(@types/jsurl)) = 1.2.28 +Provides: bundled(npm(@types/lodash)) = 4.14.123 +Provides: bundled(npm(@types/lru-cache)) = 5.1.0 +Provides: bundled(npm(@types/marked)) = 1.1.0 +Provides: bundled(npm(@types/md5)) = 2.1.33 +Provides: bundled(npm(@types/moment-timezone)) = 0.5.13 +Provides: bundled(npm(@types/mousetrap)) = 1.6.3 +Provides: bundled(npm(@types/node)) = 10.14.1 +Provides: bundled(npm(@types/papaparse)) = 5.2.0 +Provides: bundled(npm(@types/prismjs)) = 1.16.0 +Provides: bundled(npm(@types/react)) = 16.8.16 +Provides: bundled(npm(@types/react-beautiful-dnd)) = 12.1.2 +Provides: bundled(npm(@types/react-dom)) = 16.8.4 +Provides: bundled(npm(@types/react-grid-layout)) = 0.16.7 +Provides: bundled(npm(@types/react-loadable)) = 5.5.2 +Provides: bundled(npm(@types/react-redux)) = 7.1.7 +Provides: bundled(npm(@types/react-select)) = 3.0.8 +Provides: bundled(npm(@types/react-test-renderer)) = 16.9.1 +Provides: bundled(npm(@types/react-transition-group)) = 4.2.3 +Provides: bundled(npm(@types/react-virtualized-auto-sizer)) = 1.0.0 +Provides: bundled(npm(@types/react-window)) = 1.8.1 +Provides: bundled(npm(@types/redux-logger)) = 3.0.7 +Provides: bundled(npm(@types/redux-mock-store)) = 1.0.2 +Provides: bundled(npm(@types/reselect)) = 2.2.0 +Provides: bundled(npm(@types/slate)) = 0.47.1 +Provides: bundled(npm(@types/slate-plain-serializer)) = 0.6.1 +Provides: bundled(npm(@types/slate-react)) = 0.22.5 +Provides: bundled(npm(@types/sockjs-client)) = 1.1.1 +Provides: bundled(npm(@types/testing-library__jest-dom)) = 5.9.2 +Provides: bundled(npm(@types/testing-library__react-hooks)) = 3.1.0 +Provides: bundled(npm(@types/tinycolor2)) = 1.4.1 +Provides: bundled(npm(@types/uuid)) = 8.3.0 +Provides: bundled(npm(@typescript-eslint/eslint-plugin)) = 4.0.1 +Provides: bundled(npm(@typescript-eslint/parser)) = 4.0.1 +Provides: bundled(npm(@welldone-software/why-did-you-render)) = 4.0.6 +Provides: bundled(npm(abortcontroller-polyfill)) = 1.4.0 +Provides: bundled(npm(angular)) = 1.6.9 +Provides: bundled(npm(angular-bindonce)) = 0.3.1 +Provides: bundled(npm(angular-mocks)) = 1.6.6 +Provides: bundled(npm(angular-native-dragdrop)) = 1.2.2 +Provides: bundled(npm(angular-route)) = 1.6.6 +Provides: bundled(npm(angular-sanitize)) = 1.6.6 +Provides: bundled(npm(antlr4)) = 4.8.0 +Provides: bundled(npm(autoprefixer)) = 9.7.4 +Provides: bundled(npm(axios)) = 0.19.0 +Provides: bundled(npm(babel-core)) = 7.0.0-bridge.0 +Provides: bundled(npm(babel-jest)) = 24.8.0 +Provides: bundled(npm(babel-loader)) = 8.0.6 +Provides: bundled(npm(babel-plugin-angularjs-annotate)) = 0.10.0 +Provides: bundled(npm(baron)) = 3.0.3 +Provides: bundled(npm(brace)) = 0.11.1 +Provides: bundled(npm(calculate-size)) = 1.1.1 +Provides: bundled(npm(centrifuge)) = 2.6.4 +Provides: bundled(npm(classnames)) = 2.2.6 +Provides: bundled(npm(clean-webpack-plugin)) = 3.0.0 +Provides: bundled(npm(clipboard)) = 2.0.4 +Provides: bundled(npm(common-tags)) = 1.8.0 +Provides: bundled(npm(core-js)) = 1.2.7 +Provides: bundled(npm(css-loader)) = 3.2.0 +Provides: bundled(npm(d3)) = 5.15.0 +Provides: bundled(npm(d3-scale-chromatic)) = 1.5.0 +Provides: bundled(npm(dangerously-set-html-content)) = 1.0.6 +Provides: bundled(npm(emotion)) = 10.0.27 +Provides: bundled(npm(enzyme)) = 3.11.0 +Provides: bundled(npm(enzyme-adapter-react-16)) = 1.15.2 +Provides: bundled(npm(enzyme-to-json)) = 3.4.4 +Provides: bundled(npm(es6-promise)) = 4.2.8 +Provides: bundled(npm(es6-shim)) = 0.35.5 +Provides: bundled(npm(eslint)) = 2.13.1 +Provides: bundled(npm(eslint-config-prettier)) = 6.11.0 +Provides: bundled(npm(eslint-plugin-jsdoc)) = 28.6.1 +Provides: bundled(npm(eslint-plugin-prettier)) = 3.1.4 +Provides: bundled(npm(eslint-plugin-react-hooks)) = 4.0.5 +Provides: bundled(npm(eventemitter3)) = 3.1.2 +Provides: bundled(npm(expect.js)) = 0.3.1 +Provides: bundled(npm(expose-loader)) = 0.7.5 +Provides: bundled(npm(fast-text-encoding)) = 1.0.0 +Provides: bundled(npm(file-loader)) = 4.3.0 +Provides: bundled(npm(file-saver)) = 2.0.2 +Provides: bundled(npm(fork-ts-checker-webpack-plugin)) = 1.0.0 +Provides: bundled(npm(gaze)) = 1.1.3 +Provides: bundled(npm(glob)) = 5.0.15 +Provides: bundled(npm(grunt)) = 1.0.4 +Provides: bundled(npm(grunt-angular-templates)) = 1.1.0 +Provides: bundled(npm(grunt-cli)) = 1.2.0 +Provides: bundled(npm(grunt-contrib-clean)) = 2.0.0 +Provides: bundled(npm(grunt-contrib-compress)) = 1.6.0 +Provides: bundled(npm(grunt-contrib-copy)) = 1.0.0 +Provides: bundled(npm(grunt-exec)) = 3.0.0 +Provides: bundled(npm(grunt-newer)) = 1.3.0 +Provides: bundled(npm(grunt-notify)) = 0.4.5 +Provides: bundled(npm(grunt-postcss)) = 0.9.0 +Provides: bundled(npm(grunt-sass-lint)) = 0.2.4 +Provides: bundled(npm(grunt-usemin)) = 3.1.1 +Provides: bundled(npm(grunt-webpack)) = 3.1.3 +Provides: bundled(npm(hoist-non-react-statics)) = 2.5.5 +Provides: bundled(npm(html-loader)) = 0.5.5 +Provides: bundled(npm(html-webpack-harddisk-plugin)) = 1.0.1 +Provides: bundled(npm(html-webpack-plugin)) = 3.2.0 +Provides: bundled(npm(husky)) = 4.2.1 +Provides: bundled(npm(immutable)) = 3.8.2 +Provides: bundled(npm(is-hotkey)) = 0.1.4 +Provides: bundled(npm(jest)) = 25.5.4 +Provides: bundled(npm(jest-canvas-mock)) = 2.1.2 +Provides: bundled(npm(jest-date-mock)) = 1.0.8 +Provides: bundled(npm(jquery)) = 3.4.1 +Provides: bundled(npm(jsurl)) = 0.1.5 +Provides: bundled(npm(lerna)) = 3.20.2 +Provides: bundled(npm(lint-staged)) = 10.0.7 +Provides: bundled(npm(load-grunt-tasks)) = 5.1.0 +Provides: bundled(npm(lodash)) = 3.10.1 +Provides: bundled(npm(lru-cache)) = 4.1.5 +Provides: bundled(npm(marked)) = 0.3.19 +Provides: bundled(npm(md5)) = 2.2.1 +Provides: bundled(npm(memoize-one)) = 4.1.0 +Provides: bundled(npm(mini-css-extract-plugin)) = 0.7.0 +Provides: bundled(npm(mocha)) = 7.0.1 +Provides: bundled(npm(module-alias)) = 2.2.2 +Provides: bundled(npm(moment)) = 2.24.0 +Provides: bundled(npm(moment-timezone)) = 0.5.28 +Provides: bundled(npm(monaco-editor)) = 0.20.0 +Provides: bundled(npm(monaco-editor-webpack-plugin)) = 1.9.0 +Provides: bundled(npm(mousetrap)) = 1.6.5 +Provides: bundled(npm(mousetrap-global-bind)) = 1.1.0 +Provides: bundled(npm(mutationobserver-shim)) = 0.3.3 +Provides: bundled(npm(ngtemplate-loader)) = 2.0.1 +Provides: bundled(npm(node-sass)) = 4.13.1 +Provides: bundled(npm(nodemon)) = 2.0.2 +Provides: bundled(npm(optimize-css-assets-webpack-plugin)) = 5.0.3 +Provides: bundled(npm(papaparse)) = 4.6.3 +Provides: bundled(npm(postcss-browser-reporter)) = 0.6.0 +Provides: bundled(npm(postcss-loader)) = 3.0.0 +Provides: bundled(npm(postcss-reporter)) = 6.0.1 +Provides: bundled(npm(prettier)) = 1.18.2 +Provides: bundled(npm(prismjs)) = 1.17.1 +Provides: bundled(npm(prop-types)) = 15.7.2 +Provides: bundled(npm(rc-cascader)) = 1.0.1 +Provides: bundled(npm(re-resizable)) = 6.2.0 +Provides: bundled(npm(react)) = 16.10.2 +Provides: bundled(npm(react-dom)) = 16.10.2 +Provides: bundled(npm(react-grid-layout)) = 0.17.1 +Provides: bundled(npm(react-highlight-words)) = 0.16.0 +Provides: bundled(npm(react-hot-loader)) = 4.8.0 +Provides: bundled(npm(react-loadable)) = 5.5.0 +Provides: bundled(npm(react-popper)) = 1.3.3 +Provides: bundled(npm(react-redux)) = 7.2.0 +Provides: bundled(npm(react-reverse-portal)) = 2.0.1 +Provides: bundled(npm(react-sizeme)) = 2.6.8 +Provides: bundled(npm(react-split-pane)) = 0.1.89 +Provides: bundled(npm(react-test-renderer)) = 16.10.2 +Provides: bundled(npm(react-transition-group)) = 2.9.0 +Provides: bundled(npm(react-use)) = 13.27.0 +Provides: bundled(npm(react-virtualized-auto-sizer)) = 1.0.2 +Provides: bundled(npm(react-window)) = 1.8.5 +Provides: bundled(npm(redux)) = 3.7.2 +Provides: bundled(npm(redux-logger)) = 3.0.6 +Provides: bundled(npm(redux-mock-store)) = 1.5.4 +Provides: bundled(npm(redux-thunk)) = 2.3.0 +Provides: bundled(npm(regenerator-runtime)) = 0.11.1 +Provides: bundled(npm(regexp-replace-loader)) = 1.0.1 +Provides: bundled(npm(reselect)) = 4.0.0 +Provides: bundled(npm(rimraf)) = 2.6.3 +Provides: bundled(npm(rst2html)) = 1.0.4 +Provides: bundled(npm(rxjs)) = 6.5.5 +Provides: bundled(npm(rxjs-spy)) = 7.5.1 +Provides: bundled(npm(sass-lint)) = 1.12.1 +Provides: bundled(npm(sass-loader)) = 8.0.2 +Provides: bundled(npm(search-query-parser)) = 1.5.4 +Provides: bundled(npm(sinon)) = 8.1.1 +Provides: bundled(npm(slate)) = 0.47.8 +Provides: bundled(npm(slate-plain-serializer)) = 0.7.10 +Provides: bundled(npm(sockjs-client)) = 1.4.0 +Provides: bundled(npm(style-loader)) = 1.1.3 +Provides: bundled(npm(terser-webpack-plugin)) = 1.4.1 +Provides: bundled(npm(tether)) = 1.4.7 +Provides: bundled(npm(tether-drop)) = 1.5.0 +Provides: bundled(npm(tinycolor2)) = 1.4.1 +Provides: bundled(npm(ts-jest)) = 26.3.0 +Provides: bundled(npm(ts-node)) = 8.8.1 +Provides: bundled(npm(tslib)) = 1.10.0 +Provides: bundled(npm(tti-polyfill)) = 0.2.2 +Provides: bundled(npm(typescript)) = 3.7.5 +Provides: bundled(npm(uuid)) = 3.3.3 +Provides: bundled(npm(webpack)) = 4.41.2 +Provides: bundled(npm(webpack-bundle-analyzer)) = 3.6.0 +Provides: bundled(npm(webpack-cleanup-plugin)) = 0.5.1 +Provides: bundled(npm(webpack-cli)) = 3.3.10 +Provides: bundled(npm(webpack-dev-server)) = 3.10.3 +Provides: bundled(npm(webpack-merge)) = 4.2.2 +Provides: bundled(npm(whatwg-fetch)) = 3.0.0 +Provides: bundled(npm(zone.js)) = 0.7.8 %description Grafana is an open source, feature rich metrics dashboard and graph editor for Graphite, InfluxDB & OpenTSDB. - -%package cloudwatch -Requires: %{name} = %{version}-%{release} -Summary: Grafana cloudwatch datasource - -%description cloudwatch -The Grafana cloudwatch datasource. - -%package elasticsearch -Requires: %{name} = %{version}-%{release} -Summary: Grafana elasticsearch datasource - -%description elasticsearch -The Grafana elasticsearch datasource. - -%package azure-monitor -Requires: %{name} = %{version}-%{release} -Summary: Grafana azure-monitor datasource - -%description azure-monitor -The Grafana azure-monitor datasource. - -%package graphite -Requires: %{name} = %{version}-%{release} -Summary: Grafana graphite datasource - -%description graphite -The Grafana graphite datasource. - -%package influxdb -Requires: %{name} = %{version}-%{release} -Summary: Grafana influxdb datasource - -%description influxdb -The Grafana influxdb datasource. - -%package loki -Requires: %{name} = %{version}-%{release} -Summary: Grafana loki datasource - -%description loki -The Grafana loki datasource. - -%package mssql -Requires: %{name} = %{version}-%{release} -Summary: Grafana mssql datasource - -%description mssql -The Grafana mssql datasource. - -%package mysql -Requires: %{name} = %{version}-%{release} -Summary: Grafana mysql datasource - -%description mysql -The Grafana mysql datasource. - -%package opentsdb -Requires: %{name} = %{version}-%{release} -Summary: Grafana opentsdb datasource - -%description opentsdb -The Grafana opentsdb datasource. - -%package postgres -Requires: %{name} = %{version}-%{release} -Summary: Grafana postgres datasource - -%description postgres -The Grafana postgres datasource. - -%package prometheus -Requires: %{name} = %{version}-%{release} -Summary: Grafana prometheus datasource - -%description prometheus -The Grafana prometheus datasource. - -%package stackdriver -Requires: %{name} = %{version}-%{release} -Summary: Grafana stackdriver datasource - -%description stackdriver -The Grafana stackdriver datasource. - - %prep %setup -q -T -D -b 0 %setup -q -T -D -b 1 +rm -r plugins-bundled +%setup -q -T -D -b 2 + +%patch1 -p1 +%patch2 -p1 +%patch3 -p1 +%patch4 -p1 +%patch5 -p1 # Set up build subdirs and links mkdir -p %{_builddir}/src/github.com/grafana -ln -sf %{_builddir}/%{name}-%{version} \ +ln -s %{_builddir}/%{name}-%{version} \ %{_builddir}/src/github.com/grafana/grafana -# remove some (apparent) development files, for rpmlint -rm -f public/sass/.sass-lint.yml public/test/.jshintrc - %build -# Build the server-side binaries +# Build the backend cd %{_builddir}/src/github.com/grafana/grafana -%global archbindir bin/`go env GOOS`-`go env GOARCH` -echo _builddir=%{_builddir} archbindir=%{archbindir} gopath=%{gopath} -[ ! -d %{archbindir} ] && mkdir -p %{archbindir} - -# non-modular build -export GOPATH=%{_builddir}:%{gopath} -export GO111MODULE=off; rm -f go.mod +export GOPATH=%{_builddir} # see grafana-X.X.X/build.go export LDFLAGS="-X main.version=%{version} -X main.buildstamp=${SOURCE_DATE_EPOCH}" for cmd in grafana-cli grafana-server; do - go build -o %{archbindir}/${cmd} ./pkg/cmd/${cmd} + %gobuild -o %{_builddir}/bin/${cmd} ./pkg/cmd/${cmd} done %install -# Fix up arch bin directories -[ ! -d bin/x86_64 ] && ln -sf linux-amd64 bin/x86_64 -[ ! -d bin/i386 ] && ln -sf linux-386 bin/i386 -[ ! -d bin/ppc64le ] && ln -sf linux-ppc64le bin/ppc64le -[ ! -d bin/s390x ] && ln -sf linux-s390x bin/s390x -[ ! -d bin/arm ] && ln -sf linux-arm bin/arm -[ ! -d bin/arm64 ] && ln -sf linux-arm64 bin/aarch64 -[ ! -d bin/aarch64 ] && ln -sf linux-aarch64 bin/aarch64 - # dirs, shared files, public html, webpack install -d %{buildroot}%{_sbindir} install -d %{buildroot}%{_datadir}/%{name} install -d %{buildroot}%{_libexecdir}/%{name} -cp -a conf public %{buildroot}%{_datadir}/%{name} +cp -a conf public plugins-bundled %{buildroot}%{_datadir}/%{name} # wrappers install -p -m 755 packaging/wrappers/grafana-cli %{buildroot}%{_sbindir}/%{name}-cli # binaries -install -p -m 755 %{archbindir}/%{name}-server %{buildroot}%{_sbindir} -install -p -m 755 %{archbindir}/%{name}-cli %{buildroot}%{_libexecdir}/%{name} +install -p -m 755 %{_builddir}/bin/%{name}-server %{buildroot}%{_sbindir} +install -p -m 755 %{_builddir}/bin/%{name}-cli %{buildroot}%{_libexecdir}/%{name} # man pages +install -d %{buildroot}%{_mandir}/man1 +install -p -m 644 docs/man/man1/* %{buildroot}%{_mandir}/man1 # config dirs install -d %{buildroot}%{_sysconfdir}/%{name} +install -d %{buildroot}%{_sysconfdir}/%{name}/provisioning +install -d %{buildroot}%{_sysconfdir}/%{name}/provisioning/dashboards +install -d %{buildroot}%{_sysconfdir}/%{name}/provisioning/datasources +install -d %{buildroot}%{_sysconfdir}/%{name}/provisioning/notifiers +install -d %{buildroot}%{_sysconfdir}/%{name}/provisioning/plugins install -d %{buildroot}%{_sysconfdir}/sysconfig # config defaults -install -p -m 640 %{SOURCE2} %{buildroot}%{_sysconfdir}/%{name}/grafana.ini +install -p -m 640 %{SOURCE3} %{buildroot}%{_sysconfdir}/%{name}/grafana.ini install -p -m 640 conf/ldap.toml %{buildroot}%{_sysconfdir}/%{name}/ldap.toml -install -p -m 644 %{SOURCE2} %{buildroot}%{_datadir}/%{name}/conf/defaults.ini +install -p -m 644 %{SOURCE3} %{buildroot}%{_datadir}/%{name}/conf/defaults.ini install -p -m 644 packaging/rpm/sysconfig/grafana-server \ %{buildroot}%{_sysconfdir}/sysconfig/grafana-server @@ -344,15 +492,16 @@ chmod 640 %{_sysconfdir}/%{name}/ldap.toml %check +# Test backend cd %{_builddir}/src/github.com/grafana/grafana -export GOPATH=%{_builddir}:%{gopath} -# remove tests currently failing - these two are due to a symlink -# BUILD/src/github.com/grafana/grafana -> BUILD/grafana-6.6.1 -rm -f pkg/services/provisioning/dashboards/file_reader_linux_test.go -rm -f pkg/services/provisioning/dashboards/file_reader_test.go -export GO111MODULE=off -go test ./pkg/... +export GOPATH=%{_builddir} +# in setting_test.go there is a unit test which checks if 10 days are 240 hours +# which is usually true except if the dayligt saving time change falls into the last 10 days, then it's either 239 or 241 hours... +# let's set the time zone to a time zone without daylight saving time +export TZ=GMT + +%gotest ./pkg/... %files # binaries and wrappers @@ -361,103 +510,43 @@ go test ./pkg/... %{_libexecdir}/%{name} # config files -%dir %{_sysconfdir}/%{name} -%config(noreplace) %attr(640, root, %{GRAFANA_GROUP}) %{_sysconfdir}/%{name}/grafana.ini -%config(noreplace) %attr(640, root, %{GRAFANA_GROUP}) %{_sysconfdir}/%{name}/ldap.toml %config(noreplace) %{_sysconfdir}/sysconfig/grafana-server - -# Grafana configuration to dynamically create /run/grafana/grafana.pid on tmpfs -%{_tmpfilesdir}/%{name}.conf +%dir %{_sysconfdir}/%{name} +%attr(0755, root, %{GRAFANA_GROUP}) %dir %{_sysconfdir}/%{name}/provisioning +%attr(0755, root, %{GRAFANA_GROUP}) %dir %{_sysconfdir}/%{name}/provisioning/dashboards +%attr(0750, root, %{GRAFANA_GROUP}) %dir %{_sysconfdir}/%{name}/provisioning/datasources +%attr(0755, root, %{GRAFANA_GROUP}) %dir %{_sysconfdir}/%{name}/provisioning/notifiers +%attr(0755, root, %{GRAFANA_GROUP}) %dir %{_sysconfdir}/%{name}/provisioning/plugins +%attr(0640, root, %{GRAFANA_GROUP}) %config(noreplace) %{_sysconfdir}/%{name}/grafana.ini +%attr(0640, root, %{GRAFANA_GROUP}) %config(noreplace) %{_sysconfdir}/%{name}/ldap.toml # config database directory and plugins -%attr(750, %{GRAFANA_USER}, %{GRAFANA_GROUP}) %dir %{_sharedstatedir}/%{name} -%attr(-, %{GRAFANA_USER}, %{GRAFANA_GROUP}) %dir %{_sharedstatedir}/%{name}/plugins +%attr(0750, %{GRAFANA_USER}, %{GRAFANA_GROUP}) %dir %{_sharedstatedir}/%{name} +%attr(-, %{GRAFANA_USER}, %{GRAFANA_GROUP}) %dir %{_sharedstatedir}/%{name}/plugins -# shared directory and all files therein, except some datasources +# shared directory and all files therein %{_datadir}/%{name} - -# built-in datasources that are sub-packaged -%global dsdir %{_datadir}/%{name}/public/app/plugins/datasource -%exclude %{dsdir}/cloudwatch -%exclude %{dsdir}/elasticsearch -%exclude %{dsdir}/graphite -%exclude %{dsdir}/grafana-azure-monitor-datasource -%exclude %{dsdir}/influxdb -%exclude %{dsdir}/loki -%exclude %{dsdir}/mssql -%exclude %{dsdir}/mysql -%exclude %{dsdir}/opentsdb -%exclude %{dsdir}/postgres -%exclude %{dsdir}/prometheus -%exclude %{dsdir}/stackdriver - -%dir %{_datadir}/%{name}/conf %attr(-, root, %{GRAFANA_GROUP}) %{_datadir}/%{name}/conf/* # systemd service file %{_unitdir}/grafana-server.service +# Grafana configuration to dynamically create /run/grafana/grafana.pid on tmpfs +%{_tmpfilesdir}/%{name}.conf + # log directory - grafana.log is created by grafana-server, and it does it's own log rotation %attr(0755, %{GRAFANA_USER}, %{GRAFANA_GROUP}) %dir %{_localstatedir}/log/%{name} # man pages for grafana binaries +%{_mandir}/man1/%{name}-server.1* +%{_mandir}/man1/%{name}-cli.1* # other docs and license %license LICENSE -%doc CHANGELOG.md CODE_OF_CONDUCT.md CONTRIBUTING.md NOTICE.md -%doc PLUGIN_DEV.md README.md ROADMAP.md UPGRADING_DEPENDENCIES.md - -# -# datasources split out into subpackages -# -%files cloudwatch -%{_datadir}/%{name}/public/app/plugins/datasource/cloudwatch -%doc %{_datadir}/%{name}/public/app/plugins/datasource/cloudwatch/README.md - -%files elasticsearch -%{_datadir}/%{name}/public/app/plugins/datasource/elasticsearch -%doc %{_datadir}/%{name}/public/app/plugins/datasource/elasticsearch/README.md - -%files azure-monitor -%{_datadir}/%{name}/public/app/plugins/datasource/grafana-azure-monitor-datasource - -%files graphite -%{_datadir}/%{name}/public/app/plugins/datasource/graphite -%doc %{_datadir}/%{name}/public/app/plugins/datasource/graphite/README.md - -%files influxdb -%{_datadir}/%{name}/public/app/plugins/datasource/influxdb -%doc %{_datadir}/%{name}/public/app/plugins/datasource/influxdb/README.md - -%files loki -%{_datadir}/%{name}/public/app/plugins/datasource/loki -%doc %{_datadir}/%{name}/public/app/plugins/datasource/loki/README.md - -%files mssql -%{_datadir}/%{name}/public/app/plugins/datasource/mssql -%doc %{_datadir}/%{name}/public/app/plugins/datasource/mssql/README.md - -%files mysql -%{_datadir}/%{name}/public/app/plugins/datasource/mysql -%doc %{_datadir}/%{name}/public/app/plugins/datasource/mysql/README.md - -%files opentsdb -%{_datadir}/%{name}/public/app/plugins/datasource/opentsdb -%doc %{_datadir}/%{name}/public/app/plugins/datasource/opentsdb/README.md - -%files postgres -%{_datadir}/%{name}/public/app/plugins/datasource/postgres -%doc %{_datadir}/%{name}/public/app/plugins/datasource/postgres/README.md - -%files prometheus -%{_datadir}/%{name}/public/app/plugins/datasource/prometheus -%doc %{_datadir}/%{name}/public/app/plugins/datasource/prometheus/README.md - -%files stackdriver -%{_datadir}/%{name}/public/app/plugins/datasource/stackdriver -%doc %{_datadir}/%{name}/public/app/plugins/datasource/stackdriver/README.md +%doc CHANGELOG.md CODE_OF_CONDUCT.md CONTRIBUTING.md GOVERNANCE.md ISSUE_TRIAGE.md MAINTAINERS.md NOTICE.md +%doc PLUGIN_DEV.md README.md ROADMAP.md SECURITY.md SUPPORT.md UPGRADING_DEPENDENCIES.md WORKFLOW.md %changelog -* Tue Aug 11 2020 houjian - 6.7.4-1 -- Package init +* Fri Sep 3 2021 Python_Bot 7.3.6-1 +- Init Package diff --git a/list_bundled_nodejs_packages.py b/list_bundled_nodejs_packages.py deleted file mode 100755 index 0f6210614118a9c94f553e070cf3874e8c625d72..0000000000000000000000000000000000000000 --- a/list_bundled_nodejs_packages.py +++ /dev/null @@ -1,44 +0,0 @@ -#!/usr/bin/env python3 -import sys -import json -import re -from packaging import version - - -def read_declared_pkgs(package_json_path): - with open(package_json_path) as f: - package_json = json.load(f) - return list(package_json['dependencies'].keys()) - - -def read_installed_pkgs(yarn_lock_path): - with open(yarn_lock_path) as f: - lockfile = f.read() - return re.findall(r'^"?' # can start with a " - r'(.+?)@.+(?:,.*)?:\n' # characters up to @ - r' version "(.+)"', # and the version - lockfile, re.MULTILINE) - - -def list_provides(declared_pkgs, installed_pkgs): - for declared_pkg in declared_pkgs: - # there can be multiple versions installed of one package (transitive dependencies) - # but rpm doesn't support Provides: with a single package and multiple versions - # so let's declare the oldest version here - versions = [version.parse(pkg_version) - for pkg_name, pkg_version in installed_pkgs if pkg_name == declared_pkg] - oldest_version = sorted(versions)[0] - yield f"Provides: bundled(nodejs-{declared_pkg}) = {oldest_version}" - - -if __name__ == "__main__": - if len(sys.argv) != 2: - print(f"usage: {sys.argv[0]} grafana-X.Y.Z/", file=sys.stdout) - sys.exit(1) - - grafana_dir = sys.argv[1] - declared_pkgs = read_declared_pkgs(f"{grafana_dir}/package.json") - installed_pkgs = read_installed_pkgs(f"{grafana_dir}/yarn.lock") - provides = list_provides(declared_pkgs, installed_pkgs) - for provide in sorted(provides): - print(provide) diff --git a/list_go_buildrequires.sh b/list_go_buildrequires.sh deleted file mode 100755 index 62e4d0617f695fc30e55f88f180a8e1554fbe203..0000000000000000000000000000000000000000 --- a/list_go_buildrequires.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/bash -eu - -[ $# -ne 1 ] && echo "Usage: $0 grafana-X.Y.Z/" && exit 1 -GRAFANA_SOURCES="$(readlink -f "$1")" - -cd "$(mktemp -d)" -mkdir -p src/github.com/grafana -ln -s "${GRAFANA_SOURCES}" src/github.com/grafana/grafana -ln -s "${GRAFANA_SOURCES}/vendor/github.com/grafana/grafana-plugin-model" src/github.com/grafana/grafana-plugin-model -ln -s "${GRAFANA_SOURCES}/vendor/github.com/grafana/grafana-plugin-sdk-go" src/github.com/grafana/grafana-plugin-sdk-go - -for pkg in grafana grafana-plugin-model grafana-plugin-sdk-go -do - GOPATH=$(pwd) golist --imported --package-path "github.com/grafana/$pkg" --skip-self --template 'BuildRequires: golang({{.}})\n' -done | sed \ - -e "s,github.com/linkedin/goavro/v2,github.com/linkedin/goavro,g" \ - -e "s,github.com/go-xorm/xorm,xorm.io/xorm,g" \ - -e "s,github.com/robfig/cron/v3,gopkg.in/robfig/cron.v3,g" \ - -e "s,github.com/unknwon/com,github.com/Unknwon/com,g" \ - | sort | uniq diff --git a/make_grafana_webpack.sh b/make_grafana_webpack.sh deleted file mode 100755 index 7baf48707f5ad2b089f659317db8bc6cd5b29320..0000000000000000000000000000000000000000 --- a/make_grafana_webpack.sh +++ /dev/null @@ -1,58 +0,0 @@ -#! /bin/bash -# -# Copyright (c) 2019-2020 Red Hat. -# -# This program is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by the -# Free Software Foundation; either version 2 of the License, or (at your -# option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# for more details. -# - -[ $# -ne 1 ] && echo "Usage: $0 version" && exit 1 - -# grafana version (must be tagged on github.com/grafana/grafana as "v$VER") -VER=$1 - -command -v yarn || { echo Error, please install the yarn package manager. && exit 1; } - -# get src tree and set cwd -echo Fetching pristine upstream git tagged branch for grafana version v$VER ... -git clone https://github.com/grafana/grafana grafana-$VER -cd grafana-$VER -git checkout -b v$VER v$VER - -# exclude the phantomjs-prebuilt binary module from the webpack -sed -i '/phantomjs-prebuilt/d' package.json - -# nuke grunt task for copying phantomjs -rm -f scripts/grunt/options/phantomjs.js -sed -i '/phantomjs/d' scripts/grunt/*.js - -# populate node_modules using package.json -echo Running yarn to populate local node_modules .... -yarn --non-interactive --no-progress --ignore-engines install --pure-lockfile > yarn.out 2>&1 - -# build the webpack -echo;echo Building production webpack .... -node_modules/webpack/bin/webpack.js --display errors-only --mode production --config scripts/webpack/webpack.prod.js - -cd .. - -# webpack tarball. Includes public/views because index.html references the webpack -tar czf grafana_webpack-$VER.tar.gz grafana-$VER/public/build grafana-$VER/public/views - -# source tarball (if needed) -if [ ! -f grafana-$VER.tar.gz ]; then - wget --quiet -O grafana-$VER.tar.gz https://github.com/grafana/grafana/archive/v$VER/grafana-$VER.tar.gz -fi - -# done -echo Both grafana-$VER.tar.gz and grafana_webpack-$VER.tar.gz -echo should now be in your working directory. - -exit 0