Unverified Commit 1f68bd11 authored by georg's avatar georg Committed by paz
Browse files

Provide systemd configs for weekly key maintenance

systemd provides a feature called "timers", which people use as a
replacement for cron.

Closes #422

(cherry picked from commit a6e48f0d)
parent 56efc1ce
......@@ -8,6 +8,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
### Added
* 'X-STOP': To use any keyword, you *must* now also use the new keyword 'X-STOP' to mark where to stop looking for keywords. This enables looking for keyword arguments in multiple lines, e.g. for X-RESEND with long, wrapped lines.
* Provide systemd configs for weekly key maintenance. This relies on a working systemd-timesyncd. (#422)
### Changed
......
[Unit]
Description=Schleuder weekly key maintenance
After=local-fs.target network.target
[Service]
Type=oneshot
ExecStart=/usr/local/bin/schleuder refresh_keys
ExecStart=/usr/local/bin/schleuder check_keys
User=schleuder
[Unit]
Description=Schleuder weekly key maintenance
[Timer]
OnCalendar=weekly
Persistent=true
[Install]
WantedBy=timers.target
......@@ -22,7 +22,7 @@ filters_dir: /usr/local/lib/schleuder/filters
log_level: warn
# Which keyserver to refresh keys from (used by `schleuder refresh_keys`, meant
# to be run from cron weekly).
# to be run from cron or systemd weekly).
# If you have gnupg 2.1, we strongly suggest to use a hkps-keyserver:
#keyserver: hkps://hkps.pool.sks-keyservers.net
# If you have gnupg 2.1 and TOR running locally, use a onion-keyserver:
......
......@@ -53,7 +53,7 @@ module Schleuder
exit 1
end
desc 'check_keys', 'Check all lists for unusable or expiring keys and send the results to the list-admins. (This is supposed to be run from cron weekly.)'
desc 'check_keys', 'Check all lists for unusable or expiring keys and send the results to the list-admins. (This is supposed to be run from cron or systemd weekly.)'
def check_keys
List.all.each do |list|
I18n.locale = list.language
......@@ -68,7 +68,7 @@ module Schleuder
permission_notice
end
desc 'refresh_keys [list1@example.com]', "Refresh all keys of all list from the keyservers sequentially (one by one or on the passed list). (This is supposed to be run from cron weekly.)"
desc 'refresh_keys [list1@example.com]', 'Refresh all keys of all list from the keyservers sequentially (one by one or on the passed list). (This is supposed to be run from cron or systemd weekly.)'
def refresh_keys(list=nil)
GPGME::Ctx.send_notice_if_gpg_does_not_know_import_filter
work_on_lists(:refresh_keys,list)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment