Check Expiry is a tool for checking resources for their expiry date. The expiry dates are collated and sorted, before being printed to standard output. The next resource to expire is top most.
I wrote this tool to help track the numerous certificates involved with my applications and web services. Forgetting to renew or reissue an expired certificate causes numerous problems.
I run Check Expiry every month as part of a scheduled cron
like task, the results of
which are e-mailed to me. This is enough of a reminder to deal with the next due task
and to not completely forget about root certificates that have another decade left.
Using checkexpiry
Check Expiry reads the resource list either from a text file, or from standard input:
./checkexpiry -input resources.txt
Each line of the input should include a resource type and where to find the resource:
certificate <file path|url|git+ssh>
tls <url>
gandi.net:bearer <token>
Empty lines and lines beginning with hash (#) are skipped. These lines are comments for the file’s user. They are ignored by Check Expiry.
An example file might read:
# Miln certificates
certificate https://miln.eu/ca/appmember.cer
certificate https://miln.eu/ca/software.cer
certificate https://miln.eu/ca/root.cer
# Lets Encrypt tokens for caddy
gandi.net:bearer 1234531234512345123451234521234512345
# Git
certificate git+ssh://vault/git/storefront#stores/miln/payment/external.pem
certificate git+ssh://vault/git/storefront#stores/miln/validation.pem
certificate git+ssh://vault/git/storefront#stores/miln/vault.pem
# TLS
tls https://miln.eu
Flags
Check Expiry’s executable checkexpiry
accepts the following command line flags:
Usage of ./checkexpiry:
-config string
File path to configuration.
-h Show this help message and exit. (shorthand)
-help
Show this help message and exit.
-input string
path to text file listing resources to check (hypen for stdin). (default "checkexpiry.txt")
-l string
Directory path to licence certificate files (PEM encoded) (shorthand) (default "~/.miln/")
-legal
Show legal notices and exit.
-licence string
Directory path to licence certificate files (PEM encoded) (default "~/.miln/")
-show-licence
Show licence details and exit.
-v Show version details and exit. (shorthand)
-version
Show version details and exit.