Only handle machine-readable requests from nginx.

- And relay the rest to hagrid.
This commit is contained in:
Justus Winter 2019-02-26 12:12:27 +01:00 committed by Justus Winter
parent b5b521edca
commit 28681b3efb
No known key found for this signature in database
GPG Key ID: 686F55B4AB2B3386
1 changed files with 12 additions and 10 deletions

View File

@ -37,26 +37,28 @@ http {
# Common HKP requests.
location /pks/lookup {
# sq keyserver get <KEYID>, gpg --receive-keys <KEYID>
if ($args ~* "^op=get&(options=mr&)?search=(0x)?([A-F0-9]{2})([A-F0-9]{14})$") {
set $dir $3;
set $file $4;
if ($args ~* "^op=get&options=mr&?search=(0x)?([A-F0-9]{2})([A-F0-9]{14})$") {
set $dir $2;
set $file $3;
rewrite . /by-keyid/$dir/$file;
}
# gpg --receive-keys <FINGERPRINT>
if ($args ~* "^op=get&(options=mr&)?search=(0x)?([A-F0-9]{2})([A-F0-9]{38})$") {
set $dir $3;
set $file $4;
if ($args ~* "^op=get&options=mr&?search=(0x)?([A-F0-9]{2})([A-F0-9]{38})$") {
set $dir $2;
set $file $3;
rewrite . /by-fingerprint/$dir/$file;
}
# gpg --locate-key <EMAIL>
if ($args ~* "^op=get&(options=mr&)?search=(..)([^&]*)@([^&]*)") {
set $dir $2;
set $local $3;
set $horst $4;
if ($args ~* "^op=get&options=mr&?search=(..)([^&]*)@([^&]*)") {
set $dir $1;
set $local $2;
set $horst $3;
rewrite . /by-email/$dir/$local%40$horst;
}
proxy_pass http://127.0.0.1:8080;
}
location = / {