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
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
2 deletions
+13
-2
pkg/services/alerting/notifiers/alertmanager.go
+13
-2
No files found.
pkg/services/alerting/notifiers/alertmanager.go
View file @
528a61b8
...
...
@@ -35,7 +35,18 @@ func init() {
</div>
<div class="gf-form max-width-30">
<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">
<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>
`
,
...
...
@@ -80,7 +91,7 @@ func NewAlertmanagerNotifier(model *models.AlertNotification) (alerting.Notifier
}
}
basicAuthUser
:=
model
.
Settings
.
Get
(
"basicAuthUser"
)
.
MustString
()
basicAuthPassword
:=
model
.
Settings
.
Get
(
"basicAuthPassword"
)
.
MustString
(
)
basicAuthPassword
:=
model
.
DecryptedValue
(
"basicAuthPassword"
,
model
.
Settings
.
Get
(
"basicAuthPassword"
)
.
MustString
()
)
return
&
AlertmanagerNotifier
{
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