Skip to content

Commit

Permalink
Merge remote-tracking branch 'grafana/master' into anno-panel
Browse files Browse the repository at this point in the history
* grafana/master: (33 commits)
  API: get list of users with additional auth info (grafana#17305)
  TimePicker: fixed minor issues with new timepicker (grafana#17756)
  Explore: Parses and updates TimeSrv in one place in Explore (grafana#17677)
  @grafana/ui: release (grafana#17754)
  Password: Remove PasswordStrength (grafana#17750)
  Devenv:SAML: devenv block with saml test app (grafana#17733)
  LDAP:Docs: add information on LDAP sync feature and update LDAP sync default (grafana#17689)
  Graph: Add data links feature (click on graph) (grafana#17267)
  Explore: Changes LogsContainer from a PureComponent to a Component (grafana#17741)
  Chore: Remove tether and tether drop dependency in grafana/ui (grafana#17745)
  noImplicitAny: time region manager etc. (grafana#17729)
  Panel: Fully escape html in drilldown links (was only sanitized before)  (grafana#17731)
  Alerting: Improve alert rule testing (grafana#16286)
  Elasticsearch: Visualize logs in Explore (grafana#17605)
  Grafana-CLI: Wrapper for `grafana-cli` within RPM/DEB packages and config/homepath are now global flags (grafana#17695)
  Add guidelines for SQL date comparisons (grafana#17732)
  Docs: clarified usage of go get and go mod (grafana#17637)
  Project: Issue triage doc improvement (grafana#17709)
  Improvement: Grafana release process minor improvements (grafana#17661)
  TimePicker: New time picker dropdown & custom range UI (grafana#16811)
  ...
  • Loading branch information
ryantxu committed Jun 25, 2019
2 parents 36ada2b + dad894f commit 8314c7b
Show file tree
Hide file tree
Showing 220 changed files with 5,426 additions and 3,941 deletions.
384 changes: 384 additions & 0 deletions ISSUE_TRIAGE.md

Large diffs are not rendered by default.

17 changes: 17 additions & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
Reporting Security Issues
------------------

If you think you have found a security vulnerability, please send a report to [security@grafana.com](mailto:security@grafana.com). This address can be used for all of Grafana Labs's open source and commercial products (including but not limited to Grafana, Grafana Cloud, Grafana Enterprise, and grafana.com). We can accept only vulnerability reports at this address. We would prefer that you encrypt your message to us; please use our PGP key. The key fingerprint is:

F988 7BEA 027A 049F AE8E 5CAA D125 8932 BE24 C5CA

The key is available from [pgp.mit.edu](https://pgp.mit.edu/pks/lookup?op=get&search=0xF9887BEA027A049FAE8E5CAAD1258932BE24C5CA) by searching for [grafana](https://pgp.mit.edu/pks/lookup?search=grafana&op=index).

Grafana Labs will send you a response indicating the next steps in handling your report. After the initial reply to your report, the security team will keep you informed of the progress towards a fix and full announcement, and may ask for additional information or guidance.

**Important:** We ask you to not disclose the vulnerability before it have been fixed and announced, unless you have got a response from the Grafana Labs security team that you can do that.

### Security Announcements

We maintain a category on the community site called [Security Announcements](https://community.grafana.com/c/security-announcements),
where we will post a summary, remediation, and mitigation details for any patch containing security fixes. You can also subscribe to email updates to this category if you have a grafana.com account and sign on to the community site or track updates via an [RSS feed](https://community.grafana.com/c/security-announcements.rss).
9 changes: 9 additions & 0 deletions SUPPORT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Need help or support?
------------------

**Please note:**
- Only submit issues for bug reports, feature requests or enhancements.
- Grafana project uses GitHub mainly for tracking bugs and feature requests.
- Asking a question by opening an issue will directly result in issue being closed.

If you require help or support then ask a question and/or find existing questions/answers in the [Grafana community site](https://community.grafana.com/).
53 changes: 35 additions & 18 deletions build.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ var (
workingDir string
includeBuildId bool = true
buildId string = "0"
binaries []string = []string{"grafana-server", "grafana-cli"}
serverBinary string = "grafana-server"
cliBinary string = "grafana-cli"
binaries []string = []string{serverBinary, cliBinary}
isDev bool = false
enterprise bool = false
skipRpmGen bool = false
Expand Down Expand Up @@ -230,6 +232,7 @@ type linuxPackageOptions struct {
packageType string
packageArch string
homeDir string
homeBinDir string
binPath string
serverBinPath string
cliBinPath string
Expand All @@ -240,10 +243,11 @@ type linuxPackageOptions struct {
initdScriptFilePath string
systemdServiceFilePath string

postinstSrc string
initdScriptSrc string
defaultFileSrc string
systemdFileSrc string
postinstSrc string
initdScriptSrc string
defaultFileSrc string
systemdFileSrc string
cliBinaryWrapperSrc string

depends []string
}
Expand All @@ -258,17 +262,19 @@ func createDebPackages() {
packageType: "deb",
packageArch: debPkgArch,
homeDir: "/usr/share/grafana",
homeBinDir: "/usr/share/grafana/bin",
binPath: "/usr/sbin",
configDir: "/etc/grafana",
etcDefaultPath: "/etc/default",
etcDefaultFilePath: "/etc/default/grafana-server",
initdScriptFilePath: "/etc/init.d/grafana-server",
systemdServiceFilePath: "/usr/lib/systemd/system/grafana-server.service",

postinstSrc: "packaging/deb/control/postinst",
initdScriptSrc: "packaging/deb/init.d/grafana-server",
defaultFileSrc: "packaging/deb/default/grafana-server",
systemdFileSrc: "packaging/deb/systemd/grafana-server.service",
postinstSrc: "packaging/deb/control/postinst",
initdScriptSrc: "packaging/deb/init.d/grafana-server",
defaultFileSrc: "packaging/deb/default/grafana-server",
systemdFileSrc: "packaging/deb/systemd/grafana-server.service",
cliBinaryWrapperSrc: "packaging/wrappers/grafana-cli",

depends: []string{"adduser", "libfontconfig1"},
})
Expand All @@ -286,17 +292,19 @@ func createRpmPackages() {
packageType: "rpm",
packageArch: rpmPkgArch,
homeDir: "/usr/share/grafana",
homeBinDir: "/usr/share/grafana/bin",
binPath: "/usr/sbin",
configDir: "/etc/grafana",
etcDefaultPath: "/etc/sysconfig",
etcDefaultFilePath: "/etc/sysconfig/grafana-server",
initdScriptFilePath: "/etc/init.d/grafana-server",
systemdServiceFilePath: "/usr/lib/systemd/system/grafana-server.service",

postinstSrc: "packaging/rpm/control/postinst",
initdScriptSrc: "packaging/rpm/init.d/grafana-server",
defaultFileSrc: "packaging/rpm/sysconfig/grafana-server",
systemdFileSrc: "packaging/rpm/systemd/grafana-server.service",
postinstSrc: "packaging/rpm/control/postinst",
initdScriptSrc: "packaging/rpm/init.d/grafana-server",
defaultFileSrc: "packaging/rpm/sysconfig/grafana-server",
systemdFileSrc: "packaging/rpm/systemd/grafana-server.service",
cliBinaryWrapperSrc: "packaging/wrappers/grafana-cli",

depends: []string{"/sbin/service", "fontconfig", "freetype", "urw-fonts"},
})
Expand All @@ -323,10 +331,12 @@ func createPackage(options linuxPackageOptions) {
runPrint("mkdir", "-p", filepath.Join(packageRoot, "/usr/lib/systemd/system"))
runPrint("mkdir", "-p", filepath.Join(packageRoot, "/usr/sbin"))

// copy binary
for _, binary := range binaries {
runPrint("cp", "-p", filepath.Join(workingDir, "tmp/bin/"+binary), filepath.Join(packageRoot, "/usr/sbin/"+binary))
}
// copy grafana-cli wrapper
runPrint("cp", "-p", options.cliBinaryWrapperSrc, filepath.Join(packageRoot, "/usr/sbin/"+cliBinary))

// copy grafana-server binary
runPrint("cp", "-p", filepath.Join(workingDir, "tmp/bin/"+serverBinary), filepath.Join(packageRoot, "/usr/sbin/"+serverBinary))

// copy init.d script
runPrint("cp", "-p", options.initdScriptSrc, filepath.Join(packageRoot, options.initdScriptFilePath))
// copy environment var file
Expand All @@ -338,6 +348,13 @@ func createPackage(options linuxPackageOptions) {
// remove bin path
runPrint("rm", "-rf", filepath.Join(packageRoot, options.homeDir, "bin"))

// create /bin within home
runPrint("mkdir", "-p", filepath.Join(packageRoot, options.homeBinDir))
// The grafana-cli binary is exposed through a wrapper to ensure a proper
// configuration is in place. To enable that, we need to store the original
// binary in a separate location to avoid conflicts.
runPrint("cp", "-p", filepath.Join(workingDir, "tmp/bin/"+cliBinary), filepath.Join(packageRoot, options.homeBinDir, cliBinary))

args := []string{
"-s", "dir",
"--description", "Grafana",
Expand Down Expand Up @@ -391,7 +408,7 @@ func createPackage(options linuxPackageOptions) {
args = append(args, "--iteration", linuxPackageIteration)
}

// add dependenciesj
// add dependencies
for _, dep := range options.depends {
args = append(args, "--depends", dep)
}
Expand Down
5 changes: 3 additions & 2 deletions conf/defaults.ini
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ type = database
# 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 =
connstr =

#################################### Data proxy ###########################
[dataproxy]
Expand Down Expand Up @@ -395,7 +395,8 @@ config_file = /etc/grafana/ldap.toml
allow_sign_up = true

# LDAP backround sync (Enterprise only)
sync_cron = @hourly
# At 1 am every day
sync_cron = "0 0 1 * * *"
active_sync_enabled = false

#################################### SMTP / Emailing #####################
Expand Down
3 changes: 3 additions & 0 deletions devenv/datasources.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,9 @@ datasources:
interval: Daily
timeField: "@timestamp"
esVersion: 70
timeInterval: "10s"
logMessageField: message
logLevelField: fields.level

- name: gdev-elasticsearch-v7-metricbeat
type: elasticsearch
Expand Down
16 changes: 16 additions & 0 deletions devenv/docker/blocks/saml/docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
saml:
container_name: saml
image: kristophjunge/test-saml-idp
environment:
SIMPLESAMLPHP_SP_ENTITY_ID: http://grafana.com
SIMPLESAMLPHP_SP_ASSERTION_CONSUMER_SERVICE: http://localhost/simplesaml/module.php/saml/sp/saml2-acs.php/test-sp
SIMPLESAMLPHP_SP_SINGLE_LOGOUT_SERVICE: http://localhost/simplesaml/module.php/saml/sp/saml2-logout.php/test-sp
SIMPLESAMLPHP_ADMIN_PASSWORD: grafana
SIMPLESAMLPHP_SECRET_SALT: salt
ports:
- "8080:8080"
- "8443:8443"
volumes:
- ./docker/blocks/saml/users.php:/var/www/simplesamlphp/config/authsources.php


16 changes: 16 additions & 0 deletions devenv/docker/blocks/saml/notes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Notes on Saml Docker Block

Uses https://github.com/kristophjunge/docker-test-saml-idp as a docker container for saml example.

## Use

See docker container docs on how to use this service - https://github.com/kristophjunge/docker-test-saml-idp#test-the-identity-provider-idp

## Groups & Users

admins
saml-admin (saml-admin@grafana.com)
editors
saml-editor (saml-editor@grafana.com)
no groups
saml-viewer (saml-viewer@grafana.com)
21 changes: 21 additions & 0 deletions devenv/docker/blocks/saml/users.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?php
$config = array(
'admin' => array(
'core:AdminPassword',
),
'grafana-userpass' => array(
'exampleauth:UserPass',
'saml-admin:grafana' => array(
'groups' => array('admins'),
'email' => 'saml-admin@grafana.com',
),
'saml-editor:grafana' => array(
'groups' => array('editors'),
'email' => 'saml-editor@grafana.com',
),
'saml-viewer:grafana' => array(
'groups' => array(),
'email' => 'saml-viewer@grafana.com',
),
),
);
2 changes: 1 addition & 1 deletion docs/sources/administration/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ If running the command returns this error:
then there are two flags that can be used to set homepath and the config file path.

`grafana-cli admin reset-admin-password --homepath "/usr/share/grafana" newpass`
`grafana-cli --homepath "/usr/share/grafana" admin reset-admin-password newpass`

If you have not lost the admin password then it is better to set in the Grafana UI. If you need to set the password in a script then the [Grafana API](http://docs.grafana.org/http_api/user/#change-password) can be used. Here is an example using curl with basic auth:

Expand Down
22 changes: 22 additions & 0 deletions docs/sources/auth/enhanced_ldap.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,25 @@ a user as member of a team and it will not be removed when the user signs in. Th
5. Click on `Add group` button to save.

<div class="clearfix"></div>

## Active LDAP Synchronization

In the open source version of Grafana, user data from LDAP will be synchronized only during the login process when authenticating using LDAP.

With this feature you can configure Grafana to actively sync users with LDAP server(s) in the background. Role and team membership will be updated, removed users will be disabled and logged out. Only users that have logged into Grafana at least once will be synchronized.```

```bash
[auth.ldap]
...

# You can use the Cron syntax or several predefined schedulers -
# @yearly (or @annually) | Run once a year, midnight, Jan. 1st | 0 0 0 1 1 *
# @monthly | Run once a month, midnight, first of month | 0 0 0 1 * *
# @weekly | Run once a week, midnight between Sat/Sun | 0 0 0 * * 0
# @daily (or @midnight) | Run once a day, midnight | 0 0 0 * * *
# @hourly | Run once an hour, beginning of hour | 0 0 * * * *
sync_cron = "@hourly"
# This cron expression format uses 6 space-separated fields (including seconds), for example
# sync_cron = "* */10 * * * *"
# This will run the LDAP Synchronization every 10th minute, which is also the minimal interval between the grafana sync times i.e. you cannot set it for every 9th minute
```
35 changes: 25 additions & 10 deletions docs/sources/features/panels/graph.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,20 +35,35 @@ The general tab allows customization of a panel's appearance and menu options.
### Repeat
Repeat a panel for each value of a variable. Repeating panels are described in more detail [here]({{< relref "../../reference/templating.md#repeating-panels" >}}).

### Drilldown / detail link
### Data link

The drilldown section allows adding dynamic links to the panel that can link to other dashboards
or URLs.
Data link in graph settings allows adding dynamic links to the visualization. Those links can link to either other dashboard or to an external URL.

Each link has a title, a type and params. A link can be either a ``dashboard`` or ``absolute`` links.
If it is a dashboard link, the `dashboard` value must be the name of a dashboard. If it is an
`absolute` link, the URL is the URL to the link.
{{< docs-imagebox img="/img/docs/data_link.png" max-width= "800px" >}}

``params`` allows adding additional URL params to the links. The format is the ``name=value`` with
multiple params separated by ``&``. Template variables can be added as values using ``$myvar``.
Data link is defined by title, url and a setting whether or not it should be opened in a new window.

When linking to another dashboard that uses template variables, you can use ``var-myvar=value`` to
populate the template variable to a desired value from the link.
**Title** is a human readable label for the link that will be displayed in the UI. The link itself is accessible in the graph's context menu when user **clicks on a single data point**:

{{< docs-imagebox img="/img/docs/data_link_tooltip.png" max-width= "800px" >}}

**URL** field allows the URL configuration for a given link. Apart from regular query params it also supports built-in variables and dashboard variables that you can choose from
available suggestions:

{{< docs-imagebox img="/img/docs/data_link_typeahead.png" max-width= "800px" >}}


Available built-in variables are:

1. ``__all_variables`` - will add all current dashboard's variables to the URL
2. ``__url_time_range`` - will add current dashboard's time range to the URL (i.e. ``?from=now-6h&to=now``)
3. ``__series_name`` - will add series name as a query param in the URL (i.e. ``?series=B-series``)
4. ``__value_time`` - will add datapoint's timestamp (Unix ms epoch) to the URL (i.e. ``?time=1560268814105``)


#### Template variables in data links
When linking to another dashboard that uses template variables, you can use ``var-myvar=${myvar}`` syntax (where ``myvar`` is a name of template variable)
to use current dashboard's variable value.

## Metrics

Expand Down
1 change: 1 addition & 0 deletions docs/sources/installation/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ callback URL to be correct).
> case add the subpath to the end of this URL setting.
### serve_from_sub_path
> Available in 6.3 and above
Serve Grafana from subpath specified in `root_url` setting. By
default it is set to `false` for compatibility reasons.
Expand Down
3 changes: 2 additions & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ module.exports = {
"roots": [
"<rootDir>/public/app",
"<rootDir>/public/test",
"<rootDir>/packages"
"<rootDir>/packages",
"<rootDir>/scripts",
],
"testRegex": "(\\.|/)(test)\\.(jsx?|tsx?)$",
"moduleFileExtensions": [
Expand Down
4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,12 @@
"@babel/polyfill": "7.2.5",
"@torkelo/react-select": "2.4.1",
"@types/angular-route": "1.7.0",
"@types/d3-scale-chromatic": "1.3.1",
"@types/enzyme-adapter-react-16": "1.0.5",
"@types/react-redux": "^7.0.8",
"@types/redux-logger": "3.0.7",
"@types/reselect": "2.2.0",
"@types/slate": "0.44.11",
"angular": "1.6.6",
"angular-bindonce": "0.3.1",
"angular-native-dragdrop": "1.2.2",
Expand Down
1 change: 1 addition & 0 deletions packages/grafana-runtime/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"license": "Apache-2.0",
"dependencies": {},
"devDependencies": {
"@types/systemjs": "^0.20.6",
"awesome-typescript-loader": "^5.2.1",
"lodash": "^4.17.10",
"pretty-format": "^24.5.0",
Expand Down
Loading

0 comments on commit 8314c7b

Please sign in to comment.