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
528a61b8
Unverified
Commit
528a61b8
authored
Jul 17, 2020
by
Mitsuhiro Tanda
Committed by
GitHub
Jul 17, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Alerting: Store sensitive settings encrypted for alertmanager notifier (#26318)
Ref #25967
parent
7969d664
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
5 deletions
+16
-5
pkg/services/alerting/notifiers/alertmanager.go
+16
-5
No files found.
pkg/services/alerting/notifiers/alertmanager.go
View file @
528a61b8
...
@@ -33,10 +33,21 @@ func init() {
...
@@ -33,10 +33,21 @@ func init() {
<span class="gf-form-label width-10">Basic Auth User</span>
<span class="gf-form-label width-10">Basic Auth User</span>
<input type="text" class="gf-form-input max-width-30" ng-model="ctrl.model.settings.basicAuthUser" placeholder=""></input>
<input type="text" class="gf-form-input max-width-30" ng-model="ctrl.model.settings.basicAuthUser" placeholder=""></input>
</div>
</div>
<div class="gf-form max-width-30">
<div class="gf-form max-width-30">
<span class="gf-form-label width-10">Basic Auth Password</span>
<span class="gf-form-label width-10">Basic Auth Password</span>
<input type="text" class="gf-form-input max-width-30" ng-model="ctrl.model.settings.basicAuthPassword" placeholder=""></input>
<div class="gf-form gf-form--grow" ng-if="!ctrl.model.secureFields.basicAuthPassword">
</div>
<input type="text"
class="gf-form-input max-width-30"
ng-init="ctrl.model.secureSettings.basicAuthPassword = ctrl.model.settings.basicAuthPassword || null; ctrl.model.settings.basicAuthPassword = null;"
ng-model="ctrl.model.secureSettings.basicAuthPassword"
data-placement="right">
</input>
</div>
<div class="gf-form" ng-if="ctrl.model.secureFields.basicAuthPassword">
<input type="text" class="gf-form-input max-width-18" disabled="disabled" value="configured" />
<a class="btn btn-secondary gf-form-btn" href="#" ng-click="ctrl.model.secureFields.basicAuthPassword = false">reset</a>
</div>
</div>
</div>
</div>
`
,
`
,
Options
:
[]
alerting
.
NotifierOption
{
Options
:
[]
alerting
.
NotifierOption
{
...
@@ -80,7 +91,7 @@ func NewAlertmanagerNotifier(model *models.AlertNotification) (alerting.Notifier
...
@@ -80,7 +91,7 @@ func NewAlertmanagerNotifier(model *models.AlertNotification) (alerting.Notifier
}
}
}
}
basicAuthUser
:=
model
.
Settings
.
Get
(
"basicAuthUser"
)
.
MustString
()
basicAuthUser
:=
model
.
Settings
.
Get
(
"basicAuthUser"
)
.
MustString
()
basicAuthPassword
:=
model
.
Settings
.
Get
(
"basicAuthPassword"
)
.
MustString
(
)
basicAuthPassword
:=
model
.
DecryptedValue
(
"basicAuthPassword"
,
model
.
Settings
.
Get
(
"basicAuthPassword"
)
.
MustString
()
)
return
&
AlertmanagerNotifier
{
return
&
AlertmanagerNotifier
{
NotifierBase
:
NewNotifierBase
(
model
),
NotifierBase
:
NewNotifierBase
(
model
),
...
...
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