Kein How-to, Anmerkung zu Mikes Blogbeitrag von 2019 https://www.kuketz-blog.de/gnupg-web-key-directory-wkd-einrichten/ , eher als Fahrplan für Leute die schon ein Docker/ NPM Setup fahren und im Netz wenig zum Thema finden.
Ziel: PGP-Public-Key IETF-konform über openpgpkey.deinedomain.de veröffentlichen (WKD Advanced).
Voraussetzung: VPS mit Docker & Docker Compose, NPM läuft, Eigene Domain (A-Record + AAAA-Record auf VPS), Docker Network (z.B. `cloud-net`)
Geholfen hat mir neben Mike’s Blog Beitrag https://miarecki.eu/de/posts/web-key-directory-einrichten/ und https://vobornik.eu/tools/wkd/ und Lumo.
Verzeichnisstruktur:
mkdir -p ~/docker-cloud/wkddir/.well-known/openpgpkey/deinedomain.de/hu/
touch ~/docker-cloud/wkddir/.well-known/openpgpkey/deinedomain.de/policy
Hash berechnen (BASE64):
# GPG-Methode (wenn Key im Ring):
gpg --with-wkd-hash --fingerprint user@deinedomain.de
# Output: dein_wkd_key@deinedomain.de
public-key (binary) platzieren:
HASH=dein_wkd_-key
gpg --export user@deinedomain.de > wkddir/.well-known/openpgpkey/deinedomain.de/hu/${HASH}
Custom NGIX Config (wkd-nginx.conf):
server {
listen 80 default_server;
server_name _;
root /usr/share/nginx/html;
location ^~ /.well-known/openpgpkey {
default_type application/octet-stream;
add_header Access-Control-Allow-Origin * always;
try_files $uri =404;
}
location / {
default_type text/plain;
try_files $uri $uri/ =404;
}
}
Docker Compose Service:
wkd:
image: nginx:alpine
container_name: wkd
restart: unless-stopped
volumes:
- ./wkddir:/usr/share/nginx/html/:ro
- ./wkd-nginx.conf:/etc/nginx/conf.d/default.conf:ro
networks:
- cloud-net
# KEINE externen Ports!
NPM Proxy Host:
- Domain Names: openpgpkey.deinedomain.de
- Forward: wkd:80
- SSL: Let’s Encrypt aktivieren
- Force SSL: Aktivieren
DNS:
A/ AAAA-Record: openpgpkey.deinedomain.de
Testen:
curl -I https://openpgpkey.deinedomain.de/.well-known/openpgpkey/deinedomain.de/hu/${HASH}
# Expected: HTTP 200, Content-Type: application/octet-stream
gpg --auto-key-locate clear,nodefault,wkd --locate-keys user@deinedomain.de
# Expected: Key wird automatisch importiert
Finaler Test: https://vobornik.eu/tools/wkd/