Live data from Hacker News

On piping Curl to apt-key

tablix.org

1–10 of 47 posts

Re: On piping Curl to apt-key

#3
post #2

Wouldn't it already help if apt-key printed the list of keys it imported instead of the absolutely superfluous "OK"?

Yes. But that would break all existing tools wrapping around apt-key.

That's the downside of everything-is-just-strings in Unix

Re: On piping Curl to apt-key

#4
On piping anything from the Internet directly to your system for execution: Don't be lazy. Don't be an ass.

When I am working in a persona that responsible for managing a server or a service, I insist on knowing everything I need to know about how to keep that service and the environment in which it operates safe, alive, and providing usable performance.

I require good, clean and coherent instructions for deploying something at production level, where all required components and their preferred method of interaction are clearly explained and documented by the developer, and can be repeated in a predictable manner by me.

If all I have to work with is "pipe this to the shell, alternatively read the code" I'm going to go with "nah, I'll find something professional".

Time spent installing a system should be only a minuscule fraction of time spent actually operating the system. Spending a few extra hours doing it right shouldn't make a difference.

[edit: added "...and another thing" argument]

Re: On piping Curl to apt-key

#5
post #3
post #2

Wouldn't it already help if apt-key printed the list of keys it imported instead of the absolutely superfluous "OK"?

Yes. But that would break all existing tools wrapping around apt-key. That's the downside of everything-is-just-strings in Unix

apt-key could detect terminal output and modify its output.

Re: On piping Curl to apt-key

#6
I hate this practice, no idea how it became commonplace. Of course lots of times, installation procedures can be long and tedious, but it takes one popular project's script server to be compromised, and tons of people are suddenly running malicious commands.

I would go through manually installing dependencies and setting up my system, adding repos, etc. over running some script any day. But then again some projects wouldn't be that popular if they were hard to install.

Some of npm's installation instructions ask you to pipe curl into bash, to run a lovely script [0] which makes things easier for you, but not by much. Is it really necessary? Would developers give up trying to get npm and node just because installing not as easy as "curl https://some.script.com/that-script.sh | sudo -E bash -; sudo apt-get install npm"?

Other than building/installing programs, adding GPG/SSH keys like in the blog post can be as dangerous, and while not simple, there could be some method built to make things easier without having to run commands you don't even check.

Anyways, hope projects grow out of this habit.

[0] https://deb.nodesource.com/setup_6.x

Re: On piping Curl to apt-key

#7
post #2

Wouldn't it already help if apt-key printed the list of keys it imported instead of the absolutely superfluous "OK"?

Wouldn't it already help if apt-key printed the list of keys it imported instead of the absolutely superfluous "OK"?

What would really help: Publishers providing the key in a clear text copy-paste format, and providing instructions on adding the key to apt-key.

Re: On piping Curl to apt-key

#8
post #3

Earlier quoted context omitted.

Yes. But that would break all existing tools wrapping around apt-key. That's the downside of everything-is-just-strings in Unix

apt-key could detect terminal output and modify its output.

Or just an extra flag like --list-after-import.

Re: On piping Curl to apt-key

#9
post #7
post #2

Wouldn't it already help if apt-key printed the list of keys it imported instead of the absolutely superfluous "OK"?

Wouldn't it already help if apt-key printed the list of keys it imported instead of the absolutely superfluous "OK"? What would really help: Publishers providing the key in a clear text copy-paste format, and providing instructions on adding the key to apt-key.

> providing instructions on adding the key to apt-key

    curl | apt-key - # that works
No really, they shouldn't tell you how to add the key to your store. If you don't know how to do that yourself, you shouldn't be admin/superuser. (Also, `man`)
Post reply on HN