Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
d505d83e
Unverified
Commit
d505d83e
authored
Oct 25, 2018
by
Torkel Ödegaard
Committed by
GitHub
Oct 25, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #13679 from mjtrangoni/fix-megacheck-issues
Fix megacheck issues
parents
946ca547
91447dcb
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
24 additions
and
28 deletions
+24
-28
pkg/login/ldap.go
+1
-1
pkg/middleware/middleware.go
+7
-6
pkg/plugins/plugins.go
+0
-1
pkg/services/alerting/reader.go
+2
-5
pkg/tsdb/graphite/graphite.go
+2
-4
pkg/tsdb/stackdriver/stackdriver.go
+1
-2
scripts/build/publish.go
+11
-9
No files found.
pkg/login/ldap.go
View file @
d505d83e
...
...
@@ -185,7 +185,7 @@ func (a *ldapAuther) GetGrafanaUserFor(ctx *m.ReqContext, ldapUser *LdapUserInfo
if
ldapUser
.
isMemberOf
(
group
.
GroupDN
)
{
extUser
.
OrgRoles
[
group
.
OrgId
]
=
group
.
OrgRole
if
extUser
.
IsGrafanaAdmin
==
nil
||
*
extUser
.
IsGrafanaAdmin
==
false
{
if
extUser
.
IsGrafanaAdmin
==
nil
||
!*
extUser
.
IsGrafanaAdmin
{
extUser
.
IsGrafanaAdmin
=
group
.
IsGrafanaAdmin
}
}
...
...
pkg/middleware/middleware.go
View file @
d505d83e
...
...
@@ -43,12 +43,13 @@ func GetContextHandler() macaron.Handler {
// then init session and look for userId in session
// then look for api key in session (special case for render calls via api)
// then test if anonymous access is enabled
if
initContextWithRenderAuth
(
ctx
)
||
initContextWithApiKey
(
ctx
)
||
initContextWithBasicAuth
(
ctx
,
orgId
)
||
initContextWithAuthProxy
(
ctx
,
orgId
)
||
initContextWithUserSessionCookie
(
ctx
,
orgId
)
||
initContextWithAnonymousUser
(
ctx
)
{
switch
{
case
initContextWithRenderAuth
(
ctx
)
:
case
initContextWithApiKey
(
ctx
)
:
case
initContextWithBasicAuth
(
ctx
,
orgId
)
:
case
initContextWithAuthProxy
(
ctx
,
orgId
)
:
case
initContextWithUserSessionCookie
(
ctx
,
orgId
)
:
case
initContextWithAnonymousUser
(
ctx
)
:
}
ctx
.
Logger
=
log
.
New
(
"context"
,
"userId"
,
ctx
.
UserId
,
"orgId"
,
ctx
.
OrgId
,
"uname"
,
ctx
.
Login
)
...
...
pkg/plugins/plugins.go
View file @
d505d83e
...
...
@@ -121,7 +121,6 @@ func (pm *PluginManager) Run(ctx context.Context) error {
pm
.
checkForUpdates
()
case
<-
ctx
.
Done
()
:
run
=
false
break
}
}
...
...
pkg/services/alerting/reader.go
View file @
d505d83e
...
...
@@ -34,11 +34,8 @@ func NewRuleReader() *DefaultRuleReader {
func
(
arr
*
DefaultRuleReader
)
initReader
()
{
heartbeat
:=
time
.
NewTicker
(
time
.
Second
*
10
)
for
{
select
{
case
<-
heartbeat
.
C
:
arr
.
heartbeat
()
}
for
range
heartbeat
.
C
{
arr
.
heartbeat
()
}
}
...
...
pkg/tsdb/graphite/graphite.go
View file @
d505d83e
...
...
@@ -164,14 +164,12 @@ func formatTimeRange(input string) string {
func
fixIntervalFormat
(
target
string
)
string
{
rMinute
:=
regexp
.
MustCompile
(
`'(\d+)m'`
)
rMin
:=
regexp
.
MustCompile
(
"m"
)
target
=
rMinute
.
ReplaceAllStringFunc
(
target
,
func
(
m
string
)
string
{
return
rMin
.
ReplaceAllString
(
m
,
"min"
)
return
strings
.
Replace
(
m
,
"m"
,
"min"
,
-
1
)
})
rMonth
:=
regexp
.
MustCompile
(
`'(\d+)M'`
)
rMon
:=
regexp
.
MustCompile
(
"M"
)
target
=
rMonth
.
ReplaceAllStringFunc
(
target
,
func
(
M
string
)
string
{
return
rMon
.
ReplaceAllString
(
M
,
"mon"
)
return
strings
.
Replace
(
M
,
"M"
,
"mon"
,
-
1
)
})
return
target
}
pkg/tsdb/stackdriver/stackdriver.go
View file @
d505d83e
...
...
@@ -186,8 +186,7 @@ func reverse(s string) string {
}
func
interpolateFilterWildcards
(
value
string
)
string
{
re
:=
regexp
.
MustCompile
(
"[*]"
)
matches
:=
len
(
re
.
FindAllStringIndex
(
value
,
-
1
))
matches
:=
strings
.
Count
(
value
,
"*"
)
if
matches
==
2
&&
strings
.
HasSuffix
(
value
,
"*"
)
&&
strings
.
HasPrefix
(
value
,
"*"
)
{
value
=
strings
.
Replace
(
value
,
"*"
,
""
,
-
1
)
value
=
fmt
.
Sprintf
(
`has_substring("%s")`
,
value
)
...
...
scripts/build/publish.go
View file @
d505d83e
...
...
@@ -22,13 +22,13 @@ var versionRe = regexp.MustCompile(`grafana-(.*)(\.|_)(arm64|armhfp|aarch64|armv
var
debVersionRe
=
regexp
.
MustCompile
(
`grafana_(.*)_(arm64|armv7|armhf|amd64)\.deb`
)
var
builds
=
[]
build
{}
var
architectureMapping
=
map
[
string
]
string
{
"armv7"
:
"armv7"
,
"armhfp"
:
"armv7"
,
"armhf"
:
"armv7"
,
"arm64"
:
"arm64"
,
"aarch64"
:
"arm64"
,
"amd64"
:
"amd64"
,
"x86_64"
:
"amd64"
,
"armv7"
:
"armv7"
,
"armhfp"
:
"armv7"
,
"armhf"
:
"armv7"
,
"arm64"
:
"arm64"
,
"aarch64"
:
"arm64"
,
"amd64"
:
"amd64"
,
"x86_64"
:
"amd64"
,
}
func
main
()
{
...
...
@@ -78,7 +78,7 @@ func mapPackage(path string, name string, shaBytes []byte) (build, error) {
if
len
(
result
)
>
0
{
version
=
string
(
result
[
1
])
log
.
Printf
(
"Version detected: %v"
,
version
)
}
else
if
(
len
(
debResult
)
>
0
)
{
}
else
if
len
(
debResult
)
>
0
{
version
=
string
(
debResult
[
1
])
}
else
{
return
build
{},
fmt
.
Errorf
(
"Unable to figure out version from '%v'"
,
name
)
...
...
@@ -124,6 +124,9 @@ func mapPackage(path string, name string, shaBytes []byte) (build, error) {
}
func
packageWalker
(
path
string
,
f
os
.
FileInfo
,
err
error
)
error
{
if
err
!=
nil
{
log
.
Printf
(
"error: %v"
,
err
)
}
if
f
.
Name
()
==
"dist"
||
strings
.
Contains
(
f
.
Name
(),
"sha256"
)
||
strings
.
Contains
(
f
.
Name
(),
"latest"
)
{
return
nil
}
...
...
@@ -134,7 +137,6 @@ func packageWalker(path string, f os.FileInfo, err error) error {
}
build
,
err
:=
mapPackage
(
path
,
f
.
Name
(),
shaBytes
)
if
err
!=
nil
{
log
.
Printf
(
"Could not map metadata from package: %v"
,
err
)
return
nil
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment