open-eid / linux-installer

Ubuntu meta package
55 stars 21 forks source link

apt-key is deprecated #83

Closed notpushkin closed 3 years ago

notpushkin commented 3 years ago

apt-key add [filename]

Note: Instead of using this command a keyring should be placed directly in the /etc/apt/trusted.gpg.d/ directory with a descriptive name and either "gpg" or "asc" as file extension.\     — apt-key(8) manpage

Here's a couple reasons why apt-key add might be deprecated. I would suggest using something like this:

echo "$RIA_KEY" \
  | gpg --dearmor \
  | sudo tee /etc/apt/trusted.gpg.d/ria-repository.gpg \
  > /dev/null

I've noticed that a couple lines above you the script mentions that gpg can't be used because it “always creates files on disk”, but that shouldn't be a problem because gpg --dearmor doesn't touch disk at all. We could instead write ASCII-armoured key, but this doesn't work on some systems.

Would there be any other concerns? I'll be happy to send in a PR!

metsma commented 3 years ago

Feel free to seend PR