Skip to content

Commit

Permalink
Merge branch 'master' into reduce-ldap
Browse files Browse the repository at this point in the history
* master: (28 commits)
  Feature: do dev environment via makefile (#17136)
  devenv: adds auth proxy load test (#17271)
  Table: various minor fixes (alpha panel) (#17258)
  Singlestat: fixes issue with value placement and line wraps (#17249)
  Devenv: Update Graphite port in dev datasources (#17255)
  Chore: bump grafana-ui version (#17256)
  Release: Updated latest.json
  Auth: Logout disabled user (#17166)
  docs: fixes typo in provisioning docs (#17248)
  CloudWatch: Made region visible for AWS Cloudwatch Expressions (#17243)
  Panel: Pass transparency prop down to React panels. (#17235)
  Build: Fix filter for building msi during release (#17236)
  DataSourcePlugin: Avoid anuglar injector if only one parameter (#17239)
  Alerting: Support for configuring content field for Discord alert notifier (#17017)
  Explore: Update the way Loki retrieve log context (#17204)
  Docs: Fix grammar in docs (#17233)
  LDAP: consistently name the LDAP entities (#17203)
  Panels: Show Drilldown links in top-left corner of custom React panels (#17142)
  Build: Fix final prompt for @grafana/ui npm publish confirmation
  Docs: Updated versions selector
  ...
  • Loading branch information
markelog committed May 25, 2019
2 parents e7f6b16 + baa55ab commit 56287d8
Show file tree
Hide file tree
Showing 85 changed files with 805 additions and 439 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -723,7 +723,7 @@ workflows:
- backend-lint
- mysql-integration-test
- postgres-integration-test
filters: *filter-only-master
filters: *filter-only-release

build-branches-and-prs:
jobs:
Expand Down
16 changes: 15 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,18 @@
# 6.2.0 (unreleased)
# 6.2.0 (2019-05-22)

### Bug Fixes
* **BarGauge**: Fix for negative min values. [#17192](https://github.com/grafana/grafana/pull/17192), [@torkelo](https://github.com/torkelo)
* **Gauge/BarGauge**: Fix for issues editing min & max options. [#17174](https://github.com/grafana/grafana/pull/17174)
* **Search**: Make only folder name only open search with current folder filter. [#17226](https://github.com/grafana/grafana/pull/17226)
* **AzureMonitor**: Revert to clearing chained dropdowns. [#17212](https://github.com/grafana/grafana/pull/17212)

### Breaking Changes
* **Plugins**: Data source plugins that process hidden queries need to add a "hiddenQueries: true" attribute in plugin.json. [#17124](https://github.com/grafana/grafana/pull/17124), [@ryantxu](https://github.com/ryantxu)

### Removal of old deprecated package repository

5 months ago we deprecated our old package cloud repository and [replaced it](https://grafana.com/blog/2019/01/05/moving-to-packages.grafana.com/) with our own. We will remove the old depreciated
repo on July 1st. Make sure you have switched to the new repo by then. The new repository has all our old releases so you are not required to upgrade just to switch package repository.

# 6.2.0-beta2 (2019-05-15)

Expand Down
15 changes: 14 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
-include local/Makefile

.PHONY: all deps-go deps-js deps build-go build-server build-cli build-js build build-docker-dev build-docker-full lint-go test-go test-js test run clean gosec revive
.PHONY: all deps-go deps-js deps build-go build-server build-cli build-js build build-docker-dev build-docker-full lint-go test-go test-js test run clean gosec revive devenv devenv-down

GO := GO111MODULE=on go
GO_FILES := ./pkg/...
Expand Down Expand Up @@ -84,6 +84,19 @@ revive: scripts/go/bin/revive
-config ./scripts/go/configs/revive.toml \
$(GO_FILES)

# create docker-compose file with provided sources and start them
# example: make devenv sources=postgres,openldap
devenv: devenv-down
$(eval targets := $(shell echo '$(sources)' | tr "," " "))

@cd devenv; \
./create_docker_compose.sh $(targets); \
docker-compose up -d

# drop down the envs
devenv-down:
@cd devenv; docker-compose down;

# TODO recheck the rules and leave only necessary exclusions
gosec: scripts/go/bin/gosec
@scripts/go/bin/gosec -quiet \
Expand Down
3 changes: 2 additions & 1 deletion devenv/datasources.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@

apiVersion: 1

datasources:
- name: gdev-graphite
type: graphite
access: proxy
url: http://localhost:8080
url: http://localhost:8180
jsonData:
graphiteVersion: "1.1"

Expand Down
10 changes: 10 additions & 0 deletions devenv/docker/loadtest/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ Runs load tests and checks using [k6](https://k6.io/).

Docker

To run the auth proxy test you'll need to setup nginx proxy from docker block and
enable auth proxy together with configuring Grafana for auth proxy.

## Run

Run load test for 15 minutes using 2 virtual users and targeting http://localhost:3000.
Expand All @@ -32,6 +35,13 @@ Run load test for 10 virtual users:
$ ./run.sh -v 10
```

Run auth proxy test:

```bash
$ ./run.sh -c auth_proxy_test
```


Example output:

```bash
Expand Down
56 changes: 56 additions & 0 deletions devenv/docker/loadtest/auth_proxy_test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
import { sleep, check, group } from 'k6';
import { createBasicAuthClient } from './modules/client.js';

export let options = {
noCookiesReset: true
};

let endpoint = __ENV.URL || 'http://localhost:10080/grafana';
const client = createBasicAuthClient(endpoint, 'user1', 'grafana');
client.withOrgId(1);

export const setup = () => {
const adminClient = createBasicAuthClient(endpoint, 'admin', 'admin');
let res = adminClient.datasources.getByName('gdev-prometheus');
if (res.status !== 200) {
throw new Error('Expected 200 response status when creating datasource');
}

return {
datasourceId: res.json().id,
};
}

export default (data) => {
group("auth proxy test", () => {
group("batch proxy requests", () => {
const d = new Date();
const batchCount = 300;
const requests = [];
const query = encodeURI('topk(5, max(scrape_duration_seconds) by (job))');
const start = (d.getTime() / 1000) - 3600;
const end = (d.getTime() / 1000);
const step = 20;

requests.push({ method: 'GET', url: '/api/annotations?dashboardId=8&from=1558670300607&to=1558691900607' });

for (let n = 0; n < batchCount; n++) {
requests.push({
method: 'GET',
url: `/api/datasources/proxy/${data.datasourceId}/api/v1/query_range?query=${query}&start=${start}&end=${end}&step=${step}`,
});
}

let responses = client.batch(requests);
for (let n = 0; n < batchCount; n++) {
check(responses[n], {
'response status is 200': (r) => r.status === 200,
});
}
});
});

sleep(5)
}

export const teardown = (data) => {}
8 changes: 6 additions & 2 deletions devenv/docker/loadtest/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ run() {
duration='15m'
url='http://localhost:3000'
vus='2'
testcase='auth_token_test'

while getopts ":d:u:v:" o; do
while getopts ":d:u:v:c:" o; do
case "${o}" in
d)
duration=${OPTARG}
Expand All @@ -18,11 +19,14 @@ run() {
v)
vus=${OPTARG}
;;
c)
testcase=${OPTARG}
;;
esac
done
shift $((OPTIND-1))

docker run -t --network=host -v $PWD:/src -e URL=$url --rm -i loadimpact/k6:master run --vus $vus --duration $duration src/auth_token_test.js
docker run -t --network=host -v $PWD:/src -e URL=$url --rm -i loadimpact/k6:master run --vus $vus --duration $duration src/$testcase.js
}

run "$@"
2 changes: 1 addition & 1 deletion docs/sources/administration/provisioning.md
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ notifiers:
# or
org_name: Main Org.
is_default: true
send_reminders: true
send_reminder: true
frequency: 1h
disable_resolve_message: false
# See `Supported Settings` section for settings supporter for each
Expand Down
63 changes: 63 additions & 0 deletions docs/sources/auth/ldap.md
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,67 @@ email = "email"
# [[servers.group_mappings]] omitted for clarity
```

### Multiple LDAP servers

Grafana does support receiving information from multiple LDAP servers.

**LDAP specific configuration file (ldap.toml):**
```bash
# --- First LDAP Server ---

[[servers]]
host = "10.0.0.1"
port = 389
use_ssl = false
start_tls = false
ssl_skip_verify = false
bind_dn = "cn=admin,dc=grafana,dc=org"
bind_password = 'grafana'
search_filter = "(cn=%s)"
search_base_dns = ["ou=users,dc=grafana,dc=org"]

[servers.attributes]
name = "givenName"
surname = "sn"
username = "cn"
member_of = "memberOf"
email = "email"

[[servers.group_mappings]]
group_dn = "cn=admins,ou=groups,dc=grafana,dc=org"
org_role = "Admin"
grafana_admin = true

# --- Second LDAP Server ---

[[servers]]
host = "10.0.0.2"
port = 389
use_ssl = false
start_tls = false
ssl_skip_verify = false

bind_dn = "cn=admin,dc=grafana,dc=org"
bind_password = 'grafana'
search_filter = "(cn=%s)"
search_base_dns = ["ou=users,dc=grafana,dc=org"]

[servers.attributes]
name = "givenName"
surname = "sn"
username = "cn"
member_of = "memberOf"
email = "email"

[[servers.group_mappings]]
group_dn = "cn=editors,ou=groups,dc=grafana,dc=org"
org_role = "Editor"

[[servers.group_mappings]]
group_dn = "*"
org_role = "Viewer"
```

### Active Directory

[Active Directory](https://technet.microsoft.com/en-us/library/hh831484(v=ws.11).aspx) is a directory service which is commonly used in Windows environments.
Expand Down Expand Up @@ -247,6 +308,8 @@ email = "mail"
# [[servers.group_mappings]] omitted for clarity
```



#### Port requirements

In above example SSL is enabled and an encrypted port have been configured. If your Active Directory don't support SSL please change `enable_ssl = false` and `port = 389`.
Expand Down
Loading

0 comments on commit 56287d8

Please sign in to comment.