pdns icon indicating copy to clipboard operation
pdns copied to clipboard

pdns should be listed in extrepo (was: apt-key is deprecated, repo.powerdns.com directions need update)

Open nivex opened this issue 3 years ago • 14 comments

  • Program: N/A (repo.powerdns.com)
  • Issue type: Bug report

Short description

From the apt-key man page in Debian 11.

Use of apt-key is deprecated... apt-key(8) will last be available in Debian 11 and Ubuntu 22.04.

Environment

  • Operating system: Debian 10, 11
  • Software version: N/A
  • Software source: repo.powerdns.com

Other information

The preferred method of managing keys is now to place them directly in /etc/apt/trusted.gpg.d.

Alternatively, if all systems which should be using the created keyring have at least apt version >= 1.4 installed, you can use the ASCII armored format with the "asc" extension instead...

Ergo, the existing directions for Debian/Ubuntu that read:

curl https://repo.powerdns.com/FD380FBB-pub.asc | sudo apt-key add -

can be simplified to

sudo curl -o /etc/apt/trusted.gpg.d/pdns.asc https://repo.powerdns.com/FD380FBB-pub.asc

or

curl https://repo.powerdns.com/FD380FBB-pub.asc | sudo tee /etc/apt/trusted.gpg.d/pdns.asc

for the more security minded (though this also dumps the key to the screen).

I have tested this works as expected on Debian 10.

nivex avatar Jul 17 '21 19:07 nivex

Also consider adding the PowerDNS repo to extrepo

wb9688 avatar Jul 17 '21 19:07 wb9688

https://blog.jak-linux.org/2021/06/20/migrating-away-apt-key/ (via sarnold)

Habbie avatar May 03 '22 18:05 Habbie

Picking this up... the 'best practice' has now changed, as even dropping keys into /etc/apt/trusted.gpg.d doesn't solve all of the problems that were identified. I'll add something to this issue to describe how the text should appear now, and also verify if it's supported in Debian 10 as well as 11.

kpfleming avatar May 03 '22 18:05 kpfleming

Of possible interest: https://salsa.debian.org/apt-team/apt/-/merge_requests/176

Habbie avatar Jul 04 '22 14:07 Habbie

Hello, I have been using the following if its of any help - and it works well with Ubuntu 22.04. It essentially drops the key into an "apt-get-non-automatically-trusted" location /usr/share/keyrings/ and then points to the key for powerdns repo signing (via signed-by directive in the source.list file.

# Download gpg key
curl -s https://repo.powerdns.com/CBC8B383-pub.asc | sudo tee /usr/share/keyrings/pdns-CBC8B383.asc > /dev/null

# Create apt source.list file
echo 'deb [arch=amd64 signed-by=/usr/share/keyrings/pdns-CBC8B383.asc] http://repo.powerdns.com/ubuntu jammy-dnsdist-master main' | sudo tee /etc/apt/sources.list.d/dnsdist.list > /dev/null
sudo apt-get update
sudo apt-get install dnsdist

git-noise avatar Jul 06 '22 15:07 git-noise

Yep, that's the preferred configuration now.

kpfleming avatar Jul 06 '22 16:07 kpfleming

Except that /usr/share/keyrings is only good if the file comes with a package...

zeha avatar Jul 07 '22 23:07 zeha

@zeha good catch, indeed as per https://wiki.debian.org/DebianRepository/UseThirdParty, I quote:

If future updates to the key will be managed by an apt/dpkg package as recommended below, then it SHOULD be downloaded into /usr/share/keyrings using the same filename that will be provided by the package. If it will be managed locally , it SHOULD be downloaded into /etc/apt/keyrings instead. 

I also see that my Ubuntu 22.04 do have that folder /etc/apt/keyrings/ created now.

git-noise avatar Jul 11 '22 15:07 git-noise

Ahh, interesting. I'll need to update my local systems to follow that practice.

kpfleming avatar Jul 11 '22 15:07 kpfleming

Debian Bullseye systems do not have /etc/apt/keyrings, but Bookworm systems do. It's easy to create of course, but creation of the directory will need to be part of the directions.

kpfleming avatar Jul 11 '22 18:07 kpfleming

Debian Bullseye systems do not have /etc/apt/keyrings, but Bookworm systems do. It's easy to create of course, but creation of the directory will need to be part of the directions.

Yes, indeed. It is a pity this wasn't all prepared a long time ago. Anyway, /etc/apt/keyrings works and is future-proof (until this stuff changes again...).

zeha avatar Jul 28 '22 11:07 zeha

I'd love a diff against https://gist.github.com/Habbie/e2e6b993aa611a0881784add3fe2977b if anybody feels so inclined :)

Habbie avatar Dec 20 '22 09:12 Habbie

Here's my attempt: https://gist.github.com/jsoref/0fdc318f584bbdf8db1dcf2e9fb1ea42/revisions

Please check the output a bit before deploying as I haven't tried to feed the j2 data to it.

jsoref avatar Dec 20 '22 20:12 jsoref

Please check the output a bit before deploying as I haven't tried to feed the j2 data to it.

Deployed, thanks!

Habbie avatar Jun 22 '23 14:06 Habbie