File tree 1 file changed +13
-0
lines changed
1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -64,12 +64,16 @@ func (s *Systray) start() {
64
64
s .updateMenuItem (mRmCrashes , config .LogsIsEmpty ())
65
65
66
66
mGenCerts := systray .AddMenuItem ("Generate and Install HTTPS certificates" , "HTTPS Certs" )
67
+ mRemoveCerts := systray .AddMenuItem ("Remove HTTPS certificates" , "" )
67
68
// On linux/windows chrome/firefox/edge(chromium) the agent works without problems on plain HTTP,
68
69
// so we disable the menuItem to generate/install the certificates
69
70
if runtime .GOOS != "darwin" {
70
71
s .updateMenuItem (mGenCerts , true )
72
+ s .updateMenuItem (mRemoveCerts , true )
71
73
} else {
72
74
s .updateMenuItem (mGenCerts , config .CertsExist ())
75
+ // TODO: should we add a different check to disable the uninstall function?
76
+ s .updateMenuItem (mRemoveCerts , ! config .CertsExist ())
73
77
}
74
78
75
79
// Add pause/quit
@@ -103,6 +107,15 @@ func (s *Systray) start() {
103
107
cert .DeleteCertificates (certDir )
104
108
}
105
109
s .Restart ()
110
+ case <- mRemoveCerts .ClickedCh :
111
+ err := cert .UninstallCertificates ()
112
+ if err != nil {
113
+ log .Errorf ("cannot uninstall certificates something went wrong: %s" , err )
114
+ } else {
115
+ certDir := config .GetCertificatesDir ()
116
+ cert .DeleteCertificates (certDir )
117
+ }
118
+ s .Restart ()
106
119
case <- mPause .ClickedCh :
107
120
s .Pause ()
108
121
case <- mQuit .ClickedCh :
You can’t perform that action at this time.
0 commit comments