diff options
author | Michał Górny <mgorny@gentoo.org> | 2018-07-21 22:48:06 +0200 |
---|---|---|
committer | Michał Górny <mgorny@gentoo.org> | 2018-07-21 22:48:06 +0200 |
commit | f68dbf0349f06640fbe04266eb08096fa43f4a47 (patch) | |
tree | e17b11ecf4ec6707222aa938d2fee3ca9d7f54fe /_plugins | |
parent | Fetch service keyring (diff) | |
download | www-f68dbf0349f06640fbe04266eb08096fa43f4a47.tar.gz www-f68dbf0349f06640fbe04266eb08096fa43f4a47.tar.bz2 www-f68dbf0349f06640fbe04266eb08096fa43f4a47.zip |
wkd: Include service keys
Diffstat (limited to '_plugins')
-rw-r--r-- | _plugins/wkd.rb | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/_plugins/wkd.rb b/_plugins/wkd.rb index c225f62..366a092 100644 --- a/_plugins/wkd.rb +++ b/_plugins/wkd.rb @@ -6,7 +6,8 @@ require 'digest' module Gentoo class WKDGenerator < Jekyll::Generator - KEYRING = '_data/active-devs.gpg' + DEV_KEYRING = '_data/active-devs.gpg' + SERVICE_KEYRING = '_data/service-keys.gpg' WKD_DIR = '.well-known/openpgpkey/' def generate(site) @@ -14,20 +15,22 @@ module Gentoo # Base32 module supports that and the zBase32 modules are hard to get Base32.table = 'ybndrfg8ejkmcpqxot1uwisza345h769' - site.data['userinfo']['current'].each do |nick, details| - begin - fps = details['gpgfp'].map { |fp| fp.gsub(/\s+/, '') } - if not fps.empty? - IO.popen(['gpg', '--no-default-keyring', '--keyring', KEYRING, - '--export', *fps], mode='rb') { |p| - keydata = p.read - if not keydata.empty? - site.pages << WKDFile.new(site, nick, keydata) - end - } + [['current', DEV_KEYRING], ['system', SERVICE_KEYRING]].each do |group, keyring| + site.data['userinfo'][group].each do |nick, details| + begin + fps = details['gpgfp'].map { |fp| fp.gsub(/\s+/, '') } + if not fps.empty? + IO.popen(['gpg', '--no-default-keyring', '--keyring', keyring, + '--export', *fps], mode='rb') { |p| + keydata = p.read + if not keydata.empty? + site.pages << WKDFile.new(site, nick, keydata) + end + } + end + rescue + # fail them silently end - rescue - # fail them silently end end |