Skip to content

Commit

Permalink
Merge branch 'master' into dfp-internal-metrics
Browse files Browse the repository at this point in the history
* master: (139 commits)
  SAML Role and Team sync (open source part) (#23391)
  Transformers: fixes column names generated by seriesToColumn transformer (#23642)
  Table: add a select option when multiple tables exist (#23545)
  Tabs: adds counter component (#23548)
  UX: Minor style tweaks and fixes (#23614)
  Modals: Fixed alignment in header (#23618)
  revent optional event arg change (#23622)
  Build: Stricter linting should break the build (#23606)
  Docs: update users API (#23570)
  Explore: Prevents sizing issue when split (#23596)
  @grafana/ui: Various smaller Icon updates (#23588)
  Because alpine uses musl instead of libc, the e2e/cypress was not compatible (#23602)
  Backend Plugins: Discard logged messages from logger named stdio (#23601)
  Fixed share json (#23607)
  Linting fixes for provisoning (#23600)
  Image Rendering: Remove PhantomJS support (#23460)
  Storybook: Organizing (#23572)
  @grafana/ui: Remove ColorPallete component (#23592)
  Docs: Change header levels of last three sections (#23587)
  CircleCI: Upgrade the build pipeline tool (#23595)
  ...
  • Loading branch information
bergquist committed Apr 17, 2020
2 parents 2356d1b + f023e7a commit 591f760
Show file tree
Hide file tree
Showing 1,147 changed files with 34,692 additions and 15,473 deletions.
16 changes: 8 additions & 8 deletions .bra.toml
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
[run]
init_cmds = [
["go", "run", "-mod=vendor", "build.go", "-dev", "build-cli"],
["go", "run", "-mod=vendor", "build.go", "-dev", "build-server"],
["./bin/grafana-server", "-packaging=dev", "cfg:app_mode=development"]
["go", "run", "build.go", "-dev", "build-cli"],
["go", "run", "build.go", "-dev", "build-server"],
["./bin/grafana-server", "-packaging=dev", "cfg:app_mode=development"]
]
watch_all = true
follow_symlinks = true
watch_dirs = [
"$WORKDIR/pkg",
"$WORKDIR/public/views",
"$WORKDIR/conf",
"$WORKDIR/pkg",
"$WORKDIR/public/views",
"$WORKDIR/conf",
]
watch_exts = [".go", ".ini", ".toml", ".template.html"]
build_delay = 1500
cmds = [
["go", "run", "-mod=vendor", "build.go", "-dev", "build-server"],
["./bin/grafana-server", "-packaging=dev", "cfg:app_mode=development"]
["go", "run", "build.go", "-dev", "build-server"],
["./bin/grafana-server", "-packaging=dev", "cfg:app_mode=development"]
]
41 changes: 31 additions & 10 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ executors:
- image: cimg/go:1.14
grafana-build:
docker:
- image: grafana/build-container:1.2.13
- image: grafana/build-container:1.2.15
grafana-publish:
docker:
- image: grafana/grafana-ci-deploy:1.2.4
- image: grafana/grafana-ci-deploy:1.2.5
windows-installer:
docker:
- image: grafana/wix-toolset-ci:v3
Expand All @@ -50,7 +50,7 @@ commands:
- run:
name: "Install Grafana build pipeline tool"
command: |
VERSION=0.2.8
VERSION=0.2.10
curl -fLO https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v${VERSION}/grabpl
chmod +x grabpl
mv grabpl /tmp
Expand Down Expand Up @@ -731,7 +731,11 @@ jobs:
golangci-lint run -v -j 4 --config scripts/go/configs/ci/.golangci.yml -E unconvert -E unused \
-E varcheck -E goconst -E errcheck -E staticcheck ./pkg/...
./scripts/go/bin/revive -formatter stylish -config ./scripts/go/configs/revive.toml ./pkg/...
./scripts/go/bin/revive -formatter stylish ./pkg/services/alerting/...
./scripts/go/bin/revive -formatter stylish -config ./scripts/go/configs/revive-strict.toml \
./pkg/services/alerting/... \
./pkg/services/provisioning/datasources/... \
./pkg/services/provisioning/dashboards/...
./scripts/go/bin/gosec -quiet -exclude=G104,G107,G108,G201,G202,G204,G301,G304,G401,G402,G501 \
-conf=./scripts/go/configs/gosec.json ./pkg/...
Expand Down Expand Up @@ -789,8 +793,7 @@ jobs:
when: on_success

build-docs-website:
docker:
- image: grafana/build-container:1.2.13
executor: grafana-build
working_directory: /docs
steps:
- checkout
Expand Down Expand Up @@ -864,7 +867,7 @@ jobs:
command: "./scripts/ci-job-succeeded.sh"
when: on_success

scan-docker-master:
scan-docker-images:
docker:
- image: circleci/buildpack-deps:stretch
steps:
Expand All @@ -887,11 +890,29 @@ jobs:
name: Clear trivy cache
command: trivy --clear-cache
- run:
name: Scan the latest grafana master alpine image with trivy
name: Scan grafana/grafana:master
command: trivy --exit-code 1 grafana/grafana:master
- run:
name: Scan the latest grafana master ubuntu image with trivy
name: Scan grafana/grafana:master-ubuntu
command: trivy --exit-code 1 grafana/grafana:master-ubuntu
- run:
name: Scan grafana/grafana-enterprise:master
command: trivy --exit-code 1 grafana/grafana-enterprise:master
- run:
name: Scan grafana/grafana-enterprise:master-ubuntu
command: trivy --exit-code 1 grafana/grafana-enterprise:master-ubuntu
- run:
name: Scan grafana/grafana:latest
command: trivy --exit-code 1 grafana/grafana:latest
- run:
name: Scan grafana/grafana:latest-ubuntu
command: trivy --exit-code 1 grafana/grafana:latest-ubuntu
- run:
name: Scan grafana/grafana-enterprise:latest
command: trivy --exit-code 1 grafana/grafana-enterprise:latest
- run:
name: Scan grafana/grafana-enterprise:latest-ubuntu
command: trivy --exit-code 1 grafana/grafana-enterprise:latest-ubuntu
- save_cache:
key: vulnerability-db
paths:
Expand Down Expand Up @@ -1227,4 +1248,4 @@ workflows:
cron: "0 0 * * *"
filters: *filter-only-master
jobs:
- scan-docker-master
- scan-docker-images
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# 7.0.0 (unreleased)

## Breaking changes

- **Removed PhantomJS**: PhantomJS was deprecated in [Grafana v6.4](https://grafana.com/docs/grafana/latest/guides/whats-new-in-v6-4/#phantomjs-deprecation) and starting from Grafana v7.0.0, all PhantomJS support has been removed. This means that Grafana no longer ships with a built-in image renderer, and we advise you to install the [Grafana Image Renderer plugin](https://grafana.com/grafana/plugins/grafana-image-renderer).

# 6.7.2 (2020-04-02)

### Bug Fixes
Expand All @@ -6,7 +12,7 @@
- **Dashboard**: Fixed issue with saving new dashboard after changing title . [#23104](https://github.com/grafana/grafana/pull/23104), [@dprokop](https://github.com/dprokop)
- **DataLinks**: make sure we use the correct datapoint when dataset contains null value.. [#22981](https://github.com/grafana/grafana/pull/22981), [@mckn](https://github.com/mckn)
- **Plugins**: Fixed issue for plugins that imported dateMath util . [#23069](https://github.com/grafana/grafana/pull/23069), [@mckn](https://github.com/mckn)
- **Security**: Fix for dashboard snapshot original dashboard link could contain XSS vulnerability in url. [#23254](https://github.com/grafana/grafana/pull/23254), [@torkelo](https://github.com/torkelo)
- **Security**: Fix for dashboard snapshot original dashboard link could contain XSS vulnerability in url. [#23254](https://github.com/grafana/grafana/pull/23254), [@torkelo](https://github.com/torkelo). Big thanks to Ahmed A. Sherif for reporting this issue.
- **Variables**: Fixes issue with too many queries being issued for nested template variables after value change. [#23220](https://github.com/grafana/grafana/pull/23220), [@torkelo](https://github.com/torkelo)
- **Plugins**: Expose promiseToDigest. [#23249](https://github.com/grafana/grafana/pull/23249), [@torkelo](https://github.com/torkelo)
- **Reporting (Enterprise)**: Fixes issue updating a report created by someone else
Expand Down
21 changes: 1 addition & 20 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Golang build container
FROM golang:1.13.4-alpine
FROM golang:1.14.1-alpine

RUN apk add --no-cache gcc g++

Expand All @@ -18,16 +18,6 @@ RUN go run build.go build
# Node build container
FROM node:12.13.0-alpine

# PhantomJS
RUN apk add --no-cache curl &&\
cd /tmp && curl -Ls https://github.com/dustinblackman/phantomized/releases/download/2.1.1/dockerized-phantomjs.tar.gz | tar xz &&\
cp -R lib lib64 / &&\
cp -R usr/lib/x86_64-linux-gnu /usr/lib &&\
cp -R usr/share /usr/share &&\
cp -R etc/fonts /etc &&\
curl -k -Ls https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-2.1.1-linux-x86_64.tar.bz2 | tar -jxf - &&\
cp phantomjs-2.1.1-linux-x86_64/bin/phantomjs /usr/local/bin/phantomjs

WORKDIR /usr/src/app/

COPY package.json yarn.lock ./
Expand Down Expand Up @@ -80,18 +70,9 @@ RUN mkdir -p "$GF_PATHS_HOME/.aws" && \
chown -R grafana:grafana "$GF_PATHS_DATA" "$GF_PATHS_HOME/.aws" "$GF_PATHS_LOGS" "$GF_PATHS_PLUGINS" "$GF_PATHS_PROVISIONING" && \
chmod -R 777 "$GF_PATHS_DATA" "$GF_PATHS_HOME/.aws" "$GF_PATHS_LOGS" "$GF_PATHS_PLUGINS" "$GF_PATHS_PROVISIONING"

# PhantomJS
COPY --from=1 /tmp/lib /lib
COPY --from=1 /tmp/lib64 /lib64
COPY --from=1 /tmp/usr/lib/x86_64-linux-gnu /usr/lib/x86_64-linux-gnu
COPY --from=1 /tmp/usr/share /usr/share
COPY --from=1 /tmp/etc/fonts /etc/fonts
COPY --from=1 /usr/local/bin/phantomjs /usr/local/bin

COPY --from=0 /go/src/github.com/grafana/grafana/bin/linux-amd64/grafana-server /go/src/github.com/grafana/grafana/bin/linux-amd64/grafana-cli ./bin/
COPY --from=1 /usr/src/app/public ./public
COPY --from=1 /usr/src/app/tools ./tools
COPY tools/phantomjs/render.js ./tools/phantomjs/render.js

EXPOSE 3000

Expand Down
14 changes: 3 additions & 11 deletions Dockerfile.ubuntu
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.13.4 AS go-builder
FROM golang:1.14.1 AS go-builder

WORKDIR /src/grafana

Expand All @@ -14,11 +14,6 @@ RUN go run build.go build

FROM node:12.13 AS js-builder

# PhantomJS
RUN apt-get update && apt-get install -y curl &&\
curl -L https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-2.1.1-linux-x86_64.tar.bz2 | tar xj &&\
cp phantomjs-2.1.1-linux-x86_64/bin/phantomjs /usr/local/bin/phantomjs

WORKDIR /usr/src/app/

COPY package.json yarn.lock ./
Expand Down Expand Up @@ -54,8 +49,8 @@ WORKDIR $GF_PATHS_HOME

COPY conf conf

# We need font libs for phantomjs, and curl should be part of the image
RUN apt-get update && apt-get upgrade -y && apt-get install -y ca-certificates libfontconfig1 curl
# curl should be part of the image
RUN apt-get update && apt-get upgrade -y && apt-get install -y ca-certificates curl

RUN mkdir -p "$GF_PATHS_HOME/.aws" && \
addgroup --system --gid $GF_GID grafana && \
Expand All @@ -71,14 +66,11 @@ RUN mkdir -p "$GF_PATHS_HOME/.aws" && \
chown -R grafana:grafana "$GF_PATHS_DATA" "$GF_PATHS_HOME/.aws" "$GF_PATHS_LOGS" "$GF_PATHS_PLUGINS" "$GF_PATHS_PROVISIONING" && \
chmod -R 777 "$GF_PATHS_DATA" "$GF_PATHS_HOME/.aws" "$GF_PATHS_LOGS" "$GF_PATHS_PLUGINS" "$GF_PATHS_PROVISIONING"

# PhantomJS
COPY --from=js-builder /usr/local/bin/phantomjs /usr/local/bin/

COPY --from=go-builder /src/grafana/bin/linux-amd64/grafana-server /src/grafana/bin/linux-amd64/grafana-cli bin/
COPY --from=js-builder /usr/src/app/public public
COPY --from=js-builder /usr/src/app/tools tools

COPY tools/phantomjs/render.js tools/phantomjs/
COPY packaging/docker/run.sh /

USER grafana
Expand Down
1 change: 0 additions & 1 deletion Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ module.exports = function (grunt) {
config.libc = grunt.option('libc');
}

config.phjs = grunt.option('phjsToRelease');
config.pkg.version = grunt.option('pkgVer') || config.pkg.version;

console.log('Version', config.pkg.version);
Expand Down
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,10 @@ revive-alerting: scripts/go/bin/revive
@echo "lint alerting via revive"
@scripts/go/bin/revive \
-formatter stylish \
./pkg/services/alerting/...
-config ./scripts/go/configs/revive-strict.toml \
./pkg/services/alerting/... \
./pkg/services/provisioning/datasources/... \
./pkg/services/provisioning/dashboards/...

scripts/go/bin/golangci-lint: scripts/go/go.mod
@cd scripts/go; \
Expand Down
4 changes: 4 additions & 0 deletions api-extractor.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@
"extractorMessageReporting": {
"default": {
"logLevel": "warning"
},
"ae-internal-missing-underscore": {
"logLevel": "none",
"addToApiReportFile": false
}
},
"tsdocMessageReporting": {
Expand Down
5 changes: 0 additions & 5 deletions build.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ var (
linuxPackageVersion string = "v1"
linuxPackageIteration string = ""
race bool
phjsToRelease string
workingDir string
includeBuildId bool = true
buildId string = "0"
Expand Down Expand Up @@ -69,7 +68,6 @@ func main() {
flag.StringVar(&libc, "libc", "", "LIBC")
flag.BoolVar(&cgo, "cgo-enabled", cgo, "Enable cgo")
flag.StringVar(&pkgArch, "pkg-arch", "", "PKG ARCH")
flag.StringVar(&phjsToRelease, "phjs", "", "PhantomJS binary")
flag.BoolVar(&race, "race", race, "Use race detector")
flag.BoolVar(&modVendor, "modVendor", modVendor, "Go modules use vendor folder")
flag.BoolVar(&includeBuildId, "includeBuildId", includeBuildId, "IncludeBuildId in package name")
Expand Down Expand Up @@ -459,9 +457,6 @@ func gruntBuildArg(task string) []string {
if libc != "" {
args = append(args, fmt.Sprintf("--libc=%s", libc))
}
if phjsToRelease != "" {
args = append(args, fmt.Sprintf("--phjsToRelease=%v", phjsToRelease))
}
if enterprise {
args = append(args, "--enterprise")
}
Expand Down
41 changes: 0 additions & 41 deletions conf/defaults.ini
Original file line number Diff line number Diff line change
Expand Up @@ -423,47 +423,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
Expand Down
23 changes: 23 additions & 0 deletions conf/provisioning/datasources/loki_test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@

apiVersion: 1

datasources:
- name: loki-derived-test
type: loki
access: proxy
url: http://localhost:3100
editable: false
jsonData:
derivedFields:
- name: "traceID"
matcherRegex: "trace_id=(\\w+)"
url: "$${__value.raw}"
datasourceUid: jaeger1234

- name: jaeger-derived-test
type: jaeger
uid: jaeger1234
access: proxy
url: http://localhost:16686
editable: false

Loading

0 comments on commit 591f760

Please sign in to comment.