clarencecastillo Posted August 9, 2017 Posted August 9, 2017 (edited) Power Thesaurus Search for Alfred Search for synonyms and antonyms on Power Thesaurus from Alfred 4. Installation Get Power Thesaurus for Alfred from GitHub or Packal. Usage Primary commands: pows <word> — Search Power Thesaurus for synonyms of <word>. powa <word> — Search Power Thesaurus for antonyms of <word>. For both primary commands: ↩ or ⌘+NUM — Copy highlighted entry to the clipboard ⌘+L — Show full query in Alfred's Large Text window Results Resulting synonyms or antonyms will be sequentially listed according to user rating. Troubleshooting SSL Errors If you're having SSL issues, try temporarily disabling it by setting the workflow environment variable ALFRED_PT_SSL_VERIFICATION to False. This will bypass SSL verification as a workaround while waiting for the SSL certificate to be rectified. You can check Power Thesaurus's SSL certificate status here. Be sure to set it back to True when all's green. Other Errors For other errors, please open an issue describing how you got the error and together with the logs from Alfred > Workflows > Debugging Mode if possible. There's no proper error handling in place yet, so we'll have to troubleshoot things this way for now. Licensing and Acknowledgement This workflow is released under the MIT Licence. It is heavily based on deanishe's Alfred-Workflow, also MIT-licensed. By using this workflow, you acknowledge, understand and signify your agreement to Power Thesaurus Website's terms and conditions, and privacy statement. Edited June 18, 2020 by clarencecastillo Add troubleshooting section targumanu, strajk and Schmedu 2 1
vitor Posted August 9, 2017 Posted August 9, 2017 (edited) 11 hours ago, clarencecastillo said: Search for synonyms and antonyms on Powerthesaurus.org from Alfred 2 & 3. The moment you save this Workflow from Alfred 3, it’s no longer compatible with Alfred 2. You’re using an old version of Alfred-Workflow. Versions bellow a certain threshold are blocked from running in Alfred. Edited August 9, 2017 by vitor clarencecastillo 1
deanishe Posted August 9, 2017 Posted August 9, 2017 1 hour ago, vitor said: You’re using an old version of Alfred-Workflow. Versions bellow a certain threshold are blocked from running in Alfred. @vitor That link points to this thread.
vitor Posted August 9, 2017 Posted August 9, 2017 1 minute ago, deanishe said: @vitor That link points to this thread. Fixed. Thank you. Meant to link to the official documentation.
Suhvity Posted April 7, 2020 Posted April 7, 2020 Been using this workflow for the past year but recently it has stopped working for me. I get an error whenever I try to enter a synonym (or antonym) into the workflow. For reference, I'm using Alfred 4. Any ideas for a fix?
clarencecastillo Posted April 8, 2020 Author Posted April 8, 2020 I've updated the workflow to fix the errors. Please try again with this new version. projjol and Suhvity 2
Suhvity Posted April 10, 2020 Posted April 10, 2020 On 4/8/2020 at 8:49 AM, clarencecastillo said: I've updated the workflow to fix the errors. Please try again with this new version. Thanks for the fix! Works like a charm now!
rozz3r Posted April 13, 2020 Posted April 13, 2020 On 4/8/2020 at 4:49 PM, clarencecastillo said: I've updated the workflow to fix the errors. Please try again with this new version. Thank you. As a writer, this is one of my most used workflows! projjol, Schmedu and clarencecastillo 3
projjol Posted June 1, 2020 Posted June 1, 2020 I'm getting a "Max retries exceeded" error. Is this issue local to me or have others faced this as well? Thank you!
clarencecastillo Posted June 1, 2020 Author Posted June 1, 2020 (edited) 1 hour ago, projjol said: I'm getting a "Max retries exceeded" error. Is this issue local to me or have others faced this as well? Thank you! Yep, I'm getting this issue as well. Something to do with verification failure of Power Thesaurus' SSL certificates. Will shortly release a hotfix for this. If this persists, please open an issue here. Edit: I've released the fix for this which can be downloaded from here. Will update the packal page with this update later. Edited June 1, 2020 by clarencecastillo projjol, Suhvity, cands and 1 other 4
Suhvity Posted June 1, 2020 Posted June 1, 2020 5 hours ago, clarencecastillo said: Edit: I've released the fix for this which can be downloaded from here. Will update the packal page with this update later. Thanks for this update! Works like a charm again. 😃 clarencecastillo 1
projjol Posted June 1, 2020 Posted June 1, 2020 5 hours ago, clarencecastillo said: Yep, I'm getting this issue as well. Something to do with verification failure of Power Thesaurus' SSL certificates. Will shortly release a hotfix for this. If this persists, please open an issue here. Edit: I've released the fix for this which can be downloaded from here. Will update the packal page with this update later. You're a star. Really appreciate the prompt fix. clarencecastillo 1
deanishe Posted June 1, 2020 Posted June 1, 2020 7 hours ago, clarencecastillo said: I've released the fix Disabling certificate verification is an awfully dubious "fix". Do you know why it's failing? I mean, it's only failing for some users, so the certificate isn't fundamentally invalid. What version of macOS are you (and other users experiencing the problem) using?
clarencecastillo Posted June 1, 2020 Author Posted June 1, 2020 22 minutes ago, deanishe said: Disabling certificate verification is an awfully dubious "fix". Do you know why it's failing? I mean, it's only failing for some users, so the certificate isn't fundamentally invalid. What version of macOS are you (and other users experiencing the problem) using? According to this, it could be due to one of the "root or intermediate certificates" expiring a few days ago. I'm using Python requests but I'm not quite sure how to bypass this specific cert issue so I just disabled SSL cert verification altogether. Google Chrome is having no problems with it (the official website making similar requests still works) so I thought it would be safe to just ignore. Probably too late to ask this now, but was it working for you (or anyone else) even before the monkey patch? I'm using Catalina 10.15.5. Appreciate it that you're looking into this!
deanishe Posted June 2, 2020 Posted June 2, 2020 7 hours ago, clarencecastillo said: but was it working for you (or anyone else) even before the monkey patch? Yes. I downloaded the previous version with verification still turned on. I'm also on Catalina 10.15.5. Can you open Keychain Access, check the "Certificates" category and see if you have this certificate: Not having that would explain why it doesn't work for some users. 7 hours ago, clarencecastillo said: I'm not quite sure how to bypass this specific cert issue The right thing to do is to contact Powerthesaurus and tell them that they're sending an expired certificate. You could also try bundling the above CA cert with requests until Powerthesaurus fix their servers. 7 hours ago, clarencecastillo said: Google Chrome is having no problems with it Chrome is probably using its own bundled copy of the USERTrust CA certificate to verify the certificate chain. 7 hours ago, clarencecastillo said: so I thought it would be safe to just ignore. It is, but by turning off certificate verification, you aren't only ignoring this error. You've more or less disabled SSL. It's not a big deal with this workflow: there are no sensitive data being passed around. But in general, turning off certificate verification is not something you should do. Seeing as only some users are having the issue, it would be a better idea to make disabling certificate verification a workflow option that users can turn on only if they need it. That way, machines that can connect securely to the API will continue to do so. clarencecastillo 1
clarencecastillo Posted June 4, 2020 Author Posted June 4, 2020 On 6/2/2020 at 3:06 PM, deanishe said: Can you open Keychain Access, check the "Certificates" category and see if you have this certificate: Oddly enough, I am seeing this cert in my keychain access but still getting SSL cert verification error. On 6/2/2020 at 3:06 PM, deanishe said: Seeing as only some users are having the issue, it would be a better idea to make disabling certificate verification a workflow option that users can turn on only if they need it. That way, machines that can connect securely to the API will continue to do so. Agreed, will also be easier to maintain it that way once they fix it or in case it happens again in the future. I've opened an issue here to track my progress on implementing this in case anyone else is interested. And thanks for the detailed explanation! Did not expect learning a new thing or two about SSL. Cheers 🍺
clarencecastillo Posted June 18, 2020 Author Posted June 18, 2020 (edited) A new minor release is out that exposes an environment variable ALFRED_PT_SSL_VERIFICATION to let users easily toggle SSL verification. Thanks again to @deanishe for the recommendations! Edited June 18, 2020 by clarencecastillo
vitor Posted June 20, 2020 Posted June 20, 2020 Instead of making it a Workflow Environmental Variable that the user needs to toggle, why not catch the exception (that’s presumably thrown), then disable SSL verification and retry? That way the user doesn’t have to do anything and you’re still getting the best behaviour. clarencecastillo 1
sashankps Posted June 21, 2020 Posted June 21, 2020 I just installed this and got the following error. Help is appreciated. Thanks in advace. clarencecastillo 1
deanishe Posted June 21, 2020 Posted June 21, 2020 8 hours ago, vitor said: why not catch the exception (that’s presumably thrown), then disable SSL verification and retry? Then you're always making two requests instead of one, which could slow down the workflow considerably, depending on network conditions. vitor 1
clarencecastillo Posted June 21, 2020 Author Posted June 21, 2020 5 hours ago, sashankps said: I just installed this and got the following error. Help is appreciated. Thanks in advace. Thanks for reporting the error and sorry about that, did a silly mistake in the code introduced in the previous version. This small update should fix it. sashankps 1
clarencecastillo Posted June 21, 2020 Author Posted June 21, 2020 12 hours ago, vitor said: Instead of making it a Workflow Environmental Variable that the user needs to toggle, why not catch the exception (that’s presumably thrown), then disable SSL verification and retry? That way the user doesn’t have to do anything and you’re still getting the best behaviour. 3 hours ago, deanishe said: Then you're always making two requests instead of one, which could slow down the workflow considerably, depending on network conditions. Yeah, that would make for a smoother user experience but I don't think this SSL certificate error happens often enough (at most once a year) to make sending two requests per query worth it. Another way could be to programatically set the workflow environment var to False it when it encounters it for the first time, but then there'd be no easy way to check if the SSL certificate has been rectified lest we go back to sending two requests per query or do some other over-engineered way just to do so. Probably more practical to just display a better error message telling the user how to fix it via the Workflow Environment Variable settings.
vitor Posted June 21, 2020 Posted June 21, 2020 (edited) 5 hours ago, deanishe said: Then you're always making two requests instead of one, which could slow down the workflow considerably, depending on network conditions. Good point, I knew I had to be missing something and that there was a reason that wasn’t your suggestion. Still, considering how users sometimes ignore or miss even simple Workflow Environment Variables and that SSL errors can be a pain even for developers, I’d consider the automated route anyway: 1. Have a condition that says SSL verification should not happen (e.g., create an empty file in the cache). 2. When making a request, see if the condition is true. 2.1. If yes, check if it has been set more than X time ago (in the example, check for file modification time). 2.1.1. If yes, reset / remove the condition. 2.1.2. If no, do the request without verification. 2.2. If no (default), try to make the request. 2.2.1. If it fails, set the condition to true and try again. That way you’ll only make two requests once (every X time), and it removes from users the responsibility of figuring out if SSL verification should be on or off (which plenty won’t understand anyway). In addition, thanks to 2.1 users also won’t have the responsibility of checking if an SSL connection is possible in the future, because it will be fixed whenever it’s available for them. It’s more code, yes, but not that much. And being realistic, I don’t believe any (significant amount of) users will ever change the Workflow Environment Variable to true after setting it to false once. They’ll make it whatever it has to be done to have it work and leave it be, negating its purpose (because an automated check that disables it forever would do the same). Edited June 21, 2020 by vitor
deanishe Posted June 21, 2020 Posted June 21, 2020 39 minutes ago, vitor said: Still, considering how users sometimes ignore or miss even simple Workflow Environment Variables and that SSL errors can be a pain even for developers, I’d consider the automated route anyway Yeah, some SSL-related smarts would be the best way, but it is a fair bit more complicated. I'm not sure I'd bother, tbh. I'd probably just wait until people stopped asking about SSL errors (someone is always too lazy to read the docs), and then push an update removing the ability to disable SSL.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now