You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// PromptInstallCertsSafari prompts the user to install the HTTPS certificates if they are using Safari
285
-
funcPromptInstallCertsSafari() bool {
286
-
buttonPressed:=utilities.UserPrompt("display dialog \"The Arduino Agent needs a local HTTPS certificate to work correctly with Safari.\nIf you use Safari, you need to install it.\" buttons {\"Do not install\", \"Install the certificate for Safari\"} default button 2 with title \"Arduino Agent: Install certificate\"")
287
-
returnstrings.Contains(string(buttonPressed), "button returned:Install the certificate for Safari")
288
-
}
289
-
290
-
// PromptExpiredCerts prompts the user to update the HTTPS certificates if they are using Safari
291
-
funcPromptExpiredCerts(certDir*paths.Path) {
292
-
ifexpired, err:=isExpired(); err!=nil {
293
-
log.Errorf("cannot check if certificates are expired something went wrong: %s", err)
294
-
} elseifexpired {
295
-
buttonPressed:=utilities.UserPrompt("display dialog \"The Arduino Agent needs a local HTTPS certificate to work correctly with Safari.\nYour certificate is expired or close to expiration. Do you want to update it?\" buttons {\"Do not update\", \"Update the certificate for Safari\"} default button 2 with title \"Arduino Agent: Update certificate\"")
296
-
ifstrings.Contains(string(buttonPressed), "button returned:Update the certificate for Safari") {
297
-
err:=UninstallCertificates()
298
-
iferr!=nil {
299
-
log.Errorf("cannot uninstall certificates something went wrong: %s", err)
300
-
} else {
301
-
DeleteCertificates(certDir)
302
-
GenerateAndInstallCertificates(certDir)
303
-
}
304
-
}
305
-
}
306
-
}
307
-
308
282
// GenerateAndInstallCertificates generates and installs the certificates
Copy file name to clipboardExpand all lines: main.go
+27-4
Original file line number
Diff line number
Diff line change
@@ -178,7 +178,7 @@ func loop() {
178
178
// If we are updating manually from 1.2.7 to 1.3.0 we have to uninstall the old agent manually first.
179
179
// This check will inform the user if he needs to run the uninstall first
180
180
ifruntime.GOOS=="darwin"&&oldInstallExists() {
181
-
utilities.UserPrompt("display dialog \"Old agent installation of the Arduino Create Agent found, please uninstall it before launching the new one\" buttons \"OK\" with title \"Error\"")
181
+
utilities.UserPrompt("Old agent installation of the Arduino Create Agent found, please uninstall it before launching the new one", "\"OK\"", "OK", "Error")
182
182
os.Exit(0)
183
183
}
184
184
@@ -233,7 +233,7 @@ func loop() {
233
233
log.Panicf("config.ini cannot be parsed: %s", err)
log.Errorf("cannot check if certificates are expired something went wrong: %s", err)
380
+
} elseifexpired {
381
+
buttonPressed:=utilities.UserPrompt("The Arduino Agent needs a local HTTPS certificate to work correctly with Safari.\nYour certificate is expired or close to expiration. Do you want to update it?", "{\"Do not update\", \"Update the certificate for Safari\"}", "Update the certificate for Safari", "Arduino Agent: Update certificate")
382
+
ifbuttonPressed {
383
+
err:=cert.UninstallCertificates()
384
+
iferr!=nil {
385
+
log.Errorf("cannot uninstall certificates something went wrong: %s", err)
returnutilities.UserPrompt("The Arduino Agent needs a local HTTPS certificate to work correctly with Safari.\nIf you use Safari, you need to install it.", "{\"Do not install\", \"Install the certificate for Safari\"}", "Install the certificate for Safari", "Arduino Agent: Install certificate")
0 commit comments