Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
64bb346
Add function to retrieve certificates expiration date
MatteoPologruto Apr 23, 2024
0cb308a
Check the certificate expiration date
MatteoPologruto Apr 23, 2024
431dc58
Obtain certificates info using the systray icon
MatteoPologruto Apr 24, 2024
0463976
Manage errors that may occur retrieving certificates expiration date
MatteoPologruto Apr 24, 2024
6a0017f
Obtain default browser name on macOS
MatteoPologruto Apr 30, 2024
f80791d
Prompt Safari users to install HTTPS certificates and check if they a…
MatteoPologruto Apr 30, 2024
40f50f4
Skip some tests on macOS because the user is prompted to install cert…
MatteoPologruto May 2, 2024
f1f76a3
Set installCerts value in config.ini if certicates are manually insta…
MatteoPologruto May 2, 2024
88495ca
Always set installCerts if the certificates exist
MatteoPologruto May 2, 2024
a438fed
Add "Arduino Agent" to the title of dialogs
Xayton May 2, 2024
66ba136
Fix check for pressed buttons
Xayton May 2, 2024
52961e2
Move osascript execution function to Utilities to avoid code duplication
MatteoPologruto May 6, 2024
a759046
Modify certificate management from the systray menu
MatteoPologruto May 6, 2024
46ceb5d
Install certificates if they are missing and the flag inside the conf…
MatteoPologruto May 7, 2024
144515b
Avoid code duplication
MatteoPologruto May 7, 2024
e9c71b3
Fix button order and title
Xayton May 7, 2024
1ba5ed1
Do not restart the Agent if no action is performed on the certificate
MatteoPologruto May 7, 2024
1ec7171
Do not modify the config if the default browser is not Safari
MatteoPologruto May 7, 2024
27d8b76
Small messages/titles fixes
Xayton May 7, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix check for pressed buttons
  • Loading branch information
Xayton authored and MatteoPologruto committed May 8, 2024
commit 66ba136928bff6e5f9fd32057d14e3062ee0830b
4 changes: 2 additions & 2 deletions certificates/certificates.go
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ func PromptInstallCertsSafari() bool {
}
oscmd := exec.Command("osascript", "-e", "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 Certificates\"")
pressed, _ := oscmd.Output()
return string(pressed) == "button returned:Install the certificate for Safari"
return strings.Contains(string(pressed), "button returned:Install the certificate for Safari")
}

// PromptExpiredCerts prompts the user to update the HTTPS certificates if they are using Safari
Expand All @@ -296,7 +296,7 @@ func PromptExpiredCerts(certDir *paths.Path) {
log.Errorf("cannot check if certificates are expired something went wrong: %s", err)
} else if expired {
oscmd := exec.Command("osascript", "-e", "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 Certificates\"")
if pressed, _ := oscmd.Output(); string(pressed) == "button returned:Update the certificate for Safari" {
if pressed, _ := oscmd.Output(); strings.Contains(string(pressed), "button returned:Update the certificate for Safari") {
err := UninstallCertificates()
if err != nil {
log.Errorf("cannot uninstall certificates something went wrong: %s", err)
Expand Down