sks-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Sks-devel] python scripts/other tools you may find useful


From: brent s.
Subject: [Sks-devel] python scripts/other tools you may find useful
Date: Mon, 16 Apr 2018 01:22:13 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0

Hey, all!

For starters, if any of you happen to be on Arch, I've packaged[0] a
patched version of SKS that will let you provide dumps of your database
from the same box you serve keys from with no downtime. (All it is is a
version of SKS with some filesystem paths changed and a
differently-named binary tied to those paths. You'd peer this to your
other instance - obviously they'll need to run on different ports - so
it stays in sync, and then you can stop that localized instance to dump
keys etc.)

Secondly, I'm not sure if I mentioned this before, but I have an SKS
dump wrapper script in python:

https://git.square-r00t.net/OpTools/tree/gpg/sksdump.py

It has some nice features like being able to perform the dump on one box
and rsync to another, service handling, compression support, and even
pruning of dumps older than X days.

Similarly, I also have a script that will let you query a keyserver's
statistics on the commandline:

https://git.square-r00t.net/OpTools/tree/gpg/keystats.py

I find it a lot faster to use than browsing to a keyserver's keystats
page. Plus it has some nice features like being able to use it for a
module for another python program (since it's classed), JSON output or
YAML output (the default is "pythonic" output), etc.

address@hidden gpg]$ ./keystats.py sks.mirror.square-r00t.net
{'keys': 5036849,
 'server': {'contact': '0x748231EBCBD808A14F5E85D28C004C2F93481F6B',
            'debug': 3,
            'hkp_port': 11371,
            'hostname': 'mirror.square-r00t.net',
            'name': 'sks.mirror.square-r00t.net',
            'recon_port': 11370,
            'version': ('1', '1', '6')}}

address@hidden gpg]$ ./keystats.py --yaml sks.mirror.square-r00t.net
keys: 5036849
server:
  contact: 0x748231EBCBD808A14F5E85D28C004C2F93481F6B
  debug: 3
  hkp_port: 11371
  hostname: mirror.square-r00t.net
  name: sks.mirror.square-r00t.net
  recon_port: 11370
  version:
    - 1
    - 1
    - 6

address@hidden gpg]$ ./keystats.py --json sks.mirror.square-r00t.net
{"server": {"name": "sks.mirror.square-r00t.net", "hostname":
"mirror.square-r00t.net", "version": ["1", "1", "6"], "contact":
"0x748231EBCBD808A14F5E85D28C004C2F93481F6B", "hkp_port": 11371,
"recon_port": 11370, "debug": 3}, "keys": 5036849}

(There's a "verbose" mode that will print all peers and key histograms
as well.)

Hope you find use for these!


[0] https://aur.archlinux.org/packages/sks-local/

-- 
brent saner
https://square-r00t.net/
GPG info: https://square-r00t.net/gpg-info

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]