commando icon indicating copy to clipboard operation
commando copied to clipboard

Broken API with `command-not-found.com`

Open geekorous opened this issue 2 years ago • 2 comments

Recently I have noticed some queries to cmd.cat does not work as expected. After evaluating the error and digging into the design, I figured out the install.sh script in the images is not working properly. Going further, I noticed it is because queries of the form curl -sSfL "https://command-not-found.com/-/api/package/alpine/$COMMAND" do not return a string anymore, but a full web-page that makes the whole code broken. I could not find the public API of the website to come up with a fix by myself, but I'd like to ask you to fix the command-not-found.com API back to its previous stage, so cmd.cat becomes operational again. Thanks for your amazing code.

geekorous avatar Nov 06 '22 23:11 geekorous

Obviously I'm not testing from the same endpoint as cmd.cat uses, but it seems to be resulting in some kind of cloudflare error/captcha page. I suggest allowlisting the source IP for cmd.cat to command-not-found.com.

Matir avatar Jan 09 '23 22:01 Matir

As stated in the original post, the single API endpoint on https://command-not-found.com (as per https://github.com/lukaszlach/commando/issues/3#issuecomment-930573752) is no longer returning simple content. If viewed in a browser it looks fine, but if you check the source the issue is apparent. It doesn't look like captcha or errors to me (but some of it does look to be Ad and Tracking JavaScript). The end result is that no packages are ever added by install.sh and those layers are empty in the served Docker image.

@lukaszlach It is impossible to use this tool as-is without that endpoint working, even if running the project locally.
This was a great tool and it'll be a shame if it lost due to invisible markup on an API endpoint.

bugreportsonly avatar Mar 10 '23 17:03 bugreportsonly